forked from jappel/leistungsbilanz-ts
Add proposed cable-sizing module
Isolated module (mirrors src/external-model/ dependency direction) that adds an on-demand, DIN VDE 0298-4 referenced cable cross-section calculator: a click-on-a-circuit input mask for laying method, insulation, ambient temperature, grouping and voltage-drop limit that suggests a cross-section for the circuit cableCrossSection/cableLength fields. Applying a suggestion goes through the existing circuit.update command (expectedRevision, undo/redo) unchanged - nothing here writes to circuits directly or touches the revision/command system. See docs/cable-sizing-module.md for the full rationale, API contract, verification status and maintenance plan. Proposal, not yet reviewed by the project owner - see the docs file. 423 existing + 11 new tests pass, build:api/build:web/typecheck:scripts clean.
This commit is contained in:
parent
a17e2e3f4b
commit
1d030971dd
17 changed files with 4179 additions and 2 deletions
14
src/db/migrations/0007_watery_kingpin.sql
Normal file
14
src/db/migrations/0007_watery_kingpin.sql
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
CREATE TABLE `cable_sizing_calculations` (
|
||||
`id` text PRIMARY KEY NOT NULL,
|
||||
`project_id` text,
|
||||
`circuit_id` text,
|
||||
`equipment_identifier` text,
|
||||
`input` text NOT NULL,
|
||||
`result` text NOT NULL,
|
||||
`applied_to_circuit` integer DEFAULT 0 NOT NULL,
|
||||
`created_at` integer DEFAULT (unixepoch()) NOT NULL,
|
||||
FOREIGN KEY (`project_id`) REFERENCES `projects`(`id`) ON UPDATE no action ON DELETE set null,
|
||||
FOREIGN KEY (`circuit_id`) REFERENCES `circuits`(`id`) ON UPDATE no action ON DELETE set null
|
||||
);
|
||||
--> statement-breakpoint
|
||||
CREATE INDEX `cable_sizing_calculations_circuit_id_idx` ON `cable_sizing_calculations` (`circuit_id`);
|
||||
Loading…
Add table
Add a link
Reference in a new issue