Skip to content

Conversation

@yhi9839
Copy link
Contributor

@yhi9839 yhi9839 commented Jan 8, 2026

  1. #⃣ 연관된 이슈
  2. 📝 작업 내용
    • 관리자 등록 관리시 DTO수정
    • 공연진 마이페이지에서 등록한 공연 조회시 Reject 추가

Summary by CodeRabbit

Release Notes

  • New Features

    • Added rejection reason tracking for amateur shows, enabling users to view detailed feedback when applications are declined.
  • Bug Fixes

    • Fixed API endpoint routing for ticket-related operations.
  • Refactor

    • Improved status terminology in admin approval workflows for better clarity.

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

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

coderabbitai bot commented Jan 8, 2026

📝 Walkthrough

Walkthrough

This PR refactors amateur show approval status tracking by renaming the admin approval response field from amateurShowStatus to approvalStatus, adds rejection reason exposure in user-facing DTOs, introduces a new REJECT status enum constant, updates status transition logic in approval/rejection workflows, and corrects URL routing patterns in the ticket controller.

Changes

Cohort / File(s) Summary
Approval Status Field Refactoring
src/main/java/cc/backend/admin/amateurShow/dto/AdminApprovalListResponseDTO.java, src/main/java/cc/backend/admin/amateurShow/service/AdminApprovalService.java
Renamed DTO field from amateurShowStatus to approvalStatus; updated service mapping and getter call from show.getStatus() to show.getApprovalStatus()
Rejection Reason Addition
src/main/java/cc/backend/amateurShow/dto/AmateurShowResponseDTO.java, src/main/java/cc/backend/amateurShow/service/amateurShowService/AmateurServiceImpl.java
Added rejectReason field to MyShowAmateurShowList inner DTO; updated builder invocation to populate the new field from entity
Status Enum Enhancement
src/main/java/cc/backend/amateurShow/entity/AmateurShowStatus.java
Added new enum constant REJECT to expand the status lifecycle
Status Transition Logic
src/main/java/cc/backend/amateurShow/entity/AmateurShow.java
Updated approve() to set status to YET alongside approvalStatus; updated reject() to set status to REJECT alongside approvalStatus
Controller URL Routing
src/main/java/cc/backend/ticket/controller/MemberTicketController.java
Fixed four endpoint path annotations by adding leading slashes (e.g., "/{amateurShowId}/..." instead of "{amateurShowId}/...")

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Poem

🐰 A rabbit hops through status fields with glee,
Renaming amateurShow to approvalStatus we see,
With REJECT and rejectReason now in place,
The amateur shows find their new embrace,
And ticket routes skip with corrected slashes—what grace! 🎭

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the main fix involving reject status handling for performer's my-page, which is the core focus of the changeset.
Description check ✅ Passed The description follows the template structure and includes the required sections with relevant information about issue reference and work details.

✏️ 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: 1

🤖 Fix all issues with AI agents
In @src/main/java/cc/backend/amateurShow/entity/AmateurShow.java:
- Around line 160-169: The approve() and reject(String) methods unconditionally
overwrite the lifecycle field status (AmateurShowStatus) which can corrupt
state; update approve() and reject() to only change approvalStatus while either
(a) not modifying status at all, or (b) guarding status mutations so they only
occur from an allowed prior state (e.g., only change status when current status
== AmateurShowStatus.YET), and reject attempts from invalid states by throwing
an IllegalStateException or returning a boolean result; ensure these guards live
in the approve() and reject() methods and document the intended relationship
between status and approvalStatus in the method Javadoc.
🧹 Nitpick comments (1)
src/main/java/cc/backend/amateurShow/entity/AmateurShowStatus.java (1)

6-7: Consider semantic clarity: mixing lifecycle states with approval states.

The REJECT constant is being added to an enum that represents temporal lifecycle states (YET, ONGOING, ENDED). However, REJECT represents an approval outcome, not a temporal state relative to show dates. This mixing of concerns could lead to confusion:

  • Temporal states (YET, ONGOING, ENDED) are computed based on current date vs. show dates
  • REJECT is a terminal approval state unrelated to show scheduling

Consider whether REJECT shows should have a separate approval status field (which appears to exist as ApprovalStatus) rather than overloading the lifecycle status field. If both fields are needed, clarify their distinct purposes in comments.

📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4098d73 and 042b718.

📒 Files selected for processing (7)
  • src/main/java/cc/backend/admin/amateurShow/dto/AdminApprovalListResponseDTO.java
  • src/main/java/cc/backend/admin/amateurShow/service/AdminApprovalService.java
  • src/main/java/cc/backend/amateurShow/dto/AmateurShowResponseDTO.java
  • src/main/java/cc/backend/amateurShow/entity/AmateurShow.java
  • src/main/java/cc/backend/amateurShow/entity/AmateurShowStatus.java
  • src/main/java/cc/backend/amateurShow/service/amateurShowService/AmateurServiceImpl.java
  • src/main/java/cc/backend/ticket/controller/MemberTicketController.java
🔇 Additional comments (5)
src/main/java/cc/backend/amateurShow/service/amateurShowService/AmateurServiceImpl.java (1)

