Skip to content

feat(report): 월간 리포트 V2 도입 및 통합 조회 확장#165

Merged
1Seob merged 9 commits into
developfrom
feat/monthly-report-v2
May 17, 2026
Merged

feat(report): 월간 리포트 V2 도입 및 통합 조회 확장#165
1Seob merged 9 commits into
developfrom
feat/monthly-report-v2

Conversation

@1Seob
Copy link
Copy Markdown
Collaborator

@1Seob 1Seob commented May 17, 2026

📝 요약(Summary)

기존 월간 리포트(V1) 흐름과 별도로 MonthlyReportV2 생성/저장/조회 파이프라인을 도입하고,
관심사 통계 추가 및 전체 리포트(주간+월간) 통합 조회 기능을 확장했습니다.

1. 월간 리포트 V2 도메인/스키마 신설

  • monthly_reports_v2 테이블 생성
  • V2 전용 엔티티/리포지토리/콘텐츠 모델 추가
    • MonthlyReportV2, MonthlyReportV2Content
    • MonthlyReportV2Repository
    • MonthlyReportComparisonType, MonthlyReportImageStatus
  • V2 콘텐츠 팩토리 추가
    • MonthlyReportV2ContentFactory
    • MonthlyContentFactory
  • DB 마이그레이션
    • V20260512_1400__IS_create_monthly_reports_v2_table.sql
    • V20260515_1710__IS_add_interest_stats_to_monthly_reports_v2.sql

2. 월간 리포트 V2 생성 파이프라인 구축

  • 월간 생성 시작 시 PENDING V2 리포트 생성/상태 전이 로직 반영
  • 텍스트 생성/저장 트랜잭션 분리 및 상태 업데이트 정비
  • 이미지 생성/업로드 파이프라인 추가
    • OpenAiImageClient
    • MonthlyReportImageStorage
  • 이벤트/서비스 연결 강화
    • MonthlyReportGenerationRequestedEventDto
    • MonthlyReportTxService, PendingMonthlyReportService, MonthlyReportGenerationListener

3. 감정/관심사 통계 연동

  • 기존 감정 통계 저장 경로를 V2에 맞게 연결
  • 관심사 통계 신규 추가
    • InterestStatsContent
    • InterestStatsCountDto
    • MonthlyInterestStatsCalculator
  • MonthlyQueryRepository에 월간 관심사 집계 쿼리 추가
  • confirmMonthlyTextupdateContent SQL에 interest_stats 저장 로직 반영

4. V2 조회 API 및 응답 모델 확장

  • MonthlyReportControllerV2 추가 및 조회/생성 엔드포인트 분리
  • MonthlyReportQueryServiceV2 구현
  • V2 조회 응답 DTO 추가/확장
    • MonthlyReportResponseV2
      • imageUrl 반환
      • comparisonType 포함
      • status를 MonthlyReportStatus enum으로 반환

5. 전체 리포트 통합 조회 API 추가

  • GET /api/v2/monthly-report/all
  • 주간(V1) + 월간(V1/V2) 통합 목록 반환
  • 응답 DTO
    • AllReportItemResponseV2 (id, type, period, summary, version)
  • 필터 파라미터 추가
    • type=ALL|MONTHLY|WEEKLY (기본 ALL)
    • ReportListTypeV2 추가
  • 정렬 규칙
    • 년-월 내림차순
    • 동일 월에서 월간 우선, 주간은 주차 내림차순
  • version 규칙
    • weekly: 1
    • monthly(v1): 1
    • monthly(v2): 2

🔗 Related Issue

  • Closes:

💬 공유사항

✅ PR Checklist

PR이 다음 요구 사항을 충족하는지 확인하세요.

  • PR 제목을 커밋 메시지 컨벤션에 맞게 작성했습니다.

Copy link
Copy Markdown
Collaborator

@coldsunn coldsunn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

코멘트 남겼습니다! 그리고 api를 v2로 사용하면서 다른 테이블을 사용하게 되었는데 앱에서 알림에 같이 보내고 있는 targetId를 사용해서 알림을 클릭했을 때 v1 api를 사용해서 화면을 띄운다면 배포 후부터 보내는 targetId가 새로운 테이블 ID여서 업데이트를 하지 않은 버전에서 알림을 받으면 v1 api를 써서 작동을 안 할 것 같습니다. 이 부분 프론트엔드 분께 전달드리고 조치할 게 있으면 해야될 듯합니다.
근데 아마 월간 리포트 알림 열 때 targetId 안 쓰시는거 같긴한디...(이게 제일 베스트)

@1Seob 1Seob closed this May 17, 2026
@1Seob 1Seob reopened this May 17, 2026
@1Seob 1Seob merged commit cac1b31 into develop May 17, 2026
2 checks passed
@1Seob 1Seob deleted the feat/monthly-report-v2 branch May 17, 2026 05:18
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