docs(m3): place create decisions in the contracts
- DATA-MODEL.md: storage engine (stdlib sqlite3 + schema.sql, no ORM/migrations), pragmas, per-test isolation. - API.md: revision coupling, async job model, PUT check order, server-derived ready. - PROMPTS.md: no prompt files ship; the DB is the only prompt source.
This commit is contained in:
+10
-3
@@ -36,7 +36,12 @@ The outbound WooCommerce payload is owned by `docs/contracts/WOO-API.md`.
|
||||
- **Envelope:** every error is `{ "error": { "code": string, "message": string, "detail": object|null } }`.
|
||||
- **Lists:** returned in full, no pagination.
|
||||
- **Revisions:** create/update carry `client_rev`; the server echoes `server_rev`; a mismatch is
|
||||
`409 revision_conflict`.
|
||||
`409 revision_conflict`. A background inference write bumps `server_rev`; the client adopts the
|
||||
polled `server_rev` before its next write.
|
||||
- **Async work:** inference and publish run through one in-process job queue with a single
|
||||
consumer; a status transition is compare-and-set inside one write transaction, so a poll never
|
||||
observes a half-applied transition. Tests run the queue inline so contract tests are
|
||||
deterministic.
|
||||
- **IDs and time:** slab ids are client-generated UUIDv4; timestamps are UTC ISO-8601.
|
||||
- **Photos:** `multipart/form-data` with `data` (JSON), `files[]` (original images), and `meta[]`
|
||||
(`{ "seq": n }`). One photo is the calibration photo, chosen by the owner.
|
||||
@@ -108,8 +113,10 @@ completion.
|
||||
|
||||
### `PUT /api/v1/slabs/{id}`
|
||||
Partial update of editable fields plus `client_rev`. Stores client-sent derived fields and does
|
||||
not recompute them. `409 revision_conflict`, `409 duplicate_sku` (SKU field actions `edit_sku` /
|
||||
`open_existing`), `422 stale_field` (current options included).
|
||||
not recompute them. Checks run in order: `409 revision_conflict`, then `409 duplicate_sku` (SKU
|
||||
field actions `edit_sku` / `open_existing`), then `422 stale_field` (current options included).
|
||||
`status` becomes `ready` only when the full required set is present; it is server-derived and a
|
||||
client never sets it.
|
||||
|
||||
### `DELETE /api/v1/slabs/{id}`
|
||||
Soft delete of unpublished drafts only (sets `deleted_at`); `204`. Deleted rows are excluded from
|
||||
|
||||
Reference in New Issue
Block a user