Rewrite frontend, added rooms, voltage selection per project, startet with todos
This commit is contained in:
@@ -3,8 +3,22 @@ import { z } from "zod";
|
||||
export const createConsumerSchema = z.object({
|
||||
projectId: z.string().min(1),
|
||||
distributionBoardId: z.string().min(1).optional(),
|
||||
circuitListId: z.string().min(1).optional(),
|
||||
roomId: z.string().min(1).optional(),
|
||||
circuitNumber: z.string().optional(),
|
||||
description: z.string().optional(),
|
||||
name: z.string().min(1),
|
||||
category: z.string().optional(),
|
||||
deviceType: z.string().optional(),
|
||||
phaseType: z.string().optional(),
|
||||
tradeOrCostGroup: z.string().optional(),
|
||||
group: z.string().optional(),
|
||||
protectionType: z.string().optional(),
|
||||
protectionRatedCurrent: z.number().min(0).optional(),
|
||||
protectionCharacteristic: z.string().optional(),
|
||||
cableType: z.string().optional(),
|
||||
cableCrossSection: z.string().optional(),
|
||||
comment: z.string().optional(),
|
||||
quantity: z.number().min(0),
|
||||
installedPowerPerUnitKw: z.number().min(0),
|
||||
demandFactor: z.number().min(0).max(1),
|
||||
@@ -18,13 +32,33 @@ export const updateConsumerSchema = createConsumerSchema;
|
||||
|
||||
export const createProjectSchema = z.object({
|
||||
name: z.string().min(1),
|
||||
singlePhaseVoltageV: z.number().positive().optional(),
|
||||
threePhaseVoltageV: z.number().positive().optional(),
|
||||
});
|
||||
|
||||
export const updateProjectSettingsSchema = z.object({
|
||||
singlePhaseVoltageV: z.number().positive(),
|
||||
threePhaseVoltageV: z.number().positive(),
|
||||
});
|
||||
|
||||
export const createDistributionBoardSchema = z.object({
|
||||
name: z.string().min(1),
|
||||
});
|
||||
|
||||
export const createFloorSchema = z.object({
|
||||
name: z.string().min(1),
|
||||
});
|
||||
|
||||
export const createRoomSchema = z.object({
|
||||
floorId: z.string().min(1).optional(),
|
||||
roomNumber: z.string().min(1),
|
||||
roomName: z.string().min(1),
|
||||
});
|
||||
|
||||
export type CreateConsumerInput = z.infer<typeof createConsumerSchema>;
|
||||
export type CreateProjectInput = z.infer<typeof createProjectSchema>;
|
||||
export type UpdateProjectSettingsInput = z.infer<typeof updateProjectSettingsSchema>;
|
||||
export type CreateDistributionBoardInput = z.infer<typeof createDistributionBoardSchema>;
|
||||
export type UpdateConsumerInput = z.infer<typeof updateConsumerSchema>;
|
||||
export type CreateFloorInput = z.infer<typeof createFloorSchema>;
|
||||
export type CreateRoomInput = z.infer<typeof createRoomSchema>;
|
||||
|
||||
Reference in New Issue
Block a user