Conversation
#485에서 Refunded 상태가 도입됐으나 결제내역(GET /api/prompts/purchases) 응답에 status 정보가 없어 환불된 거래를 식별할 수 없었음. 환불 표시 추가. - PurchaseRepository.findSucceededByUser → findPurchaseHistory로 rename - status IN (Succeed, Refunded) 양쪽 모두 조회 - payment.status / refund.refunded_at include - PurchaseHistoryItemDTO 확장: purchased_at(stale dto 정정) + status + refunded_at - PurchaseHistoryService.list: status, refunded_at 매핑 - Swagger 응답 schema에 status enum + refunded_at 필드 추가 프론트는 status='Refunded' 항목에 환불 뱃지/메시지 표시 가능.
직전 commit에서 jsdoc 인덴트가 ' * * ' 형태로 별표 두 개가 들어가 YAML 파싱 실패. swagger 빌드 깨짐. ' * '로 정정.
- 쿼리 파라미터 page(기본 1), limit(기본 10, 최대 100) 추가 - repository: - findSalesByMonth에 skip/take 적용 (페이지 데이터만 반환) - countSalesByMonth 신규 (페이지네이션 메타) - aggregateSalesByMonth 신규 (raw SQL로 월 전체 합계 — Refunded 분리 포함) - service: 세 호출 병렬 + items/summary/pagination 매핑 - summary의 의미를 페이지 단위 → 월 전체 합계로 정합화 (페이지네이션 도입과 함께 통계 정확성 우선). 응답 형식 동일 (count/total_sales/total_settled/ total_fee/refunded_count/refunded_amount). - DTO에 pagination 필드 추가 - Swagger 갱신: query params + pagination 응답 + summary description 보강 - swagger.json 재생성
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.
Summary
정산/구매 통계 UX 보완 두 가지. 커밋 분리.
커밋
c062c78status/refunded_at) 추가d3665070411cfc/sales/monthly페이지네이션 + summary를 월 전체 합계로 정합화핵심 변경
1. 결제내역에 환불 표시
PurchaseRepository.findSucceededByUser→findPurchaseHistory로 rename,Succeed+Refunded둘 다 조회PurchaseHistoryItemDTO에purchased_at(stale dto 정정) +status+refunded_at필드 추가refund.refunded_at매핑 (Payple 응답 시각 또는 우리 DB 기록 시각)2.
/sales/monthly페이지네이션page(기본 1),limit(기본 10, 최대 100)findSalesByMonth(skip,take)/countSalesByMonth/aggregateSalesByMonth(raw SQL)pagination: { page, limit, total, total_pages, has_next }추가API 변경 (프론트 동기화 필요)
GET /api/prompts/purchasesitemsstatus(Succeed/Refunded),refunded_at,purchased_at노출GET /api/settlements/sales/monthlyquerypage,limit신규GET /api/settlements/sales/monthly응답pagination신규, summary는 월 전체 합계로 의미 변경별도 이슈 후보 (남은 부채)
Test plan
pnpm build/pnpm tsc --noEmit통과status='Refunded'로 노출)/sales/monthly?page=2&limit=5응답 확인 (pagination 정상)Closes #497