Skip to content

[STORY-401] 라벨 목록 조회 API 응답 알림 설정 필드 추가 - #166

Merged
asitisdev merged 1 commit into
mainfrom
401-label-dto-fix
Jun 24, 2026
Merged

[STORY-401] 라벨 목록 조회 API 응답 알림 설정 필드 추가#166
asitisdev merged 1 commit into
mainfrom
401-label-dto-fix

Conversation

@asitisdev

Copy link
Copy Markdown
Member

🔗 관련 작업

👤 User Story

📌 Task

💡 작업 내용

  • 라벨 목록 조회 응답에 notificationPolicy 필드를 추가했습니다.
  • 라벨 목록 Swagger 문서 설명에 알림 정책 반환 정보를 반영했습니다.
  • 라벨 목록 응답 매핑 테스트에서 알림 정책이 함께 반환되는지 검증하도록 보강했습니다.

📝 추가 설명

1. 라벨 목록 응답 필드 확장

  • LabelListResponseNotificationPolicy notificationPolicy를 추가했습니다.
  • LabelListResponse.of(...)에서 Label#getNotificationPolicy()를 매핑합니다.
  • 기존 rule 필드는 상세 조회 전용으로 유지하고, 목록에서는 라벨 행/카드 렌더링에 필요한 알림 정책만 노출합니다.

2. 라벨 제안 목록 영향

  • LabelListResponse는 라벨 목록뿐 아니라 라벨 제안 생성/목록 응답에도 사용됩니다.
  • AI 라벨 제안도 notificationPolicy를 생성하고 저장하므로, 제안 목록에서도 동일하게 알림 정책이 반환됩니다.
    • GET /api/v1/labels
    • POST /api/v1/labels/suggestions
    • GET /api/v1/labels/suggestions

⚡️ Test 결과

검증 항목 대상 결과 비고
단위 테스트 ./gradlew :test --tests "com.mailsangja.core.facade.LabelFacadeTest" --rerun-tasks 통과 BUILD SUCCESSFUL in 5s

@asitisdev
asitisdev requested a review from Copilot June 24, 2026 15:27
@coderabbitai

coderabbitai Bot commented Jun 24, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

LabelListResponse DTO 레코드에 NotificationPolicy 타입의 notificationPolicy 컴포넌트를 추가하고, of() 팩토리 메서드에서 해당 값을 매핑한다. getLabels Swagger 설명을 갱신하고, 파사드 테스트에서 응답의 notificationPolicy 값을 검증하도록 확장한다.

Changes

라벨 알림 정책 필드 추가

Layer / File(s) Summary
DTO 필드 추가 및 Swagger 설명 갱신
core/src/main/java/com/mailsangja/core/dto/label/LabelListResponse.java, core/src/main/java/com/mailsangja/core/controller/docs/LabelControllerDocs.java
LabelListResponse 레코드에 NotificationPolicy 타입의 notificationPolicy 컴포넌트와 @Schema 메타데이터를 추가하고, of(Label, long) 팩토리에서 label.getNotificationPolicy()를 새 컴포넌트에 전달한다. getLabels의 Swagger @Operation 설명도 알림 정책 포함 내용으로 갱신된다.
파사드 테스트 확장
core/src/test/java/com/mailsangja/core/facade/LabelFacadeTest.java
getLabels 테스트에서 각 라벨 응답의 notificationPolicy 값을 추가로 assert하도록 수정하고, label() 헬퍼에 notificationPolicy 인자를 받는 오버로드를 추가한다. 기존 헬퍼는 NotificationPolicy.INHERIT를 기본값으로 새 오버로드에 위임한다.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% 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
Title check ✅ Passed 제목이 라벨 목록 조회 응답에 알림 설정 필드를 추가한다는 핵심 변경을 정확히 요약합니다.
Description check ✅ Passed 설명이 응답 필드 추가, Swagger 반영, 테스트 보강 등 실제 변경 사항과 일치합니다.
Linked Issues check ✅ Passed 직접 이슈 #165의 완료 조건인 라벨 목록 조회 응답의 알림 설정 필드 추가를 구현했습니다.
Out of Scope Changes check ✅ Passed 공유 DTO 변경에 따른 Swagger와 테스트 수정만 포함되어 있어, 목적과 무관한 변경은 보이지 않습니다.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


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
Contributor