604-604: LGTM! Rejection reason properly exposed to performers.

The addition of rejectReason to the MyShowAmateurShowList builder correctly exposes rejection feedback to performers viewing their show submissions. This aligns with the PR objective to display reject status on the performer's mypage.

src/main/java/cc/backend/ticket/controller/MemberTicketController.java (1)

31-105: No action needed—no hardcoded endpoint references or API documentation exist in the codebase.

Verification found no hardcoded URL references to these ticket endpoints in Java, TypeScript, or JavaScript files, and no API documentation files that reference these paths. The paths already include the leading slash pattern (e.g., @GetMapping("/{amateurShowId}/showSimple")). When combined with the class-level @RequestMapping("/tickets"), Spring Boot resolves them correctly to /tickets/{amateurShowId}/showSimple. No API clients or documentation need updating.

Likely an incorrect or invalid review comment.

src/main/java/cc/backend/admin/amateurShow/dto/AdminApprovalListResponseDTO.java (1)

19-19: This review comment is incorrect. The field approvalStatus in AdminApprovalListResponseDTO is not a rename from amateurShowStatus. These are two separate DTOs:

  • AdminApprovalListResponseDTO (the file under review) correctly uses approvalStatus with the implementation calling show.getApprovalStatus().name()
  • AdminAmateurShowListResponseDTO (a different DTO in a different flow) uses amateurShowStatus

There is no breaking change in the code under review. The field naming is consistent throughout the approval workflow (service and controller both use approvalStatus correctly).

Likely an incorrect or invalid review comment.

src/main/java/cc/backend/amateurShow/dto/AmateurShowResponseDTO.java (1)

109-122: LGTM! Rejection reason properly integrated into performer's show list.

The rejectReason field is correctly added to MyShowAmateurShowList and is being populated from the entity via AmateurServiceImpl.getMyAmateurShow() (line 604). The entity has proper getter/setter methods and rejection logic, with the reject() method appropriately setting both status and reason. Nullable String type and placement after status are appropriate.

src/main/java/cc/backend/admin/amateurShow/service/AdminApprovalService.java (1)

70-82: Semantic improvement: approval status separated from show status.

The refactor from getStatus() to getApprovalStatus() correctly distinguishes approval workflow state (WAITING/APPROVED/REJECTED) from show lifecycle state (YET/ONGOING/COMPLETED). The field approvalStatus in AdminApprovalListResponseDTO is properly defined and the method call is valid through Lombok's generated getter.

Comment on lines 160 to 169
public void approve(){
this.approvalStatus = ApprovalStatus.APPROVED;
this.status = AmateurShowStatus.YET;
}
public void reject(String rejectReason){
this.approvalStatus = ApprovalStatus.REJECTED;
this.status = AmateurShowStatus.REJECT;
this.rejectReason = rejectReason;

}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

Critical: Unconditional status transitions may corrupt lifecycle state.

The approve() and reject() methods unconditionally set the status field without considering its current value:

  • approve() always sets status = YET, even if the show is already ONGOING or ENDED
  • reject() always sets status = REJECT, regardless of current state

Potential issues:

  1. If an admin approves a show that has already started (ONGOING), it gets reset to YET
  2. If an admin processes approval/rejection for a show after it ended, the temporal state is lost
  3. Status transitions don't follow a proper state machine pattern

Recommendations:

  • Consider whether status should be updated at all during approval/rejection, since approvalStatus already tracks approval state
  • If status must change, add guards to prevent invalid transitions
  • Document the intended relationship between status and approvalStatus
  • Consider whether approval/rejection should only be allowed when status is YET
🔒 Suggested defensive logic
 public void approve(){
     this.approvalStatus = ApprovalStatus.APPROVED;
-    this.status = AmateurShowStatus.YET;
+    // Only set status to YET if not already in a more advanced state
+    if (this.status != AmateurShowStatus.ONGOING && this.status != AmateurShowStatus.ENDED) {
+        this.status = AmateurShowStatus.YET;
+    }
 }
 public void reject(String rejectReason){
     this.approvalStatus = ApprovalStatus.REJECTED;
-    this.status = AmateurShowStatus.REJECT;
+    // Only set status to REJECT if not already ended
+    if (this.status != AmateurShowStatus.ENDED) {
+        this.status = AmateurShowStatus.REJECT;
+    }
     this.rejectReason = rejectReason;
-
 }
🤖 Prompt for AI Agents
In @src/main/java/cc/backend/amateurShow/entity/AmateurShow.java around lines
160 - 169, The approve() and reject(String) methods unconditionally overwrite
the lifecycle field status (AmateurShowStatus) which can corrupt state; update
approve() and reject() to only change approvalStatus while either (a) not
modifying status at all, or (b) guarding status mutations so they only occur
from an allowed prior state (e.g., only change status when current status ==
AmateurShowStatus.YET), and reject attempts from invalid states by throwing an
IllegalStateException or returning a boolean result; ensure these guards live in
the approve() and reject() methods and document the intended relationship
between status and approvalStatus in the method Javadoc.

@yhi9839 yhi9839 merged commit 1896b40 into develop Jan 8, 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