Add project device sync history

This commit is contained in:
2026-07-24 08:47:25 +02:00
parent 4b4603b71b
commit 2668fc2f16
14 changed files with 1180 additions and 21 deletions
+18 -11
View File
@@ -25,17 +25,17 @@ concurrency checks.
The public dispatcher currently supports `circuit.update`, `circuit.insert`,
`circuit.delete`, `circuit-device-row.update`,
`circuit-device-row.insert`, `circuit-device-row.delete` and
`circuit-device-row.move` plus
`circuit-device-row.move-with-new-circuit` and `circuit.reorder-section`, all
with `circuit.renumber-section`, 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.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.
`circuit-device-row.move` targets existing circuits in the same circuit list.
`circuit-device-row.move-with-new-circuit` atomically creates exactly one
@@ -56,6 +56,13 @@ targets occupied by other sections, then applies swaps through collision-safe
temporary identifiers. Undo restores the exact prior identifiers; sort
positions and device rows remain unchanged.
`project-device.sync-rows` represents `synchronize`, `disconnect` and
`reconnect` operations. Every selected row carries complete expected and target
snapshots of all ProjectDevice-sync fields, the link and `overriddenFields`.
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.
Example:
```json
+9 -2
View File
@@ -102,8 +102,15 @@ jedes Stromkreises eines vollständigen Abschnitts. Forward, Undo und Redo
bleiben unverändert. `circuit.renumber-section` bildet die getrennte,
ausdrücklich ausgelöste Neunummerierung ab. Es speichert alle erwarteten und
neuen BMKs des Abschnitts, löst Tauschkollisionen über temporäre Werte und
ändert weder Sortierung noch Gerätezeilen. Synchronisierung muss vor der
Frontend-Umstellung noch als persistentes Command modelliert werden.
ändert weder Sortierung noch Gerätezeilen.
`project-device.sync-rows` persistiert Synchronisierung, Trennen und erneutes
Verknüpfen als atomaren Mehrzeilen-Command. Jede betroffene Zeile enthält den
vollständigen erwarteten und neuen Stand aller synchronisierbaren Felder,
einschließlich ProjectDevice-Verknüpfung und lokaler Override-Metadaten. Damit
werden stille Überschreibungen veralteter Zeilen verhindert und Undo/Redo stellt
exakt die vorherigen lokalen Werte wieder her. Die bestehenden
Projektgeräte-Endpunkte verwenden diesen Command bis zur Frontend-Umstellung
noch nicht.
## Projektgeräte
@@ -192,18 +192,21 @@ Completed foundation:
- `circuit.renumber-section` is the separate explicit renumber operation; it
stores every expected/target equipment identifier, uses collision-safe
temporary values and restores the exact prior identifiers on undo
- `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
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 plus section-reorder/renumber slices; the generic
versioned command envelope is complete
- route the remaining structural, synchronization and destructive domain
field/insert/delete/move, section-reorder/renumber and ProjectDevice 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
command coverage is complete for structural, destructive and synchronization
operations
command coverage is complete for structural and destructive operations; then
route the existing synchronization UI through its persistent command
- do not model IFCGUID as an overloaded circuit equipment identifier
- keep database backup/restore checks separate from project history tests
@@ -406,6 +406,9 @@ Implemented foundation:
- explicit section renumber commands persist every expected and target
equipment identifier, apply swaps collision-safely and restore exact prior
identifiers without changing sort positions or device rows
- 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
- revision metadata, change-set payloads and the project counter are committed
in one SQLite transaction
- a stale expected revision produces no history writes