Include external models in project snapshots
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user