Skip to content

Commit f2d6a79

Browse files
authored
Merge pull request #54 from DayoookE/feat/#39
feat/#39: 강의 승인 로직 수정
2 parents cdf76f5 + 06794c1 commit f2d6a79

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

src/main/java/inha/dayoook_e/application/api/service/ApplicationServiceImpl.java

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -252,10 +252,17 @@ public ApplicationResponse approveApplication(User tutor, Integer applicationGro
252252
}
253253
}
254254

255+
// 7. 현재 그룹 처리
255256
// 7. 현재 그룹 처리
256257
log.info("7. 현재 ApplicationGroup 처리 시작");
258+
259+
// 7.1. Lesson 생성 (반복문 밖으로 이동)
260+
CreateLessonRequest createLessonRequest = lessonMapper.toCreateLessonRequest(applicationGroup);
261+
LessonResponse lessonResponse = lessonService.createLesson(createLessonRequest);
262+
log.info("Lesson 생성 성공 - Lesson ID: {}", lessonResponse.id());
263+
257264
for (Application application : applicationGroup.getApplications()) {
258-
// 7.1. 스케줄 업데이트
265+
// 7.2. 스케줄 업데이트
259266
TutorScheduleId scheduleId = new TutorScheduleId(
260267
tutor.getId(),
261268
application.getDay().getId(),
@@ -265,11 +272,6 @@ public ApplicationResponse approveApplication(User tutor, Integer applicationGro
265272
tutorSchedule.makeUnavailable();
266273
log.info("스케줄 업데이트 완료 - {}", scheduleId);
267274

268-
// 7.2. Lesson 생성료
269-
CreateLessonRequest createLessonRequest = lessonMapper.toCreateLessonRequest(applicationGroup);
270-
LessonResponse lessonResponse = lessonService.createLesson(createLessonRequest);
271-
log.info("Lesson 생성 성공 - Lesson ID: {}", lessonResponse.id());
272-
273275
// 7.3. 상태 변경
274276
application.changeStatus(APPROVED);
275277
log.info("신청 승인 완료 - Application ID: {}", application.getId());

0 commit comments

Comments
 (0)