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
+8
View File
@@ -8,8 +8,16 @@ export const projectDevices = sqliteTable("project_devices", {
.references(() => projects.id, { onDelete: "cascade" }),
name: text("name").notNull(),
displayName: text("display_name").notNull(),
phaseType: text("phase_type").notNull().default("single_phase"),
connectionKind: text("connection_kind"),
costGroup: text("cost_group"),
category: text("category"),
quantity: integer("quantity").notNull(),
powerPerUnit: real("power_per_unit").notNull().default(0),
simultaneityFactor: real("simultaneity_factor").notNull().default(1),
cosPhi: real("cos_phi"),
remark: text("remark"),
// Legacy compatibility fields. Keep these synchronized until the Consumer editor is removed.
installedPowerPerUnitKw: real("installed_power_per_unit_kw").notNull(),
demandFactor: real("demand_factor").notNull(),
voltageV: real("voltage_v"),