forked from jappel/leistungsbilanz-ts
19 lines
724 B
TypeScript
19 lines
724 B
TypeScript
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),
|
|
demandFactor: z.number().min(0).max(1),
|
|
voltageV: z.number().positive().optional(),
|
|
phaseCount: z.union([z.literal(1), z.literal(3)]).optional(),
|
|
powerFactor: z.number().min(0).max(1).optional(),
|
|
note: z.string().optional(),
|
|
});
|
|
|
|
export const updateProjectDeviceSchema = createProjectDeviceSchema;
|
|
|
|
export type CreateProjectDeviceInput = z.infer<typeof createProjectDeviceSchema>;
|
|
export type UpdateProjectDeviceInput = z.infer<typeof updateProjectDeviceSchema>;
|