forked from jappel/leistungsbilanz-ts
Standardize phase type labels
This commit is contained in:
parent
084103bf54
commit
096ba8aa1c
23 changed files with 6117 additions and 52 deletions
|
|
@ -14,6 +14,7 @@ import type {
|
|||
ExecuteCircuitDeviceRowStructureCommandInput,
|
||||
} from "../../domain/ports/circuit-device-row-structure-project-command.store.js";
|
||||
import type { AppDatabase } from "../database-context.js";
|
||||
import { isElectricalPhaseType } from "../../domain/services/project-voltage.service.js";
|
||||
import { circuitDeviceRows } from "../schema/circuit-device-rows.js";
|
||||
import { circuitLists } from "../schema/circuit-lists.js";
|
||||
import { circuits } from "../schema/circuits.js";
|
||||
|
|
@ -81,6 +82,9 @@ export class CircuitDeviceRowStructureProjectCommandRepository
|
|||
"User commands cannot assign legacy consumer ids."
|
||||
);
|
||||
}
|
||||
if (source === "user" && !isElectricalPhaseType(row.phaseType)) {
|
||||
throw new Error("Device-row phase type is invalid.");
|
||||
}
|
||||
this.assertCircuitInProject(database, projectId, row.circuitId);
|
||||
assertCircuitDeviceRowReferencesInProject(database, projectId, row);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue