Refactor/task type을 schedule type으로 변경#22
Merged
Hidden character warning
The head ref may contain hidden characters: "refactor/TaskType\uc744-ScheduleType\uc73c\ub85c-\ubcc0\uacbd"
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
이 PR은 Task 도메인에 있던 TaskType을 ScheduleType으로 이름 변경하고 Schedule 애그리거트로 이동시키는 리팩토링을 수행합니다. 작업(Task)은 "무엇을 해야 하는가"를 나타내고, 일정(Schedule)은 "언제, 어떤 유형의 작업으로 수행할 것인가"를 나타내도록 도메인 모델을 명확히 분리합니다.
Changes:
- TaskType enum을 ScheduleType으로 이름 변경하고
domain.task.model에서domain.schedule.model로 이동 - TemporalConstraint에서 taskType 필드 제거 및 Schedule 엔티티에 scheduleType 필드 추가
- 통계 기록 로직을 Task 기반에서 Schedule 기반으로 변경하여 이벤트 핸들러 단순화
- Task 및 Schedule에 대한 포괄적인 통합 테스트 추가
Reviewed changes
Copilot reviewed 37 out of 37 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| ScheduleType.java | TaskType에서 이름 변경, schedule 도메인으로 이동, Recorder 인터페이스 구현 유지 |
| Schedule.java | scheduleType 필드 추가, NOT NULL 제약조건 및 validation 로직 포함 |
| Recorder.java | task 도메인에서 schedule 도메인으로 이동, 개선된 영문 문서화 |
| TemporalConstraint.java | taskType 필드 및 관련 메서드 제거 |
| Task.java | changeTaskType 메서드 제거 |
| TaskPatch.java | taskType 필드 및 setter/getter 제거 |
| SchedulePatch.java | scheduleType 필드 및 setter/getter 추가 |
| TaskRequest.java | taskType 필드 제거 (API 변경) |
| TaskResponse.java | taskType 필드 제거 (API 변경) |
| TaskScheduleRequest.java | scheduleType 필드 추가, @NotNull 검증 포함 |
| ScheduleSimpleRequest.java | scheduleType 필드 추가, @NotNull 검증 포함 |
| ScheduleSimplePatchRequest.java | scheduleType 필드 추가, nullable (부분 업데이트) |
| ScheduleResponse.java | scheduleType 필드 응답에 추가 |
| ScheduleSimpleResponse.java | scheduleType 필드 응답에 추가 |
| StatisticsService.java | TaskType 파라미터를 ScheduleType으로 변경 |
| ScheduleCompletedEventHandler.java | Task 조회 제거, Schedule에서 직접 scheduleType 읽기 |
| ScheduleCanceledEventHandler.java | Task 조회 제거, Schedule에서 직접 scheduleType 읽기 |
| TaskDependencyAdjustCommand.java | taskType 필드 및 관련 로직 제거 |
| ScheduleDependencyAdjustCommand.java | taskType을 scheduleType으로 변경 |
| TemporalConstraintTest.java | taskType 관련 테스트 제거 |
| TaskUtils.java | TemporalConstraint 생성 시 taskType 제거 |
| ScheduleUtils.java | Schedule 생성 시 scheduleType 추가, 기본값 DEEP_WORK 사용 |
| TaskServiceTest.java | TemporalConstraint 생성 업데이트 |
| TaskAdjustmentServiceTest.java | taskType 관련 필드 및 검증 제거 |
| StatisticsServiceTest.java | TaskType을 ScheduleType으로 변경 |
| ScheduleCompletedEventHandlerTest.java | Task 모킹 제거, Schedule에서 scheduleType 반환 |
| ScheduleCanceledEventHandlerTest.java | Task 모킹 제거, Schedule에서 scheduleType 반환 |
| ScheduleServiceTest.java | Schedule 생성 시 scheduleType 추가 |
| ScheduleAdjustmentServiceTest.java | ScheduleType 사용 및 검증 추가 |
| DependencyServiceTest.java | TemporalConstraint 생성 업데이트 |
| TaskControllerV1Test.java | 테스트에서 TemporalConstraint 및 Schedule 생성 업데이트 |
| TaskControllerV1IntegrationTest.java | Task 및 Schedule 생명주기를 검증하는 새 통합 테스트 |
| ScheduleControllerV1Test.java | Schedule 생성 시 scheduleType 추가 |
| ScheduleControllerV1IntegrationTest.java | Schedule CRUD 및 상태 전환을 검증하는 새 통합 테스트 |
| ScheduleControllerV0IntegrationTest.java | 레거시 API를 검증하는 새 통합 테스트 |
Comments suppressed due to low confidence (1)
src/test/java/me/gg/pinit/pinittask/application/task/service/TaskServiceTest.java:94
- The variable 'ownerId' is only assigned values of primitive type and is never 'null', but it is declared with the boxed type 'Long'.
Long ownerId = 3L;
Comment on lines
+50
to
+53
| @Getter | ||
| @Enumerated(EnumType.STRING) | ||
| @Column(name = "schedule_type", nullable = false) | ||
| private ScheduleType scheduleType; |
There was a problem hiding this comment.
새로운 NOT NULL 컬럼 'schedule_type'이 추가되었지만 데이터베이스 마이그레이션 스크립트가 누락된 것으로 보입니다.
문제점:
기존 데이터베이스에 이미 Schedule 레코드가 존재하는 경우, nullable = false 제약조건으로 인해 마이그레이션이 실패합니다.
영향:
프로덕션 환경 배포 시 기존 일정 데이터가 있다면 애플리케이션 시작에 실패하거나 데이터베이스 스키마 업데이트가 실패할 수 있습니다.
수정 제안:
- 데이터베이스 마이그레이션 스크립트를 추가하여 기존 레코드에 기본값(예: DEEP_WORK)을 설정하거나
- 마이그레이션 단계에서 nullable = true로 먼저 추가 후, 기존 데이터 업데이트, 그 다음 NOT NULL 제약조건을 추가하는 방식으로 처리해야 합니다.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
변경된 점