feat(notification): notification 도메인 구성 #28 - #65
Conversation
|
Important Review skippedAuto reviews are limited based on label configuration. 🏷️ Required labels (at least one) (1)
🚫 Excluded labels (none allowed) (2)
Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 Walkthrough사용자는 공지사항, FAQ, 전형요강을 조회할 수 있는 애플리케이션 기반을 사용할 수 있습니다. REST API와 실제 저장소 연동은 포함하지 않습니다. 주요 변경
위험 영역
마이그레이션 및 호환성
검증 체크리스트 및 롤아웃
Walkthrough공지사항, FAQ, 채용 안내의 도메인 모델과 조회 계약을 추가했습니다. Changes알림 조회 기능
Estimated code review effort: 3 (Moderate) | ~20 minutes Suggested labels: Suggested reviewers: Sequence Diagram(s)sequenceDiagram
participant NotificationPort
participant NotificationService
participant NoticeRepository
NotificationPort->>NotificationService: getNotices(ReadNotificationPageCommand)
NotificationService->>NoticeRepository: findAll()
NoticeRepository-->>NotificationService: List<Notice>
NotificationService-->>NotificationPort: PageResult<NoticeSummaryResult>
🚥 Pre-merge checks | ✅ 5 | ❌ 5❌ Failed checks (5 warnings)
✅ Passed checks (5 passed)
✨ Finishing Touches 💡 1📝 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: 4
🤖 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
`@systems/notification/notification-application/src/main/kotlin/hs/kr/entrydsm/notification/application/port/in/command/ReadNotificationPageCommand.kt`:
- Around line 3-6: NotificationService.toPage calculates page * size as an
overflowing Int, allowing negative indices to reach subList. Update toPage to
perform offset arithmetic in Long, clamp the resulting offset to the available
list-size range, and preserve valid pagination behavior; add a regression test
covering page = Int.MAX_VALUE with size = 2.
In
`@systems/notification/notification-application/src/main/kotlin/hs/kr/entrydsm/notification/application/port/out/NoticeRepository.kt`:
- Around line 5-7: Replace the all-items repository contracts with paginated
queries that accept page parameters and return both the page contents and total
count; in NoticeRepository, define deterministic createdAt DESC, id DESC
ordering. Apply this to
systems/notification/notification-application/src/main/kotlin/hs/kr/entrydsm/notification/application/port/out/NoticeRepository.kt
lines 5-7 and FaqRepository.kt lines 5-7. Update NotificationService in
systems/notification/notification-application/src/main/kotlin/hs/kr/entrydsm/notification/application/service/NotificationService.kt
lines 26-38 to map the repository page directly into the result DTO, removing
full-list sorting and subList pagination.
In
`@systems/notification/notification-application/src/main/kotlin/hs/kr/entrydsm/notification/application/service/NotificationService.kt`:
- Around line 103-107: Update the pagination index calculation in the
notification service method containing fromIndex and toIndex to perform page ×
size using Long before coercing to the collection size, preventing Int overflow
and invalid subList indices. Inspect ReadNotificationPageCommand validation and
add or preserve appropriate upper-bound validation for page and size if absent,
while keeping nonnegative page and positive size requirements.
- Around line 18-20: Remove the org.springframework.stereotype.Service import
and `@Service` annotation from NotificationService so it remains a plain Kotlin
class; register it as a bean from bootstrap configuration or a factory. Also
remove the Spring Boot starter dependency from
systems/notification/notification-application/deps.bzl (lines 1-4) after
eliminating the application-layer Spring usage.
🪄 Autofix
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.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 95749a1b-42fd-4067-9da6-1baff28ffed6
📒 Files selected for processing (15)
systems/notification/notification-application/deps.bzlsystems/notification/notification-application/src/main/kotlin/hs/kr/entrydsm/notification/application/exception/NotificationNotFoundException.ktsystems/notification/notification-application/src/main/kotlin/hs/kr/entrydsm/notification/application/port/in/NotificationPort.ktsystems/notification/notification-application/src/main/kotlin/hs/kr/entrydsm/notification/application/port/in/command/ReadNotificationPageCommand.ktsystems/notification/notification-application/src/main/kotlin/hs/kr/entrydsm/notification/application/port/in/result/FaqResults.ktsystems/notification/notification-application/src/main/kotlin/hs/kr/entrydsm/notification/application/port/in/result/NoticeResults.ktsystems/notification/notification-application/src/main/kotlin/hs/kr/entrydsm/notification/application/port/in/result/PageResult.ktsystems/notification/notification-application/src/main/kotlin/hs/kr/entrydsm/notification/application/port/in/result/RecruitmentGuidelineResult.ktsystems/notification/notification-application/src/main/kotlin/hs/kr/entrydsm/notification/application/port/out/FaqRepository.ktsystems/notification/notification-application/src/main/kotlin/hs/kr/entrydsm/notification/application/port/out/NoticeRepository.ktsystems/notification/notification-application/src/main/kotlin/hs/kr/entrydsm/notification/application/port/out/RecruitmentGuidelineRepository.ktsystems/notification/notification-application/src/main/kotlin/hs/kr/entrydsm/notification/application/service/NotificationService.ktsystems/notification/notification-domain/src/main/kotlin/hs/kr/entrydsm/notification/domain/model/Faq.ktsystems/notification/notification-domain/src/main/kotlin/hs/kr/entrydsm/notification/domain/model/Notice.ktsystems/notification/notification-domain/src/main/kotlin/hs/kr/entrydsm/notification/domain/model/RecruitmentGuideline.kt
📜 Review details
🧰 Additional context used
📓 Path-based instructions (7)
**/{BUILD.bazel,*.bzl}
📄 CodeRabbit inference engine (Custom checks)
In BUILD.bazel and .bzl files, require buildifier-compatible formatting and stable target naming
Files:
systems/notification/notification-application/deps.bzl
**/*.bzl
⚙️ CodeRabbit configuration file
**/*.bzl: Apply Bazel Starlark (.bzl) style guidance.Readability and docs:
- Keep file/module docstrings and docstrings for public functions/macros.
- Use descriptive parameter names and document attribute intent.
API design:
- Macros should take a
nameargument and derive generated target names from it.- Prefer keyword arguments when calling macros for clarity and stability.
- Keep macro side effects predictable and visible.
Encapsulation:
- Use private visibility for helper targets created by macros unless explicitly public.
- Avoid exposing internal implementation targets unintentionally.
Tooling:
- Enforce buildifier formatting and lint compliance.
Files:
systems/notification/notification-application/deps.bzl
**/*.{kt,go}
📄 CodeRabbit inference engine (Custom checks)
If production logic is changed in Kotlin or Go files, require corresponding test updates in the same subsystem unless the PR description explicitly justifies why tests are unnecessary
Files:
systems/notification/notification-application/src/main/kotlin/hs/kr/entrydsm/notification/application/port/out/FaqRepository.ktsystems/notification/notification-application/src/main/kotlin/hs/kr/entrydsm/notification/application/port/in/result/PageResult.ktsystems/notification/notification-domain/src/main/kotlin/hs/kr/entrydsm/notification/domain/model/Faq.ktsystems/notification/notification-domain/src/main/kotlin/hs/kr/entrydsm/notification/domain/model/RecruitmentGuideline.ktsystems/notification/notification-application/src/main/kotlin/hs/kr/entrydsm/notification/application/exception/NotificationNotFoundException.ktsystems/notification/notification-application/src/main/kotlin/hs/kr/entrydsm/notification/application/port/in/command/ReadNotificationPageCommand.ktsystems/notification/notification-application/src/main/kotlin/hs/kr/entrydsm/notification/application/port/in/NotificationPort.ktsystems/notification/notification-domain/src/main/kotlin/hs/kr/entrydsm/notification/domain/model/Notice.ktsystems/notification/notification-application/src/main/kotlin/hs/kr/entrydsm/notification/application/port/in/result/NoticeResults.ktsystems/notification/notification-application/src/main/kotlin/hs/kr/entrydsm/notification/application/port/out/NoticeRepository.ktsystems/notification/notification-application/src/main/kotlin/hs/kr/entrydsm/notification/application/port/in/result/RecruitmentGuidelineResult.ktsystems/notification/notification-application/src/main/kotlin/hs/kr/entrydsm/notification/application/port/out/RecruitmentGuidelineRepository.ktsystems/notification/notification-application/src/main/kotlin/hs/kr/entrydsm/notification/application/service/NotificationService.ktsystems/notification/notification-application/src/main/kotlin/hs/kr/entrydsm/notification/application/port/in/result/FaqResults.kt
**/*-application/**/*.{java,kt,scala,groovy}
📄 CodeRabbit inference engine (Custom checks)
For files under *-application modules, flag direct dependency on infrastructure-specific framework classes unless justified
Files:
systems/notification/notification-application/src/main/kotlin/hs/kr/entrydsm/notification/application/port/out/FaqRepository.ktsystems/notification/notification-application/src/main/kotlin/hs/kr/entrydsm/notification/application/port/in/result/PageResult.ktsystems/notification/notification-application/src/main/kotlin/hs/kr/entrydsm/notification/application/exception/NotificationNotFoundException.ktsystems/notification/notification-application/src/main/kotlin/hs/kr/entrydsm/notification/application/port/in/command/ReadNotificationPageCommand.ktsystems/notification/notification-application/src/main/kotlin/hs/kr/entrydsm/notification/application/port/in/NotificationPort.ktsystems/notification/notification-application/src/main/kotlin/hs/kr/entrydsm/notification/application/port/in/result/NoticeResults.ktsystems/notification/notification-application/src/main/kotlin/hs/kr/entrydsm/notification/application/port/out/NoticeRepository.ktsystems/notification/notification-application/src/main/kotlin/hs/kr/entrydsm/notification/application/port/in/result/RecruitmentGuidelineResult.ktsystems/notification/notification-application/src/main/kotlin/hs/kr/entrydsm/notification/application/port/out/RecruitmentGuidelineRepository.ktsystems/notification/notification-application/src/main/kotlin/hs/kr/entrydsm/notification/application/service/NotificationService.ktsystems/notification/notification-application/src/main/kotlin/hs/kr/entrydsm/notification/application/port/in/result/FaqResults.kt
**/*.{java,kt,scala,groovy,go,js,ts,tsx,jsx,py,rb,rs,cpp,c,h,hpp,cs}
📄 CodeRabbit inference engine (Custom checks)
Flag TODO/FIXME comments introduced by this PR that do not include an issue reference in the form
#123or a full tracker key like PROJ-123
Files:
systems/notification/notification-application/src/main/kotlin/hs/kr/entrydsm/notification/application/port/out/FaqRepository.ktsystems/notification/notification-application/src/main/kotlin/hs/kr/entrydsm/notification/application/port/in/result/PageResult.ktsystems/notification/notification-domain/src/main/kotlin/hs/kr/entrydsm/notification/domain/model/Faq.ktsystems/notification/notification-domain/src/main/kotlin/hs/kr/entrydsm/notification/domain/model/RecruitmentGuideline.ktsystems/notification/notification-application/src/main/kotlin/hs/kr/entrydsm/notification/application/exception/NotificationNotFoundException.ktsystems/notification/notification-application/src/main/kotlin/hs/kr/entrydsm/notification/application/port/in/command/ReadNotificationPageCommand.ktsystems/notification/notification-application/src/main/kotlin/hs/kr/entrydsm/notification/application/port/in/NotificationPort.ktsystems/notification/notification-domain/src/main/kotlin/hs/kr/entrydsm/notification/domain/model/Notice.ktsystems/notification/notification-application/src/main/kotlin/hs/kr/entrydsm/notification/application/port/in/result/NoticeResults.ktsystems/notification/notification-application/src/main/kotlin/hs/kr/entrydsm/notification/application/port/out/NoticeRepository.ktsystems/notification/notification-application/src/main/kotlin/hs/kr/entrydsm/notification/application/port/in/result/RecruitmentGuidelineResult.ktsystems/notification/notification-application/src/main/kotlin/hs/kr/entrydsm/notification/application/port/out/RecruitmentGuidelineRepository.ktsystems/notification/notification-application/src/main/kotlin/hs/kr/entrydsm/notification/application/service/NotificationService.ktsystems/notification/notification-application/src/main/kotlin/hs/kr/entrydsm/notification/application/port/in/result/FaqResults.kt
**/*.kt
⚙️ CodeRabbit configuration file
**/*.kt: Apply Kotlin Official Coding Conventions.Formatting and structure:
- Use 4 spaces for indentation; no tabs.
- Keep files focused and readable; avoid horizontal alignment for spacing.
- Place related declarations together and keep overloads adjacent.
- Keep implementation member order stable and logical for readability.
Naming:
- Package names are lowercase and do not use underscores.
- Class/object names use UpperCamelCase.
- Functions/properties/local variables use lowerCamelCase.
- Constants use UPPER_SNAKE_CASE only for true constants.
API and null-safety:
- Avoid platform type leakage in public APIs.
- Use explicit types in public APIs when inference obscures meaning.
- Prefer immutable values (
val) over mutable values (var) unless mutation is required.- Flag nullable flows that can be replaced with safer modeling.
Imports and idioms:
- Avoid wildcard imports unless justified by language/tooling conventions.
- Prefer expression bodies for short, clear functions.
- Prefer standard library idioms over custom utility wrappers when equivalent.
Architecture and tests:
- Respect module boundaries (domain/application/adapter/bootstrap layering).
- Highlight behavior-changing code that lacks corresponding unit/integration tests.
- Ask for deterministic tests and meaningful assertions, not only happy-path checks.
Files:
systems/notification/notification-application/src/main/kotlin/hs/kr/entrydsm/notification/application/port/out/FaqRepository.ktsystems/notification/notification-application/src/main/kotlin/hs/kr/entrydsm/notification/application/port/in/result/PageResult.ktsystems/notification/notification-domain/src/main/kotlin/hs/kr/entrydsm/notification/domain/model/Faq.ktsystems/notification/notification-domain/src/main/kotlin/hs/kr/entrydsm/notification/domain/model/RecruitmentGuideline.ktsystems/notification/notification-application/src/main/kotlin/hs/kr/entrydsm/notification/application/exception/NotificationNotFoundException.ktsystems/notification/notification-application/src/main/kotlin/hs/kr/entrydsm/notification/application/port/in/command/ReadNotificationPageCommand.ktsystems/notification/notification-application/src/main/kotlin/hs/kr/entrydsm/notification/application/port/in/NotificationPort.ktsystems/notification/notification-domain/src/main/kotlin/hs/kr/entrydsm/notification/domain/model/Notice.ktsystems/notification/notification-application/src/main/kotlin/hs/kr/entrydsm/notification/application/port/in/result/NoticeResults.ktsystems/notification/notification-application/src/main/kotlin/hs/kr/entrydsm/notification/application/port/out/NoticeRepository.ktsystems/notification/notification-application/src/main/kotlin/hs/kr/entrydsm/notification/application/port/in/result/RecruitmentGuidelineResult.ktsystems/notification/notification-application/src/main/kotlin/hs/kr/entrydsm/notification/application/port/out/RecruitmentGuidelineRepository.ktsystems/notification/notification-application/src/main/kotlin/hs/kr/entrydsm/notification/application/service/NotificationService.ktsystems/notification/notification-application/src/main/kotlin/hs/kr/entrydsm/notification/application/port/in/result/FaqResults.kt
**/*-domain/**/*.{java,kt,scala,groovy}
📄 CodeRabbit inference engine (Custom checks)
For files under *-domain modules, fail if imports reference adapter or bootstrap packages
Files:
systems/notification/notification-domain/src/main/kotlin/hs/kr/entrydsm/notification/domain/model/Faq.ktsystems/notification/notification-domain/src/main/kotlin/hs/kr/entrydsm/notification/domain/model/RecruitmentGuideline.ktsystems/notification/notification-domain/src/main/kotlin/hs/kr/entrydsm/notification/domain/model/Notice.kt
🔇 Additional comments (10)
systems/notification/notification-domain/src/main/kotlin/hs/kr/entrydsm/notification/domain/model/Faq.kt (1)
1-13: LGTM!systems/notification/notification-domain/src/main/kotlin/hs/kr/entrydsm/notification/domain/model/Notice.kt (1)
1-13: LGTM!systems/notification/notification-application/src/main/kotlin/hs/kr/entrydsm/notification/application/port/out/RecruitmentGuidelineRepository.kt (1)
1-7: LGTM!systems/notification/notification-application/src/main/kotlin/hs/kr/entrydsm/notification/application/exception/NotificationNotFoundException.kt (1)
1-5: LGTM!systems/notification/notification-domain/src/main/kotlin/hs/kr/entrydsm/notification/domain/model/RecruitmentGuideline.kt (1)
1-19: LGTM!systems/notification/notification-application/src/main/kotlin/hs/kr/entrydsm/notification/application/port/in/result/PageResult.kt (1)
1-10: LGTM!systems/notification/notification-application/src/main/kotlin/hs/kr/entrydsm/notification/application/port/in/result/NoticeResults.kt (1)
1-20: LGTM!systems/notification/notification-application/src/main/kotlin/hs/kr/entrydsm/notification/application/port/in/result/FaqResults.kt (1)
1-20: LGTM!systems/notification/notification-application/src/main/kotlin/hs/kr/entrydsm/notification/application/port/in/result/RecruitmentGuidelineResult.kt (1)
1-19: LGTM!systems/notification/notification-application/src/main/kotlin/hs/kr/entrydsm/notification/application/port/in/NotificationPort.kt (1)
1-17: LGTM!
| interface NoticeRepository { | ||
| fun findAll(): List<Notice> | ||
| fun findById(id: Long): Notice? |
There was a problem hiding this comment.
🚀 Performance & Scalability | 🟠 Major | 🏗️ Heavy lift
페이지 조회를 repository 계약으로 내려야 합니다.
현재 포트는 모든 공지와 FAQ를 반환합니다. 서비스는 전체 목록을 정렬한 뒤 일부만 반환합니다. 실제 persistence adapter는 LIMIT, OFFSET, 정렬, 전체 건수를 데이터 저장소에서 처리할 수 없습니다. 데이터가 증가하면 요청마다 메모리와 CPU 사용량이 전체 데이터 크기에 비례합니다.
systems/notification/notification-application/src/main/kotlin/hs/kr/entrydsm/notification/application/port/out/NoticeRepository.kt#L5-L7: 페이지 인자와 전체 건수를 포함하는 페이지 조회 계약으로findAll()을 대체하십시오. 공지 정렬은createdAt DESC, id DESC처럼 결정적으로 정의하십시오.systems/notification/notification-application/src/main/kotlin/hs/kr/entrydsm/notification/application/port/out/FaqRepository.kt#L5-L7: 페이지 인자와 전체 건수를 포함하는 페이지 조회 계약으로findAll()을 대체하십시오.systems/notification/notification-application/src/main/kotlin/hs/kr/entrydsm/notification/application/service/NotificationService.kt#L26-L38: repository가 반환한 페이지를 결과 DTO로 변환하십시오. 전체 목록 정렬과subList()페이지 처리를 제거하십시오.
📍 Affects 3 files
systems/notification/notification-application/src/main/kotlin/hs/kr/entrydsm/notification/application/port/out/NoticeRepository.kt#L5-L7(this comment)systems/notification/notification-application/src/main/kotlin/hs/kr/entrydsm/notification/application/port/out/FaqRepository.kt#L5-L7systems/notification/notification-application/src/main/kotlin/hs/kr/entrydsm/notification/application/service/NotificationService.kt#L26-L38
🤖 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
`@systems/notification/notification-application/src/main/kotlin/hs/kr/entrydsm/notification/application/port/out/NoticeRepository.kt`
around lines 5 - 7, Replace the all-items repository contracts with paginated
queries that accept page parameters and return both the page contents and total
count; in NoticeRepository, define deterministic createdAt DESC, id DESC
ordering. Apply this to
systems/notification/notification-application/src/main/kotlin/hs/kr/entrydsm/notification/application/port/out/NoticeRepository.kt
lines 5-7 and FaqRepository.kt lines 5-7. Update NotificationService in
systems/notification/notification-application/src/main/kotlin/hs/kr/entrydsm/notification/application/service/NotificationService.kt
lines 26-38 to map the repository page directly into the result DTO, removing
full-list sorting and subList pagination.
9ddabb0 to
c0fcb19
Compare
55bb978 to
fed2877
Compare
Summary
notification 조회 기능의 domain/application 기반을 구성했습니다.
공지, QnA, 전형요강 domain model을 추가했습니다.
조회 use case를 위한 input/output port, command/result, service, exception을 정의했습니다.
Related Issue
Closes #28
Scope
In scope:
Out of scope:
Implementation
공지 목록/상세, QnA 목록/상세, 전형요강 조회 흐름을 application service로 구성했습니다.
NotificationService는 repository port에만 의존하도록 구성했습니다.
공지 등록, 수정, 삭제는 admin API 범위이므로 포함하지 않았습니다.
이 PR은 현재 전달받은 notification 조회 API 명세와 ERD 기준으로 공지/QnA/전형요강 조회에 필요한 도메인 골격을 우선 구성했습니다.
이슈 원문에 포함된 게시 예약, 상태 변경, 도메인 이벤트는 admin 등록/수정/삭제 API 범위와 함께 후속 작업으로 분리합니다.
Testing
Deployment Notes
Feature flag: 없음
Migration required: 없음
Rollout considerations:
Checklist