Skip to content

[FEAT] 로그인 응답에 온보딩 완료 여부 추가#269

Merged
kjhyeon0620 merged 2 commits into
develop-demofrom
feat/#268-add-onboarding-completed-to-login-response
May 8, 2026
Merged

[FEAT] 로그인 응답에 온보딩 완료 여부 추가#269
kjhyeon0620 merged 2 commits into
develop-demofrom
feat/#268-add-onboarding-completed-to-login-response

Conversation

@kjhyeon0620
Copy link
Copy Markdown
Contributor

@kjhyeon0620 kjhyeon0620 commented May 8, 2026

📄 작업 내용 요약

  • 로그인 응답에 onboardingCompleted 필드 추가
  • 온보딩 완료 여부 판단 메서드를 isOnboardingCompleted()로 정리

📎 Issue 번호


✅ 작업 목록

  • 기능 구현
  • 코드 리뷰 반영
  • 테스트 코드 작성
  • 문서 업데이트

📝 기타 참고사항

Summary by CodeRabbit

릴리스 노트

  • New Features

    • 사용자 온보딩 완료 상태 정보가 로그인 및 사용자 정보 API 응답에 추가되었습니다. 클라이언트는 이제 각 사용자의 온보딩 완료 여부를 확인할 수 있습니다.
  • Bug Fixes

    • 온보딩 상태 조회 로직이 개선되어 더 정확한 상태 반환을 보장합니다.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 8, 2026

Review Change Stack

Warning

Rate limit exceeded

@kjhyeon0620 has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 47 minutes and 18 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 728f45fa-b624-4e4a-b695-f6b6326526d9

📥 Commits

Reviewing files that changed from the base of the PR and between 03f3665 and 4588403.

📒 Files selected for processing (3)
  • src/main/java/app/nook/user/dto/UserDTO.java
  • src/test/java/app/nook/user/oauth/OAuthServiceTest.java
  • src/test/java/app/nook/user/service/UserServiceTest.java

Walkthrough

로그인 응답 DTO에 사용자의 온보딩 완료 여부를 나타내는 onboardingCompleted 필드를 추가합니다. User 도메인에서 needsOnboarding() 메서드를 제거하고 isOnboardingCompleted() 메서드로 교체하며, OAuth 및 사용자 서비스의 모든 로그인/토큰 발급 경로에서 이 필드를 설정합니다. 테스트와 REST Docs 스키마를 업데이트하여 새 필드를 검증합니다.

Changes

온보딩 상태 로그인 응답

Layer / File(s) Summary
Domain & Response Contract
src/main/java/app/nook/user/domain/User.java, src/main/java/app/nook/user/dto/UserDTO.java
User 도메인에서 needsOnboarding() 메서드를 제거하고 isOnboardingCompleted() 메서드를 추가합니다. LoginResponse DTO에 onboardingCompleted 필드를 추가합니다.
Service & OAuth Integration
src/main/java/app/nook/user/oauth/OAuthService.java, src/main/java/app/nook/user/service/UserService.java, src/main/java/app/nook/user/service/OnboardingService.java
OAuthService, UserService(devSignUp, getThisUser, issueTokens), OnboardingService에서 사용자의 isOnboardingCompleted() 상태를 조회하여 LoginResponse에 설정합니다.
Test & API Documentation
src/test/java/app/nook/controller/user/AuthControllerTest.java
OAuth 로그인, DEV 로그인, DEV 회원가입, 사용자 정보 조회 테스트에서 onboardingCompleted 필드 값을 검증하고, REST Docs 응답 스키마를 확장하여 새 필드를 문서화합니다.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

  • UMC-NOOK/Server#227: 이 PR의 변경사항(User.needsOnboarding() 제거 및 User.isOnboardingCompleted() 추가)은 PR #227에서 도입된 User 온보딩 필드 및 메서드와 OnboardingService 사용을 직접 수정하므로 관련이 있습니다.

Poem

🐰 로그인 응답에 온보딩 상태를 싣고,
프론트엔드는 즉시 화면을 정하네.
needsOnboarding에서 isOnboardingCompleted로,
긍정의 관점으로 바뀐 메서드,
DTO에 실려 가는 작은 boolean이,
사용자 여정을 매끄럽게 만드네! ✨

🚥 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 제목이 주요 변경사항인 로그인 응답에 온보딩 완료 여부 필드 추가를 명확하게 설명합니다.
Linked Issues check ✅ Passed PR이 이슈 #268의 요구사항인 UserDTO.LoginResponse에 onboardingCompleted 필드 추가를 완전히 충족합니다.
Out of Scope Changes check ✅ Passed PR의 모든 변경사항이 로그인 응답에 온보딩 완료 여부 추가라는 범위 내에 있습니다.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/#268-add-onboarding-completed-to-login-response

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 and usage tips.

@JiwonLee42
Copy link
Copy Markdown
Contributor

Overall Project 67.2% -0.03% 🍏
Files changed 88% 🍏

File Coverage
OnboardingService.java 91.21% 🍏
UserService.java 91.18% -1.26% 🍏
User.java 66.67% 🍏
OAuthService.java 63.59% 🍏

Copy link
Copy Markdown

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

🧹 Nitpick comments (2)
src/test/java/app/nook/controller/user/AuthControllerTest.java (1)

60-105: ⚡ Quick win

onboardingCompleted = true 케이스에 대한 테스트가 없습니다

