import type { EquipmentViewModel } from "../equipment/equipment.models"; import type { InspectionPlanViewModel, InspectionPointViewModel, InspectionVersionedPlanViewModel, } from "./inspectionPlan.models"; import type { VehicleViewModel } from "../vehicle/vehicle.models"; import { WearableViewModel } from "../wearable/wearable.models"; export type InspectionRelated = { relatedId: string; } & ( | { assigned: "equipment"; related: EquipmentViewModel; } | { assigned: "vehicle"; related: VehicleViewModel; } | { assigned: "wearable"; related: WearableViewModel; } ); export type InspectionViewModel = { id: string; inspectionPlanId: string; inspectionPlan: InspectionPlanViewModel; inspectionVersionedPlanId: string; inspectionVersionedPlan: InspectionVersionedPlanViewModel; context: string; created: Date; finished?: Date; isOpen: boolean; nextInspection?: Date; checks: Array; } & InspectionRelated; export interface InspectionPointResultViewModel { inspectionId: string; inspectionVersionedPlanId: string; inspectionPointId: string; inspectionPoint: InspectionPointViewModel; value: string; }