Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Projects/App/Sources/Navigation/Class/ClassCoordinator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,7 @@ private extension ClassCoordinator {
state.routes.push(.ticket(.init(instanceID: uuid())))
return .none

case let .routeAction(routeID, action: .ticket(.delegate(.showOverview(startDate, endDate)))):
case let .routeAction(routeID, action: .ticket(.delegate(.registrationConfirmed(startDate: startDate, endDate: endDate)))):
guard routeID == state.routes.count - 1,
case let .ticket(completed)? = state.routes.last?.screen,
completed.phase == .registered,
Expand Down Expand Up @@ -517,7 +517,7 @@ private extension ClassCoordinator {
}
return .none

case let .routeAction(routeID, action: .ticket(.delegate(.addRegistration))):
case let .routeAction(routeID, action: .ticket(.delegate(.addRegistrationRequested))):
guard routeID == state.routes.count - 1,
case let .ticket(overview)? = state.routes.last?.screen,
overview.phase == .overview
Expand Down
6 changes: 3 additions & 3 deletions Projects/App/Tests/Sources/ClassCoordinatorTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1942,7 +1942,7 @@ struct ClassParticipantPushTests {

await store.send(.router(.routeAction(
id: 1,
action: .ticket(.delegate(.showOverview(firstStart, firstEnd)))
action: .ticket(.delegate(.registrationConfirmed(startDate: firstStart, endDate: firstEnd)))
)))
await store.receive(\.inner) {
var overview = ClassTicketFeature.State(instanceID: UUID(0))
Expand All @@ -1956,7 +1956,7 @@ struct ClassParticipantPushTests {

await store.send(.router(.routeAction(
id: 2,
action: .ticket(.delegate(.addRegistration))
action: .ticket(.delegate(.addRegistrationRequested))
))) {
$0.routes.push(.ticket(.init(instanceID: UUID(1))))
$0.ticketInstanceIDs = [originalID, UUID(0), UUID(1)]
Expand Down Expand Up @@ -1999,7 +1999,7 @@ struct ClassParticipantPushTests {
}
await store.send(.router(.routeAction(
id: 3,
action: .ticket(.delegate(.showOverview(secondStart, secondEnd)))
action: .ticket(.delegate(.registrationConfirmed(startDate: secondStart, endDate: secondEnd)))
)))
#expect(store.state.routes.count == 4)
await store.receive(\.inner) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ public struct ClassTicketFeature {
@CasePathable
public enum DelegateAction: Equatable {
case dismiss
case showOverview(Date, Date)
case addRegistration
case registrationConfirmed(startDate: Date, endDate: Date)
case addRegistrationRequested
case registered(Date, Date)
}

Expand Down Expand Up @@ -93,11 +93,14 @@ public struct ClassTicketFeature {
let registrationStartDate = state.registrationStartDate,
let expirationDate = state.expirationDate
else { return .none }
return .send(.delegate(.showOverview(registrationStartDate, expirationDate)))
return .send(.delegate(.registrationConfirmed(
startDate: registrationStartDate,
endDate: expirationDate
)))

case .view(.addRegistrationTapped):
guard state.phase == .overview else { return .none }
return .send(.delegate(.addRegistration))
return .send(.delegate(.addRegistrationRequested))

case let .view(.faqTapped(index)):
state.expandedFAQ = state.expandedFAQ == index ? nil : index
Expand Down
4 changes: 2 additions & 2 deletions Projects/Feature/Class/Tests/Sources/ClassTicketTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ struct ClassTicketTests {
let store = TestStore(initialState: state) { ClassTicketFeature() }

await store.send(.view(.confirmTapped))
await store.receive(\.delegate, .showOverview(start, end))
await store.receive(\.delegate, .registrationConfirmed(startDate: start, endDate: end))
#expect(store.state.navigationTitle == "이용권 등록하기")
}

Expand Down Expand Up @@ -191,7 +191,7 @@ struct ClassTicketTests {
#expect(store.state.navigationTitle == "클래스 이용권")
#expect(store.state.periodText == "2026.10.09 – 2027.04.08")
await store.send(.view(.addRegistrationTapped))
await store.receive(\.delegate, .addRegistration)
await store.receive(\.delegate, .addRegistrationRequested)
await store.send(.view(.backTapped))
await store.receive(\.delegate, .dismiss)
}
Expand Down
Loading