Prepare circuits for future sizing
This commit is contained in:
@@ -104,6 +104,7 @@ interface CircuitSnapshot {
|
||||
rcdAssignment?: string;
|
||||
terminalDesignation?: string;
|
||||
voltage?: number;
|
||||
controlRequirement?: string;
|
||||
status?: string;
|
||||
isReserve: boolean;
|
||||
remark?: string;
|
||||
@@ -938,7 +939,7 @@ export function CircuitTreeEditor(props: { projectId: string; circuitListId: str
|
||||
const payload: Record<string, unknown> = {};
|
||||
if (key === "protectionSummary" || key === "cableSummary") {
|
||||
payload.remark = draft.trim() === "" ? undefined : draft;
|
||||
} else if (["protectionRatedCurrent", "cableLength"].includes(key)) {
|
||||
} else if (["protectionRatedCurrent", "cableLength", "voltage"].includes(key)) {
|
||||
payload[key] = parseNumeric(key, draft);
|
||||
} else if (key === "isReserve") {
|
||||
const normalized = draft.trim().toLowerCase();
|
||||
@@ -1510,6 +1511,7 @@ export function CircuitTreeEditor(props: { projectId: string; circuitListId: str
|
||||
rcdAssignment: found.rcdAssignment ?? undefined,
|
||||
terminalDesignation: found.terminalDesignation ?? undefined,
|
||||
voltage: found.voltage ?? undefined,
|
||||
controlRequirement: found.controlRequirement ?? undefined,
|
||||
status: found.status ?? undefined,
|
||||
isReserve: found.isReserve,
|
||||
remark: found.remark ?? undefined,
|
||||
@@ -1534,6 +1536,7 @@ export function CircuitTreeEditor(props: { projectId: string; circuitListId: str
|
||||
rcdAssignment: snapshot.rcdAssignment,
|
||||
terminalDesignation: snapshot.terminalDesignation,
|
||||
voltage: snapshot.voltage,
|
||||
controlRequirement: snapshot.controlRequirement,
|
||||
status: snapshot.status,
|
||||
isReserve: snapshot.isReserve,
|
||||
remark: snapshot.remark,
|
||||
|
||||
@@ -270,6 +270,7 @@ export interface CircuitTreeCircuitDto {
|
||||
rcdAssignment?: string;
|
||||
terminalDesignation?: string;
|
||||
voltage?: number;
|
||||
controlRequirement?: string;
|
||||
status?: string;
|
||||
isReserve: boolean;
|
||||
remark?: string;
|
||||
@@ -317,6 +318,7 @@ export interface CreateCircuitInputDto {
|
||||
rcdAssignment?: string;
|
||||
terminalDesignation?: string;
|
||||
voltage?: number;
|
||||
controlRequirement?: string;
|
||||
status?: string;
|
||||
isReserve?: boolean;
|
||||
remark?: string;
|
||||
|
||||
@@ -29,6 +29,8 @@ export type CellKey =
|
||||
| "cableLength"
|
||||
| "rcdAssignment"
|
||||
| "terminalDesignation"
|
||||
| "voltage"
|
||||
| "controlRequirement"
|
||||
| "status"
|
||||
| "isReserve";
|
||||
|
||||
@@ -81,6 +83,8 @@ export const allColumns: ColumnDef[] = [
|
||||
{ key: "cableLength", label: "Cable length", numeric: true },
|
||||
{ key: "rcdAssignment", label: "RCD assignment" },
|
||||
{ key: "terminalDesignation", label: "Terminal designation" },
|
||||
{ key: "voltage", label: "Voltage", numeric: true },
|
||||
{ key: "controlRequirement", label: "Control requirement" },
|
||||
{ key: "status", label: "Status" },
|
||||
{ key: "isReserve", label: "Reserve" },
|
||||
];
|
||||
@@ -119,6 +123,8 @@ export const circuitOnlyColumns = new Set<CellKey>([
|
||||
"cableLength",
|
||||
"rcdAssignment",
|
||||
"terminalDesignation",
|
||||
"voltage",
|
||||
"controlRequirement",
|
||||
"status",
|
||||
"isReserve",
|
||||
]);
|
||||
@@ -154,6 +160,8 @@ const circuitFieldKeys = new Set<CellKey>([
|
||||
"cableSummary",
|
||||
"rcdAssignment",
|
||||
"terminalDesignation",
|
||||
"voltage",
|
||||
"controlRequirement",
|
||||
"status",
|
||||
"isReserve",
|
||||
"remark",
|
||||
@@ -226,6 +234,8 @@ export function getCircuitValue(circuit: CircuitTreeCircuitDto, key: CellKey): G
|
||||
case "cableLength": return circuit.cableLength;
|
||||
case "rcdAssignment": return circuit.rcdAssignment;
|
||||
case "terminalDesignation": return circuit.terminalDesignation;
|
||||
case "voltage": return circuit.voltage;
|
||||
case "controlRequirement": return circuit.controlRequirement;
|
||||
case "status": return circuit.status;
|
||||
case "isReserve": return circuit.isReserve;
|
||||
case "remark": return circuit.remark;
|
||||
|
||||
Reference in New Issue
Block a user