diff --git a/SOPT-iOS/Projects/Data/Sources/Transform/AttendanceScheduleTransform.swift b/SOPT-iOS/Projects/Data/Sources/Transform/AttendanceScheduleTransform.swift new file mode 100644 index 000000000..ceccc6955 --- /dev/null +++ b/SOPT-iOS/Projects/Data/Sources/Transform/AttendanceScheduleTransform.swift @@ -0,0 +1,33 @@ +// +// AttendanceScheduleTransform.swift +// Data +// +// Created by devxsby on 2023/04/11. +// Copyright © 2023 SOPT-iOS. All rights reserved. +// + +import Foundation + +import Domain +import Network + +extension AttendanceScheduleEntity { + + public func toDomain() -> AttendanceScheduleModel { + return .init(type: self.type, + location: self.location, + name: self.name, + startDate: self.startDate, + endDate: self.endDate, + message: self.message, + attendances: self.attendances.map { $0.toDomain() }) + } +} + +extension TodayAttendance { + + public func toDomain() -> TodayAttendanceModel { + return .init(status: self.status, + attendedAt: self.attendedAt) + } +} diff --git a/SOPT-iOS/Projects/Data/Sources/Transform/AttendanceScoreTransform.swift b/SOPT-iOS/Projects/Data/Sources/Transform/AttendanceScoreTransform.swift new file mode 100644 index 000000000..0d18da248 --- /dev/null +++ b/SOPT-iOS/Projects/Data/Sources/Transform/AttendanceScoreTransform.swift @@ -0,0 +1,42 @@ +// +// AttendanceScoreTransform.swift +// Data +// +// Created by devxsby on 2023/04/15. +// Copyright © 2023 SOPT-iOS. All rights reserved. +// + +import Foundation + +import Domain +import Network + +extension AttendanceScoreEntity { + + public func toDomain() -> AttendanceScoreModel { + .init(part: self.part, + generation: self.generation, + name: self.name, + score: self.score, + total: self.total.toDomain(), + attendances: self.attendances.map { $0.toDomain() } ) + } +} + +extension TotalScore { + public func toDomain() -> TotalScoreModel { + .init(attendance: self.attendance, + absent: self.absent, + tardy: self.tardy, + participate: self.participate) + } +} + +extension Attendance { + public func toDomain() -> AttendanceModel { + .init(attribute: self.attribute, + name: self.name, + status: self.status, + date: self.date) + } +} diff --git a/SOPT-iOS/Projects/Data/Sources/Transform/ShowAttendanceTransform.swift b/SOPT-iOS/Projects/Data/Sources/Transform/ShowAttendanceTransform.swift deleted file mode 100644 index 9dd73e6a8..000000000 --- a/SOPT-iOS/Projects/Data/Sources/Transform/ShowAttendanceTransform.swift +++ /dev/null @@ -1,19 +0,0 @@ -// -// ShowAttendanceTransform.swift -// Data -// -// Created by devxsby on 2023/04/11. -// Copyright © 2023 SOPT-iOS. All rights reserved. -// - -import Foundation - -import Domain -import Network - -extension ShowAttendanceEntity { - - public func toDomain() -> ShowAttendanceModel { - return ShowAttendanceModel.init() - } -}