import type { EquipmentTypeViewModel } from "../equipmentType/equipmentType.models"; import type { VehicleTypeViewModel } from "../vehicleType/vehicleType.models"; export type PlanTimeDefinition = `${number}-${"d" | "m" | "y"}` | `${number}/${number | "*"}`; export type InspectionPlanViewModel = { id: string; title: string; inspectionInterval: PlanTimeDefinition; remindTime: PlanTimeDefinition; version: number; created: Date; inspectionPoints: InspectionPointViewModel[]; relatedId: string; } & ( | { assigned: "equipment"; related: EquipmentTypeViewModel; } | { assigned: "vehicle"; related: VehicleTypeViewModel; } ); export interface InspectionVersionedPlanViewModel { id: string; version: number; created: Date; inspectionPoints: InspectionPointViewModel[]; } export interface InspectionPointViewModel { id: string; title: string; description: string; type: "iO-niO" | "text" | "number"; min?: number; } export interface CreateInspectionPlanViewModel { title: string; inspectionInterval: PlanTimeDefinition; remindTime: PlanTimeDefinition; relatedId: string; assigned: "vehicle" | "equipment"; } export interface UpdateInspectionPlanViewModel { id: string; title: string; inspectionInterval: PlanTimeDefinition; remindTime?: PlanTimeDefinition; }