feat(api): full API surface with typed DTOs and role-gated stubs (PH1.7) #74
No reviewers
Labels
No labels
in-progress
in-review
ready-for-agent
seam-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
patrick/Polaris!74
Loading…
Reference in a new issue
No description provided.
Delete branch "feature/api-surface"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Description
This finishes the whole planning-tool API's shape: every endpoint from the API design (
docs/09-api.md) now exists — with the right URL, method, request/response data, and who's allowed to call it — even though most of them don't do their real work yet (they answer "not implemented" until the ticket that builds that piece lands). Vehicles, sites, and the catalogue (service types, skills, reason codes), plus crews and people, are fully working already: list, create, edit, and (soft) delete, with paging, safe retries, and optimistic-concurrency editing all included for free.The practical effect: the frontend can now generate its typed API client once, against a complete and stable contract, and every other in-flight and upcoming feature can build its screens against real request/response shapes instead of guessing or waiting on a backend PR.
Related Issues
Closes #15 (PH1.7 API surface). Builds on #10, #11, #12.
Type of Change
Breaking Changes
None.
Test Plan
Unit tests cover every hand-written stub endpoint: a caller without the right role gets a 403, a caller with the right role gets the expected "not implemented" response — never the other way round. The genuinely-working aggregates (vehicles, sites, catalogue, crews, people) are covered by the existing CRUD test suite. Full backend suite (unit + integration, real Postgres) is green, as are lint and strict type checks. Regenerated the committed API contract and confirmed the frontend's client-generation step runs against it and produces code that compiles cleanly.
Checklist
docs/updated for any behavioural change (ADR added if a prior decision was reversed)polaris.domainAdditional Context
A handful of request/response shapes aren't literally specified in the design doc (e.g. the FleetPulse ingest document, the manual-window body, the plan diff and dashboard responses) — these are reasonable first drafts, called out on the issue for whoever builds the real endpoint to confirm or adjust. One area (feedback reporting) isn't clearly claimed by any upcoming ticket yet, also flagged on the issue. The one CI acceptance criterion (a freshness check on the committed contract) can't be verified because no CI workflow exists in this repo yet; the contract is freshly regenerated so it's ready for that check whenever it's added.
🤖 Generated with Claude Code
https://claude.ai/code/session_013YioTVKBPoE6thZqbnTtnM