feat(backend): add single-record draft read endpoints

add backend read endpoints for single draft records

support direct fetch of individual draft entities
improve draft inspection and targeted editor workflows
This commit is contained in:
greebo
2026-03-19 19:42:03 +03:00
parent 56aadf848b
commit 35fc170cef
6 changed files with 169 additions and 0 deletions

View File

@@ -57,6 +57,10 @@
## app/api/routes/editor.py
- GET /api/v1/schemes/{scheme_id}/draft/structure
- GET /api/v1/schemes/{scheme_id}/draft/validation
- GET /api/v1/schemes/{scheme_id}/draft/seats/records/{seat_record_id}
- GET /api/v1/schemes/{scheme_id}/draft/sectors/records/{sector_record_id}
- GET /api/v1/schemes/{scheme_id}/draft/groups/records/{group_record_id}
- GET /api/v1/schemes/{scheme_id}/draft/compare-preview
- POST /api/v1/schemes/{scheme_id}/draft/sectors
- POST /api/v1/schemes/{scheme_id}/draft/groups

View File

@@ -79,6 +79,7 @@ Validate:
## 6. Draft publish preview
- GET /api/v1/schemes/{scheme_id}/draft/validation -> 200
- GET /api/v1/schemes/{scheme_id}/publish/validation -> 200
- POST /api/v1/schemes/{scheme_id}/draft/pricing/snapshot -> 200 when scheme is in draft
- GET /api/v1/schemes/{scheme_id}/draft/publish-preview?refresh=true -> 200
@@ -140,3 +141,16 @@ Run this checklist after:
- display pipeline changes
- route reorganization
- startup/import/config changes
## 3.1. Draft editor read model
- GET /api/v1/schemes/{scheme_id}/draft/structure -> 200 when current version is draft
- GET /api/v1/schemes/{scheme_id}/draft/seats/records/{seat_record_id} -> 200 for known seat record
- GET /api/v1/schemes/{scheme_id}/draft/sectors/records/{sector_record_id} -> 200 for known sector record
- GET /api/v1/schemes/{scheme_id}/draft/groups/records/{group_record_id} -> 200 for known group record
Validate:
- returned record belongs to current draft scheme_version_id
- single-entity endpoints match items visible in draft structure
- missing draft record returns 404, not 500