Skip to content

Conversation

@toychip
Copy link
Member

@toychip toychip commented Jul 17, 2025

요약(개요)

온보딩 상태 조회 API 및 관련 로직, DTO, 명세, 예외 처리를 추가

작업 내용

  • 온보딩 상태 조회 API 및 서비스 구현
  • 온보딩 상태 Enum과 DTO 추가
  • 예외 처리(INVALID_ONBOARD_STATUS) 및 Swagger 명세 작성
  • User의 remainingAnnualLeave 필드를 Nullable로 변경

집중해서 리뷰해야 하는 부분

  • 온보딩 상태 분기 및 예외 처리 로직

기타 전달 사항 및 참고 자료(선택)

Summary by CodeRabbit

  • 신규 기능

    • 사용자의 온보딩 진행 상태를 확인할 수 있는 새로운 API 엔드포인트가 추가되었습니다. (진행 단계: NONE, NAME_AND_BIRTHDAY, ANNUAL_LEAVE, DONE)
  • 버그 수정

    • 연차 정보가 없을 때(Null)도 안전하게 처리하도록 개선되었습니다.
  • 기타 변경

    • 연차 정보 필드가 선택적으로 입력(Nullable)될 수 있도록 변경되었습니다.
    • 온보딩 상태가 잘못된 순서로 요청될 경우 반환되는 오류 메시지가 추가되었습니다.

@toychip toychip requested a review from mkSpace as a code owner July 17, 2025 01:30
@coderabbitai
Copy link

coderabbitai bot commented Jul 17, 2025

"""

Walkthrough

온보딩 진행 상태를 조회하는 새로운 GET API(/onboarding/status)가 추가되었습니다. 이를 위해 온보딩 상태 응답용 데이터 클래스 및 enum이 도입되었고, User 도메인 및 DB 모델의 연차 정보가 nullable로 변경되었습니다. 온보딩 상태 확인 로직과 관련 예외 처리 및 에러 타입도 추가되었습니다.

Changes

파일/경로 그룹 변경 요약
.../controller/v1/OnboardingController.kt,
.../controller/v1/docs/OnboardingControllerDocs.kt
온보딩 상태 조회 GET 엔드포인트 및 API 문서 메서드 추가
.../controller/v1/response/OnboardingStatusResponse.kt 온보딩 상태 응답 데이터 클래스 및 상태 enum 신규 추가
.../domain/user/UserService.kt,
.../domain/user/UserServiceImpl.kt
UserService/Impl에 온보딩 상태 조회 메서드 추가, 연차 정보 nullable 대응, 온보딩 상태 판별 로직 구현
.../support/error/ErrorType.kt INVALID_ONBOARD_STATUS 에러 타입 추가
.../domain/user/User.kt,
.../user/UserEntity.kt
User 및 UserEntity의 remainingAnnualLeave 타입을 Double에서 Double?로 변경, 기본값 제거
.../api/controller/v1/response/UserInformationResponse.kt UserInformationResponse의 remainingAnnualLeave 타입을 Double에서 Double?로 변경
.../domain/auth/TestUserService.kt UserWithToken.from 메서드에서 remainingAnnualLeave를 10.0으로 고정 설정

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>
Loading

Suggested labels

준형
"""

✨ Finishing Touches
  • 📝 Generate Docstrings

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need 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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a 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

📥 Commits

Reviewing files that changed from the base of the PR and between 2381707 and 17b857d.

📒 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 사용자가 이해하기 쉽도록 잘 문서화되어 있습니다.

Copy link

@coderabbitai coderabbitai bot left a 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으로 하드코딩되어 있습니다. 테스트의 일관성과 유지보수성을 위해 다음 중 하나를 고려해보세요:

  1. 상수로 추출하여 명확한 의미 부여
  2. 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

📥 Commits

Reviewing files that changed from the base of the PR and between 17b857d and a6f2752.

📒 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 문서 검증 요청

remainingAnnualLeaveDouble?로 변경한 것은 온보딩 상태 판단 로직과 일치합니다.
아래 항목을 확인/반영해주세요:

  • 파일: 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)으로 표시되는지 검증

@toychip toychip merged commit 35e975d into develop Jul 17, 2025
2 checks passed
@toychip toychip deleted the feat/onboarding-status branch July 17, 2025 02:07
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.

2 participants