52 lines
1.4 KiB
TypeScript
52 lines
1.4 KiB
TypeScript
import { InspectionPointEnum } from "../../../../enums/inspectionEnum";
|
|
import type { EquipmentViewModel } from "../equipment/equipment.models";
|
|
import { EquipmentTypeViewModel } from "../equipment/equipmentType.models";
|
|
import type { VehicleViewModel } from "../vehicle/vehicle.models";
|
|
import { VehicleTypeViewModel } from "../vehicle/vehicleType.models";
|
|
import { WearableTypeViewModel } from "../wearable/wearableType.models";
|
|
|
|
export type PlanTimeDefinition = `${number}-${"d" | "m" | "y"}` | `${number}/${number | "*"}`;
|
|
|
|
export type InspectionPlanRelated = {
|
|
relatedId: string;
|
|
} & (
|
|
| {
|
|
assigned: "equipment";
|
|
related: EquipmentTypeViewModel;
|
|
}
|
|
| {
|
|
assigned: "vehicle";
|
|
related: VehicleTypeViewModel;
|
|
}
|
|
| {
|
|
assigned: "wearable";
|
|
related: WearableTypeViewModel;
|
|
}
|
|
);
|
|
|
|
export type InspectionPlanViewModel = {
|
|
id: string;
|
|
title: string;
|
|
inspectionInterval: PlanTimeDefinition;
|
|
remindTime: PlanTimeDefinition;
|
|
version: number;
|
|
created: Date;
|
|
inspectionPoints: InspectionPointViewModel[];
|
|
} & InspectionPlanRelated;
|
|
|
|
export interface InspectionVersionedPlanViewModel {
|
|
id: string;
|
|
version: number;
|
|
created: Date;
|
|
inspectionPoints: InspectionPointViewModel[];
|
|
}
|
|
|
|
export interface InspectionPointViewModel {
|
|
id: string;
|
|
title: string;
|
|
description: string;
|
|
type: InspectionPointEnum;
|
|
min?: number;
|
|
max?: number;
|
|
sort: number;
|
|
}
|