Skip to content

[Feat] 프로필 및 온보딩 API 구현#31

Merged
yeonjuncho merged 8 commits into
developfrom
feat/#29
Jul 22, 2026
Merged

[Feat] 프로필 및 온보딩 API 구현#31
yeonjuncho merged 8 commits into
developfrom
feat/#29

Conversation

@yeonjuncho

@yeonjuncho yeonjuncho commented Jul 21, 2026

Copy link
Copy Markdown
Collaborator

#️⃣ 관련 이슈

closed #29

프로필 조회·수정과 온보딩 임시저장·완료 기능을 구현했습니다.

PR 유형

어떤 변경 사항이 있나요?

  • 새로운 기능 추가
  • 버그 수정
  • 코드 리팩토링
  • 주석 추가 및 수정
  • 문서 수정
  • 테스트 추가, 테스트 리팩토링
  • 빌드 부분 혹은 패키지 매니저 수정
  • 파일 혹은 폴더명 수정
  • 파일 혹은 폴더 삭제

PR Checklist

PR이 다음 요구 사항을 충족하는지 확인하세요.

  • 커밋 메시지 컨벤션에 맞게 작성했습니다.
  • 변경 사항에 대한 테스트를 했습니다.(버그 수정/기능에 대한 테스트).

🧩 작업 내용

  • 프로필 조회 API 구현
    • GET /api/profile
  • 프로필 수정 API 구현
    • PATCH /api/profile
  • 온보딩 임시저장 조회 API 구현
    • GET /api/profile/draft
  • 온보딩 임시저장 API 구현
    • PUT /api/profile/draft
  • 온보딩 완료 API 구현
    • POST /api/profile/onboarding/complete
  • 온보딩 진행 단계 PROFILE, QUIZ, REVIEW 관리
  • 관심 직무 최대 3개 및 대표 직무 1개 저장
  • 희망 지역 1개 저장
  • 선호 조건, 제외 키워드, 기술 스택 목록 저장
  • 경력 단계 미선택 상태의 임시저장 허용
  • 온보딩 완료 조건 검증 및 완료 상태 반영
  • JPA Auditing 시간 타입 불일치 수정
  • 프로필 및 온보딩 API 테스트 추가

📸 스크린샷(선택)

  • 프로필 조회 및 수정 성공 화면
프로필 조회 프로필 수정
  • 온보딩 임시저장 및 조회 성공 화면
온보딩 부분 임시저장 온보딩 최종 임시저장
  • 온보딩 완료 성공 화면
온보딩 완료

📣 To Reviewers

  • 온보딩 퀴즈는 선택 사항이며 건너뛸 수 있습니다.
  • 임시저장은 careerLevel이 없어도 가능하고, 온보딩 완료 시에는 필수로 검증합니다.
  • 기존 로컬 DB를 사용 중인 경우 user_profiles.career_levelNOT NULL 제약 해제가 필요할 수 있습니다.

Summary by CodeRabbit

  • 새로운 기능

    • 프로필 조회 및 부분 수정 기능을 추가했습니다.
    • 온보딩 진행 내용을 임시 저장하고 조회할 수 있습니다.
    • 온보딩 단계 관리 및 완료 처리를 지원합니다.
    • 직무 카테고리, 지역, 경력 수준, 선호 정보와 기술 스택을 관리할 수 있습니다.
  • 개선 사항

    • 프로필 입력값 검증과 중복 데이터 방지를 강화했습니다.
    • 프로필 및 온보딩 관련 오류 메시지를 세분화했습니다.

@yeonjuncho yeonjuncho self-assigned this Jul 21, 2026
@yeonjuncho yeonjuncho added the ✨ Feat 새로운 기능 추가 label Jul 21, 2026
@yeonjuncho yeonjuncho linked an issue Jul 21, 2026 that may be closed by this pull request
13 tasks
@coderabbitai

coderabbitai Bot commented Jul 21, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 35a20219-85a6-44c1-bf98-daca4479933e

📥 Commits

Reviewing files that changed from the base of the PR and between 7f6dfda and 99054ba.

