Align project devices with circuit model

This commit is contained in:
2026-07-22 19:31:08 +02:00
parent 689cfd3c65
commit 9d07ed9856
16 changed files with 301 additions and 106 deletions
@@ -69,12 +69,12 @@ export async function copyProjectDeviceToGlobal(req: Request, res: Response) {
displayName: source.displayName,
category: source.category ?? undefined,
quantity: source.quantity,
installedPowerPerUnitKw: source.installedPowerPerUnitKw,
demandFactor: source.demandFactor,
installedPowerPerUnitKw: source.powerPerUnit,
demandFactor: source.simultaneityFactor,
voltageV: source.voltageV ?? undefined,
phaseCount: source.phaseCount === 1 || source.phaseCount === 3 ? source.phaseCount : undefined,
powerFactor: source.powerFactor ?? undefined,
note: source.note ?? undefined,
phaseCount: source.phaseType === "three_phase" ? 3 : 1,
powerFactor: source.cosPhi ?? undefined,
note: source.remark ?? undefined,
});
return res.status(201).json(created);