Closes #1052 (epic #1050). **Stacked on #1055.** The base is `feat/supply-chain-graph`; it will be retargeted to `main` once #1055 merges.
## What it adds
The customer's arrangement of the Lieferkette, kept per workspace:
| Call | What it does |
|---|---|
| `GET /api/v1/supply-chain/layout` | Returns `data: { positions: [{key, x, y}], updated_at }`. The list is empty before the first save, and every box then takes its computed place. |
| `PUT /api/v1/supply-chain/layout` `{positions}` | Replaces the whole arrangement; the last save wins. Each key is trimmed and kept once, with its last position. |
| `DELETE /api/v1/supply-chain/layout` | Resets to the computed columns. |
- **Storage:** one document, `supply_chain_layout`, in the tenant database, so the workspace export and erasure cover it.
- **Positions are a list, not a map by key:** a supplier name can contain a dot (`Beispiel GmbH & Co. KG`), and a document key can't.
- **Refused with `422`:**
- more than 5,000 boxes;
- an empty key, or one longer than 400 characters;
- a position beyond ±100,000 px.
A refused save changes nothing.
- **Roles:** `PUT` and `DELETE` are writes, so the role gate refuses read-only roles. Every role that may read can read the arrangement.
- **Stale keys:** the page ignores a saved key whose node no longer exists, and a new node takes its computed place.
- **Tests:** a `put` helper is added to the test server.
## Tests
- **Unit:** a key is kept once with its last position; a name with a dot is kept; the refusals; an empty list.
- **Integration:**
- empty before the first save;
- a save, then a read;
- a refused save changes nothing;
- a reset empties it.
- **Checks:** the OpenAPI and route gates pass, and clippy is clean.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01Q9inRcu428A2iNjDHPEAT9
The Lieferkette page (#1050) keeps where the customer put each box, per
workspace:
- `GET /api/v1/supply-chain/layout`: the placed boxes by node key (empty
before the first save);
- `PUT`: replaces the whole arrangement (the last save wins), each key
trimmed and kept once with its last position; 422 for more than 5000
boxes, an empty or overlong key, or a box beyond 100000 px;
- `DELETE`: resets to the computed columns.
One document in the tenant database (`supply_chain_layout`), so export and
erasure cover it; positions are a list, not a map by key, as a supplier name
may hold a dot. Saving and resetting are writes, so read-only roles are
refused by the role gate.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q9inRcu428A2iNjDHPEAT9
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Closes #1052 (epic #1050). Stacked on #1055. The base is
feat/supply-chain-graph; it will be retargeted tomainonce #1055 merges.What it adds
The customer's arrangement of the Lieferkette, kept per workspace:
GET /api/v1/supply-chain/layoutdata: { positions: [{key, x, y}], updated_at }. The list is empty before the first save, and every box then takes its computed place.PUT /api/v1/supply-chain/layout{positions}DELETE /api/v1/supply-chain/layoutStorage: one document,
supply_chain_layout, in the tenant database, so the workspace export and erasure cover it.Positions are a list, not a map by key: a supplier name can contain a dot (
Beispiel GmbH & Co. KG), and a document key can't.Refused with
422:A refused save changes nothing.
Roles:
PUTandDELETEare writes, so the role gate refuses read-only roles. Every role that may read can read the arrangement.Stale keys: the page ignores a saved key whose node no longer exists, and a new node takes its computed place.
Tests: a
puthelper is added to the test server.Tests
🤖 Generated with Claude Code
https://claude.ai/code/session_01Q9inRcu428A2iNjDHPEAT9
15d07c96f6to3b1952f5ec