add viewmodels from frontend
This commit is contained in:
parent
d7a0ee694f
commit
15a511f942
12 changed files with 307 additions and 0 deletions
27
src/viewmodel/admin/unit/damageReport/damageReport.models.ts
Normal file
27
src/viewmodel/admin/unit/damageReport/damageReport.models.ts
Normal file
|
@ -0,0 +1,27 @@
|
|||
import type { EquipmentViewModel } from "../equipment/equipment.models";
|
||||
import type { VehicleViewModel } from "../vehicle/vehicle.models";
|
||||
import type { WearableViewModel } from "../wearable/wearable.models";
|
||||
|
||||
export interface DamageReportViewModel {
|
||||
id: string;
|
||||
reported: Date;
|
||||
status: string;
|
||||
done: boolean;
|
||||
description: string;
|
||||
providedImage: Array<string>;
|
||||
relatedId: string;
|
||||
related: EquipmentViewModel | VehicleViewModel | WearableViewModel;
|
||||
affected: "equipment" | "vehicle" | "wearable";
|
||||
}
|
||||
|
||||
export interface CreateDamageReportViewModel {
|
||||
description: string;
|
||||
affectedId: string;
|
||||
affected: "equipment" | "vehicle" | "wearable";
|
||||
}
|
||||
|
||||
export interface UpdateDamageReportViewModel {
|
||||
id: string;
|
||||
status: string;
|
||||
done: boolean;
|
||||
}
|
31
src/viewmodel/admin/unit/equipment/equipment.models.ts
Normal file
31
src/viewmodel/admin/unit/equipment/equipment.models.ts
Normal file
|
@ -0,0 +1,31 @@
|
|||
import type { EquipmentTypeViewModel } from "../equipmentType/equipmentType.models";
|
||||
import type { InspectionViewModel } from "../inspection/inspection.models";
|
||||
|
||||
export interface EquipmentViewModel {
|
||||
id: string;
|
||||
code?: string;
|
||||
name: string;
|
||||
location: string;
|
||||
commissioned: Date;
|
||||
decommissioned?: Date;
|
||||
equipmentTypeId: string;
|
||||
equipmentType: EquipmentTypeViewModel;
|
||||
inspections: Array<InspectionViewModel>;
|
||||
}
|
||||
|
||||
export interface CreateEquipmentViewModel {
|
||||
code?: string;
|
||||
name: string;
|
||||
location: string;
|
||||
commissioned: Date;
|
||||
equipmentTypeId: string;
|
||||
}
|
||||
|
||||
export interface UpdateEquipmentViewModel {
|
||||
id: string;
|
||||
code?: string;
|
||||
name: string;
|
||||
location: string;
|
||||
commissioned: Date;
|
||||
decommissioned?: Date;
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
import type { InspectionPlanViewModel } from "../inspectionPlan/inspectionPlan.models";
|
||||
|
||||
export interface EquipmentTypeViewModel {
|
||||
id: string;
|
||||
type: string;
|
||||
description: string;
|
||||
inspectionPlans: Array<InspectionPlanViewModel>;
|
||||
}
|
||||
|
||||
export interface CreateEquipmentTypeViewModel {
|
||||
type: string;
|
||||
description: string;
|
||||
}
|
||||
|
||||
export interface UpdateEquipmentTypeViewModel {
|
||||
id: string;
|
||||
type: string;
|
||||
description: string;
|
||||
}
|
37
src/viewmodel/admin/unit/inspection/inspection.models.ts
Normal file
37
src/viewmodel/admin/unit/inspection/inspection.models.ts
Normal file
|
@ -0,0 +1,37 @@
|
|||
import type { EquipmentViewModel } from "../equipment/equipment.models";
|
||||
import type {
|
||||
InspectionPlanViewModel,
|
||||
InspectionVersionedPlanViewModel,
|
||||
} from "../inspectionPlan/inspectionPlan.models";
|
||||
import type { VehicleViewModel } from "../vehicle/vehicle.models";
|
||||
|
||||
export interface InspectionViewModel {
|
||||
id: string;
|
||||
inspectionPlanId: string;
|
||||
inspectionPlan: InspectionPlanViewModel;
|
||||
inspectionVersionedPlanId: string;
|
||||
inspectionVersionedPlan: InspectionVersionedPlanViewModel;
|
||||
context: string;
|
||||
created: Date;
|
||||
finished?: Date;
|
||||
isOpen: boolean;
|
||||
nextInspection?: Date;
|
||||
checks: Array<InspectionPointResultViewModel>;
|
||||
relatedId: string;
|
||||
related: EquipmentViewModel | VehicleViewModel;
|
||||
}
|
||||
|
||||
export interface InspectionPointViewModel {
|
||||
id: string;
|
||||
title: string;
|
||||
description: string;
|
||||
type: "iO-niO" | "text" | "number";
|
||||
min?: number;
|
||||
}
|
||||
|
||||
export interface InspectionPointResultViewModel {
|
||||
inspectionId: string;
|
||||
inspectionVersionedPlanId: string;
|
||||
inspectionPointId: string;
|
||||
value: string;
|
||||
}
|
|
@ -0,0 +1,41 @@
|
|||
import type { EquipmentViewModel } from "../equipment/equipment.models";
|
||||
import type { EquipmentTypeViewModel } from "../equipmentType/equipmentType.models";
|
||||
import type { InspectionPointViewModel } from "../inspection/inspection.models";
|
||||
import type { VehicleViewModel } from "../vehicle/vehicle.models";
|
||||
import type { VehicleTypeViewModel } from "../vehicleType/vehicleType.models";
|
||||
|
||||
export type PlanTimeDefinition = `${number}-${"d" | "m" | "y"}` | `${number}/${number | "*"}`;
|
||||
|
||||
export interface InspectionPlanViewModel {
|
||||
id: string;
|
||||
title: string;
|
||||
inspectionInterval: PlanTimeDefinition;
|
||||
remindTime: PlanTimeDefinition;
|
||||
version: number;
|
||||
created: Date;
|
||||
inspectionPoints: InspectionPointViewModel[];
|
||||
relatedId: string;
|
||||
related: EquipmentTypeViewModel | VehicleTypeViewModel;
|
||||
}
|
||||
|
||||
export interface InspectionVersionedPlanViewModel {
|
||||
id: string;
|
||||
version: number;
|
||||
created: Date;
|
||||
inspectionPoints: InspectionPointViewModel[];
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
import type { EquipmentViewModel } from "../equipment/equipment.models";
|
||||
|
||||
export interface RespiratoryGearViewModel {
|
||||
id: string;
|
||||
equipmentId: string;
|
||||
equipment: EquipmentViewModel;
|
||||
}
|
||||
|
||||
export interface CreateRespiratoryGearViewModel {
|
||||
equipmentId: string;
|
||||
}
|
||||
|
||||
export interface UpdateRespiratoryGearViewModel {
|
||||
id: string;
|
||||
equipmentId: string;
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
export interface RespiratoryMissionViewModel {
|
||||
id: string;
|
||||
date: Date;
|
||||
title: string;
|
||||
description: string;
|
||||
// refs to used respiratory gear and wearers
|
||||
}
|
||||
|
||||
export interface CreateRespiratoryMissionViewModel {
|
||||
date: Date;
|
||||
title: string;
|
||||
description: string;
|
||||
}
|
||||
|
||||
export interface UpdateRespiratoryMissionViewModel {
|
||||
id: string;
|
||||
date: Date;
|
||||
title: string;
|
||||
description: string;
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
import { MemberViewModel } from "../../club/member/member.models";
|
||||
|
||||
export interface RespiratoryWearerViewModel {
|
||||
id: string;
|
||||
memberId: string;
|
||||
member: MemberViewModel;
|
||||
}
|
||||
|
||||
export interface CreateRespiratoryWearerViewModel {
|
||||
memberId: string;
|
||||
}
|
||||
|
||||
export interface UpdateRespiratoryWearerViewModel {
|
||||
id: string;
|
||||
memberId: string;
|
||||
}
|
31
src/viewmodel/admin/unit/vehicle/vehicle.models.ts
Normal file
31
src/viewmodel/admin/unit/vehicle/vehicle.models.ts
Normal file
|
@ -0,0 +1,31 @@
|
|||
import type { InspectionViewModel } from "../inspection/inspection.models";
|
||||
import type { VehicleTypeViewModel } from "../vehicleType/vehicleType.models";
|
||||
|
||||
export interface VehicleViewModel {
|
||||
id: string;
|
||||
code?: string;
|
||||
name: string;
|
||||
location: string;
|
||||
commissioned: Date;
|
||||
decommissioned?: Date;
|
||||
vehicleTypeId: string;
|
||||
vehicleType: VehicleTypeViewModel;
|
||||
inspections: Array<InspectionViewModel>;
|
||||
}
|
||||
|
||||
export interface CreateVehicleViewModel {
|
||||
code?: string;
|
||||
name: string;
|
||||
location: string;
|
||||
commissioned: Date;
|
||||
vehicleTypeId: string;
|
||||
}
|
||||
|
||||
export interface UpdateVehicleViewModel {
|
||||
id: string;
|
||||
code?: string;
|
||||
name: string;
|
||||
location: string;
|
||||
commissioned: Date;
|
||||
decommissioned?: Date;
|
||||
}
|
19
src/viewmodel/admin/unit/vehicleType/vehicleType.models.ts
Normal file
19
src/viewmodel/admin/unit/vehicleType/vehicleType.models.ts
Normal file
|
@ -0,0 +1,19 @@
|
|||
import type { InspectionPlanViewModel } from "../inspectionPlan/inspectionPlan.models";
|
||||
|
||||
export interface VehicleTypeViewModel {
|
||||
id: string;
|
||||
type: string;
|
||||
description: string;
|
||||
inspectionPlans: Array<InspectionPlanViewModel>;
|
||||
}
|
||||
|
||||
export interface CreateVehicleTypeViewModel {
|
||||
type: string;
|
||||
description: string;
|
||||
}
|
||||
|
||||
export interface UpdateVehicleTypeViewModel {
|
||||
id: string;
|
||||
type: string;
|
||||
description: string;
|
||||
}
|
34
src/viewmodel/admin/unit/wearable/wearable.models.ts
Normal file
34
src/viewmodel/admin/unit/wearable/wearable.models.ts
Normal file
|
@ -0,0 +1,34 @@
|
|||
import { MemberViewModel } from "../../club/member/member.models";
|
||||
import type { WearableTypeViewModel } from "../wearableType/wearableType.models";
|
||||
|
||||
export interface WearableViewModel {
|
||||
id: string;
|
||||
code?: string;
|
||||
name: string;
|
||||
location: string;
|
||||
commissioned: Date;
|
||||
decommissioned?: Date;
|
||||
wearerId?: string;
|
||||
wearer?: MemberViewModel;
|
||||
wearableTypeId: string;
|
||||
wearableType: WearableTypeViewModel;
|
||||
}
|
||||
|
||||
export interface CreateWearableViewModel {
|
||||
code?: string;
|
||||
name: string;
|
||||
wearerId?: string;
|
||||
location?: string;
|
||||
commissioned: Date;
|
||||
wearableTypeId: string;
|
||||
}
|
||||
|
||||
export interface UpdateWearableViewModel {
|
||||
id: string;
|
||||
code?: string;
|
||||
name: string;
|
||||
location?: string;
|
||||
commissioned: Date;
|
||||
decommissioned?: Date;
|
||||
wearerId?: string;
|
||||
}
|
16
src/viewmodel/admin/unit/wearableType/wearableType.models.ts
Normal file
16
src/viewmodel/admin/unit/wearableType/wearableType.models.ts
Normal file
|
@ -0,0 +1,16 @@
|
|||
export interface WearableTypeViewModel {
|
||||
id: string;
|
||||
type: string;
|
||||
description: string;
|
||||
}
|
||||
|
||||
export interface CreateWearableTypeViewModel {
|
||||
type: string;
|
||||
description: string;
|
||||
}
|
||||
|
||||
export interface UpdateWearableTypeViewModel {
|
||||
id: string;
|
||||
type: string;
|
||||
description: string;
|
||||
}
|
Loading…
Add table
Reference in a new issue