@@ -500,8 +500,8 @@ private Plan findPlanWithOwnerCheck(Long planId, User user) {
500500 }
501501
502502 /**
503- * Plan을 조회하고 수정/삭제 권한을 체크
504- * OWNER 또는 EDITOR만 수정/삭제 가능
503+ * Plan을 조회하고 수정 권한을 체크
504+ * OWNER 또는 EDITOR만 수정 가능 (계획 수정, 일정 추가/수정/삭제, 참가자 관리 등)
505505 *
506506 * @param planId 계획 ID
507507 * @param user 현재 로그인한 사용자
@@ -1091,8 +1091,9 @@ public void kickParticipant(Long planId, Long participantId, User user) {
10911091 throw new BusinessException (PlanErrorCode .CANNOT_REMOVE_OWNER );
10921092 }
10931093
1094- // 상태를 REMOVED로 변경
1095- participant .updateInviteStatus (PlanParticipant .InviteStatus .REMOVED );
1094+ // 참가자 삭제 (Plan의 participants 리스트에서도 제거)
1095+ plan .removeParticipant (participant );
1096+ planParticipantRepository .delete (participant );
10961097 }
10971098
10981099 /**
@@ -1119,9 +1120,9 @@ public void quitPlan(Long planId, User user) {
11191120 .findByUser_IdAndPlan_PlanId (user .getId (), planId )
11201121 .orElseThrow (() -> new BusinessException (PlanErrorCode .PARTICIPANT_NOT_FOUND ));
11211122
1122- // 상태를 LEFT로 변경
1123- participant . updateInviteStatus ( PlanParticipant . InviteStatus . LEFT );
1124- planParticipantRepository .save (participant );
1123+ // 참가자 삭제 (Plan의 participants 리스트에서도 제거)
1124+ plan . removeParticipant ( participant );
1125+ planParticipantRepository .delete (participant );
11251126 // 명시적으로 flush하여 OptimisticLockException을 즉시 감지
11261127 planParticipantRepository .flush ();
11271128 } catch (OptimisticLockException e ) {
0 commit comments