Configure circuit protection

This commit is contained in:
Julian Appel 2026-07-31 07:45:48 +02:00
parent 18ca5eb3d4
commit 8898117ed4
18 changed files with 642 additions and 14 deletions

View file

@ -66,17 +66,20 @@ export function assertCircuitProtectionUpdateProjectCommand(
throw new Error("Circuit protection update must change state.");
}
if (expected !== null) {
assertSnapshot(expected, circuitId);
assertCircuitProtectionSnapshot(expected, circuitId);
}
if (target !== null) {
assertSnapshot(target, circuitId);
assertCircuitProtectionSnapshot(target, circuitId);
}
if (JSON.stringify(expected) === JSON.stringify(target)) {
throw new Error("Circuit protection update must change state.");
}
}
function assertSnapshot(value: unknown, circuitId: string) {
export function assertCircuitProtectionSnapshot(
value: unknown,
circuitId: string
) {
if (
!isPlainObject(value) ||
Object.keys(value).length !== 7 ||