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 { VehicleViewModel } from "../vehicle/vehicle.models";
|
||||||
import type { WearableViewModel } from "../wearable/wearable.models";
|
import type { WearableViewModel } from "../wearable/wearable.models";
|
||||||
|
|
||||||
export interface DamageReportViewModel {
|
export type DamageReportViewModel = {
|
||||||
id: string;
|
id: string;
|
||||||
reported: Date;
|
reported: Date;
|
||||||
status: string;
|
status: string;
|
||||||
|
@ -10,9 +10,20 @@ export interface DamageReportViewModel {
|
||||||
description: string;
|
description: string;
|
||||||
providedImage: Array<string>;
|
providedImage: Array<string>;
|
||||||
relatedId: 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 {
|
export interface CreateDamageReportViewModel {
|
||||||
description: string;
|
description: string;
|
||||||
|
|
|
@ -5,7 +5,7 @@ import type {
|
||||||
} from "../inspectionPlan/inspectionPlan.models";
|
} from "../inspectionPlan/inspectionPlan.models";
|
||||||
import type { VehicleViewModel } from "../vehicle/vehicle.models";
|
import type { VehicleViewModel } from "../vehicle/vehicle.models";
|
||||||
|
|
||||||
export interface InspectionViewModel {
|
export type InspectionViewModel = {
|
||||||
id: string;
|
id: string;
|
||||||
inspectionPlanId: string;
|
inspectionPlanId: string;
|
||||||
inspectionPlan: InspectionPlanViewModel;
|
inspectionPlan: InspectionPlanViewModel;
|
||||||
|
@ -18,8 +18,16 @@ export interface InspectionViewModel {
|
||||||
nextInspection?: Date;
|
nextInspection?: Date;
|
||||||
checks: Array<InspectionPointResultViewModel>;
|
checks: Array<InspectionPointResultViewModel>;
|
||||||
relatedId: string;
|
relatedId: string;
|
||||||
related: EquipmentViewModel | VehicleViewModel;
|
} & (
|
||||||
}
|
| {
|
||||||
|
assigned: "equipment";
|
||||||
|
related: EquipmentViewModel;
|
||||||
|
}
|
||||||
|
| {
|
||||||
|
assigned: "vehicle";
|
||||||
|
related: VehicleViewModel;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
export interface InspectionPointViewModel {
|
export interface InspectionPointViewModel {
|
||||||
id: string;
|
id: string;
|
||||||
|
|
|
@ -6,7 +6,7 @@ import type { VehicleTypeViewModel } from "../vehicleType/vehicleType.models";
|
||||||
|
|
||||||
export type PlanTimeDefinition = `${number}-${"d" | "m" | "y"}` | `${number}/${number | "*"}`;
|
export type PlanTimeDefinition = `${number}-${"d" | "m" | "y"}` | `${number}/${number | "*"}`;
|
||||||
|
|
||||||
export interface InspectionPlanViewModel {
|
export type InspectionPlanViewModel = {
|
||||||
id: string;
|
id: string;
|
||||||
title: string;
|
title: string;
|
||||||
inspectionInterval: PlanTimeDefinition;
|
inspectionInterval: PlanTimeDefinition;
|
||||||
|
@ -16,7 +16,16 @@ export interface InspectionPlanViewModel {
|
||||||
inspectionPoints: InspectionPointViewModel[];
|
inspectionPoints: InspectionPointViewModel[];
|
||||||
relatedId: string;
|
relatedId: string;
|
||||||
related: EquipmentTypeViewModel | VehicleTypeViewModel;
|
related: EquipmentTypeViewModel | VehicleTypeViewModel;
|
||||||
}
|
} & (
|
||||||
|
| {
|
||||||
|
assigned: "equipment";
|
||||||
|
related: EquipmentViewModel;
|
||||||
|
}
|
||||||
|
| {
|
||||||
|
assigned: "vehicle";
|
||||||
|
related: VehicleViewModel;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
export interface InspectionVersionedPlanViewModel {
|
export interface InspectionVersionedPlanViewModel {
|
||||||
id: string;
|
id: string;
|
||||||
|
|
Loading…
Add table
Reference in a new issue