Skip to content

[FIX] User 엔티티 후속 보완#38

Merged
ownue merged 3 commits into
developfrom
fix/#37-user-entity-followup
Jul 23, 2026
Merged

[FIX] User 엔티티 후속 보완#38
ownue merged 3 commits into
developfrom
fix/#37-user-entity-followup

Conversation

@p1001q

@p1001q p1001q commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

📍 개요

기존 User 도메인 엔티티 PR(#17) 리뷰에서 놓친 profileImgUrl 검증과 StudentInstrument 인덱스를 보완

⛓️‍💥 관련 이슈


🛠️ 작업 내용

  • User.profileImgUrl이 null/blank로 들어올 경우 GeneralException(UserErrorStatus.PROFILE_IMAGE_REQUIRED)를 던지도록 필수값 검증 추가
  • StudentInstrumentinstrument_id 단독 인덱스 추가 (기존 (student_id, instrument_id) 복합 UNIQUE는 유지, 악기 기준 단독 조회 성능을 위함)
  • 기본 프로필 이미지 URL을 위한 설정값(app.profile.default-image-url) 추가

🔥 리뷰 요청 사항

리뷰어가 중점적으로 확인해주었으면 하는 내용을 작성해주세요.

  • profileImgUrl 검증 위치와 방식이 적절한지
  • instrument_id 단독 인덱스 추가가 맞는 방향인지 (student_id는 복합 UNIQUE 선두 컬럼이라 별도 인덱스 안 만들었습니다)
  • 기본 프로필 이미지를 S3로 통일하는 방향에 대한 의견

✅ 체크리스트

  • 코드 컨벤션을 준수했습니다.
  • 불필요한 코드 및 import를 제거했습니다.
  • 예외 처리를 적용했습니다.
  • 테스트를 완료했습니다.
  • 관련 Issue를 연결했습니다.

📎 참고 사항

  • 기본 프로필 이미지 파일을 실제로 S3에 업로드하기
  • URL 설정값에 채우기

Summary by CodeRabbit

  • 개선 사항
    • 프로필 이미지 URL이 필수로 검증되며, 누락 또는 공백인 경우 명확한 오류 메시지(400)가 제공됩니다.
    • 기본 프로필 이미지 URL을 설정할 수 있도록 환경 구성을 확장했습니다.
    • 구독 생성 시 사용자 및 구독 등급이 필수로 검증되도록 오류 처리가 강화되었습니다.
    • 악기 정보 조회 성능이 개선되었습니다.

@p1001q p1001q self-assigned this Jul 23, 2026
@coderabbitai

coderabbitai Bot commented Jul 23, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 32d6e20d-b005-415d-82df-4666a9f312b6

📥 Commits

Reviewing files that changed from the base of the PR and between 8aa7719 and 91f5f16.

📒 Files selected for processing (2)
  • src/main/java/com/mr/domain/subscriptions/entity/Subscription.java
  • src/main/java/com/mr/domain/subscriptions/exception/SubscriptionErrorStatus.java

📝 Walkthrough

Walkthrough

User 프로필 이미지 정책과 StudentInstrument 인덱스를 보완하고, Subscription을 User 연관 기반으로 변경했습니다. 구독 생성 시 사용자와 등급 필수 검증 및 관련 오류 코드도 추가했습니다.

Changes

사용자 도메인 보완

Layer / File(s) Summary
프로필 이미지 검증 및 기본값 설정
src/main/java/com/mr/domain/user/entity/User.java, src/main/java/com/mr/domain/user/exception/UserErrorStatus.java, src/main/resources/application.yml
User 생성 시 profileImgUrl이 null 또는 blank인지 검증하고, PROFILE_IMAGE_REQUIRED 오류와 기본 이미지 URL 설정을 추가합니다.
악기 기준 조회 인덱스
src/main/java/com/mr/domain/user/entity/StudentInstrument.java
instrument_id 컬럼에 idx_student_instrument_instrument_id 인덱스를 추가합니다.

구독 도메인 보완

Layer / File(s) Summary
구독 사용자 연관 및 생성 검증
src/main/java/com/mr/domain/subscriptions/entity/Subscription.java, src/main/java/com/mr/domain/subscriptions/exception/SubscriptionErrorStatus.java
Subscription의 사용자 식별자를 Long userId에서 지연 로딩 User 연관으로 변경하고, 생성 시 사용자·등급·날짜를 검증합니다. USER_REQUIREDTIER_REQUIRED 오류 코드도 추가합니다.

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

Possibly related PRs

  • Musereview/BE#18: 동일한 UserStudentInstrument 영역을 직접 수정한 변경입니다.
  • Musereview/BE#24: 동일한 Subscription 생성 흐름과 구독 오류 상태를 다룬 변경입니다.

Poem

프로필 URL은 빈틈없이,
악기 조회엔 색인 하나,
구독은 User와 손을 잡고,
필수값 문지기가 서네,
도메인이 한층 단단해졌네.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning 프로필 이미지 필수 검증과 기본 URL 설정, StudentInstrument 인덱스는 반영됐지만 S3 업로드와 Auth 회원가입 연계는 보이지 않습니다. 기본 프로필 이미지의 S3 업로드/실제 객체 URL 연결과 Auth 회원가입에서의 기본 URL 사용 로직을 추가하고, NOT NULL 정책과 빌드 확인도 포함하세요.
Out of Scope Changes check ⚠️ Warning Subscription 엔티티와 SubscriptionErrorStatus 변경은 이슈 #37의 User/StudentInstrument 범위를 벗어납니다. 구독 관련 변경은 별도 PR로 분리하거나, 이슈 #37 범위에 맞게 제거하세요.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 제목은 User 엔티티 보완이라는 핵심을 담고 있어 변경사항과 관련 있으며, 다소 넓지만 오해를 부르진 않습니다.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/#37-user-entity-followup

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.

@ownue ownue left a comment

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.

이전에 별도로 리뷰했던 부분들이 잘 반영된 것 같습니다! 성능과 예외 케이스를 잘 고려해서 작성하셨네요!! 수고 많으셨어요~ ><///

@rkdehdrbs7885-oss rkdehdrbs7885-oss left a comment

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.

인덱스와 검증 로직을 추가한 점 좋은 것 같습니다!

@ownue
ownue merged commit ca43bab into develop Jul 23, 2026
2 checks passed
@p1001q
p1001q deleted the fix/#37-user-entity-followup branch July 24, 2026 11:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

🐛 BugFix - User 도메인 엔티티 보완

3 participants