ff-admin-server/src/viewmodel/admin/unit/inspection/inspectionPlan.models.ts

53 lines
1.4 KiB
TypeScript
Raw Normal View History

2025-05-24 13:51:38 +02:00
import { InspectionPointEnum } from "../../../../enums/inspectionEnum";
2025-05-24 11:30:58 +02:00
import type { EquipmentViewModel } from "../equipment/equipment.models";
import { EquipmentTypeViewModel } from "../equipment/equipmentType.models";
2025-05-24 11:30:58 +02:00
import type { VehicleViewModel } from "../vehicle/vehicle.models";
import { VehicleTypeViewModel } from "../vehicle/vehicleType.models";
2025-06-13 11:31:34 +02:00
import { WearableTypeViewModel } from "../wearable/wearableType.models";
2025-05-24 11:30:58 +02:00
export type PlanTimeDefinition = `${number}-${"d" | "m" | "y"}` | `${number}/${number | "*"}`;
2025-06-13 11:31:34 +02:00
export type InspectionPlanRelated = {
2025-05-24 11:30:58 +02:00
relatedId: string;
2025-05-24 13:51:38 +02:00
} & (
| {
assigned: "equipment";
related: EquipmentTypeViewModel;
2025-05-24 13:51:38 +02:00
}
| {
assigned: "vehicle";
related: VehicleTypeViewModel;
2025-05-24 13:51:38 +02:00
}
2025-06-13 11:31:34 +02:00
| {
assigned: "wearable";
related: WearableTypeViewModel;
}
2025-05-24 13:51:38 +02:00
);
2025-05-24 11:30:58 +02:00
2025-06-13 11:31:34 +02:00
export type InspectionPlanViewModel = {
id: string;
title: string;
inspectionInterval: PlanTimeDefinition;
remindTime: PlanTimeDefinition;
version: number;
created: Date;
inspectionPoints: InspectionPointViewModel[];
} & InspectionPlanRelated;
2025-05-24 11:30:58 +02:00
export interface InspectionVersionedPlanViewModel {
id: string;
version: number;
created: Date;
inspectionPoints: InspectionPointViewModel[];
}
2025-05-24 13:51:38 +02:00
export interface InspectionPointViewModel {
id: string;
title: string;
description: string;
type: InspectionPointEnum;
min?: number;
2025-05-28 18:30:00 +02:00
max?: number;
sort: number;
2025-05-24 13:51:38 +02:00
}