ff-admin-server/src/viewmodel/admin/unit/damageReport.models.ts

44 lines
947 B
TypeScript
Raw Normal View History

2025-05-28 18:30:00 +02:00
import { EquipmentViewModel } from "./equipment/equipment.models";
import { VehicleViewModel } from "./vehicle/vehicle.models";
import { WearableViewModel } from "./wearable/wearable.models";
2025-05-24 11:30:58 +02:00
2025-05-28 18:30:00 +02:00
export type DamageReportAssigned = {
2025-05-24 11:30:58 +02:00
relatedId: string;
2025-05-24 13:51:38 +02:00
} & (
| {
assigned: "equipment";
related: EquipmentViewModel;
}
| {
assigned: "vehicle";
related: VehicleViewModel;
}
| {
assigned: "wearable";
related: WearableViewModel;
}
);
2025-05-24 11:30:58 +02:00
2025-05-28 18:30:00 +02:00
export type DamageReportViewModel = {
id: string;
reported: Date;
status: string;
done: boolean;
description: string;
imageCount: number;
reportedBy: string;
} & DamageReportAssigned;
2025-05-24 11:30:58 +02:00
export interface CreateDamageReportViewModel {
description: string;
2025-05-28 17:06:56 +02:00
reportedBy: string;
2025-05-24 11:30:58 +02:00
affectedId: string;
affected: "equipment" | "vehicle" | "wearable";
}
export interface UpdateDamageReportViewModel {
id: string;
status: string;
done: boolean;
}