type safetiy
This commit is contained in:
parent
9b2ab1923e
commit
30baca2567
3 changed files with 37 additions and 9 deletions
|
@ -2,7 +2,7 @@ import type { EquipmentViewModel } from "../equipment/equipment.models";
|
|||
import type { VehicleViewModel } from "../vehicle/vehicle.models";
|
||||
import type { WearableViewModel } from "../wearable/wearable.models";
|
||||
|
||||
export interface DamageReportViewModel {
|
||||
export type DamageReportViewModel = {
|
||||
id: string;
|
||||
reported: Date;
|
||||
status: string;
|
||||
|
@ -10,9 +10,20 @@ export interface DamageReportViewModel {
|
|||
description: string;
|
||||
providedImage: Array<string>;
|
||||
relatedId: string;
|
||||
related: EquipmentViewModel | VehicleViewModel | WearableViewModel;
|
||||
affected: "equipment" | "vehicle" | "wearable";
|
||||
}
|
||||
} & (
|
||||
| {
|
||||
assigned: "equipment";
|
||||
related: EquipmentViewModel;
|
||||
}
|
||||
| {
|
||||
assigned: "vehicle";
|
||||
related: VehicleViewModel;
|
||||
}
|
||||
| {
|
||||
assigned: "wearable";
|
||||
related: WearableViewModel;
|
||||
}
|
||||
);
|
||||
|
||||
export interface CreateDamageReportViewModel {
|
||||
description: string;
|
||||
|
|
|
@ -5,7 +5,7 @@ import type {
|
|||
} from "../inspectionPlan/inspectionPlan.models";
|
||||
import type { VehicleViewModel } from "../vehicle/vehicle.models";
|
||||
|
||||
export interface InspectionViewModel {
|
||||
export type InspectionViewModel = {
|
||||
id: string;
|
||||
inspectionPlanId: string;
|
||||
inspectionPlan: InspectionPlanViewModel;
|
||||
|
@ -18,8 +18,16 @@ export interface InspectionViewModel {
|
|||
nextInspection?: Date;
|
||||
checks: Array<InspectionPointResultViewModel>;
|
||||
relatedId: string;
|
||||
related: EquipmentViewModel | VehicleViewModel;
|
||||
}
|
||||
} & (
|
||||
| {
|
||||
assigned: "equipment";
|
||||
related: EquipmentViewModel;
|
||||
}
|
||||
| {
|
||||
assigned: "vehicle";
|
||||
related: VehicleViewModel;
|
||||
}
|
||||
);
|
||||
|
||||
export interface InspectionPointViewModel {
|
||||
id: string;
|
||||
|
|
|
@ -6,7 +6,7 @@ import type { VehicleTypeViewModel } from "../vehicleType/vehicleType.models";
|
|||
|
||||
export type PlanTimeDefinition = `${number}-${"d" | "m" | "y"}` | `${number}/${number | "*"}`;
|
||||
|
||||
export interface InspectionPlanViewModel {
|
||||
export type InspectionPlanViewModel = {
|
||||
id: string;
|
||||
title: string;
|
||||
inspectionInterval: PlanTimeDefinition;
|
||||
|
@ -16,7 +16,16 @@ export interface InspectionPlanViewModel {
|
|||
inspectionPoints: InspectionPointViewModel[];
|
||||
relatedId: string;
|
||||
related: EquipmentTypeViewModel | VehicleTypeViewModel;
|
||||
}
|
||||
} & (
|
||||
| {
|
||||
assigned: "equipment";
|
||||
related: EquipmentViewModel;
|
||||
}
|
||||
| {
|
||||
assigned: "vehicle";
|
||||
related: VehicleViewModel;
|
||||
}
|
||||
);
|
||||
|
||||
export interface InspectionVersionedPlanViewModel {
|
||||
id: string;
|
||||
|
|
Loading…
Add table
Reference in a new issue