Include external models in project snapshots
This commit is contained in:
parent
76493b573e
commit
e87a3289fa
10 changed files with 685 additions and 15 deletions
|
|
@ -20,6 +20,7 @@ import { projectDevices } from "../schema/project-devices.js";
|
|||
import { projects } from "../schema/projects.js";
|
||||
import { rooms } from "../schema/rooms.js";
|
||||
import { externalCsvConfigurations } from "../schema/external-csv-configurations.js";
|
||||
import { ExternalModelStateRepository } from "./external-model-state.repository.js";
|
||||
|
||||
export interface PersistedProjectStateSnapshot {
|
||||
currentRevision: number;
|
||||
|
|
@ -65,6 +66,8 @@ export function readProjectStateSnapshot(
|
|||
.from(externalCsvConfigurations)
|
||||
.where(eq(externalCsvConfigurations.projectId, projectId))
|
||||
.get() ?? null;
|
||||
const externalModel = new ExternalModelStateRepository(database)
|
||||
.getByProject(projectId).state;
|
||||
const listRows = database
|
||||
.select()
|
||||
.from(circuitLists)
|
||||
|
|
@ -248,6 +251,7 @@ export function readProjectStateSnapshot(
|
|||
},
|
||||
distributionBoards: boardRows,
|
||||
externalCsvConfiguration,
|
||||
externalModel,
|
||||
circuitLists: listRows,
|
||||
circuitSections: sectionRows,
|
||||
distributionBoardComponents: componentRows,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue