Standardize phase type labels
This commit is contained in:
@@ -13,6 +13,7 @@ import type {
|
||||
CircuitStructureProjectCommandStore,
|
||||
ExecuteCircuitStructureCommandInput,
|
||||
} from "../../domain/ports/circuit-structure-project-command.store.js";
|
||||
import { isElectricalPhaseType } from "../../domain/services/project-voltage.service.js";
|
||||
import type { AppDatabase } from "../database-context.js";
|
||||
import { circuitDeviceRows } from "../schema/circuit-device-rows.js";
|
||||
import { circuitLists } from "../schema/circuit-lists.js";
|
||||
@@ -136,6 +137,9 @@ export class CircuitStructureProjectCommandRepository
|
||||
"User commands cannot assign legacy consumer ids."
|
||||
);
|
||||
}
|
||||
if (source === "user" && !isElectricalPhaseType(row.phaseType)) {
|
||||
throw new Error("Device-row phase type is invalid.");
|
||||
}
|
||||
assertCircuitDeviceRowReferencesInProject(
|
||||
database,
|
||||
projectId,
|
||||
|
||||
Reference in New Issue
Block a user