📒 Files selected for processing (5)
  • src/main/java/com/leets7th/job_is_be/domain/user/entity/UserProfile.java
  • src/main/java/com/leets7th/job_is_be/domain/user/service/ProfileService.java
  • src/main/java/com/leets7th/job_is_be/global/status/ErrorStatus.java
  • src/main/java/com/leets7th/job_is_be/global/status/SuccessStatus.java
  • src/test/java/com/leets7th/job_is_be/domain/user/controller/ProfileControllerIntegrationTest.java
🚧 Files skipped from review as they are similar to previous changes (4)
  • src/main/java/com/leets7th/job_is_be/global/status/ErrorStatus.java
  • src/test/java/com/leets7th/job_is_be/domain/user/controller/ProfileControllerIntegrationTest.java
  • src/main/java/com/leets7th/job_is_be/domain/user/entity/UserProfile.java
  • src/main/java/com/leets7th/job_is_be/domain/user/service/ProfileService.java

📝 Walkthrough

Walkthrough

프로필 드래프트 저장·조회, 온보딩 완료, 완료 프로필 조회·수정 API를 추가했습니다. 온보딩 단계와 프로필 응답 DTO, 사용자별 직무·지역 저장소 및 유니크 제약, 값 인코딩, 검증 오류·성공 상태와 통합 테스트를 함께 구현했습니다.

Changes

프로필 및 온보딩

Layer / File(s) Summary
프로필 도메인 계약과 저장 구조
src/main/java/com/leets7th/job_is_be/domain/user/dto/*, src/main/java/com/leets7th/job_is_be/domain/user/entity/*, src/main/java/com/leets7th/job_is_be/domain/user/enums/*, src/main/java/com/leets7th/job_is_be/domain/user/repository/*
온보딩 단계, 프로필 요청·응답 record, 프로필 상태 갱신 메서드, 사용자별 직무·지역 저장소와 유니크 제약을 정의했습니다.
프로필 저장·검증 서비스
src/main/java/com/leets7th/job_is_be/domain/user/service/*
프로필 목록 값을 JSON으로 인코딩·디코딩하고, 드래프트 저장·조회, 필수값 검증, 온보딩 완료, 완료 프로필 조회·수정과 관계 데이터 교체를 구현했습니다.
프로필 HTTP API 연결
src/main/java/com/leets7th/job_is_be/domain/user/controller/ProfileController.java, src/main/java/com/leets7th/job_is_be/global/status/*
JWT subject를 사용자 ID로 변환해 프로필 및 드래프트 엔드포인트를 제공하고, 프로필 성공·오류 상태 코드를 추가했습니다.
프로필 API 통합 검증
src/test/java/com/leets7th/job_is_be/domain/user/controller/ProfileControllerIntegrationTest.java
드래프트 단계 전환, 온보딩 완료, 프로필 조회·수정, 값 보존과 필수값·직무 수·미완료 프로필 오류 응답을 검증했습니다.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Client
  participant ProfileController
  participant ProfileService
  participant UserProfileRepository
  participant UserRelationRepositories
  Client->>ProfileController: PUT /api/profile/draft + JWT
  ProfileController->>ProfileService: userId와 ProfileDraftRequest 전달
  ProfileService->>UserProfileRepository: 프로필 생성 또는 드래프트 갱신
  ProfileService->>UserRelationRepositories: 직무 카테고리·지역 교체
  UserRelationRepositories-->>ProfileService: 저장된 관계 데이터 반환
  ProfileService-->>ProfileController: ProfileDraftResponse 반환
  ProfileController-->>Client: ApiResponse와 성공 상태 반환
Loading

Possibly related PRs

Suggested reviewers: yukyoungs, sky-0131

🚥 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 프로필 조회·수정, 드래프트 저장·조회, 온보딩 완료, 단계 관리, 검증, 테스트 추가가 이슈 요구사항과 맞습니다.
Out of Scope Changes check ✅ Passed 변경 사항은 프로필·온보딩 기능과 관련 DTO/엔티티/테스트로 구성되어 있어 별도 범위 이탈이 보이지 않습니다.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
src/main/java/com/leets7th/job_is_be/domain/user/service/ProfileService.java (1)

313-347: 🩺 Stability & Availability | 🔵 Trivial | 💤 Low value

toProfileResponseuserRegion null 체크가 없습니다.

toDraftResponse(285-290줄)는 userRegion == null을 삼항으로 방어하지만, toProfileResponse는 바로 userRegion.getRegion()을 호출합니다. 현재 흐름상 완료된 프로필은 region이 항상 존재하도록 강제되어 있어 즉시 문제가 되진 않지만, 일관성 있게 방어 코드를 넣는 것이 안전합니다.

🤖 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/com/leets7th/job_is_be/domain/user/service/ProfileService.java`
around lines 313 - 347, Update toProfileResponse to handle a null userRegion
consistently with toDraftResponse: create a null-safe ProfileRegionResponse,
returning null when userRegion is absent, and only access userRegion.getRegion()
when it is non-null. Preserve the existing region mapping for present regions.
🤖 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
`@src/main/java/com/leets7th/job_is_be/domain/user/service/ProfileService.java`:
- Around line 83-97: Update saveDraft around replaceJobCategories and
replaceRegion so relationship replacement is skipped when the corresponding
request field is null, preserving existing job categories and region. Match
updateProfile’s null-handling behavior while continuing to replace each
relationship when its request value is provided.

---

Nitpick comments:
In
`@src/main/java/com/leets7th/job_is_be/domain/user/service/ProfileService.java`:
- Around line 313-347: Update toProfileResponse to handle a null userRegion
consistently with toDraftResponse: create a null-safe ProfileRegionResponse,
returning null when userRegion is absent, and only access userRegion.getRegion()
when it is non-null. Preserve the existing region mapping for present regions.
🪄 Autofix (Beta)

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: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: b3c7e4dc-3b25-42b9-acba-baf41fa80565

📥 Commits

Reviewing files that changed from the base of the PR and between 6f586f0 and 7f6dfda.

📒 Files selected for processing (19)
  • src/main/java/com/leets7th/job_is_be/domain/user/controller/ProfileController.java
  • src/main/java/com/leets7th/job_is_be/domain/user/dto/ProfileDraftRequest.java
  • src/main/java/com/leets7th/job_is_be/domain/user/dto/ProfileDraftResponse.java
  • src/main/java/com/leets7th/job_is_be/domain/user/dto/ProfileJobCategoryResponse.java
  • src/main/java/com/leets7th/job_is_be/domain/user/dto/ProfileRegionResponse.java
  • src/main/java/com/leets7th/job_is_be/domain/user/dto/ProfileResponse.java
  • src/main/java/com/leets7th/job_is_be/domain/user/dto/ProfileUpdateRequest.java
  • src/main/java/com/leets7th/job_is_be/domain/user/entity/UserJobCategory.java
  • src/main/java/com/leets7th/job_is_be/domain/user/entity/UserProfile.java
  • src/main/java/com/leets7th/job_is_be/domain/user/entity/UserRegion.java
  • src/main/java/com/leets7th/job_is_be/domain/user/enums/OnboardingStep.java
  • src/main/java/com/leets7th/job_is_be/domain/user/repository/UserJobCategoryRepository.java
  • src/main/java/com/leets7th/job_is_be/domain/user/repository/UserRegionRepository.java
  • src/main/java/com/leets7th/job_is_be/domain/user/service/ProfileService.java
  • src/main/java/com/leets7th/job_is_be/domain/user/service/ProfileValueCodec.java
  • src/main/java/com/leets7th/job_is_be/global/config/JpaConfig.java
  • src/main/java/com/leets7th/job_is_be/global/status/ErrorStatus.java
  • src/main/java/com/leets7th/job_is_be/global/status/SuccessStatus.java
  • src/test/java/com/leets7th/job_is_be/domain/user/controller/ProfileControllerIntegrationTest.java

Comment thread src/main/java/com/leets7th/job_is_be/domain/user/service/ProfileService.java Outdated
jihoonkim501
jihoonkim501 previously approved these changes Jul 21, 2026

@jihoonkim501 jihoonkim501 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

수고많으셨습니다! 코드레빗 코멘트만 수정부탁드려요~!

@yukyoungs yukyoungs left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

굿굿 화이팅!

@yeonjuncho
yeonjuncho merged commit 305c0cf into develop Jul 22, 2026
1 check 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 구현

3 participants