import type { EquipmentViewModel } from "../equipment/equipment.models"; import type { EquipmentTypeViewModel } from "../equipmentType/equipmentType.models"; import type { VehicleViewModel } from "../vehicle/vehicle.models"; import type { VehicleTypeViewModel } from "../vehicleType/vehicleType.models"; export type PlanTimeDefinition = `${number}-${"d" | "m" | "y"}` | `${number}/${number | "*"}`; export interface InspectionPlanViewModel { id: string; title: string; inspectionInterval: PlanTimeDefinition; remindTime: PlanTimeDefinition; version: number; created: Date; inspectionPoints: InspectionPointViewModel[]; relatedId: string; related: EquipmentTypeViewModel | VehicleTypeViewModel; } export interface InspectionVersionedPlanViewModel { id: string; version: number; created: Date; inspectionPoints: InspectionPointViewModel[]; } 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; } export interface InspectionPointViewModel { id: string; title: string; description: string; type: "iO-niO" | "text" | "number"; } export interface InspectionViewModel { id: string; inspectionPlanId: string; inspectionPlan: InspectionPlanViewModel; inspectionVersionedPlanId: string; inspectionVersionedPlan: InspectionVersionedPlanViewModel; context: string; created: Date; finished?: Date; isOpen: boolean; nextInspection?: Date; checks: Array; relatedId: string; related: EquipmentViewModel | VehicleViewModel; } export interface InspectionPointResultViewModel { inspectionId: string; inspectionVersionedPlanId: string; inspectionVersionedPlan: InspectionVersionedPlanViewModel; inspectionPointId: string; inspectionPoint: InspectionPointViewModel; value: string; }