Skip to content

[FEATURE] 디자이너 외주 찾기 목록 조회 기능 추가#59

Merged
Jong0128 merged 8 commits into
devfrom
feat/#55-designers-commission-list
Jun 30, 2026
Merged

[FEATURE] 디자이너 외주 찾기 목록 조회 기능 추가#59
Jong0128 merged 8 commits into
devfrom
feat/#55-designers-commission-list

Conversation

@Jong0128

@Jong0128 Jong0128 commented Jun 26, 2026

Copy link
Copy Markdown
Collaborator

🚀 Related issue

Closes #55

#️⃣ Summary

  • 디자이너 외주 찾기 목록 조회 기능 추가

🔧 Changes

  • GET /api/v1/designers/commissions API 추가

📸 Test Evidence

image

💬 Reviewer Notes

  • 해당 Controller에서도 InstructorCommissionHistoryController 와 같이 Pageable 정렬 정의하여 주입하는 방식으로 진행했습니다.

Summary by CodeRabbit

  • New Features

    • 디자이너용 외주 목록 조회 API가 추가되어, 모집 중인 외주를 페이지 단위로 확인할 수 있습니다.
    • 외주 목록 응답에 제목, 카테고리, 마감일, 금액 정보와 페이지 정보가 포함됩니다.
    • 디자이너 등급에 따라 외주 금액이 자동으로 계산되어 표시됩니다.
  • Bug Fixes

    • 디자이너가 존재하지 않거나 등급 정책이 없을 때 더 명확한 오류가 반환됩니다.

@Jong0128 Jong0128 requested a review from fervovita as a code owner June 26, 2026 02:47
@Jong0128 Jong0128 self-assigned this Jun 26, 2026
@Ditda-Official Ditda-Official deleted a comment from coderabbitai Bot Jun 26, 2026
@Ditda-Official Ditda-Official deleted a comment from coderabbitai Bot Jun 26, 2026
@Jong0128 Jong0128 requested a review from Copilot June 26, 2026 03:33

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

Comment thread src/main/java/ditda/backend/domain/designer/exception/DesignerErrorCode.java Outdated
@coderabbitai

coderabbitai Bot commented Jun 26, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@Jong0128, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 53 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Path: .coderabbit.yml

Review profile: CHILL

Plan: Pro Plus

Run ID: 9f25a5ba-c4be-4ed8-bf96-ff71ee00f9ff

📥 Commits

Reviewing files that changed from the base of the PR and between d6e4556 and f06adfa.

📒 Files selected for processing (1)
  • src/main/java/ditda/backend/domain/designer/exception/DesignerErrorCode.java
📝 Walkthrough

Walkthrough

GET /api/v1/designers/commissions 엔드포인트를 추가한다. DesignerCommissionController가 정렬을 고정한 뒤 DesignerCommissionFacade를 호출하고, facade는 디자이너 레벨 조회 → 모집 중 커미션 페이징 조회 → 레벨별 PriceInfo 계산 → CommissionListResponse 변환 순으로 동작한다.

Changes

디자이너 모집 외주 목록 조회

Layer / File(s) Summary
오류 코드, PriceInfo, 응답 DTO 계약
domain/designer/exception/DesignerErrorCode.java, domain/commission/core/dto/PriceInfo.java, domain/commission/core/dto/response/CommissionListResponse.java
DesignerErrorCodeDESIGNER_NOT_FOUND·DESIGNER_LEVEL_POLICY_MISSING 상수 추가, PriceInfo 레코드 신규 정의, CommissionListResponse/중첩 CommissionResponse 레코드 및 from(Page, Map) 팩토리 메서드 추가.
금액 정책 및 PriceInfo 생성
domain/commission/core/entity/enums/CommissionAmountPolicy.java, domain/commission/core/policy/CommissionPricePolicy.java
CommissionAmountPolicy 열거형이 레벨별 baseAmountgetMaxAmount()를 정의하고, CommissionPricePolicygetPriceInfo(CategoryType, DesignerLevel) 메서드가 추가된다.
디자이너 조회, 저장소, 서비스
domain/designer/service/DesignerService.java, domain/commission/core/repository/CommissionRepository.java, domain/commission/core/service/DesignerCommissionService.java
DesignerService.getById, CommissionRepository.findByStatus(CommissionStatus, Pageable), DesignerCommissionService.getRecruitingCommissions(Pageable)가 각각 추가된다.
Facade 조합 및 컨트롤러 엔드포인트
domain/commission/core/facade/DesignerCommissionFacade.java, domain/commission/core/controller/DesignerCommissionController.java
DesignerCommissionFacade가 디자이너 레벨 조회·커미션 페이징·PriceInfo 맵 구성·응답 변환을 조합하고, DesignerCommissionController가 정렬(applicationDeadlineid 오름차순)을 고정한 뒤 ApiResponse로 반환한다.

추정 코드 리뷰 노력

🎯 3 (Moderate) | ⏱️ ~20 minutes

관련 PR

  • Ditda-Official/Ditda-Backend#22: 이 PR의 DesignerCommissionServiceCommissionRepository.findByStatus가 의존하는 Commission, CommissionStatus, CategoryType 등 커미션 도메인 기본 요소가 도입된 PR.
  • Ditda-Official/Ditda-Backend#60: 이 PR이 확장하는 CommissionPricePolicy의 금액 계산 메서드들을 다루는 PR으로, 동일 클래스 로직에 대한 코드 수준 연관이 있다.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 21.43% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 변경 내용의 핵심인 디자이너 외주 목록 조회 API 추가를 잘 요약한 제목입니다.
