Skip to content

feat: 목표 상세목록 조회 api 연동#142

Merged
jihun32 merged 8 commits into
developfrom
feat/#138
Feb 10, 2026
Merged

feat: 목표 상세목록 조회 api 연동#142
jihun32 merged 8 commits into
developfrom
feat/#138

Conversation

@jihun32
Copy link
Copy Markdown
Contributor

@jihun32 jihun32 commented Feb 10, 2026

🔗 관련 이슈

📙 작업 내역

  • 기존 fetchById 병렬에서 새로 생긴 api로 편집 아이템들 받아오도록 수정
  • id 타입 Int -> Int64로 변경
  • WeekCalendar 스와이프 처리

💬 추가 설명 or 리뷰 포인트 (선택)

@clxxrlove
Copy link
Copy Markdown
Member

@coderabbitai summary

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Feb 10, 2026

@clxxrlove, I'll generate a summary of this PR for you.

✅ Actions performed

Summary regeneration triggered.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Feb 10, 2026

📝 Walkthrough

목표 상세목록 조회 API 연동 및 WeekCalendar 스와이프 기능 구현

주요 변경사항

1. API 통합 및 데이터 흐름 개선

  • 새로운 fetchGoalEditList(date: String) API 엔드포인트 추가 (GET /api/v1/goals/detail?date=...)
  • 기존의 병렬 fetchById 로직을 단일 API 호출로 대체
  • GoalEditListResponseDTO 도입으로 목표 목록을 한 번에 조회 가능
  • GoalClientfetchGoalEditList: (String) async throws -> [Goal] 의존성 추가

2. TCA 상태 및 액션 흐름 변경

EditGoalListReducer:

  • State 초기화: init(calendarDate: TXCalendarDate) 추가로 화면 진입 시 특정 날짜 설정 가능
  • 새로운 액션: weekCalendarSwipe(TXCalendar.SwipeGesture) - 주간 캘린더 스와이프 처리
  • 액션 흐름 단순화: onAppear에서 직접 fetchGoals 호출
  • fetchGoalsCompleted 액션에 날짜 파라미터 추가로 상태 일관성 보장

HomeReducer:

  • 액션 타입 변경: goalCheckButtonTapped(id: Int64, ...), authorizationCompleted(id: Int64, ...)
  • 상태 변경: pendingDeleteGoalID: Int64?
  • 새로운 액션: weekCalendarSwipe 처리
  • 델리게이트 변경: goToEditGoalList(date: TXCalendarDate) - 선택한 날짜를 전달

3. WeekCalendar 스와이프 기능

  • TXCalendarSwipeGesture 열거형 추가 (.next, .previous)
  • onWeekSwipe 콜백 파라미터 추가로 스와이프 이벤트 처리
  • TXCalendarUtil.dateByAddingWeek(from:by:) 유틸리티 메서드 추가로 주 단위 날짜 계산
  • HomeView와 EditGoalListView에서 스와이프 이벤트를 액션으로 전달

4. 타입 안전성 강화

  • 모든 Goal ID를 Int에서 Int64로 변경 (Domain 및 Feature 계층 전반)
  • 영향받는 DTO 및 엔티티:
    • Goal, GoalDetail, GoalCardItem, GoalEditCardItem
    • 모든 Response DTO (GoalCreateResponseDTO, GoalCompleteResponseDTO 등)
    • PhotoLogCreateResponseDTO, PhotoLogCreateRequestDTO
  • 검증 필드 옵셀널화: Goal.myVerification, Goal.yourVerification을 필수 → 선택사항으로 변경

5. 라우팅 및 상태 전파

  • HomeCoordinator에서 goToEditGoalList(date:) 처리로 선택한 날짜를 EditGoalList 초기 상태에 전달
  • 날짜 변경 시 자동으로 fetchGoals 액션 디스패치로 데이터 재조회

아키텍처 개선 효과

  • 병렬 처리 제거: 여러 개의 fetchById 대신 단일 배치 API 호출로 성능 개선
  • 상태 일관성: 날짜 기반 상태 관리로 화면 전환 시에도 데이터 동기화 보장
  • 사용자 경험: 주간 캘린더 스와이프로 직관적인 주 단위 네비게이션 제공

관련 이슈

  • #138 종료 (목표 상세목록 조회 API 연동 완료)

Walkthrough

INT를 INT64로 변경하여 Goal 관련 API의 ID 타입을 확대하고, 목표 상세목록 조회 API를 새로 추가했습니다. EditGoalList의 병렬 데이터 로딩을 새로운 단일 API 호출로 대체하고, 주간 스와이프 네비게이션 기능을 추가했습니다.

Changes

