Add project device update history
This commit is contained in:
@@ -28,14 +28,14 @@ The public dispatcher currently supports `circuit.update`, `circuit.insert`,
|
||||
`circuit-device-row.insert`, `circuit-device-row.delete`,
|
||||
`circuit-device-row.move`, `circuit-device-row.move-with-new-circuit`,
|
||||
`circuit.reorder-section`, `circuit.renumber-section` and
|
||||
`project-device.sync-rows`, all with schema version `1`. Other command types
|
||||
are rejected. Insert commands contain the complete entity or circuit block
|
||||
with stable ids; delete commands include the expected parent identity. Circuit
|
||||
snapshots contain zero, one or multiple complete device rows. Move commands
|
||||
contain each row's expected and target circuit plus its exact expected and
|
||||
target sort order. This makes deletion and moves undoable without generating
|
||||
replacement identities or renumbering circuits. The editor does not consume
|
||||
these endpoints yet.
|
||||
`project-device.update` and `project-device.sync-rows`, all with schema version
|
||||
`1`. Other command types are rejected. Insert commands contain the complete
|
||||
entity or circuit block with stable ids; delete commands include the expected
|
||||
parent identity. Circuit snapshots contain zero, one or multiple complete
|
||||
device rows. Move commands contain each row's expected and target circuit plus
|
||||
its exact expected and target sort order. This makes deletion and moves
|
||||
undoable without generating replacement identities or renumbering circuits.
|
||||
The editor does not consume these endpoints yet.
|
||||
|
||||
`circuit-device-row.move` targets existing circuits in the same circuit list.
|
||||
`circuit-device-row.move-with-new-circuit` atomically creates exactly one
|
||||
@@ -63,6 +63,11 @@ All rows, the inverse command, revision and history-stack transition commit or
|
||||
roll back together. Disconnect/reconnect may only change the link; stale row
|
||||
snapshots and cross-project devices or rows are rejected.
|
||||
|
||||
`project-device.update` changes one or multiple canonical ProjectDevice fields
|
||||
and derives its inverse from the persisted device. It validates project
|
||||
ownership and never writes linked `CircuitDeviceRow` values; synchronization
|
||||
remains a separate explicit command.
|
||||
|
||||
Example:
|
||||
|
||||
```json
|
||||
|
||||
@@ -111,6 +111,12 @@ werden stille Überschreibungen veralteter Zeilen verhindert und Undo/Redo stell
|
||||
exakt die vorherigen lokalen Werte wieder her. Die bestehenden
|
||||
Projektgeräte-Endpunkte verwenden diesen Command bis zur Frontend-Umstellung
|
||||
noch nicht.
|
||||
`project-device.update` versioniert Änderungen an den kanonischen
|
||||
Projektgerätefeldern unabhängig davon. Der Store erzeugt die Inverse aus dem
|
||||
gespeicherten Gerät und schreibt Geräteänderung, Revision und Historienstapel
|
||||
atomar. Verknüpfte Stromkreiszeilen werden dabei bewusst nicht automatisch
|
||||
synchronisiert. Der bestehende ProjectDevice-`PUT`-Endpunkt verwendet diesen
|
||||
Command bis zum UI-Cutover noch nicht.
|
||||
|
||||
## Projektgeräte
|
||||
|
||||
|
||||
@@ -195,13 +195,15 @@ Completed foundation:
|
||||
- `project-device.sync-rows` records synchronization, disconnect and reconnect
|
||||
as one atomic multi-row operation; complete expected/target sync snapshots
|
||||
protect local values, links and override metadata against silent stale writes
|
||||
- `project-device.update` persists canonical source-device field changes
|
||||
independently and never synchronizes linked rows implicitly
|
||||
|
||||
Remaining constraints before completing persistent history:
|
||||
|
||||
- extend the concrete project-scoped command union and executors beyond the
|
||||
Circuit field/insert/delete and CircuitDeviceRow
|
||||
field/insert/delete/move, section-reorder/renumber and ProjectDevice row-sync
|
||||
slices; the generic versioned command envelope is complete
|
||||
field/insert/delete/move, section-reorder/renumber, ProjectDevice field-update
|
||||
and row-sync slices; the generic versioned command envelope is complete
|
||||
- route the remaining structural and destructive domain
|
||||
writes through the shared command, revision and stack transaction boundary
|
||||
- replace the session-local frontend command stack only after server-side
|
||||
|
||||
@@ -409,6 +409,8 @@ Implemented foundation:
|
||||
- ProjectDevice row synchronization, disconnect and reconnect persist complete
|
||||
expected/target sync snapshots in one atomic multi-row command; undo restores
|
||||
local values, links and override metadata without silent overwrites
|
||||
- canonical ProjectDevice field updates persist independently with exact
|
||||
inverses and never overwrite linked CircuitDeviceRow values implicitly
|
||||
- revision metadata, change-set payloads and the project counter are committed
|
||||
in one SQLite transaction
|
||||
- a stale expected revision produces no history writes
|
||||
|
||||
Reference in New Issue
Block a user