Route project devices through history
This commit is contained in:
@@ -76,6 +76,27 @@ recreates the same device and reconnects only rows whose complete disconnected
|
||||
snapshot still matches; device, links, revision and history transition are
|
||||
atomic.
|
||||
|
||||
### Project Device CRUD
|
||||
|
||||
- `GET /project-devices/projects/:projectId`
|
||||
- lists the project's reusable devices
|
||||
- `POST /project-devices/projects/:projectId`
|
||||
- `PUT /project-devices/projects/:projectId/:projectDeviceId`
|
||||
- request: all canonical device fields plus `expectedRevision`
|
||||
- response: `{ "projectDevice": { ... }, "revision": { ... }, "history": { ... } }`
|
||||
- `DELETE /project-devices/projects/:projectId/:projectDeviceId`
|
||||
- request: `{ "expectedRevision": 12 }`
|
||||
- response: the project command result with the updated history state
|
||||
- `POST /project-devices/projects/:projectId/import-global/:globalDeviceId`
|
||||
- request: `{ "expectedRevision": 12 }`
|
||||
- creates an independent project device with a stable UUID
|
||||
- response shape matches ProjectDevice create/update
|
||||
|
||||
These write endpoints execute the typed `project-device.update`,
|
||||
`project-device.insert` and `project-device.delete` commands. A stale revision
|
||||
returns `409 PROJECT_REVISION_CONFLICT`. Updating a project device still never
|
||||
synchronizes linked circuit rows implicitly.
|
||||
|
||||
Example:
|
||||
|
||||
```json
|
||||
|
||||
Reference in New Issue
Block a user