Skip to content

Conversation

@yhi9839
Copy link
Contributor

@yhi9839 yhi9839 commented Jan 14, 2026

MemberTicket 테이블명을 TempTicket으로 변경

/ready API에서
파라미터 명은 변경하지 않음, 배포 사이트 오류 예상
-> 추후 논의 후 변경 예정

Summary by CodeRabbit

  • Bug Fixes

    • Removed unused imports from payment controller to streamline dependencies.
  • Refactor

    • Updated ticket system architecture across services and data layers for improved handling.
    • Modified API response structures for ticket creation and retrieval endpoints, including updated field naming.
    • Optimized repository queries for ticket operations.

✏️ Tip: You can customize this high-level summary in your review settings.

@yhi9839 yhi9839 linked an issue Jan 14, 2026 that may be closed by this pull request
3 tasks
@coderabbitai
Copy link

coderabbitai bot commented Jan 14, 2026

📝 Walkthrough

Walkthrough

This pull request systematically refactors the ticket system by replacing all references to MemberTicket with TempTicket across entities, repositories, services, controllers, and DTOs. The change includes renaming classes, updating imports, and adjusting method signatures while preserving the underlying business logic and control flow.

Changes

Cohort / File(s) Summary
Entity & Relationship Updates
src/main/java/cc/backend/amateurShow/entity/AmateurTicket.java, src/main/java/cc/backend/member/entity/Member.java, src/main/java/cc/backend/ticket/entity/TempTicket.java
Updated list associations and class names from MemberTicket to TempTicket; adjusted imports and initialization patterns
Repository Layer Refactoring
src/main/java/cc/backend/ticket/repository/MemberTicketRepository.java (deleted), src/main/java/cc/backend/ticket/repository/TempTicketRepository.java (new)
Removed deprecated MemberTicketRepository interface; introduced TempTicketRepository with equivalent query methods including entity graph for eager loading of related data
Service Layer Migration
src/main/java/cc/backend/ticket/service/TempTicketService.java, src/main/java/cc/backend/ticket/service/TempTicketServiceImpl.java, src/main/java/cc/backend/ticket/service/RealTicketService.java
Renamed interfaces/classes and updated method signatures; refactored ticket creation and real-ticket generation to operate on TempTicket entities with updated DTO types
KakaoPay Integration Updates
src/main/java/cc/backend/kakaoPay/service/KakaoPayService.java, src/main/java/cc/backend/kakaoPay/service/KakaoPayBusinessService.java
Updated payment preparation, completion, and confirmation flows to use TempTicket instead of MemberTicket; changed method signatures from memberTicketId to tempTicketId parameters
Controller Layer Changes
src/main/java/cc/backend/ticket/controller/TempTicketController.java, src/main/java/cc/backend/ticket/controller/MyTicketController.java
Renamed controller class and updated service dependency injection; replaced request/response DTOs with TempTicket equivalents and updated method calls
Data Transfer Objects
src/main/java/cc/backend/ticket/dto/request/TempTicketCreateRequestDTO.java, src/main/java/cc/backend/ticket/dto/response/TempTicketCreateResponseDTO.java, src/main/java/cc/backend/ticket/dto/response/TempTicketListResponseDTO.java, src/main/java/cc/backend/ticket/dto/response/TempTicketResponseDTO.java
Renamed DTO classes and updated field names from memberTicketId to tempTicketId; adjusted factory methods and builder patterns to work with TempTicket entities
Scheduler & Cleanup
src/main/java/cc/backend/notice/service/NoticeScheduler.java, src/main/java/cc/backend/kakaoPay/controller/KakaoPayController.java
Updated NoticeScheduler to query and group by TempTicket entities; removed unused imports from KakaoPayController
Test Updates
src/test/java/cc/backend/kakaoPay/service/KakaoPayBusinessServiceConcurrencyTest.java
Updated SQL update statements to target TempTicket table instead of MemberTicket in concurrency test scenarios

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Possibly related PRs

Poem

🐰 Whiskers twitching with refactoring glee,
From Member to Temp, the tickets now flow free,
Repositories dance, imports align,
A systematic rename—the logic stays fine!

🚥 Pre-merge checks | ✅ 1 | ❌ 2
❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description is incomplete; it lacks critical sections required by the template (연관된 이슈, 스크린샷, 리뷰 요구사항) and doesn't adequately explain the refactoring scope. Add the linked issue number, explain the refactoring impact on related services, and clarify the intentional decision to leave /ready API parameters unchanged.
Docstring Coverage ⚠️ Warning Docstring coverage is 18.75% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: renaming MemberTicket to TempTicket throughout the codebase.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

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 and usage tips.

Copy link

@coderabbitai coderabbitai bot left a 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 @Table annotation may cause database migration issues.

Renaming the class from MemberTicket to TempTicket without an explicit @Table annotation will change the underlying table name from member_ticket to temp_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: memberTicketId not renamed to tempTicketId.

The field memberTicketId still 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 @Service to the implementation class.

The @Service annotation 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: Unused tempTicketService field.

The tempTicketService is injected but never used in any of the controller methods. All operations use realTicketService or kakaoPayBusinessService. 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_STOCK still 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 named TempTicket. This naming inconsistency appears in ErrorStatus definitions and is used consistently across multiple service classes. Consider renaming these error codes to follow the TEMP_TICKET_* pattern to match the current entity name.

📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1896b40 and 68d935d.

📒 Files selected for processing (19)
  • src/main/java/cc/backend/amateurShow/entity/AmateurTicket.java
  • src/main/java/cc/backend/kakaoPay/controller/KakaoPayController.java
  • src/main/java/cc/backend/kakaoPay/service/KakaoPayBusinessService.java
  • src/main/java/cc/backend/kakaoPay/service/KakaoPayService.java
  • src/main/java/cc/backend/member/entity/Member.java
  • src/main/java/cc/backend/notice/service/NoticeScheduler.java
  • src/main/java/cc/backend/ticket/controller/MyTicketController.java
  • src/main/java/cc/backend/ticket/controller/TempTicketController.java
  • src/main/java/cc/backend/ticket/dto/request/TempTicketCreateRequestDTO.java
  • src/main/java/cc/backend/ticket/dto/response/TempTicketCreateResponseDTO.java
  • src/main/java/cc/backend/ticket/dto/response/TempTicketListResponseDTO.java
  • src/main/java/cc/backend/ticket/dto/response/TempTicketResponseDTO.java
  • src/main/java/cc/backend/ticket/entity/TempTicket.java
  • src/main/java/cc/backend/ticket/repository/MemberTicketRepository.java
  • src/main/java/cc/backend/ticket/repository/TempTicketRepository.java
  • src/main/java/cc/backend/ticket/service/RealTicketService.java
  • src/main/java/cc/backend/ticket/service/TempTicketService.java
  • src/main/java/cc/backend/ticket/service/TempTicketServiceImpl.java
  • src/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 OneToMany mapping is correctly updated to use TempTicket with the appropriate mappedBy reference. 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 TempTicket as input and return TempTicketResponseDTO.

src/main/java/cc/backend/member/entity/Member.java (1)

67-68: LGTM!

The OneToMany relationship is correctly updated with the renamed field and type. The mappedBy = "member" correctly references the member field in TempTicket.

src/main/java/cc/backend/ticket/dto/response/TempTicketListResponseDTO.java (1)

3-38: LGTM!

The DTO renaming from MemberTicketListResponseDTO to TempTicketListResponseDTO is consistent, with the import, class name, field name (tempTicketId), and static factory method all correctly updated to align with the TempTicket entity.

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 @EntityGraph for 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 TempTicket and TempTicketRepository throughout. 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 the TempTicket entity 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 TempTicket refactoring. The createTicket method correctly uses TempTicketCreateRequestDTO and TempTicketCreateResponseDTO types.

src/main/java/cc/backend/ticket/service/TempTicketServiceImpl.java (1)

45-104: LGTM on the core refactoring.

The createTicket method correctly migrates to use TempTicket entity 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 the ready method refactoring.

The method correctly migrates to use TempTicket for 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 on createRealTicketFromTempTicket method.

The method correctly migrates to fetch from TempTicketRepository and the transformation logic from TempTicket to RealTicket is preserved, including cancel policy determination and all ticket attributes.

src/main/java/cc/backend/kakaoPay/service/KakaoPayBusinessService.java (4)

37-64: LGTM on preparePayment method refactoring.

The method correctly migrates to use TempTicket for ownership verification, stock preemption, and KakaoPay ready flow. The TID is properly stored on the temp ticket entity.


77-129: LGTM on completePayment method refactoring.

The payment completion flow correctly operates on TempTicket, including status checks, TID retrieval, stock recovery on failure, and the call to createRealTicketFromTempTicket for final ticket creation.


190-210: LGTM on stopPayment method refactoring.

The payment cancellation/failure handling correctly uses TempTicket for 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 the TempTicket naming 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 TempTicket entity, consistent with the refactoring objective.


69-70: LGTM - Batch update query aligned with entity rename.

The IN clause query correctly targets TempTicket for the concurrent test scenario.


127-128: LGTM - TOCTOU test query updated.

Entity reference properly updated to TempTicket for 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 TempTicket domain model.


39-41: LGTM - Service delegation updated.

Method correctly delegates to the renamed service.


69-72: LGTM - Service call updated.

The getRoundsList delegation is properly wired to tempTicketService.


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 TempTicket domain. 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.

@yhi9839 yhi9839 merged commit 9735134 into develop Jan 14, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

✨ [FIX] 티켓 예매 가능 기한 추가

2 participants