[GMSS-166] 카드 월별 조회 API 추가 - #49
Merged
Merged
Conversation
보관함 상세가 오늘 하루치가 아니라 고른 달 전체를 보여줘야 해서, 서버의 GET /api/cards/monthly(yearMonth=yyyy-MM)를 붙였다. YearMonth.toString()이 서버가 요구하는 yyyy-MM 그대로라 포맷터는 두지 않았다. 이 응답에는 카드 식별자가 없고 날짜별 대표 감정 목록만 온다. 그래서 카드 한 건의 신원을 날짜와 그날 순번(CardEntry.indexInDate)으로 잡았다. 순번은 알 수 없는 감정을 걸러낸 뒤를 기준으로 센다. 날짜별 조회(getCardsByDate)도 같은 기준으로 걸러내므로, 나중에 요약 같은 상세가 필요해지면 날짜로 다시 조회해 그 순번의 카드를 그대로 찾을 수 있다.
soyeonLee126
force-pushed
the
feature/card-month-query
branch
from
August 18, 2026 08:07
04ac8b6 to
5a9d7de
Compare
This was referenced Aug 18, 2026
Merged
어노테이션이 없어 getCardsByMonth 의 날짜 파싱과 펼치기를 검증하는 유일한 테스트가 실행되지 않았다.
날짜별 조회는 못 읽는 날짜의 카드만 버리는데 월별 조회는 LocalDate.parse 가 그대로 던져 그 달이 전부 실패했다. 두 응답의 필터 기준이 어긋나면 CardEntry.indexInDate 가 서로 다른 카드를 가리킨다.
CardRepository 구현 fake 6개가 각자 메서드 6종을 손으로 썼다. 인터페이스에 메서드를 하나 추가할 때마다 테스트 파일을 전부 건드려야 했다.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
작업 개요
보관함 상세 화면이 쓸 카드 월별 조회 API를 데이터 레이어에만 먼저 추가했습니다.
보관함 작업 전체를 담은 #43이 69개 파일까지 커져서 리뷰가 어려운 상태였습니다. 화면 코드와 독립적인 데이터 레이어를 1단계로 떼어 먼저 올립니다.
머지 순서는 이 PR을 먼저, 그다음 #51, 마지막에 #43입니다.
작업 유형
변경 사항
domain
CardEntry를 추가했습니다. 월별 조회는 요약 없이 날짜, 그날 순번, 감정만 다룹니다.CardRepository.getCardsByMonth(yearMonth)를 추가했습니다.GetCardsByMonthUseCase를 추가했습니다.data
CardService에 월별 조회 엔드포인트를 추가했습니다.CardCalendarResponse를 추가했습니다. 하루치 감정 목록을 카드 한 건씩으로 펼칩니다.CardRepositoryImpl에 구현을 추가했습니다.테스트
CardRepository구현 fake 8개 파일(9개 지점)에 새 메서드 override를 추가했습니다. 기존getCardsByDate동작은 그대로 두었습니다.16개 파일, 209줄 추가, 삭제 0줄입니다. 기존 코드의 동작을 바꾸는 변경은 없습니다.
관련 이슈
관련 작업 (Notion)
스크린샷 / 동작 화면
UI 변경이 없습니다.
체크리스트
develop으로 설정되어 있다feat:,fix:등)을 따른다데이터 레이어만 바뀌어 아직 호출하는 화면이 없습니다. 앱 실행 확인은 생략했고
./gradlew detekt lint test로 검증했습니다. 전부 통과하며 새로 생긴 경고는 없습니다.리뷰 요청 사항
두 곳을 봐주시면 좋겠습니다.
CardCalendarResponse.toDomain()의 순번 계산입니다. 알 수 없는 감정을 버린 뒤를 기준으로 세도록 했습니다. 날짜별 조회도 같은 규칙이라 두 API가 같은 카드에 같은 순번을 줘야 합니다.error(...)로 둔 선택입니다. 현재 월별 조회를 호출하는 테스트가 없어 호출되면 바로 드러나게 했습니다. 빈 목록을 돌려주는 편이 낫다면 바꾸겠습니다.