ff-admin/src/viewmodels/admin/unit/inspectionPlan/inspectionPlan.models.ts

73 lines
2 KiB
TypeScript
Raw Normal View History

2025-05-14 14:42:00 +02:00
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";
2025-05-13 12:16:39 +02:00
export type PlanTimeDefinition = `${number}-${"d" | "m" | "y"}` | `${number}/${number | "*"}`;
2025-04-11 14:14:11 +02:00
export interface InspectionPlanViewModel {
id: string;
title: string;
2025-05-13 12:16:39 +02:00
inspectionInterval: PlanTimeDefinition;
remindTime: PlanTimeDefinition;
2025-04-28 12:29:44 +02:00
version: number;
2025-05-13 12:16:39 +02:00
created: Date;
inspectionPoints: InspectionPointViewModel[];
2025-05-14 14:42:00 +02:00
relatedId: string;
related: EquipmentTypeViewModel | VehicleTypeViewModel;
2025-05-13 12:16:39 +02:00
}
export interface InspectionVersionedPlanViewModel {
id: string;
version: number;
created: Date;
2025-04-28 12:29:44 +02:00
inspectionPoints: InspectionPointViewModel[];
2025-04-11 14:14:11 +02:00
}
export interface CreateInspectionPlanViewModel {
title: string;
2025-05-13 12:16:39 +02:00
inspectionInterval: PlanTimeDefinition;
remindTime: PlanTimeDefinition;
2025-05-14 14:42:00 +02:00
relatedId: string;
2025-05-14 09:13:47 +02:00
assigned: "vehicle" | "equipment";
2025-04-11 14:14:11 +02:00
}
export interface UpdateInspectionPlanViewModel {
id: string;
title: string;
2025-05-13 12:16:39 +02:00
inspectionInterval: PlanTimeDefinition;
remindTime?: PlanTimeDefinition;
2025-04-28 12:29:44 +02:00
}
export interface InspectionPointViewModel {
id: string;
title: string;
description: string;
type: "iO-niO" | "text" | "number";
2025-04-11 14:14:11 +02:00
}
2025-05-13 10:11:26 +02:00
2025-05-14 09:13:47 +02:00
export interface InspectionViewModel {
2025-05-13 10:11:26 +02:00
id: string;
2025-05-14 09:13:47 +02:00
inspectionPlanId: string;
inspectionPlan: InspectionPlanViewModel;
2025-05-13 12:16:39 +02:00
inspectionVersionedPlanId: string;
inspectionVersionedPlan: InspectionVersionedPlanViewModel;
context: string;
created: Date;
finished?: Date;
isOpen: boolean;
nextInspection?: Date;
2025-05-14 09:13:47 +02:00
checks: Array<InspectionPointResultViewModel>;
2025-05-14 14:42:00 +02:00
relatedId: string;
related: EquipmentViewModel | VehicleViewModel;
2025-05-13 10:11:26 +02:00
}
2025-05-14 09:13:47 +02:00
export interface InspectionPointResultViewModel {
2025-05-13 10:11:26 +02:00
inspectionId: string;
2025-05-13 12:16:39 +02:00
inspectionVersionedPlanId: string;
inspectionVersionedPlan: InspectionVersionedPlanViewModel;
2025-05-13 10:11:26 +02:00
inspectionPointId: string;
2025-05-13 12:16:39 +02:00
inspectionPoint: InspectionPointViewModel;
2025-05-13 10:11:26 +02:00
value: string;
}