47 lines
1.2 KiB
TypeScript
47 lines
1.2 KiB
TypeScript
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<InspectionPointResultViewModel>;
|
|
} & InspectionRelated;
|
|
|
|
export interface InspectionPointResultViewModel {
|
|
inspectionId: string;
|
|
inspectionVersionedPlanId: string;
|
|
inspectionPointId: string;
|
|
inspectionPoint: InspectionPointViewModel;
|
|
value: string;
|
|
}
|