현재 모든 성공 케이스 테스트는 onboardingCompleted(false)만 검증합니다. 온보딩을 완료한 사용자(onboardingCompleted = true)에 대한 테스트 케이스를 최소 하나 추가하면, 필드 직렬화의 정확성을 더 완전하게 검증할 수 있습니다.

예: 소셜로그인_성공 또는 내정보_조회_성공 테스트에서 onboardingCompleted(true) mock 응답을 사용하는 별도 테스트 케이스를 추가하거나, $.result.onboardingCompletedtrue인 시나리오를 커버하는 테스트를 추가하세요.

🤖 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 `@src/test/java/app/nook/controller/user/AuthControllerTest.java` around lines
60 - 105, Add a parallel test that asserts onboardingCompleted=true: in
AuthControllerTest create a new test (e.g., 소셜로그인_성공_온보딩완료) that builds an
OAuthDTO.OAuthLoginRequest, stubs oAuthService.login(...) to return a
UserDTO.LoginResponse with onboardingCompleted(true) (similar to the existing
소셜로그인_성공), then call mockMvc.perform(post("/api/v1/auth/oauth")...) and assert
jsonPath("$.result.onboardingCompleted").value(true) and include the same
requestFields/responseFields snippet in restDocs to ensure serialization is
validated for the true case.
src/main/java/app/nook/user/dto/UserDTO.java (1)

17-25: 💤 Low value

Boolean 래퍼 타입으로 인해 필드가 조용히 누락될 수 있습니다

클래스 레벨의 @JsonInclude(JsonInclude.Include.NON_NULL)Boolean 래퍼 타입의 조합은, 빌더에서 onboardingCompleted를 설정하지 않은 경우 JSON 응답에서 해당 필드가 아무런 오류 없이 누락됩니다. 현재 모든 코드 경로에서 이 필드를 설정하고 있지만, 향후 새로운 로그인 흐름이 추가될 때 설정을 누락하면 프론트엔드가 예측 불가능한 동작을 할 수 있습니다.

Boolean 대신 boolean 원시 타입을 사용하면, 필드가 항상 직렬화되므로 누락 위험이 없습니다 (단, @JsonInclude(NON_NULL) 는 원시 타입에는 영향을 주지 않습니다).

🛡️ 원시 타입 사용 제안
-        private Boolean onboardingCompleted;
+        private boolean onboardingCompleted;
🤖 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 `@src/main/java/app/nook/user/dto/UserDTO.java` around lines 17 - 25, Change
the nullable wrapper type for onboardingCompleted in the LoginResponse inner
class to the primitive boolean so the field is always present in serialized JSON
even when not explicitly set by builders; update the field declaration for
onboardingCompleted in the LoginResponse class (and any related getters/setters
or builder code) to use boolean (default false) while leaving the class-level
`@JsonInclude`(JsonInclude.Include.NON_NULL) unchanged.
🤖 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 `@src/main/java/app/nook/user/dto/UserDTO.java`:
- Around line 17-25: Change the nullable wrapper type for onboardingCompleted in
the LoginResponse inner class to the primitive boolean so the field is always
present in serialized JSON even when not explicitly set by builders; update the
field declaration for onboardingCompleted in the LoginResponse class (and any
related getters/setters or builder code) to use boolean (default false) while
leaving the class-level `@JsonInclude`(JsonInclude.Include.NON_NULL) unchanged.

In `@src/test/java/app/nook/controller/user/AuthControllerTest.java`:
- Around line 60-105: Add a parallel test that asserts onboardingCompleted=true:
in AuthControllerTest create a new test (e.g., 소셜로그인_성공_온보딩완료) that builds an
OAuthDTO.OAuthLoginRequest, stubs oAuthService.login(...) to return a
UserDTO.LoginResponse with onboardingCompleted(true) (similar to the existing
소셜로그인_성공), then call mockMvc.perform(post("/api/v1/auth/oauth")...) and assert
jsonPath("$.result.onboardingCompleted").value(true) and include the same
requestFields/responseFields snippet in restDocs to ensure serialization is
validated for the true case.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 9b492998-1fab-480e-9a3d-c9287315408b

📥 Commits

Reviewing files that changed from the base of the PR and between 9efe641 and 03f3665.

📒 Files selected for processing (6)
  • src/main/java/app/nook/user/domain/User.java
  • src/main/java/app/nook/user/dto/UserDTO.java
  • src/main/java/app/nook/user/oauth/OAuthService.java
  • src/main/java/app/nook/user/service/OnboardingService.java
  • src/main/java/app/nook/user/service/UserService.java
  • src/test/java/app/nook/controller/user/AuthControllerTest.java

@JiwonLee42
Copy link
Copy Markdown
Contributor

Overall Project 67.2% -0.02% 🍏
Files changed 90.48% 🍏

File Coverage
UserService.java 91.49% -0.85% 🍏
OnboardingService.java 91.21% 🍏
User.java 66.67% 🍏
OAuthService.java 63.49% 🍏

@kjhyeon0620 kjhyeon0620 merged commit 8aa7dd1 into develop-demo May 8, 2026
5 checks passed
@kjhyeon0620 kjhyeon0620 deleted the feat/#268-add-onboarding-completed-to-login-response branch May 19, 2026 17:15
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.

[FEAT] 로그인 응답에 온보딩 완료 여부 추가

2 participants