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
17 changes: 17 additions & 0 deletions Projects/Domain/Goal/Interface/Sources/DTO/PokeRequestDTO.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
//
// PokeRequestDTO.swift
// DomainGoalInterface
//
// Created by 정지훈 on 5/28/26.
//

import Foundation

/// 목표를 찌르기 위한 요청 DTO입니다.
public struct PokeRequestDTO: Encodable {
public let date: String

public init(date: String) {
self.date = date
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ import Foundation
/// 찌르기 관련 API 엔드포인트입니다.
public enum PokeEndpoint: Endpoint {
/// 파트너에게 찌르기
case poke(goalId: Int64)
case poke(goalId: Int64, request: PokeRequestDTO)
}

extension PokeEndpoint {
public var path: String {
switch self {
case let .poke(goalId):
case let .poke(goalId, _):
return "/api/v1/pokes/goals/\(goalId)"
}
}
Expand All @@ -38,7 +38,10 @@ extension PokeEndpoint {
}

public var body: (any Encodable)? {
nil
switch self {
case let .poke(_, request):
return request
}
}

public var requiresAuth: Bool { true }
Expand Down
8 changes: 4 additions & 4 deletions Projects/Domain/Goal/Interface/Sources/GoalClient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public struct GoalClient {
public var updateGoal: (Int64, GoalUpdateRequestDTO) async throws -> Goal
public var deleteGoal: (Int64) async throws -> Void
public var completeGoal: (Int64) async throws -> GoalCompleteResponseDTO
public var pokePartner: (Int64) async throws -> Void
public var pokePartner: (Int64, PokeRequestDTO) async throws -> Void

/// 목표 조회 클로저를 주입하여 GoalClient를 생성합니다.
///
Expand All @@ -47,7 +47,7 @@ public struct GoalClient {
updateGoal: @escaping (Int64, GoalUpdateRequestDTO) async throws -> Goal,
deleteGoal: @escaping (Int64) async throws -> Void,
completeGoal: @escaping (Int64) async throws -> GoalCompleteResponseDTO,
pokePartner: @escaping (Int64) async throws -> Void
pokePartner: @escaping (Int64, PokeRequestDTO) async throws -> Void
) {
self.fetchGoals = fetchGoals
self.createGoal = createGoal
Expand Down Expand Up @@ -135,7 +135,7 @@ extension GoalClient: TestDependencyKey {
completedAt: ""
)
},
pokePartner: { _ in
pokePartner: { _, _ in
assertionFailure("GoalClient.pokePartner가 구현되지 않았습니다. withDependencies로 mock을 주입하세요.")
}
)
Expand Down Expand Up @@ -283,7 +283,7 @@ extension GoalClient: TestDependencyKey {
completedAt: "2026-02-22T00:00:00Z"
)
},
pokePartner: { _ in
pokePartner: { _, _ in
return
}
)
Expand Down
7 changes: 5 additions & 2 deletions Projects/Domain/Goal/Sources/GoalClient+Live.swift
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,13 @@ extension GoalClient: @retroactive DependencyKey {
throw error
}
},
pokePartner: { goalId in
pokePartner: { goalId, requestDTO in
do {
let _: EmptyResponse = try await networkClient.request(
endpoint: PokeEndpoint.poke(goalId: goalId)
endpoint: PokeEndpoint.poke(
goalId: goalId,
request: requestDTO
)
)
} catch {
throw error
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,11 @@ extension GoalDetailReducer {
let timeText = PokeCooldownManager.formatRemainingTime(remaining)
return .send(.presentation(.showToast(.warning(message: "\(timeText) 뒤에 다시 찌를 수 있어요"))))
}
let date = state.verificationDate
return .run { send in
PokeCooldownManager.recordPoke(goalId: goalId)
do {
try await goalClient.pokePartner(goalId)
try await goalClient.pokePartner(goalId, PokeRequestDTO(date: date))
analyticsClient.logEvent(GoalDetailAnalyticsEvent.pokeSent)
await send(.presentation(.showToast(.poke(message: "상대방을 찔렀어요!"))))
} catch {
Expand Down
3 changes: 3 additions & 0 deletions Projects/Feature/Home/Sources/Home/HomeCalendarSection.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ struct HomeCalendarSection: View {
)
.frame(maxWidth: .infinity, maxHeight: 76)
.perfControl(slug: "home", element: "calendar")
.transaction { transaction in
transaction.animation = nil
}

if UITestMode.isProbeScenario {
calendarView.perfStateMarker(
Expand Down
2 changes: 1 addition & 1 deletion Projects/Feature/Home/Sources/Home/HomeReducer+Impl.swift
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ extension HomeReducer {
return .run { send in
PokeCooldownManager.recordPoke(goalId: goalId)
do {
try await goalClient.pokePartner(goalId)
try await goalClient.pokePartner(goalId, PokeRequestDTO(date: pokeDate.formattedAPIDateString()))
await send(.internal(.setPokeButtonDisabled(goalId: goalId, true, date: pokeDate)))
await send(.presentation(.showToast(.poke(message: "상대방을 찔렀어요!"))))
} catch {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ private extension StatsDetailView {
)
.padding(.top, 24)
.padding(.bottom, 32)
.background(Color.Common.white)
.background(Color.Common.white, in: RoundedRectangle(cornerRadius: 16))
.insideBorder(
Color.Gray.gray500,
shape: RoundedRectangle(cornerRadius: 16),
Expand Down
Loading