first commit

This commit is contained in:
2026-04-30 18:22:10 +02:00
commit c3e98af5b6
36 changed files with 4779 additions and 0 deletions
+26
View File
@@ -0,0 +1,26 @@
export interface ProjectDto {
id: string;
name: string;
}
export interface DistributionBoardDto {
id: string;
projectId: string;
name: string;
}
export interface ConsumerDto {
id: string;
projectId: string;
distributionBoardId: string | null;
name: string;
category: string | null;
quantity: number;
installedPowerPerUnitKw: number;
demandFactor: number;
voltageV: number | null;
phaseCount: 1 | 3 | null;
powerFactor: number | null;
note: string | null;
}
+23
View File
@@ -0,0 +1,23 @@
import { z } from "zod";
export const createConsumerSchema = z.object({
projectId: z.string().min(1),
distributionBoardId: z.string().min(1).optional(),
name: 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 createProjectSchema = z.object({
name: z.string().min(1),
});
export type CreateConsumerInput = z.infer<typeof createConsumerSchema>;
export type CreateProjectInput = z.infer<typeof createProjectSchema>;