forked from jappel/leistungsbilanz-ts
Create circuits with rows atomically
This commit is contained in:
parent
b0fc2b4fbf
commit
0800f984bb
11 changed files with 450 additions and 93 deletions
|
|
@ -48,6 +48,11 @@ export const createCircuitDeviceRowSchema = z.object({
|
|||
sortOrder: z.number().optional(),
|
||||
});
|
||||
|
||||
export const createCircuitWithDeviceRowsSchema = z.object({
|
||||
circuit: createCircuitSchema,
|
||||
deviceRows: z.array(createCircuitDeviceRowSchema).min(1),
|
||||
});
|
||||
|
||||
export const updateCircuitDeviceRowSchema = createCircuitDeviceRowSchema.partial();
|
||||
|
||||
export const moveCircuitDeviceRowSchema = z
|
||||
|
|
@ -95,6 +100,7 @@ export const updateSectionEquipmentIdentifiersSchema = z.object({
|
|||
export type CreateCircuitInput = z.infer<typeof createCircuitSchema>;
|
||||
export type UpdateCircuitInput = z.infer<typeof updateCircuitSchema>;
|
||||
export type CreateCircuitDeviceRowInput = z.infer<typeof createCircuitDeviceRowSchema>;
|
||||
export type CreateCircuitWithDeviceRowsInput = z.infer<typeof createCircuitWithDeviceRowsSchema>;
|
||||
export type UpdateCircuitDeviceRowInput = z.infer<typeof updateCircuitDeviceRowSchema>;
|
||||
export type MoveCircuitDeviceRowInput = z.infer<typeof moveCircuitDeviceRowSchema>;
|
||||
export type MoveCircuitDeviceRowsBulkInput = z.infer<typeof moveCircuitDeviceRowsBulkSchema>;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue