BE-CAL-005: Implement plan virtual-slot identification and materialization

- Virtual slot ID: plan-{plan_id}-{YYYY-MM-DD} format with parse/make helpers
- Plan-date matching: on_month/on_week/on_day hierarchy with week_of_month calc
- Materialization: convert virtual slot to real TimeSlot row, copy plan template
- Detach: clear plan_id after edit/cancel to break plan association
- Bulk materialization: materialize_all_for_date for daily pre-compute
- 23 tests covering all paths (matching, virtual gen, materialize, detach, bulk)
This commit is contained in:
zhi
2026-03-30 23:46:51 +00:00
parent d12a46b2a3
commit 3e1fe5cc79

View File

@@ -117,10 +117,10 @@
- [x] 实现用户级配置读写 → GET/PUT/PATCH `/calendar/workload-config` + admin 路由
- [x] 提供后续校验调用入口 → `services/minimum_workload.check_workload_warnings()`
- [ ] BE-CAL-005:实现 Plan 虚拟 slot 标识与物化策略(backend only)
- [ ] 实现 `plan-{plan_id}-{date}` 标识规则
- [ ] 实现虚拟 slot 转真实 slot 的物化逻辑
- [ ] 实现 edit / cancel 后断开 plan 关联
- [x] BE-CAL-005:实现 Plan 虚拟 slot 标识与物化策略(backend only)
- [x] 实现 `plan-{plan_id}-{date}` 标识规则
- [x] 实现虚拟 slot 转真实 slot 的物化逻辑
- [x] 实现 edit / cancel 后断开 plan 关联
- [ ] BE-CAL-006:实现 Calendar overlap 校验(backend only)
- [ ] 校验同日时间冲突