[FEATURE] 어드민 디자이너 포트폴리오 조회 기능 구현#117
Conversation
📝 WalkthroughWalkthrough디자이너 포트폴리오 조회 API가 어드민 컨트롤러에 추가되었고, 관련 DTO/매퍼/서비스 로직이 도입되었습니다. 동시에 다수의 알림 발송 로직이 즉시 메일 발송 방식에서 Changes어드민 디자이너 포트폴리오 조회 기능
Estimated code review effort: 2 (Simple) | ~12 minutes 알림 발송 outbox 전환
Estimated code review effort: 4 (Complex) | ~60 minutes Sequence Diagram(s)sequenceDiagram
participant DesignerAuthService
participant DesignerSignupNotifier
participant NotificationOutboxRepository
participant NotificationOutboxScheduler
participant EmailSender
DesignerAuthService->>DesignerSignupNotifier: DesignerSignedUpEvent(designerId, hasPortfolio, mailScheduledAt)
DesignerSignupNotifier->>NotificationOutboxRepository: save(outbox with NotificationType)
NotificationOutboxScheduler->>NotificationOutboxRepository: poll pending outbox
NotificationOutboxScheduler->>EmailSender: sendAsync(to, type, variables)
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 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
🧹 Nitpick comments (1)
src/main/java/ditda/backend/domain/commission/core/notification/CommissionMatchedNotifier.java (1)
35-66: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win
ApplicationDeadlineClosedNotifier와 매칭 완료 알림 등록 로직이 중복됩니다.
registerInstructorMatchComplete와registerDesignerMatchComplete메서드가ApplicationDeadlineClosedNotifier의 동명 메서드와NotificationType, 템플릿 변수 키, 값 추출 방식까지 완전히 동일합니다. 이벤트 타입(CommissionMatchedEventvsApplicationDeadlineClosedEvent)만 다를 뿐입니다. 공유 헬퍼로 추출하여 중복을 제거하는 것을 권장합니다.♻️ 공유 헬퍼 추출 제안
// 예시: 별도의 공통 컴포넌트 또는 NotificationOutboxRepository 확장 메서드로 추출 `@Component` `@RequiredArgsConstructor` public class MatchCompleteNotificationHelper { private final NotificationOutboxRepository outboxRepository; public void registerInstructorMatchComplete( String instructorEmail, String instructorName, String commissionTitle, int requiredCount, int designerCount, LocalDateTime mailScheduledAt ) { outboxRepository.save(NotificationOutbox.create( instructorEmail, NotificationType.APPLICATION_MATCHED_INSTRUCTOR, Map.of( "instructorName", instructorName, "commissionTitle", commissionTitle, "requiredCount", requiredCount, "designerCount", designerCount ), mailScheduledAt )); } public void registerDesignerMatchComplete( String designerEmail, String designerName, String commissionTitle, LocalDate firstDraftDeadline, LocalDateTime mailScheduledAt ) { outboxRepository.save(NotificationOutbox.create( designerEmail, NotificationType.APPLICATION_MATCHED_DESIGNER, Map.of( "designerName", designerName, "commissionTitle", commissionTitle, "firstDraftDeadline", firstDraftDeadline ), mailScheduledAt )); } }이후
CommissionMatchedNotifier와ApplicationDeadlineClosedNotifier양쪽에서 이 헬퍼를 주입받아 호출하도록 변경하면 됩니다.🤖 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/notification/CommissionMatchedNotifier.java` around lines 35 - 66, `CommissionMatchedNotifier` duplicates the same notification registration logic already present in `ApplicationDeadlineClosedNotifier`. Extract the shared outbox creation flow from `registerInstructorMatchComplete` and `registerDesignerMatchComplete` into a reusable helper that accepts the recipient, `NotificationType`, template variables, and schedule time, then have both notifier classes call that helper with their respective event data. Keep the existing field/value mapping in `CommissionMatchedEvent` and preserve the current `NotificationType` and template keys while removing the duplicated `NotificationOutbox.create`/`outboxRepository.save` code.
🤖 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/payment/service/PaymentService.java`:
- Around line 82-83: The deposit notification timestamp is being recorded in the
server default timezone instead of KST, so align it with the existing KST
scheduling logic. Update the timestamp assignment path used by PaymentService
and Payment.markDepositNotified() so the “notifiedAt” value is created with
ZONE_KST, matching mailScheduledAt and ensuring admin display/storage stays
consistent.
---
Nitpick comments:
In
`@src/main/java/ditda/backend/domain/commission/core/notification/CommissionMatchedNotifier.java`:
- Around line 35-66: `CommissionMatchedNotifier` duplicates the same
notification registration logic already present in
`ApplicationDeadlineClosedNotifier`. Extract the shared outbox creation flow
from `registerInstructorMatchComplete` and `registerDesignerMatchComplete` into
a reusable helper that accepts the recipient, `NotificationType`, template
variables, and schedule time, then have both notifier classes call that helper
with their respective event data. Keep the existing field/value mapping in
`CommissionMatchedEvent` and preserve the current `NotificationType` and
template keys while removing the duplicated
`NotificationOutbox.create`/`outboxRepository.save` code.
🪄 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: a2e3224c-8439-476a-adbe-4ae22d3a5f69
📒 Files selected for processing (36)
src/main/java/ditda/backend/domain/admin/designer/controller/AdminDesignerController.javasrc/main/java/ditda/backend/domain/admin/designer/dto/response/DesignerPortfolioResponse.javasrc/main/java/ditda/backend/domain/admin/designer/mapper/AdminDesignerMapper.javasrc/main/java/ditda/backend/domain/admin/designer/service/AdminDesignerService.javasrc/main/java/ditda/backend/domain/auth/event/DesignerSignedUpEvent.javasrc/main/java/ditda/backend/domain/auth/notification/DesignerSignupMailer.javasrc/main/java/ditda/backend/domain/auth/notification/DesignerSignupNotifier.javasrc/main/java/ditda/backend/domain/auth/notification/EmailVerificationMailer.javasrc/main/java/ditda/backend/domain/auth/service/DesignerAuthService.javasrc/main/java/ditda/backend/domain/commission/application/facade/DesignerApplicationFacade.javasrc/main/java/ditda/backend/domain/commission/core/event/CommissionMatchedEvent.javasrc/main/java/ditda/backend/domain/commission/core/notification/AllFirstDraftsSubmittedNotifier.javasrc/main/java/ditda/backend/domain/commission/core/notification/ApplicationDeadlineClosedNotifier.javasrc/main/java/ditda/backend/domain/commission/core/notification/CommissionCompletedNotifier.javasrc/main/java/ditda/backend/domain/commission/core/notification/CommissionMatchedNotifier.javasrc/main/java/ditda/backend/domain/commission/core/notification/DraftSelectedNotifier.javasrc/main/java/ditda/backend/domain/commission/core/notification/FinalDeadlineClosedNotifier.javasrc/main/java/ditda/backend/domain/commission/core/notification/FirstDraftDeadlineClosedNotifier.javasrc/main/java/ditda/backend/domain/commission/core/notification/PayoutRequestedNotifier.javasrc/main/java/ditda/backend/domain/commission/core/notification/RevisionRequestedNotifier.javasrc/main/java/ditda/backend/domain/commission/core/notification/RevisionSubmittedNotifier.javasrc/main/java/ditda/backend/domain/designer/repository/PortfolioRepository.javasrc/main/java/ditda/backend/domain/designer/service/DesignerService.javasrc/main/java/ditda/backend/domain/designer/service/PortfolioService.javasrc/main/java/ditda/backend/domain/payment/event/DepositNotifiedEvent.javasrc/main/java/ditda/backend/domain/payment/notification/DepositMailer.javasrc/main/java/ditda/backend/domain/payment/notification/DepositNotifier.javasrc/main/java/ditda/backend/domain/payment/service/PaymentService.javasrc/main/java/ditda/backend/global/notification/EmailSender.javasrc/main/java/ditda/backend/global/notification/NotificationOutbox.javasrc/main/java/ditda/backend/global/notification/NotificationOutboxRepository.javasrc/main/java/ditda/backend/global/notification/NotificationOutboxScheduler.javasrc/main/java/ditda/backend/global/notification/NotificationType.javasrc/main/java/ditda/backend/global/notification/OutboxStatus.javasrc/main/resources/templates/email/deposit-notification.htmlsrc/main/resources/templates/email/designer-signup-notification.html
💤 Files with no reviewable changes (2)
- src/main/java/ditda/backend/domain/payment/notification/DepositMailer.java
- src/main/java/ditda/backend/domain/auth/notification/DesignerSignupMailer.java
🚀 Related issue
Closes #113
#️⃣ Summary
🔧 Changes
GET /api/v1/admin/designers/{designerId}/portfolios) 추가📸 Test Evidence
💬 Reviewer Notes
Summary by CodeRabbit
New Features
Bug Fixes