Export and import single distribution boards as JSON

A board with its complete circuit list can be downloaded as a
leistungsbilanz.distribution-board file and imported into any project as
a new board. The import reuses distribution-board.insert-subtree, so it
is one revision with restart-safe Undo/Redo. All ids are new;
project-bound references (project devices with override metadata, room
ids, floor, logical feed, a disabled supply type and the Revit quantity
share) are dropped, circuit voltages follow the target project, and the
response lists these adjustments. The project page offers export per
board and import in the board card header.

Refs #26

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Julian Appel 2026-10-30 07:38:28 +01:00
parent 17a3945813
commit d0bd4fe7e0
11 changed files with 955 additions and 10 deletions

View file

@ -352,6 +352,20 @@ Projektgeräten und Räumen erhalten bleiben. Beide Aktionen sind atomare
Projektrevisionen und bleiben nach einem Neustart über Undo/Redo umkehrbar. Die
Projektseite bietet sie im Einstellungsmodal der jeweiligen Verteilung an;
Löschen verlangt dort eine ausdrückliche Bestätigung.
Derselbe Unterbaum ist auch als portable Datei verfügbar:
`GET /api/projects/:projectId/distribution-boards/:distributionBoardId/export`
liefert das Format `leistungsbilanz.distribution-board` (Version 1,
`src/domain/models/distribution-board-transfer.model.ts`), und
`POST /api/projects/:projectId/distribution-boards/import` (`expectedRevision`,
optionaler Name, Datei) legt ihn über `distribution-board.insert-subtree` als
neue Verteilung an – eine Revision, Undo/Redo wie beim Kopieren. Beim Import
werden alle UUIDs neu vergeben und projektgebundene Bezüge entfernt:
Projektgeräte-Verknüpfungen samt Override-Metadaten, Raum-IDs (Raumnummer und
-name bleiben als Text), Etage, logische Einspeisung, eine im Zielprojekt nicht
freigegebene Netzart und der Revit-Anteil der Anzahl (`quantity =
manualQuantity`). Stromkreisspannungen folgen den Spannungen des Zielprojekts.
Die Antwort nennt diese Anpassungen in `adjustments`; die Projektseite bietet
Export je Verteilung und Import im Kopf der Verteilerkarte an.
`distribution-board-component.insert` und
`distribution-board-component.delete` sowie
`distribution-board-component.update` versionieren Anlage, Entfernung,