Skip to content

Commit

Permalink
RAC-254 feat: 멘토링 취소 시 payment 상태 CANCEL 로 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
ay-eonii committed Jan 15, 2024
1 parent 2aa8d97 commit da99c2d
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
import com.postgraduate.domain.mentoring.domain.service.MentoringUpdateService;
import com.postgraduate.domain.mentoring.exception.MentoringNotExpectedException;
import com.postgraduate.domain.mentoring.exception.MentoringNotWaitingException;
import com.postgraduate.domain.payment.domain.entity.Payment;
import com.postgraduate.domain.payment.domain.entity.constant.Status;
import com.postgraduate.domain.payment.domain.service.PaymentGetService;
import com.postgraduate.domain.payment.domain.service.PaymentUpdateService;
import com.postgraduate.domain.refuse.application.dto.req.MentoringRefuseRequest;
import com.postgraduate.domain.refuse.application.mapper.RefuseMapper;
import com.postgraduate.domain.refuse.domain.entity.Refuse;
Expand Down Expand Up @@ -43,12 +47,16 @@ public class MentoringManageUseCase {
private final SeniorGetService seniorGetService;
private final SalaryGetService salaryGetService;
private final SalaryUpdateService salaryUpdateService;
private final PaymentGetService paymentGetService;
private final PaymentUpdateService paymentUpdateService;

public void updateCancel(User user, Long mentoringId) {
Mentoring mentoring = checkIsMyMentoringUseCase.byUser(user, mentoringId);
if (mentoring.getStatus() != WAITING)
throw new MentoringNotWaitingException();
mentoringUpdateService.updateStatus(mentoring, CANCEL);
Payment payment = paymentGetService.byMentoring(mentoring);
paymentUpdateService.updateStatus(payment, Status.CANCEL);
}

public void updateDone(User user, Long mentoringId) {
Expand Down

0 comments on commit da99c2d

Please sign in to comment.