46 lines
1.3 KiB
TypeScript
46 lines
1.3 KiB
TypeScript
|
|
import { z } from "zod/v4";
|
||
|
|
|
||
|
|
import { SoftwareInstallationInputSchema } from "../api/domain/software-installation-values";
|
||
|
|
|
||
|
|
export type { SoftwareInstallationInput } from "../api/domain/software-installation-values";
|
||
|
|
export {
|
||
|
|
SOFTWARE_STATE_TRANSITIONS,
|
||
|
|
SoftwareInstallationInputSchema,
|
||
|
|
} from "../api/domain/software-installation-values";
|
||
|
|
|
||
|
|
export const SoftwareParamsSchema = z.strictObject({ companyId: z.uuid() });
|
||
|
|
|
||
|
|
export const SoftwareItemParamsSchema = SoftwareParamsSchema.extend({ id: z.uuid() });
|
||
|
|
|
||
|
|
export const SaveSoftwareInstallationRequestSchema = z.strictObject({
|
||
|
|
values: SoftwareInstallationInputSchema,
|
||
|
|
});
|
||
|
|
|
||
|
|
export const SoftwareInstallationSchema = z.strictObject({
|
||
|
|
id: z.uuid(),
|
||
|
|
companyId: z.uuid(),
|
||
|
|
values: SoftwareInstallationInputSchema,
|
||
|
|
needsReview: z.boolean(),
|
||
|
|
history: z
|
||
|
|
.array(
|
||
|
|
z.strictObject({
|
||
|
|
id: z.uuid(),
|
||
|
|
actorId: z.uuid(),
|
||
|
|
actorName: z.string().min(1),
|
||
|
|
recordedAt: z.iso.datetime(),
|
||
|
|
values: SoftwareInstallationInputSchema,
|
||
|
|
})
|
||
|
|
)
|
||
|
|
.min(1),
|
||
|
|
});
|
||
|
|
|
||
|
|
export const SoftwareInstallationsResponseSchema = z.strictObject({
|
||
|
|
configurations: z.array(SoftwareInstallationSchema),
|
||
|
|
});
|
||
|
|
|
||
|
|
export const SoftwareInstallationResponseSchema = z.strictObject({
|
||
|
|
configuration: SoftwareInstallationSchema,
|
||
|
|
});
|
||
|
|
|
||
|
|
export type SoftwareInstallationDTO = z.infer<typeof SoftwareInstallationSchema>;
|