metis-desk/modules/companies/src/common/software-installations.ts
David 3ceac47cd6 feat: implement software installation management
- Add SoftwareInstallationValues value object for encapsulating software installation data.
- Create HTTP routes for managing software installations, including GET, POST, and DELETE operations.
- Implement Sequelize repository for software installations, handling database interactions.
- Add migration script for creating necessary database tables for software installations.
- Create persistence mapper for transforming between domain models and database rows.
- Define snapshot schema for software installations to ensure data consistency.
- Introduce common schemas for software installations to validate API requests and responses.
- Develop UI components for displaying and managing software installations, including history dialogs and forms.
- Implement API client for interacting with software installation endpoints.
- Write tests for software installations panel and form components to ensure functionality.
2026-10-12 20:31:21 +02:00

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>;