Skip to content

Commit 790486c

Browse files
committed
✨[feat]: 일정표 목록 UI 구현 DDD-Community#30
1 parent ed80d39 commit 790486c

File tree

6 files changed

+274
-70
lines changed

6 files changed

+274
-70
lines changed

Attendance/Projects/App/Sources/Di/RepositoryModuleFactory.swift

+2-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ extension RepositoryModuleFactory {
1818
registerModuleCopy.makeDependency(AuthRepositoryProtocol.self) { AuthRepository() },
1919
registerModuleCopy.makeDependency(FireStoreRepositoryProtocol.self) { FireStoreRepository() },
2020
registerModuleCopy.makeDependency(QrCodeRepositoryProtcol.self) { QrCodeRepository() },
21-
registerModuleCopy.makeDependency(SignUpRepositoryProtcol.self) { SignUpRepository() }
21+
registerModuleCopy.makeDependency(SignUpRepositoryProtcol.self) { SignUpRepository() },
22+
registerModuleCopy.makeDependency(OAuthRepositoryProtocol.self) { OAuthRepository() }
2223
]
2324
}()
2425
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
//
2+
// AttendanceStatus.swift
3+
// DDDAttendance
4+
//
5+
// Created by eunpyo on 4/13/25.
6+
//
7+
8+
import Foundation
9+
10+
public enum AttendanceStatus: String {
11+
case tbd
12+
case present
13+
case late
14+
case absent
15+
case exception
16+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
//
2+
// Schedule.swift
3+
// DDDAttendance
4+
//
5+
// Created by eunpyo on 4/13/25.
6+
//
7+
8+
import Foundation
9+
10+
public struct Schedule: Identifiable, Equatable {
11+
public let id: String
12+
public let month: Int
13+
public let day: Int
14+
public let title: String
15+
public let description: String
16+
public let status: AttendanceStatus
17+
18+
public init(
19+
id: String,
20+
month: Int,
21+
day: Int,
22+
title: String,
23+
description: String,
24+
status: AttendanceStatus
25+
) {
26+
self.id = id
27+
self.month = month
28+
self.day = day
29+
self.title = title
30+
self.description = description
31+
self.status = status
32+
}
33+
34+
public static func ==(lhs: Schedule, rhs: Schedule) -> Bool {
35+
return lhs.id == rhs.id
36+
}
37+
}
38+
39+
public extension Schedule {
40+
static let mock: [Schedule] = [
41+
.init(
42+
id: UUID().uuidString,
43+
month: 6,
44+
day: 11,
45+
title: "오리엔테이션",
46+
description: "커리큘럼에 대한 설명 문구 작성",
47+
status: .present
48+
),
49+
.init(
50+
id: UUID().uuidString,
51+
month: 6,
52+
day: 22,
53+
title: "부스팅 데이 1",
54+
description: "커리큘럼에 대한 설명 문구 작성",
55+
status: .late
56+
),
57+
.init(
58+
id: UUID().uuidString,
59+
month: 7,
60+
day: 06,
61+
title: "직군 모임 1",
62+
description: "커리큘럼에 대한 설명 문구 작성",
63+
status: .absent
64+
),
65+
.init(
66+
id: UUID().uuidString,
67+
month: 7,
68+
day: 20,
69+
title: "오리엔테이션",
70+
description: "커리큘럼에 대한 설명 문구 작성",
71+
status: .tbd
72+
)
73+
]
74+
}

Attendance/Projects/Presentation/Presentation/Sources/Member/Coordinator/Reducer/MemberCoordinator.swift

+28-28
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,17 @@ import TCACoordinators
1616
@Reducer
1717
public struct MemberCoordinator {
1818
public init() {}
19-
19+
2020
@ObservableState
2121
public struct State: Equatable {
2222
@Shared(.appStorage("UserUID")) var userUid: String = ""
2323
var routes: [Route<MemberScreen.State>]
24-
24+
2525
public init() {
2626
routes = [.root(.member(.init()), embedInNavigationView: true)]
2727
}
2828
}
29-
29+
3030
public enum Action: ViewAction, BindableAction, FeatureAction {
3131
case binding(BindingAction<State>)
3232
case router(IndexedRouterActionOf<MemberScreen>)
@@ -35,51 +35,51 @@ public struct MemberCoordinator {
3535
case async(AsyncAction)
3636
case navigation(NavigationAction)
3737
}
38-
38+
3939
@CasePathable
4040
public enum View {
41-
41+
4242
}
43-
43+
4444
public enum AsyncAction: Equatable {
45-
45+
4646
}
47-
47+
4848
public enum InnerAction: Equatable {
49-
49+
5050
}
51-
51+
5252
public enum NavigationAction: Equatable {
53-
53+
5454
}
55-
55+
5656
public var body: some ReducerOf<Self> {
5757
BindingReducer()
58-
58+
5959
Reduce { state, action in
6060
switch action {
6161
case .binding:
6262
return .none
63-
63+
6464
case .router(let action):
6565
return handleRouterAction(state: &state, action: action)
66-
66+
6767
case .view(let action):
6868
return handleViewAction(state: &state, action: action)
69-
69+
7070
case .inner(let action):
7171
return handleInnerAction(state: &state, action: action)
72-
72+
7373
case .async(let action):
7474
return handleAsyncAction(state: &state, action: action)
75-
75+
7676
case .navigation(let action):
7777
return handleNavigationAction(state: &state, action: action)
7878
}
7979
}
8080
.forEachRoute(\.routes, action: \.router)
8181
}
82-
82+
8383
private func handleRouterAction(
8484
state: inout State,
8585
action: IndexedRouterActionOf<MemberScreen>
@@ -88,38 +88,38 @@ public struct MemberCoordinator {
8888
case .routeAction(id: _, action: .member(.navigation(.routeToProfile))):
8989
// TODO: - navigate to profile View
9090
return .none
91-
91+
9292
default:
9393
return .none
9494
}
9595
}
96-
96+
9797
private func handleViewAction(
9898
state: inout State,
9999
action: View
100100
) -> Effect<Action> {
101-
101+
102102
}
103-
103+
104104
private func handleInnerAction(
105105
state: inout State,
106106
action: InnerAction
107107
) -> Effect<Action> {
108-
108+
109109
}
110-
110+
111111
private func handleAsyncAction(
112112
state: inout State,
113113
action: AsyncAction
114114
) -> Effect<Action> {
115-
115+
116116
}
117-
117+
118118
private func handleNavigationAction(
119119
state: inout State,
120120
action: NavigationAction
121121
) -> Effect<Action> {
122-
122+
123123
}
124124
}
125125

0 commit comments

Comments
 (0)