This commit is contained in:
natib21
2026-07-03 19:17:45 +00:00
parent 2550172480
commit a1dfb439ff
9 changed files with 289 additions and 131 deletions

View File

@@ -22,6 +22,8 @@ export interface LastMileBooking {
originYard?: { id: string; name?: string; label?: string } | null;
destinationYard?: { id: string; name?: string; label?: string } | null;
cargoType?: { id: string; name?: string; label?: string; cargoTypeName?: string } | null;
/** Container lines — total container count drives how many trucks are needed. */
bookingContainers?: Array<{ id: string; quantity: number }>;
}
export interface LastMileVehicle {
@@ -48,6 +50,8 @@ export interface LastMileRecord {
vehicleId?: string | null;
booking?: LastMileBooking | null;
vehicle?: LastMileVehicle | null;
/** Full set of vehicles serving this delivery (multi-truck). */
vehicleAssignments?: Array<{ id: string; vehicleId: string; vehicle?: LastMileVehicle | null }>;
createdAt: string;
updatedAt: string;
}
@@ -69,4 +73,6 @@ export const lastMileService = {
api.post<LastMileRecord>(LM.ACCEPT(encodeURIComponent(bookingReference))),
remove: (id: string) =>
api.delete<void>(LM.BY_ID(id)),
setVehicles: (id: string, vehicleIds: string[]) =>
api.post<LastMileRecord>(`${LM.BASE}/${id}/vehicles`, { vehicleIds }),
};