Skip to content

feat/KD-48 : Schedule API 구현#285

Closed
dkdltm221 wants to merge 14 commits intodevelopfrom
feat/KD-48
Closed

feat/KD-48 : Schedule API 구현#285
dkdltm221 wants to merge 14 commits intodevelopfrom
feat/KD-48

Conversation

@dkdltm221
Copy link
Copy Markdown
Contributor

Summary

논문 페이지에 들어갈 일정 관련 api 구현 했습니다.

Tasks

  • schedule 조회 api 구현
  • schedule 관리용 api구현

To Reviewer

  • 일정 타입으로 본문 내용을 조회하고
    본문 내용을 수정하도록 기존에 구현 되었다고 해서 일정 타입이 중복 생성되는 것을 막았습니다.
  • 일정 조회시 시작일자와 종료 일자,일정 타입, 일정 이름이 조회됩니다.

@dkdltm221 dkdltm221 self-assigned this Nov 16, 2025
@dkdltm221 dkdltm221 added the ✨feature create new feature label Nov 16, 2025
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Nov 16, 2025

Walkthrough

일정 관리 기능을 위한 관리자 API 레이어(페이드, 컨트롤러, 요청/응답 DTO)와 일반 사용자 조회 API 레이어를 추가합니다. 도메인 서비스에 중복 타입 검증 및 존재 여부 확인 로직을 포함시킵니다.

Changes

코호트 / 파일 변경 요약
관리자 일정 관리 - 애플리케이션 계층
aics-admin/src/main/java/kgu/developers/admin/schedule/application/ScheduleAdminFacade.java
일정 생성, 수정, 내용 업데이트, 삭제를 위한 공개 메서드를 노출하는 Spring 컴포넌트 페이드 추가
관리자 일정 관리 - 프레젠테이션 인터페이스
aics-admin/src/main/java/kgu/developers/admin/schedule/presentation/ScheduleAdminController.java
CRUD 스타일 엔드포인트를 정의하는 공개 인터페이스 추가 (생성, 수정, 내용 업데이트, 삭제)
관리자 일정 관리 - 프레젠테이션 구현
aics-admin/src/main/java/kgu/developers/admin/schedule/presentation/ScheduleAdminControllerImpl.java
/api/v1/admin/schedules 경로 하에 네 개의 REST 엔드포인트를 구현하는 컨트롤러 추가
관리자 일정 관리 - 요청 DTO
aics-admin/src/main/java/kgu/developers/admin/schedule/presentation/request/ScheduleCreateRequest.java, ScheduleUpdateRequest.java, ScheduleContentUpdateRequest.java
일정 생성, 수정, 내용 업데이트를 위한 검증이 포함된 요청 DTO 레코드 추가 (날짜 범위 검증 포함)
관리자 일정 관리 - 응답 DTO
aics-admin/src/main/java/kgu/developers/admin/schedule/presentation/response/SchedulePersistResponse.java
일정 ID를 반환하는 응답 DTO 레코드 및 팩토리 메서드 추가
API 조회 - 애플리케이션 계층
aics-api/src/main/java/kgu/developers/api/schedule/application/ScheduleFacade.java
일정 조회 연산을 위임하는 읽기 전용 Spring 컴포넌트 페이드 추가
API 조회 - 프레젠테이션 인터페이스
aics-api/src/main/java/kgu/developers/api/schedule/presentation/ScheduleController.java
일정 목록, 타입별, ID별 조회를 위한 공개 인터페이스 추가
API 조회 - 프레젠테이션 구현
aics-api/src/main/java/kgu/developers/api/schedule/presentation/ScheduleControllerImpl.java
/api/v1/schedules 경로 하에 세 개의 GET 엔드포인트를 구현하는 컨트롤러 추가
API 조회 - 응답 DTO
aics-api/src/main/java/kgu/developers/api/schedule/presentation/response/ScheduleListResponse.java, ScheduleSummaryResponse.java, ScheduleTypeContentResponse.java
일정 조회 결과 반환을 위한 응답 DTO 레코드 및 팩토리 메서드 추가
도메인 검증 로직
aics-domain/src/main/java/kgu/developers/domain/schedule/application/command/ScheduleService.java
수정 시 중복 제출 타입 검증 및 삭제 시 존재 여부 확인 로직 추가
포매팅 변경
aics-domain/src/main/java/kgu/developers/domain/club/domain/Club.java, aics-domain/src/main/java/kgu/developers/domain/lab/domain/Lab.java
빌더 호출 들여쓰기 조정 (기능 변경 없음)

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20-25 minutes

  • 주의 필요 영역:
    • ScheduleService의 중복 타입 검증 로직: 제출 타입 변경 시 현재 일정을 제외한 기존 일정 검사 및 예외 처리 확인 필요
    • ScheduleService의 존재 여부 검사: ScheduleNotFoundException 예외 발생 조건 검증 필요
    • 요청 DTO의 날짜 범위 검증: @AssertTrue를 사용한 isValidDateRange() 메서드의 null 처리 및 검증 로직 확인 필요
    • 응답 DTO의 날짜 포매팅: ScheduleSummaryResponse에서 "yyyy-MM-dd" 포매팅이 모든 경우에 올바르게 적용되는지 확인 필요
    • 트랜잭션 경계: @Transactional 어노테이션이 수정 연산에만 올바르게 적용되었는지 확인 필요

Possibly related PRs

  • PR #277: 이번 PR이 수정하는 ScheduleService 동작 및 관리자/API 페이드와 컨트롤러를 추가하는 것과 관련하여, 해당 PR에서는 초기 ScheduleService 및 일정 도메인/저장소/엔티티를 도입합니다.

Suggested reviewers

  • LeeHanEum
  • JangYeongHu

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed Pull request title clearly and specifically summarizes the main change: implementing schedule API with feature indicator and ticket reference (KD-48).
Description check ✅ Passed Pull request description is directly related to the changeset, explaining schedule API implementation, retrieval/management APIs, and duplicate type prevention logic.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/KD-48

Tip

📝 Customizable high-level summaries are now available!

You can now customize how CodeRabbit generates the high-level summary in your pull requests — including its content, structure, tone, and formatting.

  • Provide custom instructions to shape the summary (bullet lists, tables, contributor stats, etc.).
  • Use high_level_summary_in_walkthrough to move the summary from the description to the walkthrough section.

Example:

"Create a concise high-level summary as a bullet-point list. Then include a Markdown table showing lines added and removed by each contributing author."


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@dkdltm221 dkdltm221 linked an issue Nov 16, 2025 that may be closed by this pull request
2 tasks
@github-actions
Copy link
Copy Markdown

Test Coverage Report

Overall Project 79.22% -4.65%
Files changed 15%

Module Coverage
aics-api 94.21% -5.41%
aics-admin 84.15% -15.85%
aics-domain 74.1% -2.4%
Files
Module File Coverage
aics-api ScheduleFacade.java 0%
aics-admin ScheduleAdminFacade.java 0%
aics-domain Club.java 100% 🍏
Lab.java 100% 🍏
ScheduleService.java 0% -39.56%

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

♻️ Duplicate comments (1)
aics-api/src/main/java/kgu/developers/api/schedule/presentation/ScheduleControllerImpl.java (1)

32-35: ScheduleFacade의 메서드 이름 수정 후 이 호출도 업데이트하세요.

findBySubmissionTyp 메서드 호출이 있습니다. ScheduleFacade의 메서드 이름이 findBySubmissionType으로 수정되면 이 호출도 함께 업데이트해야 합니다.

🧹 Nitpick comments (5)
aics-api/src/main/java/kgu/developers/api/schedule/presentation/response/ScheduleListResponse.java (1)

28-32: from 팩토리의 null‑방어와 자잘한 포맷팅 제안

  • from(List<Schedule> schedules, LocalDateTime referenceTime)에서 schedulesnull이면 NPE가 발생할 수 있습니다. 상위 계층에서 항상 빈 리스트를 넘긴다는 계약이라면 괜찮지만, 방어적으로 한 번 감싸 두는 것도 고려해 볼 만합니다.
  • 또한 파라미터/람다 인자 사이 공백(schedules,LocalDateTime, schedule,referenceTime)만 정리해 두면 가독성이 조금 더 좋아질 것 같습니다.

예시:

-    public static ScheduleListResponse from(List<Schedule> schedules,LocalDateTime referenceTime) {
-        return ScheduleListResponse.builder()
-                .contents(schedules.stream()
-                        .map(schedule -> ScheduleSummaryResponse.from(schedule,referenceTime))
-                        .toList())
+    public static ScheduleListResponse from(List<Schedule> schedules, LocalDateTime referenceTime) {
+        List<Schedule> safeSchedules = schedules == null ? List.of() : schedules;
+        return ScheduleListResponse.builder()
+                .contents(safeSchedules.stream()
+                        .map(schedule -> ScheduleSummaryResponse.from(schedule, referenceTime))
+                        .toList())
                 .build();
     }
aics-domain/src/main/java/kgu/developers/domain/schedule/application/command/ScheduleService.java (1)

30-35: 중복 타입 검증과 삭제 시 존재 여부 확인은 적절합니다 (삭제 쿼리 최적화 소소 제안)

  • updateSchedule에서 기존 타입과 다른 경우에만 findBySubmissionType으로 중복 여부를 확인하고, id가 같은 엔티티는 제외하는 방식이 의도(다른 스케줄과 타입 중복 방지)에 잘 맞습니다.
  • deleteSchedule에서는 findByIddeleteById를 호출해 동일 엔티티에 대해 DB 접근이 두 번 일어납니다. 이미 Schedule schedule 객체를 확보했으므로, 아래처럼 한 번의 호출로 정리하는 것도 고려해 볼 수 있습니다(기능상 차이는 없습니다).
-    public void deleteSchedule(Long id) {
-        Schedule schedule = scheduleRepository.findById(id)
-                .orElseThrow(ScheduleNotFoundException::new);
-        scheduleRepository.deleteById(id);
-    }
+    public void deleteSchedule(Long id) {
+        Schedule schedule = scheduleRepository.findById(id)
+                .orElseThrow(ScheduleNotFoundException::new);
+        scheduleRepository.delete(schedule);
+    }

Also applies to: 49-50

aics-api/src/main/java/kgu/developers/api/schedule/presentation/response/ScheduleSummaryResponse.java (1)

24-30: 응답 필드 타입과 @DateTimeFormat 사용 방식 관련 정리 제안

  • startDate, endDateString으로 노출하면서 @DateTimeFormat(pattern = "yyyy-MM-dd")를 붙여두셨는데, 이 어노테이션은 주로 요청 바인딩 시 LocalDate/LocalDateTime 같은 날짜 타입에서 의미가 있어 현재 구조에서는 실질적인 효과가 거의 없습니다.
  • 이미 DATE_FORMATTER"yyyy-MM-dd" 포맷을 강제하고 있으므로, 선택지는:
    • 필드를 LocalDate(또는 LocalDateTime)로 바꾸고 @DateTimeFormat을 그대로 활용하거나,
    • 지금처럼 String을 유지하되 @DateTimeFormat을 제거해 혼란을 줄이는 것입니다.

예시(두 번째 선택지):

-    @Schema(description = "시작일", example = "2025-05-01", requiredMode = REQUIRED)
-    @DateTimeFormat(pattern = "yyyy-MM-dd")
-    String startDate,
+    @Schema(description = "시작일", example = "2025-05-01", requiredMode = REQUIRED)
+    String startDate,
@@
-    @Schema(description = "종료일", example = "2025-12-31", requiredMode = REQUIRED)
-    @DateTimeFormat(pattern = "yyyy-MM-dd")
-    String endDate,
+    @Schema(description = "종료일", example = "2025-12-31", requiredMode = REQUIRED)
+    String endDate,
aics-admin/src/main/java/kgu/developers/admin/schedule/presentation/request/ScheduleContentUpdateRequest.java (1)

8-11: 본문 수정용 DTO 최소 필드 정의는 적절합니다 (길이 제한은 선택 사항)

  • 단일 필드 DTO로 잘 분리되어 있어서 API 사용성이 명확합니다.
  • 생성 시 사용되는 ScheduleCreateRequest.content와 동일한 비즈니스 제약이 필요하다면, 여기에도 @Size(max = …)를 추가해 길이 제한을 통일하는 것을 한 번 고려해 볼 수 있습니다.
aics-admin/src/main/java/kgu/developers/admin/schedule/application/ScheduleAdminFacade.java (1)

44-46: 코드 포맷팅을 개선하세요.

Line 45에서 대입 연산자 = 뒤에 공백이 누락되었습니다.

다음 diff를 적용하세요:

     public void updateScheduleContent(SubmissionType submissionType, ScheduleContentUpdateRequest request) {
-        Schedule schedule =scheduleQueryService.getBySubmissionType(submissionType);
+        Schedule schedule = scheduleQueryService.getBySubmissionType(submissionType);
         scheduleService.updateScheduleContent(schedule,request.content());
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7bdf45c and 19452da.

📒 Files selected for processing (16)
  • aics-admin/src/main/java/kgu/developers/admin/schedule/application/ScheduleAdminFacade.java (1 hunks)
  • aics-admin/src/main/java/kgu/developers/admin/schedule/presentation/ScheduleAdminController.java (1 hunks)
  • aics-admin/src/main/java/kgu/developers/admin/schedule/presentation/ScheduleAdminControllerImpl.java (1 hunks)
  • aics-admin/src/main/java/kgu/developers/admin/schedule/presentation/request/ScheduleContentUpdateRequest.java (1 hunks)
  • aics-admin/src/main/java/kgu/developers/admin/schedule/presentation/request/ScheduleCreateRequest.java (1 hunks)
  • aics-admin/src/main/java/kgu/developers/admin/schedule/presentation/request/ScheduleUpdateRequest.java (1 hunks)
  • aics-admin/src/main/java/kgu/developers/admin/schedule/presentation/response/SchedulePersistResponse.java (1 hunks)
  • aics-api/src/main/java/kgu/developers/api/schedule/application/ScheduleFacade.java (1 hunks)
  • aics-api/src/main/java/kgu/developers/api/schedule/presentation/ScheduleController.java (1 hunks)
  • aics-api/src/main/java/kgu/developers/api/schedule/presentation/ScheduleControllerImpl.java (1 hunks)
  • aics-api/src/main/java/kgu/developers/api/schedule/presentation/response/ScheduleListResponse.java (1 hunks)
  • aics-api/src/main/java/kgu/developers/api/schedule/presentation/response/ScheduleSummaryResponse.java (1 hunks)
  • aics-api/src/main/java/kgu/developers/api/schedule/presentation/response/ScheduleTypeContentResponse.java (1 hunks)
  • aics-domain/src/main/java/kgu/developers/domain/club/domain/Club.java (2 hunks)
  • aics-domain/src/main/java/kgu/developers/domain/lab/domain/Lab.java (2 hunks)
  • aics-domain/src/main/java/kgu/developers/domain/schedule/application/command/ScheduleService.java (3 hunks)
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: minjo-on
Repo: kgu-developers/aics-server PR: 128
File: aics-api/src/testFixtures/java/about/application/AboutServiceTest.java:41-65
Timestamp: 2024-12-05T07:01:42.709Z
Learning: AICS 프로젝트에서는 DTO 계층에서 유효성 검증을 수행합니다. 따라서, 서비스 계층의 테스트에서 중복되는 유효성 검증을 제안하지 않도록 합니다.
📚 Learning: 2024-11-13T08:30:13.201Z
Learnt from: minjo-on
Repo: kgu-developers/aics-server PR: 94
File: aics-domain/src/main/java/kgu/developers/domain/lab/domain/LabRepository.java:11-11
Timestamp: 2024-11-13T08:30:13.201Z
Learning: In `LabRepository.java`, Labs should be sorted by name, and priority-based sorting is not required.

Applied to files:

  • aics-domain/src/main/java/kgu/developers/domain/lab/domain/Lab.java
🧬 Code graph analysis (5)
aics-api/src/main/java/kgu/developers/api/schedule/presentation/ScheduleControllerImpl.java (1)
aics-admin/src/main/java/kgu/developers/admin/schedule/presentation/ScheduleAdminControllerImpl.java (1)
  • RestController (18-61)
aics-admin/src/main/java/kgu/developers/admin/schedule/presentation/ScheduleAdminControllerImpl.java (1)
aics-api/src/main/java/kgu/developers/api/schedule/presentation/ScheduleControllerImpl.java (1)
  • RestController (18-43)
aics-api/src/main/java/kgu/developers/api/schedule/application/ScheduleFacade.java (1)
aics-admin/src/main/java/kgu/developers/admin/schedule/application/ScheduleAdminFacade.java (1)
  • Component (15-52)
aics-domain/src/main/java/kgu/developers/domain/schedule/application/command/ScheduleService.java (1)
aics-domain/src/main/java/kgu/developers/domain/schedule/exception/ScheduleNotFoundException.java (1)
  • ScheduleNotFoundException (7-9)
aics-admin/src/main/java/kgu/developers/admin/schedule/application/ScheduleAdminFacade.java (1)
aics-api/src/main/java/kgu/developers/api/schedule/application/ScheduleFacade.java (1)
  • Component (13-32)
🔇 Additional comments (10)
aics-domain/src/main/java/kgu/developers/domain/lab/domain/Lab.java (1)

27-34: 빌더 체인의 들여쓰기 조정 승인

포맷팅 개선이 명확하고 일관성 있습니다. 빌더 패턴 구현과 팩토리 메서드 설계가 적절합니다.

aics-domain/src/main/java/kgu/developers/domain/club/domain/Club.java (1)

26-31: 포맷팅 변경만 있으며 기능에 영향 없음.

빌더 메소드 체인의 들여쓰기 정렬로 가독성이 개선되었습니다. 기능적 변화는 없습니다.

aics-admin/src/main/java/kgu/developers/admin/schedule/presentation/request/ScheduleCreateRequest.java (1)

10-31: 생성 요청 DTO의 기간 검증 패턴이 프로젝트 컨벤션과 잘 맞습니다

  • 필드 단위 제약(@NotNull, @notblank, @SiZe)과 @AssertTrue 기반의 isValidDateRange 교차 필드 검증을 DTO 계층에서 처리한 구조가 AICS 프로젝트에서 사용하던 방식과 일관됩니다.
  • startDate/endDate 중 하나라도 null이면 바로 true를 반환해, 단일 필드의 @NotNull 에러 메시지와 충돌하지 않도록 한 점도 좋습니다.

Based on learnings

aics-api/src/main/java/kgu/developers/api/schedule/presentation/response/ScheduleTypeContentResponse.java (1)

17-21: 제출 유형별 본문 응답 매핑 로직이 명확합니다

  • ScheduleTypeContentResponse.from에서 submissionType.name()content만 노출하는 단순 매핑이라, 도메인 엔티티를 숨기면서 필요한 정보만 잘 전달하는 구조로 보입니다. 현재 요구사항에는 충분해 보입니다.
aics-admin/src/main/java/kgu/developers/admin/schedule/presentation/response/SchedulePersistResponse.java (1)

8-17: 생성 응답 DTO가 간결하면서 확장 여지도 있습니다

  • scheduleId 하나만 가진 단순 구조에 builder() 기반 from 팩토리를 둬서, 나중에 필드가 추가되어도 호출부 변경을 최소화할 수 있는 패턴이라 괜찮아 보입니다.
aics-api/src/main/java/kgu/developers/api/schedule/application/ScheduleFacade.java (1)

13-28: 읽기 전용 파사드 구현이 적절합니다.

@Transactional(readOnly = true) 어노테이션과 함께 ScheduleQueryService로의 단순 위임 패턴이 올바르게 구현되었습니다.

aics-api/src/main/java/kgu/developers/api/schedule/presentation/ScheduleController.java (1)

14-42: API 인터페이스 정의가 적절합니다.

Swagger 어노테이션과 함께 RESTful 엔드포인트가 명확하게 정의되어 있으며, API 문서화가 잘 되어 있습니다.

aics-admin/src/main/java/kgu/developers/admin/schedule/presentation/ScheduleAdminController.java (1)

21-83: 관리자 API 인터페이스가 잘 설계되었습니다.

엔드포인트별로 적절한 검증 어노테이션(@Valid, @Positive)과 상세한 API 문서화가 포함되어 있습니다.

aics-api/src/main/java/kgu/developers/api/schedule/presentation/ScheduleControllerImpl.java (1)

18-42: 컨트롤러 구현이 적절합니다.

Spring MVC 패턴을 따르며, 파사드 계층으로의 위임이 올바르게 구현되어 있습니다. LocalDateTime.now()를 참조 시간으로 사용하는 것도 적절합니다.

aics-admin/src/main/java/kgu/developers/admin/schedule/presentation/ScheduleAdminControllerImpl.java (1)

18-60: 관리자 컨트롤러 구현이 우수합니다.

@PreAuthorize를 통한 역할 기반 접근 제어, 적절한 HTTP 상태 코드 사용(생성 시 201, 수정/삭제 시 204), 그리고 파사드로의 명확한 위임이 잘 구현되어 있습니다.

Comment on lines +21 to +30
public SchedulePersistResponse createSchedule(ScheduleCreateRequest request) {
Long id = scheduleService.createSchedule(
request.submissionType(),
request.title(),
request.content(),
request.startDate(),
request.endDate()
);
return SchedulePersistResponse.from(id);
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

생성 메서드에 트랜잭션 어노테이션이 누락되었습니다.

createSchedule 메서드는 데이터를 생성하는 쓰기 작업이므로 @Transactional 어노테이션이 필요합니다. 트랜잭션 관리가 없으면 예외 발생 시 롤백이 제대로 이루어지지 않을 수 있습니다.

다음 diff를 적용하세요:

+    @Transactional
     public SchedulePersistResponse createSchedule(ScheduleCreateRequest request) {
         Long id = scheduleService.createSchedule(
                 request.submissionType(),
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
public SchedulePersistResponse createSchedule(ScheduleCreateRequest request) {
Long id = scheduleService.createSchedule(
request.submissionType(),
request.title(),
request.content(),
request.startDate(),
request.endDate()
);
return SchedulePersistResponse.from(id);
}
@Transactional
public SchedulePersistResponse createSchedule(ScheduleCreateRequest request) {
Long id = scheduleService.createSchedule(
request.submissionType(),
request.title(),
request.content(),
request.startDate(),
request.endDate()
);
return SchedulePersistResponse.from(id);
}
🤖 Prompt for AI Agents
In
aics-admin/src/main/java/kgu/developers/admin/schedule/application/ScheduleAdminFacade.java
around lines 21 to 30, the createSchedule method performs a write operation but
is missing a transactional annotation; add @Transactional to the method (or
annotate the class if appropriate) and import
org.springframework.transaction.annotation.Transactional so the operation is
executed within a Spring-managed transaction and will roll back on exceptions.

Comment on lines +49 to +51
public void deleteSchedule(Long scheduleId) {
scheduleService.deleteSchedule(scheduleId);
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

삭제 메서드에 트랜잭션 어노테이션이 누락되었습니다.

deleteSchedule 메서드는 데이터를 삭제하는 쓰기 작업이므로 @Transactional 어노테이션이 필요합니다.

다음 diff를 적용하세요:

+    @Transactional
     public void deleteSchedule(Long scheduleId) {
         scheduleService.deleteSchedule(scheduleId);
     }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
public void deleteSchedule(Long scheduleId) {
scheduleService.deleteSchedule(scheduleId);
}
@Transactional
public void deleteSchedule(Long scheduleId) {
scheduleService.deleteSchedule(scheduleId);
}
🤖 Prompt for AI Agents
In
aics-admin/src/main/java/kgu/developers/admin/schedule/application/ScheduleAdminFacade.java
around lines 49-51, the deleteSchedule method performs a write/delete operation
but lacks the @Transactional annotation; add @Transactional to the method (or
the class if preferred) and import
org.springframework.transaction.annotation.Transactional so the delete runs
inside a transaction and rolls back on failure.

Comment on lines +16 to +18
@Schema(description = "일정 제목", example = "중간논문 제출 안내",requiredMode = REQUIRED)
@NotBlank @Size(max=50)
String title,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

제목 길이 제한(50 vs 100) 불일치로 인한 업데이트 실패 가능성

  • ScheduleCreateRequest에서는 title@Size(max = 100, …)를 사용하고, 여기 ScheduleUpdateRequest에서는 @Size(max = 50)을 사용하고 있습니다.
  • 이대로라면 길이가 51~100자인 제목으로 생성된 일정은 이후 수정 요청 시(다른 필드만 변경하더라도) 검증 단계에서 막혀 업데이트가 불가능해질 수 있습니다.
  • 생성/수정 모두 동일한 비즈니스 규칙을 의도하셨다면, 두 DTO의 max 값을 맞춰 주는 게 안전해 보입니다(100자로 통일하거나, 반대로 생성 쪽을 50자로 줄이는 등).

예시(생성과 동일하게 100자로 맞추는 경우):

-        @Schema(description = "일정 제목", example = "중간논문 제출 안내",requiredMode = REQUIRED)
-        @NotBlank @Size(max=50)
+        @Schema(description = "일정 제목", example = "중간논문 제출 안내", requiredMode = REQUIRED)
+        @NotBlank @Size(max = 100)
         String title,
  • 그 외 isValidDateRange 구현은 생성 요청 DTO와 동일해 기간 검증 관점에서는 일관성이 있습니다.

Also applies to: 29-35



---

🏁 Script executed:

```shell
#!/bin/bash
# Find ScheduleCreateRequest and ScheduleUpdateRequest files
fd -t f "ScheduleCreateRequest|ScheduleUpdateRequest" --extension java

Length of output: 205


🏁 Script executed:

#!/bin/bash
# Examine ScheduleCreateRequest.java for title field and @Size annotation
rg -n "@Size|title" --type java -B2 -A2 aics-admin/src/main/java/kgu/developers/admin/schedule/presentation/request/ScheduleCreateRequest.java

Length of output: 295


🏁 Script executed:

#!/bin/bash
# Examine full ScheduleUpdateRequest.java to see all constraints and validators
cat aics-admin/src/main/java/kgu/developers/admin/schedule/presentation/request/ScheduleUpdateRequest.java

Length of output: 1227


🏁 Script executed:

#!/bin/bash
# Check for isValidDateRange validator implementations in both files
rg -n "isValidDateRange" --type java aics-admin/src/main/java/kgu/developers/admin/schedule/presentation/request/

Length of output: 299


🏁 Script executed:

#!/bin/bash
# Get full ScheduleCreateRequest to compare isValidDateRange implementation
cat aics-admin/src/main/java/kgu/developers/admin/schedule/presentation/request/ScheduleCreateRequest.java

Length of output: 1373


title 필드의 @Size 제약 불일치로 인한 업데이트 실패 위험

  • ScheduleCreateRequest에서는 title@Size(max = 100)을 사용하고, ScheduleUpdateRequest에서는 @Size(max = 50)을 사용하고 있습니다.
  • 길이가 51~100자인 제목으로 생성된 일정은 이후 수정 요청 시(다른 필드만 변경하더라도) 검증 단계에서 실패하여 업데이트가 불가능해집니다.
  • ScheduleUpdateRequest 라인 17의 @Size(max = 50)@Size(max = 100)으로 변경하여 두 DTO의 비즈니스 규칙을 통일해야 합니다.
         @Schema(description = "일정 제목", example = "중간논문 제출 안내", requiredMode = REQUIRED)
-        @NotBlank @Size(max=50)
+        @NotBlank @Size(max = 100, message = "일정 제목은 100자 이내여야 합니다.")
         String title,

(ScheduleCreateRequest와의 일관성을 위해 에러 메시지도 추가하는 것을 권장합니다.)

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
@Schema(description = "일정 제목", example = "중간논문 제출 안내",requiredMode = REQUIRED)
@NotBlank @Size(max=50)
String title,
@Schema(description = "일정 제목", example = "중간논문 제출 안내", requiredMode = REQUIRED)
@NotBlank @Size(max = 100, message = "일정 제목은 100자 이내여야 합니다.")
String title,
🤖 Prompt for AI Agents
aics-admin/src/main/java/kgu/developers/admin/schedule/presentation/request/ScheduleUpdateRequest.java
around lines 16 to 18: the title field uses @Size(max = 50) which conflicts with
ScheduleCreateRequest's @Size(max = 100) and will block updates for titles
between 51–100 chars; change @Size(max = 50) to @Size(max = 100) to align DTO
validation rules, and add a clear message attribute to the annotation (e.g.,
message = "제목은 최대 100자까지 가능합니다") to keep error feedback consistent with
ScheduleCreateRequest.

Comment on lines +22 to +24
public Schedule findBySubmissionTyp(SubmissionType submissionType) {
return scheduleQueryService.getBySubmissionType(submissionType);
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

메서드 이름의 오타를 수정하세요.

메서드 이름 findBySubmissionTyp에서 마지막 'e'가 누락되었습니다. 이는 ScheduleControllerImpl의 Line 34에서도 사용되고 있습니다.

다음 diff를 적용하여 수정하세요:

-    public Schedule findBySubmissionTyp(SubmissionType submissionType) {
+    public Schedule findBySubmissionType(SubmissionType submissionType) {
         return scheduleQueryService.getBySubmissionType(submissionType);
     }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
public Schedule findBySubmissionTyp(SubmissionType submissionType) {
return scheduleQueryService.getBySubmissionType(submissionType);
}
public Schedule findBySubmissionType(SubmissionType submissionType) {
return scheduleQueryService.getBySubmissionType(submissionType);
}
🤖 Prompt for AI Agents
In
aics-api/src/main/java/kgu/developers/api/schedule/application/ScheduleFacade.java
around lines 22-24 the method name has a typo: rename the method from
findBySubmissionTyp to findBySubmissionType (add the missing 'e'), keep the
return and body unchanged, and update all call sites (e.g.,
ScheduleControllerImpl line 34) to use the corrected name.

@dkdltm221 dkdltm221 closed this Nov 16, 2025
@dkdltm221 dkdltm221 deleted the feat/KD-48 branch November 16, 2025 10:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

✨feature create new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Schedule API 구현

1 participant