Skip to content

feat: 장부 통합 report의 members/categories를 월별로 응답한다#19

Merged
rlarltj merged 1 commit into
MONEYMONG:devfrom
pott-101:pott-101/monthly-members-cat
May 24, 2026
Merged

feat: 장부 통합 report의 members/categories를 월별로 응답한다#19
rlarltj merged 1 commit into
MONEYMONG:devfrom
pott-101:pott-101/monthly-members-cat

Conversation

@pott-101

Copy link
Copy Markdown
Contributor

Summary

LedgerReportResponse의 최상위 members / categories 필드를 제거하고, MonthlyReport 내부로 옮겨 월별 멤버/카테고리 집계를 응답하도록 변경합니다.

기존 구조에서는 요청 기간 전체에 대한 합계 1세트만 응답되어, 클라이언트가 월별 breakdown을 받으려면 월 단위로 요청을 끊어야 했습니다. 변경 후엔 임의 기간(예: 1~5월)을 한 번에 요청해도 monthly 배열의 각 월 안에서 멤버/카테고리 데이터를 받을 수 있습니다.

변경 내역

  • LedgerReportResponse: 최상위 members, categories 필드 제거
  • LedgerReportResponse.MonthlyReport: members: List<MemberReport>, categories: List<CategoryReport> 필드 추가
  • LedgerReportReader.generateMonthlyReports: 각 월의 monthDetailsgenerateMemberReports, generateCategoryReports 호출
  • 월별 멤버/카테고리의 incomeShare/expenseShare 분모는 해당 월 합계(monthIncome, monthExpense) 기준
  • 데이터 없는 달도 members: [], categories: []로 row 유지

응답 예시 (1~5월 요청)

{
  "totalIncome": 0,
  "totalExpense": 0,
  "totalBalance": 0,
  "monthly": [
    {
      "year": 2024, "month": 1,
      "income": 0, "expense": 0, "netAmount": 0,
      "incomeShareOfPeriod": 0, "expenseShareOfPeriod": 0,
      "members": [ { "userId": 0, "nickname": "...", "income": 0, "expense": 0, "incomeShare": 0, "expenseShare": 0 } ],
      "categories": [ { "name": "...", "income": 0, "expense": 0, "incomeShare": 0, "expenseShare": 0 } ]
    },
    ...
  ]
}

Test plan

  • 1~5월 요청 시 monthly가 5개 원소를 갖는지 확인
  • 각 월의 members/categories가 해당 월 데이터만 반영하는지 확인
  • 데이터 없는 월도 members: [], categories: []로 응답되는지 확인
  • 클라이언트에서 응답 스키마(최상위 members/categories 제거, monthly[].members/categories 추가) 반영

🤖 Generated with Claude Code

- 최상위 members/categories 필드 제거
- MonthlyReport 내부에 members/categories 필드 추가
- 월별 멤버/카테고리의 share 분모는 해당 월 합계 기준

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@rlarltj rlarltj merged commit 1bc8303 into MONEYMONG:dev May 24, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants