-
Notifications
You must be signed in to change notification settings - Fork 1
[REFACTOR] memberTicket 이름 변경 -> TempTicket #139
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
📝 WalkthroughWalkthroughThis pull request systematically refactors the ticket system by replacing all references to Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
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. Comment |
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.
Actionable comments posted: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/main/java/cc/backend/ticket/entity/TempTicket.java (1)
16-21: Missing@Tableannotation may cause database migration issues.Renaming the class from
MemberTickettoTempTicketwithout an explicit@Tableannotation will change the underlying table name frommember_tickettotemp_ticket. This could cause data loss or application errors if the existing table contains data.Consider adding
@Table(name = "member_ticket")to preserve the existing table name, or ensure a proper database migration script is in place to rename the table.Suggested fix to preserve existing table name
`@Entity` `@Getter` `@Builder` `@NoArgsConstructor` `@AllArgsConstructor` +@Table(name = "member_ticket") public class TempTicket extends BaseEntity {
🧹 Nitpick comments (6)
src/main/java/cc/backend/ticket/dto/response/TempTicketResponseDTO.java (1)
16-16: Inconsistent field name:memberTicketIdnot renamed totempTicketId.The field
memberTicketIdstill references the old naming convention. Per the PR description, this may be intentional to avoid breaking API consumers. Consider adding a comment to clarify this is a deliberate choice for backward compatibility, or plan to rename it in a follow-up PR.src/main/java/cc/backend/ticket/service/TempTicketService.java (1)
10-11: Consider moving@Serviceto the implementation class.The
@Serviceannotation is typically placed on the concrete implementation (TempTicketServiceImpl) rather than on the interface. This is a minor stylistic point and doesn't affect functionality since Spring will still wire the implementation correctly.src/main/java/cc/backend/ticket/controller/MyTicketController.java (1)
27-27: UnusedtempTicketServicefield.The
tempTicketServiceis injected but never used in any of the controller methods. All operations userealTicketServiceorkakaoPayBusinessService. Consider removing this unused dependency.♻️ Suggested fix
- private final TempTicketService tempTicketService;Also remove the import on line 8:
-import cc.backend.ticket.service.TempTicketService;src/main/java/cc/backend/ticket/service/TempTicketServiceImpl.java (1)
65-67: Inconsistent error status naming.The error status
ErrorStatus.MEMBER_TICKET_STOCKstill uses the old "MEMBER_TICKET" naming convention. Consider updating this to align with the TempTicket rename for consistency, or document that error codes are intentionally kept stable for API compatibility.src/main/java/cc/backend/kakaoPay/service/KakaoPayService.java (1)
88-90: Stale comment references old entity name.The comment on line 88 still references "MemberTicket" but the code now operates on
TempTicket. Update the comment for clarity.♻️ Suggested fix
- // partnerOrderId로 MemberTicket 조회 + // partnerOrderId로 TempTicket 조회src/test/java/cc/backend/kakaoPay/service/KakaoPayBusinessServiceConcurrencyTest.java (1)
52-55: Rename error codes for consistency with TempTicket entity naming.The error codes throughout the codebase use the
MEMBER_TICKET_*prefix (e.g.,MEMBER_TICKET_STOCK,MEMBER_TICKET_NOT_FOUND), while the entity itself is namedTempTicket. This naming inconsistency appears in ErrorStatus definitions and is used consistently across multiple service classes. Consider renaming these error codes to follow theTEMP_TICKET_*pattern to match the current entity name.
📜 Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (19)
src/main/java/cc/backend/amateurShow/entity/AmateurTicket.javasrc/main/java/cc/backend/kakaoPay/controller/KakaoPayController.javasrc/main/java/cc/backend/kakaoPay/service/KakaoPayBusinessService.javasrc/main/java/cc/backend/kakaoPay/service/KakaoPayService.javasrc/main/java/cc/backend/member/entity/Member.javasrc/main/java/cc/backend/notice/service/NoticeScheduler.javasrc/main/java/cc/backend/ticket/controller/MyTicketController.javasrc/main/java/cc/backend/ticket/controller/TempTicketController.javasrc/main/java/cc/backend/ticket/dto/request/TempTicketCreateRequestDTO.javasrc/main/java/cc/backend/ticket/dto/response/TempTicketCreateResponseDTO.javasrc/main/java/cc/backend/ticket/dto/response/TempTicketListResponseDTO.javasrc/main/java/cc/backend/ticket/dto/response/TempTicketResponseDTO.javasrc/main/java/cc/backend/ticket/entity/TempTicket.javasrc/main/java/cc/backend/ticket/repository/MemberTicketRepository.javasrc/main/java/cc/backend/ticket/repository/TempTicketRepository.javasrc/main/java/cc/backend/ticket/service/RealTicketService.javasrc/main/java/cc/backend/ticket/service/TempTicketService.javasrc/main/java/cc/backend/ticket/service/TempTicketServiceImpl.javasrc/test/java/cc/backend/kakaoPay/service/KakaoPayBusinessServiceConcurrencyTest.java
💤 Files with no reviewable changes (2)
- src/main/java/cc/backend/kakaoPay/controller/KakaoPayController.java
- src/main/java/cc/backend/ticket/repository/MemberTicketRepository.java
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-11-23T16:23:29.885Z
Learnt from: chaechaen
Repo: SeeATheater/CC_Backend PR: 112
File: src/main/java/cc/backend/kakaoPay/controller/KakaoPayController.java:40-54
Timestamp: 2025-11-23T16:23:29.885Z
Learning: In the KakaoPay payment flow, the /cancel and /fail endpoints in KakaoPayController are browser redirect URLs (user browser redirects), not server-to-server callbacks from KakaoPay servers. This means server-side verification methods like IP whitelisting or signature verification are not applicable to these endpoints.
Applied to files:
src/main/java/cc/backend/kakaoPay/service/KakaoPayService.java
🧬 Code graph analysis (1)
src/main/java/cc/backend/ticket/service/TempTicketService.java (1)
src/main/java/cc/backend/ticket/service/TempTicketServiceImpl.java (1)
Service(31-148)
🔇 Additional comments (25)
src/main/java/cc/backend/amateurShow/entity/AmateurTicket.java (1)
33-35: LGTM!The
OneToManymapping is correctly updated to useTempTicketwith the appropriatemappedByreference. The relationship consistency is maintained.src/main/java/cc/backend/ticket/dto/request/TempTicketCreateRequestDTO.java (1)
12-14: LGTM!The DTO class rename is consistent with the broader refactoring effort. The structure remains unchanged.
src/main/java/cc/backend/ticket/dto/response/TempTicketResponseDTO.java (1)
27-40: LGTM!The static factory method is correctly updated to use
TempTicketas input and returnTempTicketResponseDTO.src/main/java/cc/backend/member/entity/Member.java (1)
67-68: LGTM!The
OneToManyrelationship is correctly updated with the renamed field and type. ThemappedBy = "member"correctly references thememberfield inTempTicket.src/main/java/cc/backend/ticket/dto/response/TempTicketListResponseDTO.java (1)
3-38: LGTM!The DTO renaming from
MemberTicketListResponseDTOtoTempTicketListResponseDTOis consistent, with the import, class name, field name (tempTicketId), and static factory method all correctly updated to align with theTempTicketentity.src/main/java/cc/backend/ticket/repository/TempTicketRepository.java (1)
1-39: LGTM!The repository is well-structured with proper Spring Data JPA conventions. The
@EntityGraphfor eager loading related entities during payment operations and the default method for date-based queries provide clean abstractions.src/main/java/cc/backend/notice/service/NoticeScheduler.java (1)
9-10: LGTM!The scheduler has been correctly updated to use
TempTicketandTempTicketRepositorythroughout. All type references, imports, and method references are consistent with the refactoring objective while preserving the notification logic.Also applies to: 25-25, 37-37, 40-46, 61-61
src/main/java/cc/backend/ticket/dto/response/TempTicketCreateResponseDTO.java (1)
15-16: LGTM!The DTO renaming is consistent with the refactoring objective. The class and field name (
tempTicketId) align with theTempTicketentity naming convention.src/main/java/cc/backend/ticket/service/TempTicketService.java (1)
10-13: LGTM!The interface renaming and method signature updates are consistent with the
TempTicketrefactoring. ThecreateTicketmethod correctly usesTempTicketCreateRequestDTOandTempTicketCreateResponseDTOtypes.src/main/java/cc/backend/ticket/service/TempTicketServiceImpl.java (1)
45-104: LGTM on the core refactoring.The
createTicketmethod correctly migrates to useTempTicketentity and related DTOs. The validation logic, ticket creation, and event publishing flow remain intact.src/main/java/cc/backend/kakaoPay/service/KakaoPayService.java (1)
44-84: LGTM on thereadymethod refactoring.The method correctly migrates to use
TempTicketfor fetching ticket data, validating status, constructing the payment request, and building redirect URLs with the temp ticket ID.src/main/java/cc/backend/ticket/service/RealTicketService.java (1)
35-67: LGTM oncreateRealTicketFromTempTicketmethod.The method correctly migrates to fetch from
TempTicketRepositoryand the transformation logic fromTempTickettoRealTicketis preserved, including cancel policy determination and all ticket attributes.src/main/java/cc/backend/kakaoPay/service/KakaoPayBusinessService.java (4)
37-64: LGTM onpreparePaymentmethod refactoring.The method correctly migrates to use
TempTicketfor ownership verification, stock preemption, and KakaoPay ready flow. The TID is properly stored on the temp ticket entity.
77-129: LGTM oncompletePaymentmethod refactoring.The payment completion flow correctly operates on
TempTicket, including status checks, TID retrieval, stock recovery on failure, and the call tocreateRealTicketFromTempTicketfor final ticket creation.
190-210: LGTM onstopPaymentmethod refactoring.The payment cancellation/failure handling correctly uses
TempTicketfor stock recovery and status updates.
40-46: Consider tracking error status code updates as a follow-up.The error statuses like
MEMBER_TICKET_NOT_FOUND,NOT_MEMBER_TICKET_OWNER, etc. still use the old "MEMBER_TICKET" naming. Per the PR description, this is intentional to avoid deployment issues. Consider creating a follow-up task to rename these error codes for consistency with theTempTicketnaming when ready.src/test/java/cc/backend/kakaoPay/service/KakaoPayBusinessServiceConcurrencyTest.java (3)
47-48: LGTM - Entity reference updated correctly.The JPQL query now targets the renamed
TempTicketentity, consistent with the refactoring objective.
69-70: LGTM - Batch update query aligned with entity rename.The IN clause query correctly targets
TempTicketfor the concurrent test scenario.
127-128: LGTM - TOCTOU test query updated.Entity reference properly updated to
TempTicketfor the race condition validation test.src/main/java/cc/backend/ticket/controller/TempTicketController.java (6)
6-7: LGTM - Imports updated correctly.Import statements properly reference the renamed DTO and service classes.
25-27: LGTM - Controller and service field renamed consistently.The class and service field names are aligned with the
TempTicketdomain model.
39-41: LGTM - Service delegation updated.Method correctly delegates to the renamed service.
69-72: LGTM - Service call updated.The
getRoundsListdelegation is properly wired totempTicketService.
96-100: LGTM - Ticket list retrieval updated.Service delegation correctly uses
tempTicketService.getAmateurTicketList.
142-150: LGTM - Ticket creation endpoint refactored correctly.The method name, return type, request body DTO, and service call are all consistently updated to the
TempTicketdomain. The API path (POST /{amateurShowId}/reserve) remains unchanged, ensuring backward compatibility as intended.
✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.
MemberTicket 테이블명을 TempTicket으로 변경
/ready API에서
파라미터 명은 변경하지 않음, 배포 사이트 오류 예상
-> 추후 논의 후 변경 예정
Summary by CodeRabbit
Bug Fixes
Refactor
✏️ Tip: You can customize this high-level summary in your review settings.