Skip to content

feat: 온보딩 완료 API 구현 - #129

Merged
issuejong merged 2 commits into
devfrom
feat/128-onboarding-complete
Aug 17, 2026
Merged

issuejong merged 2 commits into
devfrom
feat/128-onboarding-complete

Conversation

@issuejong

@issuejong issuejong commented Aug 17, 2026 •

Copy link
Copy Markdown
Contributor

🎋 작업중인 브랜치 및 이슈

🔑 주요 변경사항

  • POST /onboarding/complete API를 구현했습니다.
  • 회원이 소유한 루틴 그룹이 존재할 때만 온보딩을 완료하도록 검증했습니다.
  • 이미 온보딩을 완료한 회원의 재요청을 성공으로 처리하도록 구현했습니다.
  • 온보딩 완료 요청 및 응답 DTO를 추가했습니다.
  • Swagger 명세와 관련 테스트를 추가했습니다.

Check List

  • Assignees 등록을 하였나요?
  • 라벨(Label) 등록을 하였나요?
  • PR 머지하기 전 반드시 CI가 정상적으로 작동하는지 확인해주세요!

Summary by CodeRabbit

  • New Features

    • Added an onboarding completion endpoint.
    • Members can complete onboarding by selecting a routine group.
    • Validates the selected routine group and returns the onboarding completion status.
    • Repeated completion requests remain safely handled.
  • Tests

    • Added coverage for successful completion, validation failures, unauthorized selections, missing members, and already-completed onboarding.

@issuejong issuejong self-assigned this Aug 17, 2026
@issuejong issuejong added the ✨ feat 새로운 기능 추가 label Aug 17, 2026
@issuejong issuejong linked an issue Aug 17, 2026 that may be closed by this pull request
10 tasks
@coderabbitai

coderabbitai Bot commented Aug 17, 2026 •

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 089c702e-cca5-49d5-8b4e-db7ea2120f91

📥 Commits

Reviewing files that changed from the base of the PR and between e3ae6fe and 8abb056.

📒 Files selected for processing (8)
  • src/main/java/com/moru/server/domain/onboarding/controller/OnboardingController.java
  • src/main/java/com/moru/server/domain/onboarding/dto/OnboardingRequestDTO.java
  • src/main/java/com/moru/server/domain/onboarding/dto/OnboardingResponseDTO.java
  • src/main/java/com/moru/server/domain/onboarding/service/command/OnboardingCommandService.java
  • src/main/java/com/moru/server/domain/onboarding/service/command/OnboardingCommandServiceImpl.java
  • src/main/java/com/moru/server/domain/routine/repository/RoutineGroupRepository.java
  • src/test/java/com/moru/server/domain/onboarding/controller/OnboardingControllerTest.java
  • src/test/java/com/moru/server/domain/onboarding/service/command/OnboardingCommandServiceImplTest.java

Included review availability: Your plan includes up to 1 review per rolling hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The PR adds POST /onboarding/complete. It validates the routine group, locks and checks the member, handles repeated completion, updates onboardingCompleted, returns status, and adds controller and service tests.

Changes

Onboarding completion

Layer / File(s) Summary
Completion contract and endpoint
src/main/java/com/moru/server/domain/onboarding/dto/OnboardingRequestDTO.java, src/main/java/com/moru/server/domain/onboarding/service/command/OnboardingCommandService.java, src/main/java/com/moru/server/domain/onboarding/controller/OnboardingController.java, src/main/java/com/moru/server/domain/onboarding/dto/OnboardingResponseDTO.java
Defines the validated completion request and service contract. Adds the authenticated POST /onboarding/complete endpoint and updates the status response description.
Completion validation and state update
src/main/java/com/moru/server/domain/onboarding/service/command/OnboardingCommandServiceImpl.java, src/main/java/com/moru/server/domain/routine/repository/RoutineGroupRepository.java
Locks and validates the member. Checks routine group ownership. Handles already-completed onboarding and updates member completion state.
Completion flow verification
src/test/java/com/moru/server/domain/onboarding/controller/OnboardingControllerTest.java, src/test/java/com/moru/server/domain/onboarding/service/command/OnboardingCommandServiceImplTest.java
Tests endpoint delegation, successful completion, idempotent requests, ownership validation, missing members, response status, and member state changes.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Merge Risk: ⚪ Minimal · up to 8abb0

The onboarding completion API change has no actionable merge-blocking risk remaining based on the supplied evidence and is merge-ready after normal checks and review.

Sequence Diagram(s)

sequenceDiagram
  participant Client
  participant OnboardingController
  participant OnboardingCommandServiceImpl
  participant MemberRepository
  participant RoutineGroupRepository

  Client->>OnboardingController: POST /onboarding/complete
  OnboardingController->>OnboardingCommandServiceImpl: completeOnboarding(memberId, CompleteRequest)
  OnboardingCommandServiceImpl->>MemberRepository: lock and find member
  MemberRepository-->>OnboardingCommandServiceImpl: member
  OnboardingCommandServiceImpl->>RoutineGroupRepository: check routine group ownership
  RoutineGroupRepository-->>OnboardingCommandServiceImpl: ownership result
  OnboardingCommandServiceImpl-->>OnboardingController: StatusResponse
  OnboardingController-->>Client: onboarding status response
Loading
🚥 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
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 제목은 주요 변경 사항인 온보딩 완료 API 구현을 명확하게 설명합니다.
Linked Issues check ✅ Passed #128의 API, 소유권 검증, 상태 변경, 멱등 처리, Swagger 명세 및 테스트 요구사항을 모두 반영합니다.
Out of Scope Changes check ✅ Passed 모든 변경 사항이 #128의 온보딩 완료 API 구현 범위에 포함됩니다.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/128-onboarding-complete

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.

Member member = memberRepository.findByIdForUpdate(memberId)
.orElseThrow(() -> new BusinessException(ErrorStatus.MEMBER_NOT_FOUND));

if (Boolean.TRUE.equals(member.getOnboardingCompleted())) {

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.

문제: 이미 온보딩 완료된 회원이 재요청하면 routineGroupId 소유권 검증(existsByIdAndMember_Id)을 아예 건너뛰고 바로 성공 반환합니다. 재시도 시 다른 사람의 routineGroupId를 보내도 통과된다고 합니다.
대안: 이미 완료 여부와 무관하게 소유권 체크를 먼저 하거나, 의도된 동작이면 코드에 주석으로 명시하는게 좋을것같습니다!

@issuejong
issuejong merged commit e1a9356 into dev Aug 17, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

✨ feat 새로운 기능 추가

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: 온보딩 완료 API 구현

2 participants