2026-10-07 11:03:01 +00:00
|
|
|
import { z } from "zod/v4";
|
|
|
|
|
|
|
|
|
|
import { InterventionTemplateInputSchema } from "../api/domain/intervention-template-values";
|
|
|
|
|
|
|
|
|
|
export type {
|
|
|
|
|
InterventionStepInput,
|
|
|
|
|
InterventionTemplateInput,
|
|
|
|
|
} from "../api/domain/intervention-template-values";
|
2026-10-10 10:01:58 +00:00
|
|
|
|
2026-10-07 11:03:01 +00:00
|
|
|
export {
|
|
|
|
|
InterventionStepInputSchema,
|
|
|
|
|
InterventionTemplateInputSchema,
|
|
|
|
|
} from "../api/domain/intervention-template-values";
|
2026-10-10 10:01:58 +00:00
|
|
|
|
2026-10-07 11:03:01 +00:00
|
|
|
export const SaveInterventionTemplateSchema = z.strictObject({
|
|
|
|
|
values: InterventionTemplateInputSchema,
|
|
|
|
|
requestKey: z.uuid(),
|
|
|
|
|
expectedRevisionId: z.uuid().nullable(),
|
|
|
|
|
});
|
2026-10-10 10:01:58 +00:00
|
|
|
|
2026-10-07 11:03:01 +00:00
|
|
|
export const InterventionTemplateSchema = z.strictObject({
|
|
|
|
|
id: z.uuid(),
|
|
|
|
|
companyId: z.uuid().nullable(),
|
|
|
|
|
values: InterventionTemplateInputSchema,
|
|
|
|
|
history: z
|
|
|
|
|
.array(
|
|
|
|
|
z.strictObject({
|
|
|
|
|
id: z.uuid(),
|
|
|
|
|
values: InterventionTemplateInputSchema,
|
|
|
|
|
actorId: z.uuid().nullable(),
|
|
|
|
|
actorName: z.string().min(1),
|
|
|
|
|
recordedAt: z.iso.datetime(),
|
|
|
|
|
})
|
|
|
|
|
)
|
|
|
|
|
.min(1),
|
|
|
|
|
});
|
2026-10-10 10:01:58 +00:00
|
|
|
|
2026-10-07 11:03:01 +00:00
|
|
|
export const InterventionTemplatesSchema = z.strictObject({
|
|
|
|
|
templates: z.array(InterventionTemplateSchema),
|
|
|
|
|
});
|
2026-10-10 10:01:58 +00:00
|
|
|
|
2026-10-07 11:03:01 +00:00
|
|
|
export const InterventionTemplateResponseSchema = z.strictObject({
|
|
|
|
|
template: InterventionTemplateSchema,
|
|
|
|
|
});
|
2026-10-10 10:01:58 +00:00
|
|
|
|
2026-10-07 11:03:01 +00:00
|
|
|
export type InterventionTemplateDTO = z.infer<typeof InterventionTemplateSchema>;
|
2026-10-10 10:01:58 +00:00
|
|
|
|
2026-10-07 11:03:01 +00:00
|
|
|
export type SaveInterventionTemplateInput = z.infer<typeof SaveInterventionTemplateSchema>;
|