T-11 커리큘럼 주차/토픽/세부항목 - #65
Open
ff1451 wants to merge 1 commit into
Open
Conversation
주차 > 토픽 > 세부항목 3단 트리 CRUD + 각 단계 순서 변경.
- CurriculumWeek/CurriculumTopic/CurriculumTopicDetail — 전부 하위 트리라
soft delete 없이 on delete cascade로 물리 삭제(INV-7)
- POST /v1/admin/curriculums/{id}/weeks, PUT/DELETE /v1/admin/weeks/{id} —
weekTo가 weekFrom보다 작으면 서비스 레이어에서 WEEK_RANGE_INVALID(400)를
먼저 던진다(AC-2.5). DB의 ck_week_range도 같은 제약을 갖고 있어 이중 방어다
- PATCH .../weeks/order, .../topics/order — DisplayOrders 재사용. 토픽 번호는
별도 컬럼이 아니라 display_order + 1로 렌더하므로 순서 변경이 곧 번호
재부여다(AC-2.6, ADR-005)
- PUT /v1/admin/topics/{id}/details — 전체 교체. 빈 배열이면 전부 삭제되고
에러가 아니다(AC-2.9)
- GET /v1/admin/curriculums/{id} — 3단 트리 전체(T-10에서 미룬 엔드포인트를
여기서 추가). 운영진 소수가 쓰는 편집 화면이라 N+1을 감수했다 — 공개 API인
T-12는 트래픽 특성이 달라 따로 최적화한다
테스트: AdminCurriculumTreeIntegrationTest(신규) —
- AC-2.5 범위 역전 시 400
- 범위 주차 생성/수정
- AC-2.3 주차 삭제가 하위에만 cascade, 다른 주차는 영향 없음
- AC-2.6 토픽 순서 변경이 트리 조회에 반영
- AC-2.9 빈 배열 전송 시 전부 삭제(에러 아님)
- 관리자 트리 조회는 빈 주차도 포함(공개 API의 제외 규칙과 다름 — T-12에서
명시적으로 다르게 구현할 지점)
./gradlew test 3회 연속 전체 통과(68개, 실패 0).
Refs #23
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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. Comment |
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.
Refs #23
Base:
feat/t10-curriculum-sets(#64)주차 > 토픽 > 세부항목 3단 트리 CRUD + 각 단계 순서 변경.
변경
CurriculumWeek/CurriculumTopic/CurriculumTopicDetail— 전부 하위 트리라 soft delete 없이on delete cascade로 물리 삭제(INV-7, ADR-006).POST /v1/admin/curriculums/{id}/weeks,PUT/DELETE /v1/admin/weeks/{id}—weekTo < weekFrom이면 서비스 레이어에서WEEK_RANGE_INVALID(400)를 먼저 던진다(AC-2.5). DB의ck_week_rangeCHECK 제약도 같은 조건을 갖고 있어 이중 방어다 — 서비스 레이어 검증이 더 명확한 메시지를 준다.PATCH .../weeks/order,.../topics/order— T-01의DisplayOrders를 재사용. 토픽 번호는 별도 컬럼이 아니라display_order + 1로 렌더하므로(ADR-005) 순서 변경이 곧 번호 재부여다(AC-2.6).PUT /v1/admin/topics/{id}/details— 전체 교체. 빈 배열을 보내면 전부 삭제되고 에러가 아니다(AC-2.9).GET /v1/admin/curriculums/{id}— 3단 트리 전체. T-10에서 "트리가 없으니 의미 없다"며 미뤄둔 엔드포인트를 여기서 추가했다. 운영진 소수가 쓰는 편집 화면이라 N+1을 감수했다 — 공개 API인 T-12는 트래픽 특성이 다르므로 거기서 별도로 최적화한다.테스트
AdminCurriculumTreeIntegrationTest(신규):weekTo < weekFrom) 시 400./gradlew test를 3회 연속 돌려 전체 통과(68개, 실패 0) 확인.