Persist project device synchronization

This commit is contained in:
2026-07-24 11:47:03 +02:00
parent e930cb75b8
commit 3977a6e6e1
20 changed files with 300 additions and 747 deletions
+8 -4
View File
@@ -277,12 +277,16 @@ endpoints above.
- returns all linked circuit device rows with distribution-board/circuit context and field differences
- `POST /project-devices/projects/:projectId/:projectDeviceId/synchronize`
- applies only explicitly selected fields to explicitly selected linked rows
- `POST /project-devices/projects/:projectId/:projectDeviceId/restore`
- restores the captured pre-sync values for session-local undo
- request: selected `rowIds`, selected `fields` and `expectedRevision`
- response: updated preview, revision and project history state
- `POST /project-devices/projects/:projectId/:projectDeviceId/disconnect`
- disconnects explicitly selected rows without changing their local values
- `POST /project-devices/projects/:projectId/:projectDeviceId/reconnect`
- restores a disconnected link if the row has not been linked elsewhere meanwhile
- request: selected `rowIds` and `expectedRevision`
- response: updated preview, revision and project history state
Both writes execute `project-device.sync-rows`. Undo uses the project-wide
`POST /projects/:projectId/history/undo` endpoint; reconnect is the validated
inverse command. The former direct restore/reconnect endpoints are removed.
`displayName` is included in the comparison but is not selected by default in the UI. Updating a
project device never triggers synchronization implicitly.
+5 -3
View File
@@ -108,9 +108,11 @@ 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.
exakt die vorherigen lokalen Werte wieder her. Die Synchronisieren- und
Trennen-Endpunkte sowie die Projektseite verwenden diesen Command mit
optimistischer Revisionsprüfung. Das dortige Rückgängig löst die persistente
projektweite Historie aus; separate direkte Restore-/Reconnect-Schreibwege
existieren nicht mehr.
`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
@@ -211,8 +211,9 @@ Remaining constraints before completing persistent history:
- 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 and destructive operations; then
route the existing synchronization UI through its persistent command
command coverage is complete for structural and destructive circuit-editor
operations; the ProjectDevice synchronization UI already uses its persistent
command and project-wide undo endpoint
- do not model IFCGUID as an overloaded circuit equipment identifier
- keep database backup/restore checks separate from project history tests
+7 -4
View File
@@ -415,16 +415,19 @@ Implemented foundation:
previously linked rows only from complete unchanged disconnected snapshots
- ProjectDevice create, update, delete and global-to-project copy endpoints use
these commands, require `expectedRevision` and return the new history state
- ProjectDevice synchronization and disconnect endpoints also require
`expectedRevision`; their UI undo uses project-wide persistent history and
the obsolete direct restore/reconnect write paths are removed
- revision metadata, change-set payloads and the project counter are committed
in one SQLite transaction
- a stale expected revision produces no history writes
- integration coverage verifies sequential revisions, stale-command rejection
and rollback after a forced late persistence failure
ProjectDevice CRUD on the project page is connected to this history boundary.
The circuit-list editor and the remaining domain writes are not fully connected;
its visible undo/redo therefore remains session-local until the remaining tasks
are implemented.
ProjectDevice CRUD, synchronization and disconnect on the project page are
connected to this history boundary. The circuit-list editor and the remaining
domain writes are not fully connected; its visible undo/redo therefore remains
session-local until the remaining tasks are implemented.
Acceptance criteria: