factory and restructure view models

This commit is contained in:
Julian Krauser 2025-05-28 18:30:00 +02:00
parent fcbfe560c3
commit 117ced38ab
33 changed files with 479 additions and 46 deletions

View file

@ -1,40 +0,0 @@
import type { EquipmentViewModel } from "../equipment/equipment.models";
import type { VehicleViewModel } from "../vehicle/vehicle.models";
import type { WearableViewModel } from "../wearable/wearable.models";
export type DamageReportViewModel = {
id: string;
reported: Date;
status: string;
done: boolean;
description: string;
providedImage: Array<string>;
reportedBy: string;
relatedId: string;
} & (
| {
assigned: "equipment";
related: EquipmentViewModel;
}
| {
assigned: "vehicle";
related: VehicleViewModel;
}
| {
assigned: "wearable";
related: WearableViewModel;
}
);
export interface CreateDamageReportViewModel {
description: string;
reportedBy: string;
affectedId: string;
affected: "equipment" | "vehicle" | "wearable";
}
export interface UpdateDamageReportViewModel {
id: string;
status: string;
done: boolean;
}