Skip to content

T-11 커리큘럼 주차/토픽/세부항목 - #65

Open
ff1451 wants to merge 1 commit into
feat/t10-curriculum-setsfrom
feat/t11-curriculum-tree
Open

T-11 커리큘럼 주차/토픽/세부항목#65
ff1451 wants to merge 1 commit into
feat/t10-curriculum-setsfrom
feat/t11-curriculum-tree

Conversation

@ff1451

@ff1451 ff1451 commented Aug 19, 2026

Copy link
Copy Markdown

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_range CHECK 제약도 같은 조건을 갖고 있어 이중 방어다 — 서비스 레이어 검증이 더 명확한 메시지를 준다.
  • 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(신규):

  • AC-2.5 범위 역전(weekTo < weekFrom) 시 400
  • 범위 주차 생성/수정
  • AC-2.3 주차 삭제가 하위에만 cascade되고 다른 주차는 영향받지 않음
  • AC-2.6 토픽 순서 변경이 트리 조회에 반영
  • AC-2.9 빈 배열 전송 시 전부 삭제(에러 아님)
  • 관리자 트리 조회는 토픽 0개인 주차도 포함 — 공개 API(T-12)의 제외 규칙과 의도적으로 다르다는 걸 테스트로 명시해 뒀다

./gradlew test를 3회 연속 돌려 전체 통과(68개, 실패 0) 확인.

주차 > 토픽 > 세부항목 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
@coderabbitai

coderabbitai Bot commented Aug 19, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 6afc94b4-183d-47ce-96dd-ecfd387ef069

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant