forked from jappel/leistungsbilanz-ts
Add explicit "no protection device" state for circuits
Circuits can now record that they deliberately have no protection device (type NONE, shown as "–"), separate from circuits whose protection is still open. Migration 0017 makes rated_current_a nullable. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
1f3b903809
commit
38019fe087
27 changed files with 3673 additions and 132 deletions
|
|
@ -205,6 +205,27 @@ describe("protection device defaults", () => {
|
|||
);
|
||||
});
|
||||
|
||||
it("maps the explicit no-protection state to a record without values", () => {
|
||||
const none = getCircuitProtectionEditorInitialValue("single_phase", {
|
||||
type: "NONE",
|
||||
});
|
||||
assert.deepEqual(none, { type: "NONE" });
|
||||
assert.deepEqual(toCircuitProtectionSnapshot("circuit-1", none), {
|
||||
circuitId: "circuit-1",
|
||||
type: "NONE",
|
||||
ratedCurrentA: null,
|
||||
fuseUtilizationCategory: null,
|
||||
tripCharacteristic: null,
|
||||
rcdType: null,
|
||||
ratedResidualCurrentMa: null,
|
||||
});
|
||||
// Distribution-board components never take the circuit-only state.
|
||||
assert.equal(
|
||||
protectionDeviceConfigurationSchema.safeParse({ type: "NONE" }).success,
|
||||
false
|
||||
);
|
||||
});
|
||||
|
||||
it("creates the agreed circuit defaults", () => {
|
||||
assert.deepEqual(createDefaultCircuitProtection("lighting"), {
|
||||
type: "LS",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue