Skip to content

Commit

Permalink
refact :: [#111] entity에서 텍스트 반환
Browse files Browse the repository at this point in the history
  • Loading branch information
cyj513 committed Oct 30, 2024
1 parent 583d81f commit df6bd62
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
10 changes: 8 additions & 2 deletions Projects/Data/Sources/DTO/WeekendMeal/WeekendMealPeriodDTO.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,16 @@ public struct WeekendMealPeriodDTO: Decodable {

extension WeekendMealPeriodDTO {
func toDomain() -> WeekendMealPeriodEntity {
var weekendMealPeriod: String {
guard let start, let end else { return "" }
let startDate = start.toDate(type: .fullDate).toString(type: .monthAndDayKor)
let endDate = end.toDate(type: .fullDate).toString(type: .monthAndDayKor)
return "(\(startDate) ~ \(endDate))"
}

return .init(
status: status,
start: start,
end: end
period: weekendMealPeriod
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,11 @@ import Core

public struct WeekendMealPeriodEntity {
public let status: Bool
public let start: String?
public let end: String?
public let period: String

public init(
status: Bool,
start: String?,
end: String?
) {
public init(status: Bool, period: String) {
self.status = status
self.start = start
self.end = end
self.period = period
}

}

0 comments on commit df6bd62

Please sign in to comment.