2026-10-04 19:04:14 +00:00
|
|
|
import { z } from "zod/v4";
|
|
|
|
|
|
|
|
|
|
import { WorkstationInputSchema } from "../api/domain/workstation-values";
|
|
|
|
|
|
|
|
|
|
export type { WorkstationInput } from "../api/domain/workstation-values";
|
|
|
|
|
|
|
|
|
|
export { WorkstationInputSchema };
|
2026-10-10 10:01:58 +00:00
|
|
|
|
2026-10-04 19:04:14 +00:00
|
|
|
export const SaveWorkstationRequestSchema = z.strictObject({ values: WorkstationInputSchema });
|
2026-10-10 10:01:58 +00:00
|
|
|
|
2026-10-04 19:04:14 +00:00
|
|
|
export const WorkstationRevisionSchema = z.strictObject({
|
|
|
|
|
id: z.uuid(),
|
|
|
|
|
values: WorkstationInputSchema,
|
|
|
|
|
actorId: z.uuid(),
|
|
|
|
|
actorName: z.string().min(1),
|
|
|
|
|
recordedAt: z.iso.datetime(),
|
|
|
|
|
});
|
2026-10-10 10:01:58 +00:00
|
|
|
|
2026-10-04 19:04:14 +00:00
|
|
|
export const WorkstationSchema = z.strictObject({
|
|
|
|
|
id: z.uuid(),
|
|
|
|
|
companyId: z.uuid(),
|
|
|
|
|
values: WorkstationInputSchema,
|
|
|
|
|
history: z.array(WorkstationRevisionSchema).min(1),
|
|
|
|
|
});
|
2026-10-10 10:01:58 +00:00
|
|
|
|
2026-10-04 19:04:14 +00:00
|
|
|
export const WorkstationResponseSchema = z.strictObject({ workstation: WorkstationSchema });
|
2026-10-10 10:01:58 +00:00
|
|
|
|
2026-10-04 19:04:14 +00:00
|
|
|
export type WorkstationDTO = z.infer<typeof WorkstationSchema>;
|