diff --git a/Projects/Feature/MyPageFeature/Sources/Intent/MyPageIntentProtocol.swift b/Projects/Feature/MyPageFeature/Sources/Intent/MyPageIntentProtocol.swift index ab4bc2a1..1b5f535b 100644 --- a/Projects/Feature/MyPageFeature/Sources/Intent/MyPageIntentProtocol.swift +++ b/Projects/Feature/MyPageFeature/Sources/Intent/MyPageIntentProtocol.swift @@ -3,4 +3,5 @@ import Foundation protocol MyPageIntentProtocol: MyPageProfileIntentProtocol, MyPageSchoolLifeIntentProtocol, - MyPageWorkInfoIntentProtocol {} + MyPageWorkInfoIntentProtocol, + MyPageMilitaryIntentProtocol {} diff --git a/Projects/Feature/MyPageFeature/Sources/Intent/MyPageMilitaryIntent.swift b/Projects/Feature/MyPageFeature/Sources/Intent/MyPageMilitaryIntent.swift new file mode 100644 index 00000000..6e66691e --- /dev/null +++ b/Projects/Feature/MyPageFeature/Sources/Intent/MyPageMilitaryIntent.swift @@ -0,0 +1,21 @@ +import StudentDomainInterface + +protocol MyPageMilitaryIntentProtocol { + func militarySheetIsRequired() + func militarySheetDismissed() + func militaryServiceTypeDidSelected(type: MilitaryServiceType) +} + +extension MyPageIntent: MyPageMilitaryIntentProtocol { + func militarySheetIsRequired() { + model?.updateIsPresentedMilitarySheet(isPresented: true) + } + + func militarySheetDismissed() { + model?.updateIsPresentedMilitarySheet(isPresented: false) + } + + func militaryServiceTypeDidSelected(type: MilitaryServiceType) { + model?.updateMilitaryServiceType(type: type) + } +} diff --git a/Projects/Feature/MyPageFeature/Sources/Model/MyPageMilitaryModel.swift b/Projects/Feature/MyPageFeature/Sources/Model/MyPageMilitaryModel.swift new file mode 100644 index 00000000..24987daa --- /dev/null +++ b/Projects/Feature/MyPageFeature/Sources/Model/MyPageMilitaryModel.swift @@ -0,0 +1,21 @@ +import StudentDomainInterface + +protocol MyPageMilitaryStateProtocol { + var selectedMilitaryServiceType: MilitaryServiceType { get } + var isPresentedMilitarySheet: Bool { get } +} + +protocol MyPageMilitaryActionProtocol: AnyObject { + func updateIsPresentedMilitarySheet(isPresented: Bool) + func updateMilitaryServiceType(type: MilitaryServiceType) +} + +extension MyPageModel: MyPageMilitaryActionProtocol { + func updateIsPresentedMilitarySheet(isPresented: Bool) { + self.isPresentedMilitarySheet = isPresented + } + + func updateMilitaryServiceType(type: MilitaryServiceType) { + self.selectedMilitaryServiceType = type + } +} diff --git a/Projects/Feature/MyPageFeature/Sources/Model/MyPageModel.swift b/Projects/Feature/MyPageFeature/Sources/Model/MyPageModel.swift index b418dc69..403f16a1 100644 --- a/Projects/Feature/MyPageFeature/Sources/Model/MyPageModel.swift +++ b/Projects/Feature/MyPageFeature/Sources/Model/MyPageModel.swift @@ -21,11 +21,15 @@ final class MyPageModel: ObservableObject, MyPageStateProtocol { @Published var gsmScore: String = "" // MARK: WorkInfo - var workRegionList: [String] = [] - var salary: String = "" - var salaryDisplay: String = "" - var formOfEmployment: FormOfEmployment = .fullTime - var isPresentedFormOfEmployeementSheet: Bool = false + @Published var workRegionList: [String] = [] + @Published var salary: String = "" + @Published var salaryDisplay: String = "" + @Published var formOfEmployment: FormOfEmployment = .fullTime + @Published var isPresentedFormOfEmployeementSheet: Bool = false + + // MARK: Military + @Published var selectedMilitaryServiceType: MilitaryServiceType = .hope + @Published var isPresentedMilitarySheet: Bool = false } extension MyPageModel: MyPageActionProtocol {} diff --git a/Projects/Feature/MyPageFeature/Sources/Model/MyPageModelProtocol.swift b/Projects/Feature/MyPageFeature/Sources/Model/MyPageModelProtocol.swift index 20efab33..f9c21f0e 100644 --- a/Projects/Feature/MyPageFeature/Sources/Model/MyPageModelProtocol.swift +++ b/Projects/Feature/MyPageFeature/Sources/Model/MyPageModelProtocol.swift @@ -1,10 +1,12 @@ protocol MyPageStateProtocol: MyPageProfileStateProtocol, MyPageSchoolLifeStateProtocol, - MyPageWorkInfoStateProtocol {} + MyPageWorkInfoStateProtocol, + MyPageMilitaryStateProtocol {} protocol MyPageActionProtocol: AnyObject, MyPageProfileActionProtocol, MyPageSchoolLifeActionProtocol, - MyPageWorkInfoActionProtocol {} + MyPageWorkInfoActionProtocol, + MyPageMilitaryActionProtocol {}