factory and restructure view models
This commit is contained in:
parent
fcbfe560c3
commit
117ced38ab
33 changed files with 479 additions and 46 deletions
|
@ -1,15 +1,8 @@
|
|||
import type { EquipmentViewModel } from "../equipment/equipment.models";
|
||||
import type { VehicleViewModel } from "../vehicle/vehicle.models";
|
||||
import type { WearableViewModel } from "../wearable/wearable.models";
|
||||
import { EquipmentViewModel } from "./equipment/equipment.models";
|
||||
import { VehicleViewModel } from "./vehicle/vehicle.models";
|
||||
import { WearableViewModel } from "./wearable/wearable.models";
|
||||
|
||||
export type DamageReportViewModel = {
|
||||
id: string;
|
||||
reported: Date;
|
||||
status: string;
|
||||
done: boolean;
|
||||
description: string;
|
||||
providedImage: Array<string>;
|
||||
reportedBy: string;
|
||||
export type DamageReportAssigned = {
|
||||
relatedId: string;
|
||||
} & (
|
||||
| {
|
||||
|
@ -26,6 +19,16 @@ export type DamageReportViewModel = {
|
|||
}
|
||||
);
|
||||
|
||||
export type DamageReportViewModel = {
|
||||
id: string;
|
||||
reported: Date;
|
||||
status: string;
|
||||
done: boolean;
|
||||
description: string;
|
||||
imageCount: number;
|
||||
reportedBy: string;
|
||||
} & DamageReportAssigned;
|
||||
|
||||
export interface CreateDamageReportViewModel {
|
||||
description: string;
|
||||
reportedBy: string;
|
|
@ -1,5 +1,4 @@
|
|||
import type { EquipmentTypeViewModel } from "../equipmentType/equipmentType.models";
|
||||
import type { InspectionViewModel } from "../inspection/inspection.models";
|
||||
import type { EquipmentTypeViewModel } from "./equipmentType.models";
|
||||
|
||||
export interface EquipmentViewModel {
|
||||
id: string;
|
||||
|
@ -10,7 +9,6 @@ export interface EquipmentViewModel {
|
|||
decommissioned?: Date;
|
||||
equipmentTypeId: string;
|
||||
equipmentType: EquipmentTypeViewModel;
|
||||
inspections: Array<InspectionViewModel>;
|
||||
}
|
||||
|
||||
export interface CreateEquipmentViewModel {
|
||||
|
|
|
@ -1,10 +1,7 @@
|
|||
import type { InspectionPlanViewModel } from "../inspectionPlan/inspectionPlan.models";
|
||||
|
||||
export interface EquipmentTypeViewModel {
|
||||
id: string;
|
||||
type: string;
|
||||
description: string;
|
||||
inspectionPlans: Array<InspectionPlanViewModel>;
|
||||
}
|
||||
|
||||
export interface CreateEquipmentTypeViewModel {
|
|
@ -1,8 +1,9 @@
|
|||
import type { EquipmentViewModel } from "../equipment/equipment.models";
|
||||
import type {
|
||||
InspectionPlanViewModel,
|
||||
InspectionPointViewModel,
|
||||
InspectionVersionedPlanViewModel,
|
||||
} from "../inspectionPlan/inspectionPlan.models";
|
||||
} from "./inspectionPlan.models";
|
||||
import type { VehicleViewModel } from "../vehicle/vehicle.models";
|
||||
|
||||
export type InspectionViewModel = {
|
||||
|
@ -33,5 +34,6 @@ export interface InspectionPointResultViewModel {
|
|||
inspectionId: string;
|
||||
inspectionVersionedPlanId: string;
|
||||
inspectionPointId: string;
|
||||
inspectionPoint: InspectionPointViewModel;
|
||||
value: string;
|
||||
}
|
||||
|
|
|
@ -37,6 +37,8 @@ export interface InspectionPointViewModel {
|
|||
description: string;
|
||||
type: InspectionPointEnum;
|
||||
min?: number;
|
||||
max?: number;
|
||||
sort: number;
|
||||
}
|
||||
|
||||
export interface CreateInspectionPlanViewModel {
|
|
@ -1,5 +1,4 @@
|
|||
import type { InspectionViewModel } from "../inspection/inspection.models";
|
||||
import type { VehicleTypeViewModel } from "../vehicleType/vehicleType.models";
|
||||
import type { VehicleTypeViewModel } from "./vehicleType.models";
|
||||
|
||||
export interface VehicleViewModel {
|
||||
id: string;
|
||||
|
@ -10,7 +9,6 @@ export interface VehicleViewModel {
|
|||
decommissioned?: Date;
|
||||
vehicleTypeId: string;
|
||||
vehicleType: VehicleTypeViewModel;
|
||||
inspections: Array<InspectionViewModel>;
|
||||
}
|
||||
|
||||
export interface CreateVehicleViewModel {
|
||||
|
|
|
@ -1,10 +1,7 @@
|
|||
import type { InspectionPlanViewModel } from "../inspectionPlan/inspectionPlan.models";
|
||||
|
||||
export interface VehicleTypeViewModel {
|
||||
id: string;
|
||||
type: string;
|
||||
description: string;
|
||||
inspectionPlans: Array<InspectionPlanViewModel>;
|
||||
}
|
||||
|
||||
export interface CreateVehicleTypeViewModel {
|
|
@ -1,5 +1,5 @@
|
|||
import { MemberViewModel } from "../../club/member/member.models";
|
||||
import type { WearableTypeViewModel } from "../wearableType/wearableType.models";
|
||||
import type { WearableTypeViewModel } from "./wearableType.models";
|
||||
|
||||
export interface WearableViewModel {
|
||||
id: string;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue