ff-admin/src/viewmodels/admin/unit/repair.models.ts

59 lines
1.3 KiB
TypeScript
Raw Normal View History

2025-07-19 11:02:03 +02:00
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;
2025-07-25 11:05:01 +02:00
finishedBy?: string;
2025-07-19 11:02:03 +02:00
status: string;
responsible: string;
2025-07-21 12:58:32 +02:00
title: string;
2025-07-19 11:02:03 +02:00
description: string;
images: string[];
reportDocument: string;
reports: DamageReportViewModel[];
} & RepairAssigned;
export interface CreateRepairViewModel {
affected: "equipment" | "vehicle" | "wearable";
2025-07-21 12:58:32 +02:00
affectedId: string;
title: string;
description: string;
responsible: string;
reports: string[];
2025-07-19 11:02:03 +02:00
}
2025-07-22 13:10:04 +02:00
export interface UpdateRepairStatusViewModel {
2025-07-19 11:02:03 +02:00
id: string;
status: string;
done: boolean;
}
2025-07-22 13:10:04 +02:00
export interface UpdateRepairViewModel {
id: string;
title: string;
description: string;
responsible: string;
}