Skip to content

Commit f9eb6b9

Browse files
committed
Refactor: 세션 종료 시 예약, 슬롯 완료 상태로 변경
1 parent b0d38e2 commit f9eb6b9

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

back/src/main/java/com/back/domain/mentoring/session/service/MentoringSessionManager.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
import com.back.domain.mentoring.reservation.entity.Reservation;
88
import com.back.domain.mentoring.session.dto.*;
99
import com.back.domain.mentoring.session.entity.MentoringSession;
10+
import com.back.domain.mentoring.slot.constant.MentorSlotStatus;
11+
import com.back.domain.mentoring.slot.entity.MentorSlot;
1012
import lombok.RequiredArgsConstructor;
1113
import org.springframework.stereotype.Service;
1214
import org.springframework.transaction.annotation.Transactional;
@@ -49,6 +51,11 @@ public CloseSessionResponse closeSession(Member requestUser, DeleteSessionReques
4951
Mentor mentor = memberStorage.findMentorByMember(requestUser);
5052
MentoringSession session = mentoringSessionService.getMentoringSession(deleteRequest.sessionId());
5153
MentoringSession closedSession = mentoringSessionService.save(session.closeSession(mentor));
54+
55+
Reservation reservation = closedSession.getReservation();
56+
reservation.complete();
57+
MentorSlot slot = reservation.getMentorSlot();
58+
slot.updateStatus(MentorSlotStatus.COMPLETED);
5259
return new CloseSessionResponse(closedSession.getSessionUrl(), closedSession.getMentoring().getTitle(), closedSession.getStatus().toString());
5360
}
5461
}

0 commit comments

Comments
 (0)