-
Notifications
You must be signed in to change notification settings - Fork 2
feat: Implement onboarding status API and related business logic #66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
""" Walkthrough온보딩 진행 상태를 조회하는 새로운 GET API( Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant OnboardingController
participant UserService
participant UserRepository
Client->>OnboardingController: GET /onboarding/status (userId)
OnboardingController->>UserService: getOnboardingStatus(userId)
UserService->>UserRepository: findById(userId)
UserRepository-->>UserService: User
UserService-->>OnboardingController: OnboardingStatusResponse
OnboardingController-->>Client: ApiResponse<OnboardingStatusResponse>
Suggested labels
✨ Finishing Touches
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 4
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (8)
noweekend-core/core-api/src/main/kotlin/noweekend/core/api/controller/v1/OnboardingController.kt(2 hunks)noweekend-core/core-api/src/main/kotlin/noweekend/core/api/controller/v1/docs/OnboardingControllerDocs.kt(2 hunks)noweekend-core/core-api/src/main/kotlin/noweekend/core/api/controller/v1/response/OnboardingStatusResponse.kt(1 hunks)noweekend-core/core-api/src/main/kotlin/noweekend/core/domain/user/UserService.kt(2 hunks)noweekend-core/core-api/src/main/kotlin/noweekend/core/domain/user/UserServiceImpl.kt(3 hunks)noweekend-core/core-api/src/main/kotlin/noweekend/core/support/error/ErrorType.kt(1 hunks)noweekend-core/core-domain/src/main/kotlin/noweekend/core/domain/user/User.kt(2 hunks)noweekend-storage/db-core/src/main/kotlin/noweekend/storage/db/core/user/UserEntity.kt(1 hunks)
🔇 Additional comments (7)
noweekend-core/core-api/src/main/kotlin/noweekend/core/domain/user/UserService.kt (1)
7-7: 인터페이스 확장이 적절하게 구현되었습니다.새로운 온보딩 상태 조회 메소드가 올바르게 추가되었고, 필요한 import도 포함되어 있습니다.
Also applies to: 21-21
noweekend-core/core-api/src/main/kotlin/noweekend/core/support/error/ErrorType.kt (1)
28-28: 적절한 에러 타입이 추가되었습니다.온보딩 순서 오류에 대한 명확한 에러 메시지와 적절한 HTTP 상태 코드(400)가 설정되어 있습니다. 사용자에게 해결 방법을 제시하는 친절한 메시지입니다.
noweekend-storage/db-core/src/main/kotlin/noweekend/storage/db/core/user/UserEntity.kt (1)
59-59: 엔티티 변경이 도메인 모델과 일관성 있게 적용되었습니다.데이터베이스 컬럼이 이미 nullable로 설정되어 있어서 코드가 스키마와 일치하게 되었습니다. 변환 메소드들도 nullable 값을 올바르게 처리하고 있습니다.
noweekend-core/core-api/src/main/kotlin/noweekend/core/api/controller/v1/response/OnboardingStatusResponse.kt (2)
5-12: 응답 DTO 구조가 명확하고 잘 설계되었습니다.단일 status 필드를 가진 간단한 구조로, API 응답의 목적에 적합합니다. Swagger 문서화도 한국어로 명확하게 작성되어 있어 API 사용자가 이해하기 쉽습니다.
14-27: 온보딩 상태 enum이 논리적 순서로 잘 정의되었습니다.NONE → NAME_AND_BIRTHDAY → ANNUAL_LEAVE → DONE 순서로 온보딩 진행 단계를 명확하게 표현하고 있으며, 각 상태에 대한 한국어 설명도 적절합니다.
noweekend-core/core-api/src/main/kotlin/noweekend/core/domain/user/UserServiceImpl.kt (1)
71-71: nullable remainingAnnualLeave 처리가 적절합니다.엘비스 연산자를 사용해 null 값을 0.0으로 기본값 처리하는 방식이 안전하고 명확합니다.
noweekend-core/core-api/src/main/kotlin/noweekend/core/api/controller/v1/docs/OnboardingControllerDocs.kt (1)
345-411: API 문서화가 매우 상세하고 잘 작성되었습니다.
- 온보딩 상태 값들에 대한 명확한 설명 제공
- 성공/실패 응답 예시가 구체적으로 작성됨
- 에러 케이스에 대한 적절한 HTTP 상태 코드(400) 사용
- 기존 문서화 패턴과 일관성 유지
API 사용자가 이해하기 쉽도록 잘 문서화되어 있습니다.
noweekend-core/core-domain/src/main/kotlin/noweekend/core/domain/user/User.kt
Show resolved
Hide resolved
...ekend-core/core-api/src/main/kotlin/noweekend/core/api/controller/v1/OnboardingController.kt
Show resolved
Hide resolved
noweekend-core/core-api/src/main/kotlin/noweekend/core/domain/user/UserServiceImpl.kt
Outdated
Show resolved
Hide resolved
noweekend-core/core-api/src/main/kotlin/noweekend/core/domain/user/UserServiceImpl.kt
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
noweekend-core/core-domain/src/main/kotlin/noweekend/core/domain/auth/TestUserService.kt (1)
87-87: 테스트 데이터의 하드코딩된 값을 개선하세요.
remainingAnnualLeave가 고정값10.0으로 하드코딩되어 있습니다. 테스트의 일관성과 유지보수성을 위해 다음 중 하나를 고려해보세요:
- 상수로 추출하여 명확한 의미 부여
- User 도메인의 nullable 값을 그대로 사용하되 기본값 처리 로직 추가
- remainingAnnualLeave = 10.0, + remainingAnnualLeave = user.remainingAnnualLeave ?: DEFAULT_TEST_ANNUAL_LEAVE,클래스 상단에 상수 추가:
companion object { private const val DEFAULT_TEST_ANNUAL_LEAVE = 10.0 }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
noweekend-core/core-api/src/main/kotlin/noweekend/core/api/controller/v1/response/UserInformationResponse.kt(1 hunks)noweekend-core/core-api/src/main/kotlin/noweekend/core/domain/user/UserServiceImpl.kt(3 hunks)noweekend-core/core-domain/src/main/kotlin/noweekend/core/domain/auth/TestUserService.kt(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- noweekend-core/core-api/src/main/kotlin/noweekend/core/domain/user/UserServiceImpl.kt
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: build
🔇 Additional comments (2)
noweekend-core/core-api/src/main/kotlin/noweekend/core/api/controller/v1/response/UserInformationResponse.kt (2)
41-41: remainingAnnualLeave null 체크 일관성 확인됨온보딩 상태 결정 로직(
UserServiceImpl.getOnboardingStatus)에서val annualLeaveEntered = user.remainingAnnualLeave != null로 null 여부를 올바르게 판별하고 있으며, 응답 DTO(
UserInformationResponse)에서도Double?타입으로 동일하게 전달되고 있습니다. 추가 수정은 필요하지 않습니다.
23-23: nullable 타입 변경 승인 및 Swagger 문서 검증 요청
remainingAnnualLeave를Double?로 변경한 것은 온보딩 상태 판단 로직과 일치합니다.
아래 항목을 확인/반영해주세요:
- 파일:
noweekend-core/core-api/src/main/kotlin/noweekend/core/api/controller/v1/response/UserInformationResponse.kt
remainingAnnualLeave필드에 Swagger(OpenAPI) 스펙에서nullable=true가 명시되었는지 확인- 필요 시
@Schema(nullable = true)어노테이션 추가 또는 YAML/JSON 스펙에nullable: true설정- Swagger UI 및 생성된 OpenAPI 문서에서 해당 필드가 null 허용(
nullable)으로 표시되는지 검증
요약(개요)
온보딩 상태 조회 API 및 관련 로직, DTO, 명세, 예외 처리를 추가
작업 내용
INVALID_ONBOARD_STATUS) 및 Swagger 명세 작성집중해서 리뷰해야 하는 부분
기타 전달 사항 및 참고 자료(선택)
Summary by CodeRabbit
신규 기능
버그 수정
기타 변경