Linked Issues check ✅ Passed 이슈 #55의 요구사항인 GET /api/v1/designers/commissions 추가를 구현했습니다.
Out of Scope Changes check ✅ Passed 목록 조회 API를 위한 컨트롤러, 서비스, DTO, 정책, 오류 코드 변경으로 보이며 범위를 벗어난 변경은 보이지 않습니다.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/#55-designers-commission-list

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated no new comments.

@Jong0128

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jun 26, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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 DESIGNE​R_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

📥 Commits

Reviewing files that changed from the base of the PR and between 1bcdbd5 and c6eee22.

📒 Files selected for processing (9)
  • src/main/java/ditda/backend/domain/commission/core/controller/DesignerCommissionController.java
  • src/main/java/ditda/backend/domain/commission/core/dto/response/CommissionListResponse.java
  • src/main/java/ditda/backend/domain/commission/core/entity/enums/CommissionAmountPolicy.java
  • src/main/java/ditda/backend/domain/commission/core/facade/DesignerCommissionFacade.java
  • src/main/java/ditda/backend/domain/commission/core/mapper/CommissionMapper.java
  • src/main/java/ditda/backend/domain/commission/core/repository/CommissionRepository.java
  • src/main/java/ditda/backend/domain/commission/core/service/DesignerCommissionService.java
  • src/main/java/ditda/backend/domain/designer/exception/DesignerErrorCode.java
  • src/main/java/ditda/backend/domain/designer/service/DesignerService.java

Comment thread src/main/java/ditda/backend/domain/designer/exception/DesignerErrorCode.java Outdated

@fervovita fervovita left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

리뷰가 늦어져서 죄송합니다...
아래의 코멘트 한번만 확인해주세요!!


@Getter
@AllArgsConstructor
public enum CommissionAmountPolicy {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

#60CommissionPricePolicy를 이미 구현해 놓았는데,
카테고리에 따라서 가격이 달라지고도 하고 환불/정산 등의 계산 로직이 추가로 들어와야 하는데 이를 enum으로만 관리하기에는 확장성 면에서 무리가 있을 것 같습니다.

혹시 CommissionPricePolicy로 통일해서 구현해주실 수 있을까요...?

그렇게 되면 아마 CommissionMapper 없이 단순 from/of 정적 메소드로 변환이 가능할 것 같습니다..!

@Jong0128 Jong0128 Jun 28, 2026

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

지금 CommissionPricePolicy@component로 등록되어 있어서 등록 없이 from 정적 메소드로 변환은 힘들꺼같습니다..!

그래서 CommissionPricePolicyCommissionMapper에 주입해서 금액 계산을 위임하는 방향으로 통일하려고 합니다. 이렇게 되면 기존 CommissionAmountPolicy enum은 제거되고, 가격 로직은 CommissionPricePolicy로 통일할 수 있을꺼같은데 괜찮을까요?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

CommissionMapper는 편의에 따라서 유지하셔도 무방할 것 같습니다.
다만, 비즈니스 로직이 포함되어 있는 CommissionPricePolicy를 mapper에서 호출하게 된다면, mapper는 단순 변환 역할 이상의 구조를 가지게 됩니다.

차라리 Service/Facade에서 계산해서 넘기는 구조가 어떨까요..?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

@fervovita 해당 부분 CommissionMapper 제거 후 CommissionPricePolicy을 통해 계산하는걸로 수정했습니다!
확인해주시고 다른 문제나 변경사항이 필요하면 편하게 말씀해주세요!

만약 문제가 따로 없다면 해당 부분 merge 후 #65 해당 PR도 수정하겠습니다 😄

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

CommissionAmountPolicy가 여전히 남아 있는데 이 부분만 삭제 부탁드립니다!
아마 그러면 DesignerErrorCode에 새로 추가한 에러도 불필요 해질 것 같아요!

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

어 해당부분 못보고 머지했네요 ㅠㅠ;;;
해당 부분 #65 여기서 수정해서 올리겠습니다..!

Jong0128 added 2 commits June 30, 2026 13:23
…mission-list

# Conflicts:
#	src/main/java/ditda/backend/domain/commission/core/repository/CommissionRepository.java

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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

📥 Commits

Reviewing files that changed from the base of the PR and between c6eee22 and d6e4556.

📒 Files selected for processing (7)
  • src/main/java/ditda/backend/domain/commission/core/dto/PriceInfo.java
  • src/main/java/ditda/backend/domain/commission/core/dto/response/CommissionListResponse.java
  • src/main/java/ditda/backend/domain/commission/core/entity/enums/CommissionAmountPolicy.java
  • src/main/java/ditda/backend/domain/commission/core/facade/DesignerCommissionFacade.java
  • src/main/java/ditda/backend/domain/commission/core/policy/CommissionPricePolicy.java
  • src/main/java/ditda/backend/domain/commission/core/repository/CommissionRepository.java
  • src/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

Comment thread src/main/java/ditda/backend/domain/designer/exception/DesignerErrorCode.java Outdated
@fervovita fervovita self-requested a review June 30, 2026 11:52

@fervovita fervovita left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

수고하셨습니다👍👍

@Jong0128 Jong0128 merged commit 45dca05 into dev Jun 30, 2026
2 checks passed
@Jong0128 Jong0128 deleted the feat/#55-designers-commission-list branch June 30, 2026 12:11
@fervovita fervovita mentioned this pull request Jun 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] 디자이너 외주 찾기 목록 조회 기능 추가

3 participants