[FEATURE] 디자이너 외주 찾기 목록 조회 기능 추가#59
Conversation
There was a problem hiding this comment.
Pull request overview
디자이너가 모집 중(RECRUITING) 외주 목록을 페이징으로 조회할 수 있는 신규 API(GET /api/v1/designers/commissions)를 추가하고, 디자이너 레벨에 따른 금액 정책을 응답에 포함하도록 구성한 PR입니다.
Changes:
- 디자이너용 모집 중 외주 목록 조회 API 컨트롤러/파사드/서비스/매퍼 및 응답 DTO 추가
CommissionRepository에 상태 기반 페이징 조회 메서드 추가- 디자이너 조회/레벨 정책 관련 에러코드 및 금액 정책(레벨별 기본금 + 최대 보너스) 추가
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/main/java/ditda/backend/domain/designer/service/DesignerService.java | 디자이너 엔티티 조회 전용 서비스 추가 |
| src/main/java/ditda/backend/domain/designer/exception/DesignerErrorCode.java | 디자이너 조회 실패/레벨 정책 미존재 에러 코드 추가 |
| src/main/java/ditda/backend/domain/commission/core/service/DesignerCommissionService.java | 모집 중 외주 목록 조회 서비스 추가 (status+pageable) |
| src/main/java/ditda/backend/domain/commission/core/repository/CommissionRepository.java | findByStatus(…, Pageable) 메서드 추가 |
| src/main/java/ditda/backend/domain/commission/core/mapper/CommissionMapper.java | Commission Page → CommissionListResponse 변환 매퍼 추가 |
| src/main/java/ditda/backend/domain/commission/core/facade/DesignerCommissionFacade.java | 디자이너 조회 + 모집중 외주 조회를 결합한 파사드 추가 |
| src/main/java/ditda/backend/domain/commission/core/entity/enums/CommissionAmountPolicy.java | 디자이너 레벨별 기본/최대 금액 정책 enum 추가 |
| src/main/java/ditda/backend/domain/commission/core/dto/response/CommissionListResponse.java | 디자이너 외주 목록 조회 응답 DTO 추가 |
| src/main/java/ditda/backend/domain/commission/core/controller/DesignerCommissionController.java | 신규 GET API 엔드포인트 및 정렬 주입(applicationDeadline ASC, id ASC) 추가 |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Warning Review limit reached
Next review available in: 53 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 (1)
📝 WalkthroughWalkthrough
Changes디자이너 모집 외주 목록 조회
추정 코드 리뷰 노력🎯 3 (Moderate) | ⏱️ ~20 minutes 관련 PR
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 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 |
|
@coderabbitai review |
✅ Action performedReview finished.
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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/exception/DesignerErrorCode.java`:
- Line 14: The DESIGNER_LEVEL_POLICY_NOT_FOUND error is currently mapped to a
404 in DesignerErrorCode, but it should be treated as a server-side 5xx
classification instead. Update the DESIGNER_LEVEL_POLICY_NOT_FOUND enum entry
to use an internal/server error HttpStatus and keep the existing error
code/message consistent, so the error is not reported as a client-side not-found
issue.
🪄 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: 2b952022-5826-4c18-82b0-90997468abcd
📒 Files selected for processing (9)
src/main/java/ditda/backend/domain/commission/core/controller/DesignerCommissionController.javasrc/main/java/ditda/backend/domain/commission/core/dto/response/CommissionListResponse.javasrc/main/java/ditda/backend/domain/commission/core/entity/enums/CommissionAmountPolicy.javasrc/main/java/ditda/backend/domain/commission/core/facade/DesignerCommissionFacade.javasrc/main/java/ditda/backend/domain/commission/core/mapper/CommissionMapper.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/designer/exception/DesignerErrorCode.javasrc/main/java/ditda/backend/domain/designer/service/DesignerService.java
fervovita
left a comment
There was a problem hiding this comment.
리뷰가 늦어져서 죄송합니다...
아래의 코멘트 한번만 확인해주세요!!
|
|
||
| @Getter | ||
| @AllArgsConstructor | ||
| public enum CommissionAmountPolicy { |
There was a problem hiding this comment.
#60 에 CommissionPricePolicy를 이미 구현해 놓았는데,
카테고리에 따라서 가격이 달라지고도 하고 환불/정산 등의 계산 로직이 추가로 들어와야 하는데 이를 enum으로만 관리하기에는 확장성 면에서 무리가 있을 것 같습니다.
혹시 CommissionPricePolicy로 통일해서 구현해주실 수 있을까요...?
그렇게 되면 아마 CommissionMapper 없이 단순 from/of 정적 메소드로 변환이 가능할 것 같습니다..!
There was a problem hiding this comment.
지금 CommissionPricePolicy가 @component로 등록되어 있어서 등록 없이 from 정적 메소드로 변환은 힘들꺼같습니다..!
그래서 CommissionPricePolicy를 CommissionMapper에 주입해서 금액 계산을 위임하는 방향으로 통일하려고 합니다. 이렇게 되면 기존 CommissionAmountPolicy enum은 제거되고, 가격 로직은 CommissionPricePolicy로 통일할 수 있을꺼같은데 괜찮을까요?
There was a problem hiding this comment.
CommissionMapper는 편의에 따라서 유지하셔도 무방할 것 같습니다.
다만, 비즈니스 로직이 포함되어 있는 CommissionPricePolicy를 mapper에서 호출하게 된다면, mapper는 단순 변환 역할 이상의 구조를 가지게 됩니다.
차라리 Service/Facade에서 계산해서 넘기는 구조가 어떨까요..?
There was a problem hiding this comment.
@fervovita 해당 부분 CommissionMapper 제거 후 CommissionPricePolicy을 통해 계산하는걸로 수정했습니다!
확인해주시고 다른 문제나 변경사항이 필요하면 편하게 말씀해주세요!
만약 문제가 따로 없다면 해당 부분 merge 후 #65 해당 PR도 수정하겠습니다 😄
There was a problem hiding this comment.
CommissionAmountPolicy가 여전히 남아 있는데 이 부분만 삭제 부탁드립니다!
아마 그러면 DesignerErrorCode에 새로 추가한 에러도 불필요 해질 것 같아요!
There was a problem hiding this comment.
어 해당부분 못보고 머지했네요 ㅠㅠ;;;
해당 부분 #65 여기서 수정해서 올리겠습니다..!
…mission-list # Conflicts: # src/main/java/ditda/backend/domain/commission/core/repository/CommissionRepository.java
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
src/main/java/ditda/backend/domain/commission/core/policy/CommissionPricePolicy.java (1)
47-59: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win레벨별 금액 정책의 소스가 둘로 갈라졌습니다.
이번 코호트에서
CommissionAmountPolicy가 이미 레벨별baseAmount/maxAmount를 갖도록 추가됐는데, 여기서는textbookCoverInnerReward()와getPriceInfo()가 같은 정책을 다시 하드코딩하고 있습니다. 지금 구조면 한쪽만 수정됐을 때 목록 응답 금액과 실제 정책이 쉽게 어긋나니,PriceInfo와 기본금 조회 모두CommissionAmountPolicy를 단일 소스로 쓰는 편이 안전합니다.예시 리팩터링
+import ditda.backend.domain.commission.core.entity.enums.CommissionAmountPolicy; + public int calculateDraftSubmissionReward(CategoryType category, DesignerLevel level) { return switch (category) { - case FLYER_TEXTBOOK_COVER_INNER -> textbookCoverInnerReward(level); + case FLYER_TEXTBOOK_COVER_INNER -> CommissionAmountPolicy.from(level).getBaseAmount(); }; } @@ public PriceInfo getPriceInfo(CategoryType category, DesignerLevel level) { - return new PriceInfo( - calculateDraftSubmissionReward(category, level), - calculateFinalPayout(category, level) - ); -} - -private int textbookCoverInnerReward(DesignerLevel level) { - return switch (level) { - case LEVEL_1 -> 40_000; - case LEVEL_2 -> 50_000; - case LEVEL_3 -> 60_000; - }; + CommissionAmountPolicy amountPolicy = CommissionAmountPolicy.from(level); + return new PriceInfo(amountPolicy.getBaseAmount(), amountPolicy.getMaxAmount()); }🤖 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/policy/CommissionPricePolicy.java` around lines 47 - 59, `CommissionPricePolicy` is duplicating the level-based amount rules instead of using `CommissionAmountPolicy` as the single source of truth. Update `getPriceInfo()` and `textbookCoverInnerReward()` to read the draft/final amounts from `CommissionAmountPolicy` (via the existing policy lookup in `CommissionPricePolicy`) so both `PriceInfo` and base amount retrieval stay in sync. Keep the change localized to the `CommissionPricePolicy` flow and remove the hardcoded level switches tied to `DesignerLevel`.
🤖 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/exception/DesignerErrorCode.java`:
- Line 14: `DESIGNER_LEVEL_POLICY_MISSING` is mapped to the wrong HTTP status
and should be treated as an internal server error instead of a service
unavailable response. Update the `DesignerErrorCode` enum entry for
`DESIGNER_LEVEL_POLICY_MISSING` to use `HttpStatus.INTERNAL_SERVER_ERROR`,
keeping the existing error code and message, so the
`CommissionAmountPolicy.from(...)` failure path is surfaced correctly through
`ExceptionAdvice`.
---
Nitpick comments:
In
`@src/main/java/ditda/backend/domain/commission/core/policy/CommissionPricePolicy.java`:
- Around line 47-59: `CommissionPricePolicy` is duplicating the level-based
amount rules instead of using `CommissionAmountPolicy` as the single source of
truth. Update `getPriceInfo()` and `textbookCoverInnerReward()` to read the
draft/final amounts from `CommissionAmountPolicy` (via the existing policy
lookup in `CommissionPricePolicy`) so both `PriceInfo` and base amount retrieval
stay in sync. Keep the change localized to the `CommissionPricePolicy` flow and
remove the hardcoded level switches tied to `DesignerLevel`.
🪄 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: 243f37e7-9389-4a63-a35c-ce86e79e61c1
📒 Files selected for processing (7)
src/main/java/ditda/backend/domain/commission/core/dto/PriceInfo.javasrc/main/java/ditda/backend/domain/commission/core/dto/response/CommissionListResponse.javasrc/main/java/ditda/backend/domain/commission/core/entity/enums/CommissionAmountPolicy.javasrc/main/java/ditda/backend/domain/commission/core/facade/DesignerCommissionFacade.javasrc/main/java/ditda/backend/domain/commission/core/policy/CommissionPricePolicy.javasrc/main/java/ditda/backend/domain/commission/core/repository/CommissionRepository.javasrc/main/java/ditda/backend/domain/designer/exception/DesignerErrorCode.java
🚧 Files skipped from review as they are similar to previous changes (3)
- src/main/java/ditda/backend/domain/commission/core/repository/CommissionRepository.java
- src/main/java/ditda/backend/domain/commission/core/entity/enums/CommissionAmountPolicy.java
- src/main/java/ditda/backend/domain/commission/core/dto/response/CommissionListResponse.java
🚀 Related issue
Closes #55
#️⃣ Summary
🔧 Changes
/api/v1/designers/commissionsAPI 추가📸 Test Evidence
💬 Reviewer Notes
InstructorCommissionHistoryController와 같이 Pageable 정렬 정의하여 주입하는 방식으로 진행했습니다.Summary by CodeRabbit
New Features
Bug Fixes