Repository navigation
Phase 4: API - #15
Merged
withrvr merged 1 commit intoAug 31, 2026
Merged
Phase 4: API#15
Conversation
A reviewer can now drive the whole flow from /docs: upload a workbook,
watch it become a Run, read its overdue/exceptions/regions/summary,
and see exactly why it failed if it did.
- api/schemas.py: Pydantic response models, separate from models.py's
SQLModel tables.
- api/deps.py: get_run_or_404, shared by every report endpoint.
- POST /collections/runs/: upload + synchronous execute_run. Always
200 with a Run -- a bad file produces a FAILED run in the body,
never a 500.
- GET /collections/runs/, /runs/{id}, /overdue/, /exceptions/
(rule_code/severity filters), /regions/, /summary/,
/run-log/{id}/events.
- No auth: this is an internal ops tool, not a multi-tenant product,
and nothing in MASTER_PLAN.md asks for one.
- summary.py returns the numeric summary + region breakdown now;
Phase 5 layers the control gate on the same response.
Refs: docs/API.md, docs/ARCHITECTURE.md
withrvr
merged commit Aug 31, 2026
a3237c7
into
claude/erp-collection-reporting-workflow-iycqto
3 of 7 checks passed
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.
Phase 4: API
What this adds
Six routers under
/api/v1/collections:runs(POST upload+execute, GET list, GET detail),overdue,exceptions(rule_code/severity filters),regions,summary,run-log/{id}/events. Pydantic response schemas (api/schemas.py). No auth.Assessment requirement served
MASTER_PLAN.md Phase 4 done-when: "a reviewer can drive the whole flow from /docs." `POST /run never returns 500 for a bad input file"* — verified: a corrupt-file upload returns 200 with a FAILED run body.
Docs updated
Verification
Known gaps carried to next phase
summaryendpoint has no gate/blocked payload yet -- Phase 5.mappings.pystill a stub -- Phase 10 (multi-workbook).