Skip to content

Commit

Permalink
✨ :: [#220] MyPageFeature / MyPageMilitary
Browse files Browse the repository at this point in the history
  • Loading branch information
baekteun committed Aug 2, 2023
1 parent 14be83c commit 1ae7467
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ import Foundation
protocol MyPageIntentProtocol:
MyPageProfileIntentProtocol,
MyPageSchoolLifeIntentProtocol,
MyPageWorkInfoIntentProtocol {}
MyPageWorkInfoIntentProtocol,
MyPageMilitaryIntentProtocol {}
Original file line number Diff line number Diff line change
@@ -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)
}
}
Original file line number Diff line number Diff line change
@@ -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
}
}
14 changes: 9 additions & 5 deletions Projects/Feature/MyPageFeature/Sources/Model/MyPageModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 {}
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
protocol MyPageStateProtocol:
MyPageProfileStateProtocol,
MyPageSchoolLifeStateProtocol,
MyPageWorkInfoStateProtocol {}
MyPageWorkInfoStateProtocol,
MyPageMilitaryStateProtocol {}

protocol MyPageActionProtocol:
AnyObject,
MyPageProfileActionProtocol,
MyPageSchoolLifeActionProtocol,
MyPageWorkInfoActionProtocol {}
MyPageWorkInfoActionProtocol,
MyPageMilitaryActionProtocol {}

0 comments on commit 1ae7467

Please sign in to comment.