Skip to content

Commit

Permalink
Merge pull request #151 from WE-ARE-RACCOONS/develop
Browse files Browse the repository at this point in the history
RAC-304 deploy : 운영 반영
  • Loading branch information
ywj9811 authored Mar 3, 2024
2 parents d176809 + 384677c commit cfef00f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -143,11 +143,11 @@ public void updateAutoCancel() {
@Transactional
public void updateCancelWithAuto(Mentoring mentoring) {
try {
Mentoring cancelMentoring = mentoringGetService.byMentoringId(mentoring.getMentoringId());
paymentManageUseCase.refundPayByUser(mentoring.getUser(), mentoring.getPayment().getOrderId());
Mentoring cancelMentoring = mentoringGetService.byMentoringIdWithLazy(mentoring.getMentoringId());
mentoringUpdateService.updateStatus(cancelMentoring, CANCEL);
Refuse refuse = RefuseMapper.mapToRefuse(mentoring);
refuseSaveService.save(refuse);
paymentManageUseCase.refundPayByUser(mentoring.getUser(), mentoring.getPayment().getOrderId());
log.info("mentoringId : {} μžλ™ μ·¨μ†Œ", mentoring.getMentoringId());
} catch (Exception ex) {
log.error("mentoringId : {} μžλ™ μ·¨μ†Œ μ‹€νŒ¨", mentoring.getMentoringId());
Expand Down Expand Up @@ -175,7 +175,7 @@ public void updateAutoDone() {
@Transactional
public void updateDoneWithAuto(Mentoring mentoring) {
try {
Mentoring doneMentoring = mentoringGetService.byMentoringId(mentoring.getMentoringId());
Mentoring doneMentoring = mentoringGetService.byMentoringIdWithLazy(mentoring.getMentoringId());
mentoringUpdateService.updateStatus(doneMentoring, DONE);
Senior senior = mentoring.getSenior();
Salary salary = salaryGetService.bySenior(senior);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ public Mentoring byMentoringId(Long mentoringId) {
.orElseThrow(MentoringNotFoundException::new);
}

public Mentoring byMentoringIdWithLazy(Long mentoringId) {
return mentoringRepository.findById(mentoringId)
.orElseThrow(MentoringNotFoundException::new);
}

public List<Mentoring> byStatusAndCreatedAt(Status status, LocalDateTime now) {
return mentoringRepository.findAllByStatusAndCreatedAtIsBefore(status, now);
}
Expand Down

0 comments on commit cfef00f

Please sign in to comment.