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

45 lines
1.2 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-05-24 11:30:58 +02:00
export type PlanTimeDefinition = `${number}-${"d" | "m" | "y"}` | `${number}/${number | "*"}`;
2025-05-24 13:51:38 +02:00
export type InspectionPlanViewModel = {
2025-05-24 11:30:58 +02:00
id: string;
title: string;
inspectionInterval: PlanTimeDefinition;
remindTime: PlanTimeDefinition;
version: number;
created: Date;
inspectionPoints: InspectionPointViewModel[];
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-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
}