-
Notifications
You must be signed in to change notification settings - Fork 0
feat: 약관동의 html 제공 기능 및 user 약관동의 저장 기능 추가 #27
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
Conversation
|
Caution Review failedThe pull request is closed. WalkthroughAdds a complete “Terms” module: JPA entities, DTOs, repositories, services, and REST controllers for fetching latest terms by type and recording user agreements. Introduces a new error code TERMS_NOT_FOUND and integrates authentication principal usage for agreement submission. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor Client
participant TermsController as TermsController (/api/terms)
participant TermsService as TermsService
participant TermsRepo as TermsRepository
participant BaseResponse as BaseResponse
Client->>TermsController: GET /api/terms?type=TERMS_OF_SERVICE
TermsController->>TermsService: getLatestTerms(type)
TermsService->>TermsRepo: findFirstByTypeOrderByEffectiveDateDescVersionDesc(type)
alt Terms exists
TermsRepo-->>TermsService: Terms
TermsService-->>TermsController: TermsResponseDto
TermsController-->>Client: 200 BaseResponse{data=TermsResponseDto}
else Terms missing
TermsRepo-->>TermsService: Optional.empty
TermsService-->>TermsController: throw CustomException(TERMS_NOT_FOUND)
TermsController-->>Client: Error response
end
sequenceDiagram
autonumber
actor Client
participant TermsAgreementController as TermsAgreementController (/api/terms-agreement)
participant TermsAgreementService as TermsAgreementService
participant UserRepo as UserRepository
participant TermsRepo as TermsRepository
participant UTARepo as UserTermsAgreementRepository
Client->>TermsAgreementController: POST /api/terms-agreement\nAuthorization: Bearer ...\nBody: { agreedTermsIds: [...] }
TermsAgreementController->>TermsAgreementService: agreeToTerms(principal, request)
TermsAgreementService->>UserRepo: findById(principal.userId)
alt User found
UserRepo-->>TermsAgreementService: User
TermsAgreementService->>TermsRepo: findAllById(agreedTermsIds)
alt All IDs resolved
TermsRepo-->>TermsAgreementService: List<Terms>
TermsAgreementService->>UTARepo: saveAll(List<UserTermsAgreement>)
TermsAgreementService-->>TermsAgreementController: void
TermsAgreementController-->>Client: 200 BaseResponse{message="약관 동의가 성공적으로 처리되었습니다."}
else Missing/invalid IDs
TermsRepo-->>TermsAgreementService: Partial/empty
TermsAgreementService-->>TermsAgreementController: throw CustomException(TERMS_NOT_FOUND)
TermsAgreementController-->>Client: Error response
end
else User missing
UserRepo-->>TermsAgreementService: empty
TermsAgreementService-->>TermsAgreementController: throw CustomException(USER_NOT_FOUND)
TermsAgreementController-->>Client: Error response
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested reviewers
Poem
Tip 🔌 Remote MCP (Model Context Protocol) integration is now available!Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats. 📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 💡 Knowledge Base configuration:
You can enable these sources in your CodeRabbit configuration. 📒 Files selected for processing (12)
✨ Finishing Touches
🧪 Generate unit tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
#️⃣ Issue Number
📝 요약(Summary)
feat: 약관동의 html 제공 기능 및 user 약관동의 저장 기능 추가
📸 기능 스크린 샷 공유
💬 공유사항 to 리뷰어
✅ PR Checklist
PR이 다음 요구 사항을 충족하는지 확인하세요.
Summary by CodeRabbit