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 type { VehicleViewModel } from "../vehicle/vehicle.models";
|
|
|
|
|
|
|
|
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: EquipmentViewModel;
|
|
|
|
}
|
|
|
|
| {
|
|
|
|
assigned: "vehicle";
|
|
|
|
related: VehicleViewModel;
|
|
|
|
}
|
|
|
|
);
|
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-24 11:30:58 +02:00
|
|
|
export interface CreateInspectionPlanViewModel {
|
|
|
|
title: string;
|
|
|
|
inspectionInterval: PlanTimeDefinition;
|
|
|
|
remindTime: PlanTimeDefinition;
|
|
|
|
relatedId: string;
|
|
|
|
assigned: "vehicle" | "equipment";
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface UpdateInspectionPlanViewModel {
|
|
|
|
id: string;
|
|
|
|
title: string;
|
|
|
|
inspectionInterval: PlanTimeDefinition;
|
|
|
|
remindTime?: PlanTimeDefinition;
|
|
|
|
}
|