All first todos completed
This commit is contained in:
@@ -0,0 +1,49 @@
|
||||
export const deviceTypeOptions = [
|
||||
"Beleuchtung",
|
||||
"Steckdose",
|
||||
"Heizung",
|
||||
"Kühlung",
|
||||
"Lüftung",
|
||||
"Antrieb",
|
||||
"Sicherheit",
|
||||
"IT",
|
||||
"Sonstiges",
|
||||
] as const;
|
||||
|
||||
export const phaseTypeOptions = ["1-phasig", "3-phasig"] as const;
|
||||
|
||||
export const tradeOrCostGroupOptions = [
|
||||
"KG 440 Starkstromanlagen",
|
||||
"KG 450 Fernmelde- und informationstechnische Anlagen",
|
||||
"KG 460 Förderanlagen",
|
||||
"KG 470 Nutzungsspezifische Anlagen",
|
||||
"KG 480 Gebäude- und Anlagenautomation",
|
||||
"Sonstiges",
|
||||
] as const;
|
||||
|
||||
export const consumerGroupOptions = [
|
||||
"Allgemein",
|
||||
"Notstrom",
|
||||
"Sicherheitsstrom",
|
||||
"USV",
|
||||
"Technik",
|
||||
"Reserve",
|
||||
] as const;
|
||||
|
||||
export const protectionTypeOptions = ["LS", "Schmelzsicherung", "Leistungsschalter", "FI/LS"] as const;
|
||||
|
||||
export const protectionCharacteristicOptions = ["B", "C", "D", "K", "Z"] as const;
|
||||
|
||||
export const cableTypeOptions = ["NYM-J", "NYY-J", "H07RN-F", "NHXMH-J", "Sonstiges"] as const;
|
||||
|
||||
export const cableCrossSectionOptions = [
|
||||
"1,5 mm²",
|
||||
"2,5 mm²",
|
||||
"4 mm²",
|
||||
"6 mm²",
|
||||
"10 mm²",
|
||||
"16 mm²",
|
||||
"25 mm²",
|
||||
"35 mm²",
|
||||
"50 mm²",
|
||||
] as const;
|
||||
@@ -1,27 +1,39 @@
|
||||
import { z } from "zod";
|
||||
import {
|
||||
cableCrossSectionOptions,
|
||||
cableTypeOptions,
|
||||
consumerGroupOptions,
|
||||
deviceTypeOptions,
|
||||
phaseTypeOptions,
|
||||
protectionCharacteristicOptions,
|
||||
protectionTypeOptions,
|
||||
tradeOrCostGroupOptions,
|
||||
} from "../constants/consumer-option-lists.js";
|
||||
|
||||
export const createConsumerSchema = z.object({
|
||||
projectId: z.string().min(1),
|
||||
distributionBoardId: z.string().min(1).optional(),
|
||||
circuitListId: z.string().min(1).optional(),
|
||||
projectDeviceId: z.string().min(1).optional(),
|
||||
isLinkedToDevice: z.boolean().optional(),
|
||||
roomId: z.string().min(1).optional(),
|
||||
circuitNumber: z.string().optional(),
|
||||
description: z.string().optional(),
|
||||
name: z.string().min(1),
|
||||
name: z.string().optional(),
|
||||
category: z.string().optional(),
|
||||
deviceType: z.string().optional(),
|
||||
phaseType: z.string().optional(),
|
||||
tradeOrCostGroup: z.string().optional(),
|
||||
group: z.string().optional(),
|
||||
protectionType: z.string().optional(),
|
||||
deviceType: z.enum(deviceTypeOptions).optional(),
|
||||
phaseType: z.enum(phaseTypeOptions).optional(),
|
||||
tradeOrCostGroup: z.enum(tradeOrCostGroupOptions).optional(),
|
||||
group: z.enum(consumerGroupOptions).optional(),
|
||||
protectionType: z.enum(protectionTypeOptions).optional(),
|
||||
protectionRatedCurrent: z.number().min(0).optional(),
|
||||
protectionCharacteristic: z.string().optional(),
|
||||
cableType: z.string().optional(),
|
||||
cableCrossSection: z.string().optional(),
|
||||
protectionCharacteristic: z.enum(protectionCharacteristicOptions).optional(),
|
||||
cableType: z.enum(cableTypeOptions).optional(),
|
||||
cableCrossSection: z.enum(cableCrossSectionOptions).optional(),
|
||||
comment: z.string().optional(),
|
||||
quantity: z.number().min(0),
|
||||
installedPowerPerUnitKw: z.number().min(0),
|
||||
demandFactor: z.number().min(0).max(1),
|
||||
quantity: z.number().min(0).optional(),
|
||||
installedPowerPerUnitKw: z.number().min(0).optional(),
|
||||
demandFactor: z.number().min(0).max(1).optional(),
|
||||
voltageV: z.number().positive().optional(),
|
||||
phaseCount: z.union([z.literal(1), z.literal(3)]).optional(),
|
||||
powerFactor: z.number().min(0).max(1).optional(),
|
||||
|
||||
@@ -2,6 +2,7 @@ import { z } from "zod";
|
||||
|
||||
export const createGlobalDeviceSchema = z.object({
|
||||
name: z.string().min(1),
|
||||
displayName: z.string().min(1),
|
||||
category: z.string().optional(),
|
||||
quantity: z.number().min(0),
|
||||
installedPowerPerUnitKw: z.number().min(0),
|
||||
|
||||
@@ -2,6 +2,7 @@ import { z } from "zod";
|
||||
|
||||
export const createProjectDeviceSchema = z.object({
|
||||
name: z.string().min(1),
|
||||
displayName: z.string().min(1),
|
||||
category: z.string().optional(),
|
||||
quantity: z.number().min(0),
|
||||
installedPowerPerUnitKw: z.number().min(0),
|
||||
|
||||
Reference in New Issue
Block a user