ADR 0001: Adopt the fleet REST API guideline
- Status: accepted (2026-11-02)
- Scope: this client only. The standard itself is the fleet's REST API guideline (warehouse-docs).
Context
The floor client is a downstream Conformist of the floor-execution REST APIs. The fleet moved
those APIs to one REST guideline as a hard cutover: command URLs are plural nouns (no verb
segments, no :custom suffix), every POST/PATCH carries an Idempotency-Key, reuse of a key
for a different request answers 409 idempotency-key-reused (was 422), a replay carries
Idempotency-Replayed: true, and every collection answers {items, nextCursor} with limit and
cursor. This client owns no API, so it adopts the guideline as a consumer (STANDARD section 5).
Decision
-
Routes. The client calls the renamed routes (status codes and bodies are unchanged):
Was Now POST /stations/{id}/claim-nextPOST /stations/{id}/task-claimsPOST /stations/{id}/check-inPOST /stations/{id}/check-insPOST /stations/{id}/check-outPOST /stations/{id}/check-outsPOST /tasks/{id}/renew-leasePOST /tasks/{id}/lease-renewalsPOST /tasks/{id}/completePOST /tasks/{id}/completionsPOST /tasks/{id}/break-casePOST /tasks/{id}/case-breaksPOST /receipts/{id}/close(inbound-receiving)POST /receipts/{id}/closuresThe outbox
kindvalues (claim-next,complete, ...) are client-internal names and do not change. -
Persisted outbox migration. A queued entry written by an older build holds an old path that would answer 404 forever.
Outbox.read()rewrites known legacy paths (all of the table above plusseal-package,slam, the sweep jobs, and the inbound-receiving appointment/ASNcheck-in/cancel) to the new ones, saves the result, and keepskey,dedupeId,body,methodand queue position, so the replay still carries the originalIdempotency-Key. Unknown paths are left untouched: the migration never drops a queued write. It is pure and idempotent (src/lib/outboxMigration.ts). -
Idempotency. Unchanged in the client: one key per user action, persisted with the command, reused on every retry and after a reload.
409 idempotency-key-reusedand400 idempotency-key-invalidget plain-words messages (a client bug; "reload and try again"). -
Lists. The open-receipts list follows
nextCursor(cursorquery parameter) until absent, bounded at 20 pages of 50. -
Stub and e2e.
scripts/stub-api.mjsserves the new routes, answers409for key reuse,400 idempotency-key-invalidfor a malformed key and addsIdempotency-Replayed: trueon a replay.
Exemptions
None. The client declares no API and no OpenAPI, so no Spectral ruleset or pagination exemption applies here.
Consequences
- Breaking: this build must be deployed together with the REST cutover set of the providers. An old client against new services (or the reverse) 404s on every command.
- Docs that described
422for key reuse, or "the service keysPOST /tasksonly", are updated.