[FEATURE] 디자이너 마이페이지 기능 구현#84
Conversation
|
Warning Review limit reached
Next review available in: 57 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthrough디자이너 마이페이지 통계 및 지급 내역 조회 API가 신규 추가되고, 정산(Settlement) 도메인이 새로 도입되었다. 신청 상태 집계 헬퍼와 관련 카운트 쿼리가 추가되었으며, Designer 조회 메서드가 정비되고, 커미션/이력 조회의 정렬 기준이 page/size 파라미터 기반으로 변경되었다. Changes디자이너 마이페이지 및 정산 기능
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant DesignerController
participant DesignerFacade
participant DesignerService
participant SettlementService
participant ApplicationService
participant DesignerResponseMapper
DesignerController->>DesignerFacade: getDesignerStats(designerId)
DesignerFacade->>DesignerService: getByIdWithUser(designerId)
DesignerFacade->>SettlementService: getTotalIncome(designerId)
DesignerFacade->>ApplicationService: countSubmittedFirstDrafts(designerId)
DesignerFacade->>ApplicationService: countSelected(designerId)
DesignerFacade->>DesignerResponseMapper: toDesignerStatsResponse(...)
DesignerResponseMapper-->>DesignerFacade: DesignerStatsResponse
DesignerFacade-->>DesignerController: ApiResponse
sequenceDiagram
participant SettlementController
participant DesignerSettlementFacade
participant SettlementService
participant SettlementRepository
SettlementController->>DesignerSettlementFacade: getDesignerSettlements(designerId, pageable)
DesignerSettlementFacade->>SettlementService: getCompletedSettlements(designerId, pageable)
SettlementService->>SettlementRepository: findByDesignerIdAndStatus(...)
SettlementRepository-->>SettlementService: Page<Settlement>
SettlementService-->>DesignerSettlementFacade: Page<Settlement>
DesignerSettlementFacade-->>SettlementController: DesignerSettlementResponse
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (2)
src/main/java/ditda/backend/domain/settlement/controller/SettlementController.java (1)
19-46: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueLGTM! URI 설계(
/api/v1/designers/settlements)가 API 컨벤션(버전 포함, 복수형 리소스, GET 사용)을 준수합니다.As per path instructions,
**/*Controller.java: "Include "api" and version in the URI" 및 "Use plural forms for resource names".참고로 클라이언트가 전달한 정렬 조건을 무시하고 항상
settledAtDESC로 고정하는 점은 의도된 설계로 보이나, Swagger@Operationdescription에 이 제약을 명시하면 API 사용자 혼란을 줄일 수 있습니다.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/main/java/ditda/backend/domain/settlement/controller/SettlementController.java` around lines 19 - 46, The endpoint in SettlementController#getMyPayments is overriding any client-provided sort by always rebuilding the Pageable with settledAt DESC, which should be made explicit in the API contract. Update the `@Operation` description to mention that results are always returned in latest-settlement order, and if appropriate also clarify this in the controller method’s documentation so users know the pageable sort is intentionally ignored.Source: Path instructions
src/main/java/ditda/backend/domain/settlement/entity/Settlement.java (1)
40-57: 🚀 Performance & Scalability | 🔵 Trivial정산 조회 성능을 위한 인덱스 검토 제안.
SettlementService.getTotalIncome/getCompletedSettlements가designer_id+status조합으로 조회하는 것으로 보입니다(연관 파일 근거). 데이터 증가 시 이 조합에 대한 복합 인덱스를 고려하면 좋겠습니다.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/main/java/ditda/backend/domain/settlement/entity/Settlement.java` around lines 40 - 57, Settlement 조회에서 designer_id와 status 조합을 자주 사용하므로 성능을 위해 복합 인덱스를 추가하도록 정리하세요. Settlement 엔티티의 designer/status 매핑을 기준으로, getTotalIncome과 getCompletedSettlements에서 사용하는 조건이 효율적으로 타도록 designer_id + status에 대한 인덱스를 클래스에 반영하고, 필요하면 엔티티의 인덱스 선언 방식에 맞춰 스키마 변경도 함께 맞추세요.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In
`@src/main/java/ditda/backend/domain/designer/repository/DesignerRepository.java`:
- Around line 3-15: `DesignerRepository.findByIdWithUser` uses a named JPQL
parameter (:designerId) but the method argument is not annotated, so binding may
fail without -parameters. Update the repository method to import
`org.springframework.data.repository.query.Param` and annotate the `designerId`
argument in `findByIdWithUser` with the matching name used in the `@Query`.
In
`@src/main/java/ditda/backend/domain/settlement/repository/SettlementRepository.java`:
- Around line 22-33: `SettlementRepository.findByDesignerIdAndStatus` has no
explicit ordering in its page query, so page results can become nondeterministic
when `Pageable` has no sort. Update the JPQL in this repository method to
include a stable default `ORDER BY` using a unique, monotonically increasing
field from `Settlement` (for example the entity id or created time) while
keeping the existing `JOIN FETCH s.commission` and `countQuery` unchanged.
Ensure the same method signature and pagination behavior remain intact.
---
Nitpick comments:
In
`@src/main/java/ditda/backend/domain/settlement/controller/SettlementController.java`:
- Around line 19-46: The endpoint in SettlementController#getMyPayments is
overriding any client-provided sort by always rebuilding the Pageable with
settledAt DESC, which should be made explicit in the API contract. Update the
`@Operation` description to mention that results are always returned in
latest-settlement order, and if appropriate also clarify this in the controller
method’s documentation so users know the pageable sort is intentionally ignored.
In `@src/main/java/ditda/backend/domain/settlement/entity/Settlement.java`:
- Around line 40-57: Settlement 조회에서 designer_id와 status 조합을 자주 사용하므로 성능을 위해 복합
인덱스를 추가하도록 정리하세요. Settlement 엔티티의 designer/status 매핑을 기준으로, getTotalIncome과
getCompletedSettlements에서 사용하는 조건이 효율적으로 타도록 designer_id + status에 대한 인덱스를 클래스에
반영하고, 필요하면 엔티티의 인덱스 선언 방식에 맞춰 스키마 변경도 함께 맞추세요.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yml
Review profile: CHILL
Plan: Pro Plus
Run ID: f9d9390b-fc37-458f-9004-04db5d4a1a1a
📒 Files selected for processing (23)
src/main/java/ditda/backend/domain/commission/application/entity/enums/ApplicationStatus.javasrc/main/java/ditda/backend/domain/commission/application/repository/CommissionApplicationRepository.javasrc/main/java/ditda/backend/domain/commission/application/service/ApplicationService.javasrc/main/java/ditda/backend/domain/commission/core/facade/CommissionFacade.javasrc/main/java/ditda/backend/domain/commission/core/facade/DesignerCommissionFacade.javasrc/main/java/ditda/backend/domain/commission/draft/facade/DraftFacade.javasrc/main/java/ditda/backend/domain/designer/controller/DesignerController.javasrc/main/java/ditda/backend/domain/designer/dto/response/DesignerStatsResponse.javasrc/main/java/ditda/backend/domain/designer/entity/Designer.javasrc/main/java/ditda/backend/domain/designer/facade/DesignerFacade.javasrc/main/java/ditda/backend/domain/designer/mapper/DesignerResponseMapper.javasrc/main/java/ditda/backend/domain/designer/repository/DesignerRepository.javasrc/main/java/ditda/backend/domain/designer/service/DesignerService.javasrc/main/java/ditda/backend/domain/instructor/controller/InstructorController.javasrc/main/java/ditda/backend/domain/instructor/facade/InstructorFacade.javasrc/main/java/ditda/backend/domain/settlement/controller/SettlementController.javasrc/main/java/ditda/backend/domain/settlement/dto/response/DesignerSettlementResponse.javasrc/main/java/ditda/backend/domain/settlement/entity/Settlement.javasrc/main/java/ditda/backend/domain/settlement/entity/enums/SettlementStatus.javasrc/main/java/ditda/backend/domain/settlement/entity/enums/SettlementType.javasrc/main/java/ditda/backend/domain/settlement/facade/DesignerSettlementFacade.javasrc/main/java/ditda/backend/domain/settlement/repository/SettlementRepository.javasrc/main/java/ditda/backend/domain/settlement/service/SettlementService.java
fervovita
left a comment
There was a problem hiding this comment.
수고하셨습니다!!
아래 코멘트 한번만 확인 부탁드려요!!
There was a problem hiding this comment.
🧹 Nitpick comments (3)
src/main/java/ditda/backend/domain/commission/history/controller/InstructorCommissionHistoryController.java (1)
28-37: 🚀 Performance & Scalability | 🔵 Trivial | ⚡ Quick win동일한
page/size검증 부재.
SettlementController/DesignerCommissionController와 동일한 패턴으로,page/size값 검증이 없습니다.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/main/java/ditda/backend/domain/commission/history/controller/InstructorCommissionHistoryController.java` around lines 28 - 37, `getMyCommissions` currently accepts `page` and `size` without validation, unlike the matching controller methods in `SettlementController` and `DesignerCommissionController`. Add the same `page`/`size` validation logic before calling `PageRequest.of(page, size)` in `InstructorCommissionHistoryController`, using the existing controller-side validation pattern or shared validation helper if present, so invalid pagination inputs are rejected consistently.src/main/java/ditda/backend/domain/commission/core/controller/DesignerCommissionController.java (1)
28-37: 🚀 Performance & Scalability | 🔵 Trivial | ⚡ Quick win동일한
page/size검증 부재.
SettlementController에서 지적한 것과 동일하게,page/size에 대한 하한/상한 검증이 없어 잘못된 입력 시 예외가 노출되거나 대량 조회가 가능합니다.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/main/java/ditda/backend/domain/commission/core/controller/DesignerCommissionController.java` around lines 28 - 37, `DesignerCommissionController.getRecruitingCommissions`에도 `page`/`size` 검증이 빠져 있어 잘못된 입력과 과도한 조회가 가능합니다. `SettlementController`와 같은 방식으로 `page`는 하한을, `size`는 하한/상한을 검증한 뒤 `PageRequest.of(page, size)`를 호출하도록 수정하고, 해당 검증 로직이 이 메서드에 명확히 적용되게 하세요.src/main/java/ditda/backend/domain/settlement/controller/SettlementController.java (1)
25-40: 🚀 Performance & Scalability | 🔵 Trivial | ⚡ Quick win
page/size파라미터에 대한 검증이 없습니다.
PageRequest.of(page, size)는page가 음수이거나size가 0 이하이면IllegalArgumentException을 던집니다. 별도의 예외 처리기가 없다면 클라이언트 입력값 오류가 500 에러로 노출될 수 있습니다. 또한size에 상한이 없어 매우 큰 값을 요청하면 대량 조회가 발생할 수 있습니다.
DesignerCommissionController,InstructorCommissionHistoryController에도 동일한 패턴이 있습니다.♻️ 검증 추가 예시
+import org.springframework.web.bind.annotation.RequestParam; + public ApiResponse<DesignerSettlementResponse> getMyPayments( `@AuthenticationPrincipal` Long designerId, - `@RequestParam`(defaultValue = "0") int page, - `@RequestParam`(defaultValue = "10") int size + `@RequestParam`(defaultValue = "0") `@Min`(0) int page, + `@RequestParam`(defaultValue = "10") `@Min`(1) `@Max`(50) int size ) {🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/main/java/ditda/backend/domain/settlement/controller/SettlementController.java` around lines 25 - 40, `SettlementController.getMyPayments`에서 `page`와 `size`를 그대로 `PageRequest.of(page, size)`에 넘기는 부분이 문제이므로, 음수 page와 0 이하 size를 먼저 검증하고 size의 최대값도 제한하도록 처리해 주세요. 동일한 패턴이 있는 `DesignerCommissionController`와 `InstructorCommissionHistoryController`의 조회 메서드들도 함께 점검해 같은 입력 검증을 추가하고, 검증 실패 시에는 컨트롤러 수준에서 명확한 4xx 응답이 나가도록 맞춰 주세요.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In
`@src/main/java/ditda/backend/domain/commission/core/controller/DesignerCommissionController.java`:
- Around line 28-37: `DesignerCommissionController.getRecruitingCommissions`에도
`page`/`size` 검증이 빠져 있어 잘못된 입력과 과도한 조회가 가능합니다. `SettlementController`와 같은 방식으로
`page`는 하한을, `size`는 하한/상한을 검증한 뒤 `PageRequest.of(page, size)`를 호출하도록 수정하고, 해당
검증 로직이 이 메서드에 명확히 적용되게 하세요.
In
`@src/main/java/ditda/backend/domain/commission/history/controller/InstructorCommissionHistoryController.java`:
- Around line 28-37: `getMyCommissions` currently accepts `page` and `size`
without validation, unlike the matching controller methods in
`SettlementController` and `DesignerCommissionController`. Add the same
`page`/`size` validation logic before calling `PageRequest.of(page, size)` in
`InstructorCommissionHistoryController`, using the existing controller-side
validation pattern or shared validation helper if present, so invalid pagination
inputs are rejected consistently.
In
`@src/main/java/ditda/backend/domain/settlement/controller/SettlementController.java`:
- Around line 25-40: `SettlementController.getMyPayments`에서 `page`와 `size`를 그대로
`PageRequest.of(page, size)`에 넘기는 부분이 문제이므로, 음수 page와 0 이하 size를 먼저 검증하고 size의
최대값도 제한하도록 처리해 주세요. 동일한 패턴이 있는 `DesignerCommissionController`와
`InstructorCommissionHistoryController`의 조회 메서드들도 함께 점검해 같은 입력 검증을 추가하고, 검증 실패
시에는 컨트롤러 수준에서 명확한 4xx 응답이 나가도록 맞춰 주세요.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yml
Review profile: CHILL
Plan: Pro Plus
Run ID: c3a1269c-424e-4fbf-92d6-f4d74b0eb91a
📒 Files selected for processing (12)
src/main/java/ditda/backend/domain/commission/core/controller/DesignerCommissionController.javasrc/main/java/ditda/backend/domain/commission/core/repository/CommissionRepository.javasrc/main/java/ditda/backend/domain/commission/core/service/DesignerCommissionService.javasrc/main/java/ditda/backend/domain/commission/history/controller/InstructorCommissionHistoryController.javasrc/main/java/ditda/backend/domain/commission/history/repository/CommissionHistoryRepository.javasrc/main/java/ditda/backend/domain/commission/history/service/CommissionHistoryService.javasrc/main/java/ditda/backend/domain/designer/dto/response/DesignerStatsResponse.javasrc/main/java/ditda/backend/domain/designer/facade/DesignerFacade.javasrc/main/java/ditda/backend/domain/designer/mapper/DesignerResponseMapper.javasrc/main/java/ditda/backend/domain/designer/repository/DesignerRepository.javasrc/main/java/ditda/backend/domain/settlement/controller/SettlementController.javasrc/main/java/ditda/backend/domain/settlement/repository/SettlementRepository.java
💤 Files with no reviewable changes (1)
- src/main/java/ditda/backend/domain/designer/dto/response/DesignerStatsResponse.java
🚧 Files skipped from review as they are similar to previous changes (3)
- src/main/java/ditda/backend/domain/settlement/repository/SettlementRepository.java
- src/main/java/ditda/backend/domain/designer/facade/DesignerFacade.java
- src/main/java/ditda/backend/domain/designer/repository/DesignerRepository.java
# Conflicts: # src/main/java/ditda/backend/domain/commission/application/repository/CommissionApplicationRepository.java # src/main/java/ditda/backend/domain/commission/application/service/ApplicationService.java # src/main/java/ditda/backend/domain/commission/core/repository/CommissionRepository.java
fervovita
left a comment
There was a problem hiding this comment.
수고하셨어요!!😄
Designer쪽 코멘트 한번만 확인해주시고 merge하셔도 될 것 같아요!
🚀 Related issue
Closes #77
#️⃣ Summary
🔧 Changes
GET /api/v1/designers/me)GET /api/v1/designers/settlements)getInstructorStats)📸 Test Evidence
💬 Reviewer Notes
income과 지급 내역은 정산 완료(COMPLETED) 건 기준으로 집계합니다.DRAFT_SUBMITTED/SELECTED/REJECTED) 기반으로 집계합니다.PageResponse)는 중복이 여러 곳이라 별도 이슈([ENHANCEMENT] 페이지네이션 응답 공통 클래스 추출 #83)로 분리 예정입니다.Summary by CodeRabbit
New Features
Improvements