-
Notifications
You must be signed in to change notification settings - Fork 0
Issue: (#166) 약관 동의 API #167
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -20,6 +20,7 @@ class OnboardingService( | |||||||||||
| member.birthDate = onboardingRequest.birthDate | ||||||||||||
| member.role = Role.MEMBER | ||||||||||||
| member.fcmToken = onboardingRequest.fcmToken | ||||||||||||
| member.isTermsAgreed = onboardingRequest.isTermsAgreed | ||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion 약관 동의 필수 검증 로직 추가를 고려해보세요. 약관 동의는 중요한 비즈니스 로직이므로, 단순한 할당보다는 검증 로직을 추가하는 것이 좋겠습니다. 다음과 같은 검증 로직을 고려해보세요: - member.isTermsAgreed = onboardingRequest.isTermsAgreed
+ if (!onboardingRequest.isTermsAgreed) {
+ throw BadRequestException("sarangggun.member.terms-agreement-required")
+ }
+ member.isTermsAgreed = onboardingRequest.isTermsAgreed📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||
| } | ||||||||||||
|
|
||||||||||||
| @Transactional(readOnly = true) | ||||||||||||
|
|
||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -15,4 +15,7 @@ data class OnboardingRequest( | |
|
|
||
| @Schema(description = "알림 설정 여부", example = "false") | ||
| val isNotification: Boolean, | ||
|
|
||
| @Schema(description = "약관 동의 여부", example = "true") | ||
| val isTermsAgreed: Boolean | ||
|
Comment on lines
+19
to
+20
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion 약관 동의 필드에 validation 추가를 고려해보세요. 약관 동의는 필수 항목일 가능성이 높으므로 validation을 추가하는 것이 좋겠습니다. 다음과 같은 validation을 고려해보세요: +import jakarta.validation.constraints.AssertTrue
+
@Schema(description = "약관 동의 여부", example = "true")
+@AssertTrue(message = "약관에 동의해야 합니다")
val isTermsAgreed: Boolean또는 커스텀 validation을 사용할 수도 있습니다: +@ValidTermsAgreement
val isTermsAgreed: Boolean🤖 Prompt for AI Agents
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. validation은 프론트엔드에서 처리할거야. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @HoyeongJeon 알겠습니다! 프론트엔드에서 validation을 처리하시는 방향으로 진행하시는군요. 현재 구현된 코드 그대로 두시면 됩니다. (´•̥̥̥ω•̥̥̥`) ✏️ Learnings added
|
||
| ) | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Verification agent
🧩 Analysis chain
데이터베이스 마이그레이션 스크립트를 확인해주세요.
새로운 non-nullable 필드가 추가되었으므로 기존 데이터에 대한 마이그레이션이 필요합니다.
다음 스크립트로 마이그레이션 파일이 있는지 확인해보겠습니다:
🏁 Script executed:
Length of output: 256
데이터베이스 마이그레이션 스크립트 추가 필요
새로 추가된 non-nullable 필드(
isTermsAgreed: Boolean = false)에 대한 마이그레이션 파일이 현재 확인되지 않습니다. 기존 테이블에 해당 컬럼을 추가하고 기본값을 설정하려면 아래 사항을 반영해주세요.• 대상 코드
src/main/kotlin/gomushin/backend/member/domain/entity/Member.kt@Column(name = "terms_agreed", nullable = false) var isTermsAgreed: Boolean = false)• 추가할 마이그레이션 예시 (Flyway SQL)
• Liquibase 사용 시 예시 (XML)
위와 같이 Flyway 또는 Liquibase 마이그레이션 파일을 작성·등록하여 기존 데이터가
false로 설정되도록 처리해주세요.🤖 Prompt for AI Agents