Choose a reason for hiding this comment

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

Pull request overview

라벨 목록/제안 목록 응답(LabelListResponse)에 알림 정책(notificationPolicy)을 포함시켜, 클라이언트가 목록 UI에서 라벨별 알림 동작을 함께 렌더링할 수 있도록 확장한 PR입니다.

Changes:

  • LabelListResponsenotificationPolicy 필드를 추가하고 Label#getNotificationPolicy()를 매핑
  • 라벨 목록 조회 Swagger 설명에 “알림 정책 포함”을 반영
  • LabelFacadeTest에서 목록 응답에 notificationPolicy가 함께 반환되는지 검증 추가

Reviewed changes

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

File Description
core/src/main/java/com/mailsangja/core/dto/label/LabelListResponse.java 라벨 목록 응답에 notificationPolicy 필드 추가 및 매핑 반영
core/src/main/java/com/mailsangja/core/controller/docs/LabelControllerDocs.java 라벨 목록 조회 API 설명에 알림 정책 포함 문구 추가
core/src/test/java/com/mailsangja/core/facade/LabelFacadeTest.java 목록 응답 매핑 테스트에 notificationPolicy 검증 및 테스트용 라벨 생성 헬퍼 확장

@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.

🧹 Nitpick comments (1)
core/src/main/java/com/mailsangja/core/controller/docs/LabelControllerDocs.java (1)

138-168: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

제안 엔드포인트 Swagger 설명에도 알림 정책 반영 고려.

PR 목적에 따르면 createSuggestions(Line 152)와 getSuggestions(Line 166)도 List<LabelListResponse>를 반환하므로 응답에 notificationPolicy가 포함됩니다. 하지만 해당 @Operation 설명(Line 140, 158)에는 알림 정책 언급이 없어 getLabels와 문서 일관성이 어긋납니다. 필요 시 설명을 보강해 주세요.

🤖 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
`@core/src/main/java/com/mailsangja/core/controller/docs/LabelControllerDocs.java`
around lines 138 - 168, Swagger 문서에서 createSuggestions와 getSuggestions의 응답 설명이
notificationPolicy 포함 여부를 반영하지 않아 getLabels와 문서 일관성이 어긋납니다. LabelControllerDocs의
`@Operation` 설명을 수정해 이 두 메서드가 반환하는 List<LabelListResponse>에 notificationPolicy가
포함된다는 점을 명시하고, createSuggestions/getSuggestions의 설명 문구를 동일한 정책 표현으로 맞춰 주세요.
🤖 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
`@core/src/main/java/com/mailsangja/core/controller/docs/LabelControllerDocs.java`:
- Around line 138-168: Swagger 문서에서 createSuggestions와 getSuggestions의 응답 설명이
notificationPolicy 포함 여부를 반영하지 않아 getLabels와 문서 일관성이 어긋납니다. LabelControllerDocs의
`@Operation` 설명을 수정해 이 두 메서드가 반환하는 List<LabelListResponse>에 notificationPolicy가
포함된다는 점을 명시하고, createSuggestions/getSuggestions의 설명 문구를 동일한 정책 표현으로 맞춰 주세요.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: c3815785-8589-4313-bf1d-368859fcfb80

📥 Commits

Reviewing files that changed from the base of the PR and between 9cb024f and a474270.

📒 Files selected for processing (3)
  • core/src/main/java/com/mailsangja/core/controller/docs/LabelControllerDocs.java
  • core/src/main/java/com/mailsangja/core/dto/label/LabelListResponse.java
  • core/src/test/java/com/mailsangja/core/facade/LabelFacadeTest.java

@asitisdev
asitisdev merged commit 02772e3 into main Jun 24, 2026
3 checks passed
@codecov

codecov Bot commented Jun 24, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[TASK-418] 라벨 목록 조회 API 응답 알림 설정 필드 추가

2 participants