Cohort / File(s) Summary
Goal DTO 타입 변경
Projects/Domain/Goal/Interface/Sources/DTO/GoalCompleteResponseDTO.swift, GoalCreateResponseDTO.swift, GoalListResponseDTO.swift, GoalPhotoLogListResponseDTO.swift
GoalId 필드를 Int에서 Int64로 변경하여 더 큰 정수 범위 지원
새로운 GoalEditList DTO
Projects/Domain/Goal/Interface/Sources/DTO/GoalEditListResponseDTO.swift
목표 상세목록 조회 응답 DTO 추가 (GoalEditResponseDTO 포함 및 Goal 엔터티 매핑 메서드)
Goal 엔드포인트 및 클라이언트 확장
Projects/Domain/Goal/Interface/Sources/Endpoint/GoalEndpoint.swift, GoalClient.swift, Projects/Domain/Goal/Sources/GoalClient+Live.swift
fetchGoalEditList 엔드포인트 추가, 기존 ID 파라미터를 Int64로 변경, 라이브 구현 추가
Goal 엔터티 및 피처 상태 변경
Projects/Domain/Goal/Interface/Sources/Entity/Goal.swift, GoalDetail.swift, Projects/Feature/GoalDetail/Interface/Sources/GoalDetailReducer.swift, Projects/Feature/Home/Interface/Sources/Goal/MakeGoalReducer.swift, ProofPhotoReducer.swift
ID를 Int64로 변경, Goal의 검증 필드를 선택적으로 변경
PhotoLog DTO 및 클라이언트 타입 변경
Projects/Domain/PhotoLog/Interface/Sources/DTO/PhotoLogCreateRequestDTO.swift, PhotoLogCreateResponseDTO.swift, Projects/Domain/PhotoLog/Interface/Sources/Endpoint/PhotoLogEndpoint.swift, PhotoLogClient.swift
GoalId 파라미터를 Int에서 Int64로 변경
EditGoalListReducer 로직 대폭 수정
Projects/Feature/Home/Interface/Sources/Goal/EditGoalListReducer.swift, Projects/Feature/Home/Sources/Goal/EditGoalListReducer+Impl.swift, EditGoalListView.swift
상태 초기화 추가, fetchGoals 액션 추가, weekCalendarSwipe 액션 추가, 병렬 상세 로딩에서 단일 API 호출로 변경
HomeReducer 주간 네비게이션 추가
Projects/Feature/Home/Interface/Sources/Home/HomeReducer.swift, Projects/Feature/Home/Sources/Home/HomeReducer+Impl.swift, HomeView.swift, Projects/Feature/Home/Sources/Root/HomeCoordinator+Impl.swift
weekCalendarSwipe 액션 추가, goToEditGoalList에 날짜 파라미터 추가, 주간 스와이프 핸들링 추가
디자인 시스템 캘린더 확장
Projects/Shared/DesignSystem/Sources/Components/Calendar/Core/TXCalendar.swift, Utilities/TXCalendarUtil.swift
SwipeGesture 열거형 및 onWeekSwipe 콜백 추가, 주간 더하기/빼기 유틸리티 메서드 추가
카드 컴포넌트 ID 타입 변경
Projects/Shared/DesignSystem/Sources/Components/Card/Goal/GoalCardItem.swift, GoalEditCardItem.swift, GoalEditCardView.swift
GoalCardItem.id를 Int로, GoalEditCardItem.id를 String에서 Int64로 변경

Sequence Diagram(s)

sequenceDiagram
    participant EditGoalListView as EditGoalListView
    participant EditGoalListReducer as EditGoalListReducer
    participant GoalClient as GoalClient
    participant GoalEndpoint as GoalEndpoint
    participant GoalEditListResponseDTO as GoalEditListResponseDTO

    EditGoalListView->>EditGoalListReducer: onAppear()
    EditGoalListReducer->>EditGoalListReducer: dispatch(fetchGoals)
    EditGoalListReducer->>GoalClient: fetchGoalEditList(date: String)
    GoalClient->>GoalEndpoint: GET /api/v1/goals/detail?date=...
    GoalEndpoint-->>GoalClient: GoalEditListResponseDTO
    GoalClient->>GoalEditListResponseDTO: toEntity() mapping
    GoalEditListResponseDTO-->>GoalClient: [Goal]
    GoalClient-->>EditGoalListReducer: fetchGoalsCompleted([Goal], date)
    EditGoalListReducer->>EditGoalListReducer: update state with cards & date
    EditGoalListReducer-->>EditGoalListView: refresh UI
Loading
sequenceDiagram
    participant HomeView as HomeView
    participant TXCalendar as TXCalendar
    participant HomeReducer as HomeReducer
    participant HomeCoordinator as HomeCoordinator
    participant EditGoalListReducer as EditGoalListReducer

    HomeView->>TXCalendar: onWeekSwipe(gesture)
    TXCalendar->>HomeReducer: send(.weekCalendarSwipe(next/previous))
    HomeReducer->>HomeReducer: calculate nextWeekDate
    HomeReducer->>HomeReducer: dispatch(setCalendarDate(date))
    HomeReducer->>HomeReducer: dispatch(fetchGoals)
    HomeReducer->>HomeCoordinator: delegate(.goToEditGoalList(date))
    HomeCoordinator->>EditGoalListReducer: init(calendarDate: date)
    EditGoalListReducer-->>HomeCoordinator: EditGoalListState
Loading

Estimated Code Review Effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly Related PRs

  • feat: GoalDetail 인터랙션 구현 #113: GoalDetail.swift의 이니셜라이저 파라미터 변경(Int64 적용, 검증 필드 선택적 변경)이 중복되어 있으며, 두 PR이 동일한 엔터티를 수정하고 있습니다.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/#138

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@jihun32 jihun32 merged commit c4394bf into develop Feb 10, 2026
6 checks passed
@jihun32 jihun32 deleted the feat/#138 branch February 10, 2026 11:03
clxxrlove pushed a commit that referenced this pull request Feb 16, 2026
* refactor: fetchByGoalId 병렬 fetch -> GoalEditList fetch로 변경 - #138

* refactor: Id 타입 Int64로 변경 - #138

* feat: EditGoalListView 홈에서 보고있는 날짜 이어받기 - #138

* feat: 날짜 변경 시 해당 날짜 goal 불러오는 기능 구현 - #138

* feat: DTO repeatCycle 추가 - #138

* feat: TXCalendar week일 떄 스와이프 콜백 추가 - #138

* feat: TXCalendarUtil dateByAddingWeek 함수 구햔 - #138

* feat: Home, EditGoalList weekCalendar swipe 기능 구현 - #138

---------

Co-authored-by: jihun <jihun332@gmai.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants