Repository navigation
[Fix/#596] 마감일 지난 과제에 세부과제 등록/수정 시 예외처리 추가 - #597
Conversation
📝 WalkthroughWalkthroughKST 날짜 계산을 결정적으로 변경합니다. 세부 태스크의 부모 마감일이 만료되면 Changes태스크 마감일 처리
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 oasdiff (1.27.0)src/swagger/swagger.ymlError: failed to load base spec from "/tmp/coderabbit-oasdiff-base.a7RdmK": failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: error converting YAML to JSON: yaml: unmarshal errors: Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/services/task.service.js`:
- Around line 612-621: Replace both plain Error instances in the task deadline
validation path with BadRequestError, preserving their existing messages and
errorCode values (TASK_DEADLINE_EXPIRED and INVALID_DEADLINE). Ensure both
thrown errors provide the required reason through the BadRequestError contract
while retaining status code 400.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: a205a564-a663-49c1-915f-4c6bb482c8ff
📒 Files selected for processing (3)
src/dtos/task.dto.jssrc/services/task.service.jstests/unit/subtask-enddate-nullable.test.js
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/swagger/swagger.yml`:
- Around line 2261-2268: Update the Swagger documentation for the registered
lowercase POST /api/v1/task/{taskId}/subtask path to include both
INVALID_DEADLINE and TASK_DEADLINE_EXPIRED response examples, and remove the
obsolete uppercase subtask path documentation.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 1e5eaafd-3046-49c9-ac51-e6d42808d5e6
📒 Files selected for processing (1)
src/swagger/swagger.yml
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/swagger/swagger.yml (1)
2965-2971: 🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win
TASK_DEADLINE_EXPIRED사유를 모든 수정 동작에 맞게 수정하세요.이
PATCH요청은title,deadline,isAlarm을 수정할 수 있습니다. PR 목표는 만료된 부모 과제의 세부 과제 수정을 거부합니다. 그러나 Line 2971은deadline변경만 불가한 것으로 설명합니다. 세부 과제 전체를 수정할 수 없다고 문서화하세요.수정 제안
- reason: "이미 마감일이 지난 과제의 세부 과제 마감일은 변경할 수 없습니다." + reason: "이미 마감일이 지난 과제의 세부 과제는 수정할 수 없습니다."🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/swagger/swagger.yml` around lines 2965 - 2971, Update the TASK_DEADLINE_EXPIRED reason in the task_deadline_expired Swagger response to state that modifying any subtask field is prohibited when the parent task deadline has expired, covering title, deadline, and isAlarm rather than only deadline changes.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In `@src/swagger/swagger.yml`:
- Around line 2965-2971: Update the TASK_DEADLINE_EXPIRED reason in the
task_deadline_expired Swagger response to state that modifying any subtask field
is prohibited when the parent task deadline has expired, covering title,
deadline, and isAlarm rather than only deadline changes.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 770aded6-ec28-4dd6-828a-9663018c4897
📒 Files selected for processing (2)
src/services/task.service.jssrc/swagger/swagger.yml
🚧 Files skipped from review as they are similar to previous changes (1)
- src/services/task.service.js
📌 [Fix/#596] 마감일 지난 과제에 세부과제 등록/수정 시 예외처리 추가
📌 관련 이슈번호
📌 PR 유형
어떤 변경 사항이 있나요?
📌 PR 요약
fix: D-Day 계산 시 서버 타임존에 따라 날짜가 밀리는 버그 수정
계산에 사용되던 로컬 getter가 서버 프로세스의 타임존에 의존해
KST 자정 전후 UTC 배포 환경에서 하루씩 밀리는 문제가 있었음.
formatDate와 동일하게 UTC+9 오프셋을 명시적으로 적용하도록 수정.
fix: 마감일 지난 과제에 세부과제 등록/수정 시 예외처리 추가
세부과제 단건 생성에는 부모 과제 마감일 초과 검증이 있었지만
일괄 수정 API에는 빠져있어 우회 가능했던 문제를 수정.
부모 마감일이 이미 지난 경우 TASK_DEADLINE_EXPIRED 에러 코드로
구분해 반환하도록 해서 프론트에서 전용 모달을 띄울 수 있게 함.
📌 작업 세부 내용
변경 사항
1. D-Day 계산 버그 수정
calculateDDay가 서버 프로세스 타임존에 의존하는 로컬 getter를 사용하고 있어,배포 서버가 UTC 타임존이면 KST 자정 전후 9시간 구간에서 D-Day가 하루씩
틀리게 나오는 문제가 있었습니다.
formatDate처럼 UTC+9 오프셋을 명시적으로 더한 뒤 UTC getter로날짜만 추출하도록 통일해, 서버 타임존과 무관하게 항상 정확한 KST 기준으로
계산되도록 수정했습니다.
2. 마감일 지난 과제에 세부과제 등록 시 예외처리
POST /task/:taskId/subtask)에는 "부모 과제 마감일 초과 불가"검증이 있었지만, 일괄 수정(
PATCH /task/:taskId/subtask)에는 이 검증이 빠져있어마감일이 지난 과제에도 세부과제 날짜를 수정할 수 있는 구멍이 있었습니다.
마감일이 이미 지난 경우
TASK_DEADLINE_EXPIRED에러 코드로 구분해 반환하도록했습니다. 프론트에서 해당 코드로 분기해 안내 모달을 띄우면 됩니다.
테스트
npx vitest run전체 통과 (기존에 실패하던 무관한 테스트 35건 제외, 회귀 없음 확인)📸 스크린샷 (선택)
🔗 참고 자료
Summary by CodeRabbit
변경 사항
버그 수정
문서