From b32895a4ba5411391476a7119f131c233d3273d3 Mon Sep 17 00:00:00 2001 From: hyotatoFrappuccino Date: Mon, 1 Sep 2025 14:04:15 +0900 Subject: [PATCH 1/5] =?UTF-8?q?refactor:=20=EB=A9=94=EC=84=9C=EB=93=9C?= =?UTF-8?q?=EB=AA=85=20=ED=86=B5=EC=9D=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../applicationform/service/ApplicationFormService.java | 4 ++-- .../service/ApplicationFormDocumentService.java | 6 +++--- .../jobnote/domain/document/service/DocumentService.java | 2 +- .../applicationform/service/ApplicationFormServiceTest.java | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/jobnote/domain/applicationform/service/ApplicationFormService.java b/src/main/java/com/jobnote/domain/applicationform/service/ApplicationFormService.java index 06a82ac..4c1a661 100644 --- a/src/main/java/com/jobnote/domain/applicationform/service/ApplicationFormService.java +++ b/src/main/java/com/jobnote/domain/applicationform/service/ApplicationFormService.java @@ -38,7 +38,7 @@ public ApplicationFormResponse getById(final Long userId, final Long formId) { form.validateOwner(userId); List schedules = scheduleService.getAllByApplicationFormId(userId, formId); - List documents = applicationFormDocumentService.getSimpleResponsesByApplicationFormId(userId, formId); + List documents = applicationFormDocumentService.getAllSimpleByApplicationFormId(userId, formId); return ApplicationFormResponse.from(form, schedules, documents); } @@ -48,7 +48,7 @@ public Page getAll(final Long userId, final Pageable pa List formIds = forms.map(ApplicationForm::getId).toList(); Map> schedulesByFormId = scheduleService.getAllGroupedByApplicationFormIds(userId, formIds); - Map> documentsByFormId = applicationFormDocumentService.getSimpleResponsesGroupedByApplicationFormIds(userId, formIds); + Map> documentsByFormId = applicationFormDocumentService.getAllSimpleGroupedByApplicationFormIds(userId, formIds); return forms.map(form -> ApplicationFormResponse.from( form, diff --git a/src/main/java/com/jobnote/domain/applicationformdocument/service/ApplicationFormDocumentService.java b/src/main/java/com/jobnote/domain/applicationformdocument/service/ApplicationFormDocumentService.java index 9262440..f4c6528 100644 --- a/src/main/java/com/jobnote/domain/applicationformdocument/service/ApplicationFormDocumentService.java +++ b/src/main/java/com/jobnote/domain/applicationformdocument/service/ApplicationFormDocumentService.java @@ -34,19 +34,19 @@ public List getAllByApplicationFormId(final Long userId return applicationFormDocumentRepository.findAllByUserIdAndApplicationFormIdIn(userId, List.of(formId)); } - public List getSimpleResponsesByDocumentId(final Long userId, final Long documentId) { + public List getAllSimpleByDocumentId(final Long userId, final Long documentId) { return applicationFormDocumentRepository.findAllByUserIdAndDocumentId(userId, documentId).stream() .map(afd -> ApplicationFormSimpleResponse.from(afd.getApplicationForm())) .toList(); } - public List getSimpleResponsesByApplicationFormId(final Long userId, final Long formId) { + public List getAllSimpleByApplicationFormId(final Long userId, final Long formId) { return applicationFormDocumentRepository.findAllByUserIdAndApplicationFormIdIn(userId, List.of(formId)).stream() .map(afd -> DocumentSimpleResponse.from(afd.getDocument())) .toList(); } - public Map> getSimpleResponsesGroupedByApplicationFormIds(final Long userId, final List formIds) { + public Map> getAllSimpleGroupedByApplicationFormIds(final Long userId, final List formIds) { List list = applicationFormDocumentRepository.findAllByUserIdAndApplicationFormIdIn(userId, formIds); return list.stream() diff --git a/src/main/java/com/jobnote/domain/document/service/DocumentService.java b/src/main/java/com/jobnote/domain/document/service/DocumentService.java index 0803b07..d9decd7 100644 --- a/src/main/java/com/jobnote/domain/document/service/DocumentService.java +++ b/src/main/java/com/jobnote/domain/document/service/DocumentService.java @@ -56,7 +56,7 @@ public Page getAll(final Long userId, final Pageable pageable) DocumentResponse.of( document, documentVersionRepository.findLatestVersionByDocumentId(document.getId()), - applicationFormDocumentService.getSimpleResponsesByDocumentId(userId, document.getId()) + applicationFormDocumentService.getAllSimpleByDocumentId(userId, document.getId()) )); } diff --git a/src/test/java/com/jobnote/domain/applicationform/service/ApplicationFormServiceTest.java b/src/test/java/com/jobnote/domain/applicationform/service/ApplicationFormServiceTest.java index d8ce519..2d3ba70 100644 --- a/src/test/java/com/jobnote/domain/applicationform/service/ApplicationFormServiceTest.java +++ b/src/test/java/com/jobnote/domain/applicationform/service/ApplicationFormServiceTest.java @@ -159,7 +159,7 @@ void getAllApplicationForms_withDocuments() { DocumentSimpleResponse document2 = new DocumentSimpleResponse(102L, DocumentType.COVER_LETTER, "네이버 자소서"); DocumentSimpleResponse document3 = new DocumentSimpleResponse(103L, DocumentType.RESUME, "카카오 이력서"); - given(applicationFormDocumentService.getSimpleResponsesGroupedByApplicationFormIds(eq(userId), eq(List.of(1L, 2L)))) + given(applicationFormDocumentService.getAllSimpleGroupedByApplicationFormIds(eq(userId), eq(List.of(1L, 2L)))) .willReturn(Map.of( 1L, List.of(document1, document2), 2L, List.of(document3) @@ -182,7 +182,7 @@ void getAllApplicationForms_withDocuments() { assertThat(result2.documents().get(0).title()).isEqualTo("카카오 이력서"); then(applicationFormRepository).should().findAllByUserId(eq(userId), any(Pageable.class)); - then(applicationFormDocumentService).should().getSimpleResponsesGroupedByApplicationFormIds(eq(userId), eq(List.of(1L, 2L))); + then(applicationFormDocumentService).should().getAllSimpleGroupedByApplicationFormIds(eq(userId), eq(List.of(1L, 2L))); } @Nested From c4fafdbea8ce9449298452c6d6e8b1d6e14e0f70 Mon Sep 17 00:00:00 2001 From: hyotatoFrappuccino Date: Mon, 1 Sep 2025 14:26:20 +0900 Subject: [PATCH 2/5] =?UTF-8?q?refactor:=20=EB=B6=88=ED=95=84=EC=9A=94?= =?UTF-8?q?=ED=95=9C=20=EA=B2=80=EC=A6=9D=20=EC=82=AD=EC=A0=9C,=20?= =?UTF-8?q?=ED=95=84=EC=9A=94=ED=95=9C=20=EA=B2=80=EC=A6=9D=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/ApplicationFormService.java | 10 ++++++++-- .../service/ApplicationFormDocumentService.java | 6 ++++-- .../domain/schedule/service/ScheduleService.java | 4 +--- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/jobnote/domain/applicationform/service/ApplicationFormService.java b/src/main/java/com/jobnote/domain/applicationform/service/ApplicationFormService.java index 4c1a661..7b64ec0 100644 --- a/src/main/java/com/jobnote/domain/applicationform/service/ApplicationFormService.java +++ b/src/main/java/com/jobnote/domain/applicationform/service/ApplicationFormService.java @@ -47,6 +47,7 @@ public Page getAll(final Long userId, final Pageable pa Page forms = applicationFormRepository.findAllByUserId(userId, pageable); List formIds = forms.map(ApplicationForm::getId).toList(); + // 각 지원서에 대한 일정, 등록된 문서 목록 생성 Map> schedulesByFormId = scheduleService.getAllGroupedByApplicationFormIds(userId, formIds); Map> documentsByFormId = applicationFormDocumentService.getAllSimpleGroupedByApplicationFormIds(userId, formIds); @@ -66,10 +67,10 @@ public Long save(final Long userId, final ApplicationFormRequest request) { ApplicationForm form = applicationFormRepository.save(request.toEntity(user)); // 일정 등록 - scheduleService.saveAll(userId, form, request.schedules()); + scheduleService.saveAll(form, request.schedules()); // 연결된 문서 등록 - applicationFormDocumentService.saveAll(form, request.documents()); + applicationFormDocumentService.saveAll(userId, form, request.documents()); return form.getId(); } @@ -96,8 +97,13 @@ public void delete(final Long userId, final Long formId) { ApplicationForm form = getByIdOrThrow(formId); form.validateOwner(userId); + // 일정 삭제 scheduleService.deleteAllByApplicationFormId(form.getId()); + + // 연결된 문서 삭제 applicationFormDocumentService.deleteAllByApplicationFormId(form.getId()); + + // 지원서 삭제 applicationFormRepository.delete(form); } diff --git a/src/main/java/com/jobnote/domain/applicationformdocument/service/ApplicationFormDocumentService.java b/src/main/java/com/jobnote/domain/applicationformdocument/service/ApplicationFormDocumentService.java index f4c6528..f860175 100644 --- a/src/main/java/com/jobnote/domain/applicationformdocument/service/ApplicationFormDocumentService.java +++ b/src/main/java/com/jobnote/domain/applicationformdocument/service/ApplicationFormDocumentService.java @@ -63,9 +63,11 @@ public Map> getAllSimpleGroupedByApplicationF /* CREATE */ @Transactional - public void saveAll(final ApplicationForm form, final List requests) { + public void saveAll(final Long userId, final ApplicationForm form, final List requests) { for (ApplicationFormDocumentRequest request : requests) { Document document = getByIdOrThrow(request.documentId()); + document.validateOwner(userId); + ApplicationFormDocument entity = request.toEntity(form, document); applicationFormDocumentRepository.save(entity); } @@ -93,7 +95,7 @@ public void updateAll(final Long userId, final ApplicationForm form, final List< // 신규 생성 for (ApplicationFormDocumentRequest req : requests) { if (req.id() == null) { - saveAll(form, List.of(req)); + saveAll(userId, form, List.of(req)); } } } diff --git a/src/main/java/com/jobnote/domain/schedule/service/ScheduleService.java b/src/main/java/com/jobnote/domain/schedule/service/ScheduleService.java index a193f63..245154b 100644 --- a/src/main/java/com/jobnote/domain/schedule/service/ScheduleService.java +++ b/src/main/java/com/jobnote/domain/schedule/service/ScheduleService.java @@ -70,9 +70,7 @@ public Long save(final Long userId, final ApplicationForm form, final ScheduleRe } @Transactional - public void saveAll(final Long userId, final ApplicationForm form, final List requests) { - form.validateOwner(userId); - + public void saveAll(final ApplicationForm form, final List requests) { List schedules = requests.stream() .map(req -> req.toEntity(form)) .toList(); From 06e02efa06ae1c8d8f8b1b718423db6ef92a2c3b Mon Sep 17 00:00:00 2001 From: hyotatoFrappuccino Date: Mon, 1 Sep 2025 14:28:21 +0900 Subject: [PATCH 3/5] =?UTF-8?q?refactor:=20=EC=B1=85=EC=9E=84=20=EB=B6=84?= =?UTF-8?q?=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/schedule/controller/ScheduleController.java | 7 +------ .../jobnote/domain/schedule/service/ScheduleService.java | 5 ++++- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/jobnote/domain/schedule/controller/ScheduleController.java b/src/main/java/com/jobnote/domain/schedule/controller/ScheduleController.java index 10401ef..c8a1123 100644 --- a/src/main/java/com/jobnote/domain/schedule/controller/ScheduleController.java +++ b/src/main/java/com/jobnote/domain/schedule/controller/ScheduleController.java @@ -2,8 +2,6 @@ import com.jobnote.auth.config.LoginUser; import com.jobnote.auth.dto.CustomUserDetails; -import com.jobnote.domain.applicationform.domain.ApplicationForm; -import com.jobnote.domain.applicationform.service.ApplicationFormService; import com.jobnote.domain.schedule.api.ScheduleApi; import com.jobnote.domain.schedule.dto.ScheduleRequest; import com.jobnote.domain.schedule.dto.ScheduleResponse; @@ -24,7 +22,6 @@ public class ScheduleController implements ScheduleApi { private final ScheduleService scheduleService; - private final ApplicationFormService applicationFormService; /* CREATE */ @Override @@ -34,9 +31,7 @@ public ResponseEntity> createSchedule( @RequestBody @Valid final ScheduleRequest request, @LoginUser final CustomUserDetails principal ) { - ApplicationForm form = applicationFormService.getByIdOrThrow(formId); - - Long savedScheduleId = scheduleService.save(principal.getUserId(), form, request); + Long savedScheduleId = scheduleService.save(principal.getUserId(), formId, request); URI location = ServletUriComponentsBuilder.fromCurrentRequest().path("/{id}").buildAndExpand(savedScheduleId).toUri(); diff --git a/src/main/java/com/jobnote/domain/schedule/service/ScheduleService.java b/src/main/java/com/jobnote/domain/schedule/service/ScheduleService.java index 245154b..cef7541 100644 --- a/src/main/java/com/jobnote/domain/schedule/service/ScheduleService.java +++ b/src/main/java/com/jobnote/domain/schedule/service/ScheduleService.java @@ -1,6 +1,7 @@ package com.jobnote.domain.schedule.service; import com.jobnote.domain.applicationform.domain.ApplicationForm; +import com.jobnote.domain.applicationform.service.ApplicationFormService; import com.jobnote.domain.schedule.domain.Schedule; import com.jobnote.domain.schedule.dto.ScheduleRequest; import com.jobnote.domain.schedule.dto.ScheduleResponse; @@ -27,6 +28,7 @@ public class ScheduleService { private final ScheduleRepository scheduleRepository; + private final ApplicationFormService applicationFormService; /* READ */ public ScheduleResponse getById(final Long userId, final Long formId, final Long scheduleId) { @@ -62,7 +64,8 @@ public Map> getAllGroupedByApplicationFormIds(final /* CREATE */ @Transactional - public Long save(final Long userId, final ApplicationForm form, final ScheduleRequest request) { + public Long save(final Long userId, final Long formId, final ScheduleRequest request) { + ApplicationForm form = applicationFormService.getByIdOrThrow(formId); form.validateOwner(userId); Schedule saved = scheduleRepository.save(request.toEntity(form)); From 0a1eff26dfb18213abafe29c6d2a5adc107d3e9b Mon Sep 17 00:00:00 2001 From: hyotatoFrappuccino Date: Mon, 1 Sep 2025 15:02:41 +0900 Subject: [PATCH 4/5] =?UTF-8?q?docs:=20=EC=A3=BC=EC=84=9D=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/ApplicationFormDocumentService.java | 4 ++++ .../jobnote/domain/document/service/DocumentService.java | 8 ++++++-- .../jobnote/domain/schedule/service/ScheduleService.java | 3 +++ .../annotation/swagger/ApiErrorResponseExplanation.java | 1 + .../annotation/swagger/ApiResponseExplanations.java | 1 + .../annotation/swagger/ApiSuccessResponseExplanation.java | 1 + .../global/annotation/swagger/PageableAsQueryParam.java | 1 + 7 files changed, 17 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/jobnote/domain/applicationformdocument/service/ApplicationFormDocumentService.java b/src/main/java/com/jobnote/domain/applicationformdocument/service/ApplicationFormDocumentService.java index f860175..bfbe284 100644 --- a/src/main/java/com/jobnote/domain/applicationformdocument/service/ApplicationFormDocumentService.java +++ b/src/main/java/com/jobnote/domain/applicationformdocument/service/ApplicationFormDocumentService.java @@ -30,22 +30,26 @@ public class ApplicationFormDocumentService { private final DocumentRepository documentRepository; /* READ */ + // 해당 지원서의 등록된 문서 목록 반환 public List getAllByApplicationFormId(final Long userId, final Long formId) { return applicationFormDocumentRepository.findAllByUserIdAndApplicationFormIdIn(userId, List.of(formId)); } + // 해당 문서와 연결된 지원서 목록 반환 public List getAllSimpleByDocumentId(final Long userId, final Long documentId) { return applicationFormDocumentRepository.findAllByUserIdAndDocumentId(userId, documentId).stream() .map(afd -> ApplicationFormSimpleResponse.from(afd.getApplicationForm())) .toList(); } + // 해당 지원서와 연결된 문서 목록 반환 public List getAllSimpleByApplicationFormId(final Long userId, final Long formId) { return applicationFormDocumentRepository.findAllByUserIdAndApplicationFormIdIn(userId, List.of(formId)).stream() .map(afd -> DocumentSimpleResponse.from(afd.getDocument())) .toList(); } + // 각 지원서에 대한 등록된 문서 목록 반환 public Map> getAllSimpleGroupedByApplicationFormIds(final Long userId, final List formIds) { List list = applicationFormDocumentRepository.findAllByUserIdAndApplicationFormIdIn(userId, formIds); diff --git a/src/main/java/com/jobnote/domain/document/service/DocumentService.java b/src/main/java/com/jobnote/domain/document/service/DocumentService.java index d9decd7..ea591c7 100644 --- a/src/main/java/com/jobnote/domain/document/service/DocumentService.java +++ b/src/main/java/com/jobnote/domain/document/service/DocumentService.java @@ -77,9 +77,13 @@ public void delete(final Long userId, final Long documentId) { s3Service.deleteFile(documentVersion.getFileKey()); } - // 엔티티 삭제 - documentVersionRepository.deleteAllByDocumentId(documentId); + // 맵핑 엔티티 삭제 applicationFormDocumentService.deleteAllByDocumentId(documentId); + + // 개별 문서 삭제 + documentVersionRepository.deleteAllByDocumentId(documentId); + + // 문서 삭제 documentRepository.delete(document); } diff --git a/src/main/java/com/jobnote/domain/schedule/service/ScheduleService.java b/src/main/java/com/jobnote/domain/schedule/service/ScheduleService.java index cef7541..9e46370 100644 --- a/src/main/java/com/jobnote/domain/schedule/service/ScheduleService.java +++ b/src/main/java/com/jobnote/domain/schedule/service/ScheduleService.java @@ -39,17 +39,20 @@ public ScheduleResponse getById(final Long userId, final Long formId, final Long return ScheduleResponse.from(schedule); } + // 해당 기간의 일정 목록 반환 public Page getAll(final Long userId, final LocalDateTime startDate, final LocalDateTime endDate, final Pageable pageable) { return scheduleRepository.findAllByUserIdAndDateTimeBetween(userId, startDate, endDate, pageable) .map(ScheduleResponse::from); } + // 해당 지원서의 일정 목록 반환 public List getAllByApplicationFormId(final Long userId, final Long formId) { return scheduleRepository.findAllByUserIdAndApplicationFormIdIn(userId, List.of(formId)).stream() .map(ScheduleResponse::from) .toList(); } + // 각 지원서의 일정 목록 반환 public Map> getAllGroupedByApplicationFormIds(final Long userId, final List formIds) { List schedules = scheduleRepository.findAllByUserIdAndApplicationFormIdIn(userId, formIds); diff --git a/src/main/java/com/jobnote/global/annotation/swagger/ApiErrorResponseExplanation.java b/src/main/java/com/jobnote/global/annotation/swagger/ApiErrorResponseExplanation.java index 4b5dcf1..401439e 100644 --- a/src/main/java/com/jobnote/global/annotation/swagger/ApiErrorResponseExplanation.java +++ b/src/main/java/com/jobnote/global/annotation/swagger/ApiErrorResponseExplanation.java @@ -7,6 +7,7 @@ import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; +/* 예외 응답 정의 */ @Target(ElementType.METHOD) @Retention(RetentionPolicy.RUNTIME) public @interface ApiErrorResponseExplanation { diff --git a/src/main/java/com/jobnote/global/annotation/swagger/ApiResponseExplanations.java b/src/main/java/com/jobnote/global/annotation/swagger/ApiResponseExplanations.java index 125450d..9960abc 100644 --- a/src/main/java/com/jobnote/global/annotation/swagger/ApiResponseExplanations.java +++ b/src/main/java/com/jobnote/global/annotation/swagger/ApiResponseExplanations.java @@ -5,6 +5,7 @@ import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; +/* 성공, 예외 응답 정의 */ @Target(ElementType.METHOD) @Retention(RetentionPolicy.RUNTIME) public @interface ApiResponseExplanations { diff --git a/src/main/java/com/jobnote/global/annotation/swagger/ApiSuccessResponseExplanation.java b/src/main/java/com/jobnote/global/annotation/swagger/ApiSuccessResponseExplanation.java index 5e7279d..3feb867 100644 --- a/src/main/java/com/jobnote/global/annotation/swagger/ApiSuccessResponseExplanation.java +++ b/src/main/java/com/jobnote/global/annotation/swagger/ApiSuccessResponseExplanation.java @@ -7,6 +7,7 @@ import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; +/* 성공 응답 형식 정의 */ @Target(ElementType.METHOD) @Retention(RetentionPolicy.RUNTIME) public @interface ApiSuccessResponseExplanation { diff --git a/src/main/java/com/jobnote/global/annotation/swagger/PageableAsQueryParam.java b/src/main/java/com/jobnote/global/annotation/swagger/PageableAsQueryParam.java index c63613a..968c1e6 100644 --- a/src/main/java/com/jobnote/global/annotation/swagger/PageableAsQueryParam.java +++ b/src/main/java/com/jobnote/global/annotation/swagger/PageableAsQueryParam.java @@ -11,6 +11,7 @@ import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; +/* org.springdoc.core.converters.models.PageableAsQueryParam 한글 버전 재정의 */ @Target({ElementType.METHOD, ElementType.ANNOTATION_TYPE}) @Retention(RetentionPolicy.RUNTIME) @Parameters({ From f1145a2c012bb7c6ccf218beaec632d539c96289 Mon Sep 17 00:00:00 2001 From: hyotatoFrappuccino Date: Mon, 1 Sep 2025 15:54:08 +0900 Subject: [PATCH 5/5] =?UTF-8?q?fix:=20=EC=88=9C=ED=99=98=20=EC=B0=B8?= =?UTF-8?q?=EC=A1=B0=20=ED=95=B4=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../jobnote/domain/schedule/service/ScheduleService.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/jobnote/domain/schedule/service/ScheduleService.java b/src/main/java/com/jobnote/domain/schedule/service/ScheduleService.java index 9e46370..38a7622 100644 --- a/src/main/java/com/jobnote/domain/schedule/service/ScheduleService.java +++ b/src/main/java/com/jobnote/domain/schedule/service/ScheduleService.java @@ -1,7 +1,7 @@ package com.jobnote.domain.schedule.service; import com.jobnote.domain.applicationform.domain.ApplicationForm; -import com.jobnote.domain.applicationform.service.ApplicationFormService; +import com.jobnote.domain.applicationform.repository.ApplicationFormRepository; import com.jobnote.domain.schedule.domain.Schedule; import com.jobnote.domain.schedule.dto.ScheduleRequest; import com.jobnote.domain.schedule.dto.ScheduleResponse; @@ -20,6 +20,7 @@ import java.util.Set; import java.util.stream.Collectors; +import static com.jobnote.global.common.ResponseCode.NOT_FOUND_APPLICATION_FORM; import static com.jobnote.global.common.ResponseCode.NOT_FOUND_SCHEDULE; @Service @@ -28,7 +29,7 @@ public class ScheduleService { private final ScheduleRepository scheduleRepository; - private final ApplicationFormService applicationFormService; + private final ApplicationFormRepository applicationFormRepository; /* READ */ public ScheduleResponse getById(final Long userId, final Long formId, final Long scheduleId) { @@ -68,7 +69,8 @@ public Map> getAllGroupedByApplicationFormIds(final /* CREATE */ @Transactional public Long save(final Long userId, final Long formId, final ScheduleRequest request) { - ApplicationForm form = applicationFormService.getByIdOrThrow(formId); + ApplicationForm form = applicationFormRepository.findById(formId) + .orElseThrow(() -> new JobNoteException(NOT_FOUND_APPLICATION_FORM)); form.validateOwner(userId); Schedule saved = scheduleRepository.save(request.toEntity(form));