base views and store
This commit is contained in:
parent
b9b0381356
commit
b56347c172
29 changed files with 655 additions and 22 deletions
48
src/viewmodels/admin/unit/repair.models.ts
Normal file
48
src/viewmodels/admin/unit/repair.models.ts
Normal file
|
@ -0,0 +1,48 @@
|
|||
import type { DamageReportViewModel } from "./damageReport.models";
|
||||
import type { EquipmentViewModel } from "./equipment/equipment.models";
|
||||
import type { MaintenanceViewModel } from "./maintenance.models";
|
||||
import type { VehicleViewModel } from "./vehicle/vehicle.models";
|
||||
import type { WearableViewModel } from "./wearable/wearable.models";
|
||||
|
||||
export type RepairAssigned = {
|
||||
relatedId: string;
|
||||
} & (
|
||||
| {
|
||||
assigned: "equipment";
|
||||
related: EquipmentViewModel;
|
||||
}
|
||||
| {
|
||||
assigned: "vehicle";
|
||||
related: VehicleViewModel;
|
||||
}
|
||||
| {
|
||||
assigned: "wearable";
|
||||
related: WearableViewModel;
|
||||
}
|
||||
);
|
||||
|
||||
export type RepairViewModel = {
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
finishedAt?: Date;
|
||||
status: string;
|
||||
responsible: string;
|
||||
description: string;
|
||||
images: string[];
|
||||
reportDocument: string;
|
||||
reports: DamageReportViewModel[];
|
||||
} & RepairAssigned;
|
||||
|
||||
export interface CreateRepairViewModel {
|
||||
description: string;
|
||||
reportedBy: string;
|
||||
affectedId: string;
|
||||
affected: "equipment" | "vehicle" | "wearable";
|
||||
}
|
||||
|
||||
export interface UpdateRepairViewModel {
|
||||
id: string;
|
||||
status: string;
|
||||
noteByWorker: string;
|
||||
done: boolean;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue