mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-09-09 01:18:18 +00:00
Display cargo warehouse location (warehouse, yard, zone, arrival time) on the portal booking detail page once the cargo has been received and assigned to a warehouse location. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
57 lines
1.3 KiB
TypeScript
57 lines
1.3 KiB
TypeScript
import { client } from "@/utils/api";
|
|
|
|
export interface InventoryFilter {
|
|
bookingId?: string;
|
|
}
|
|
|
|
export interface WarehouseInventoryItem {
|
|
id: string;
|
|
bookingId: string | null;
|
|
warehouseId: string;
|
|
yardId: string;
|
|
zoneId: string;
|
|
status: string;
|
|
arrivedAt: string | null;
|
|
warehouse?: {
|
|
id: string;
|
|
name: string;
|
|
code: string;
|
|
} | null;
|
|
yard?: {
|
|
id: string;
|
|
name: string;
|
|
code: string;
|
|
} | null;
|
|
zone?: {
|
|
id: string;
|
|
name: string;
|
|
code: string;
|
|
} | null;
|
|
}
|
|
|
|
export interface BookingScheduleView {
|
|
schedule: {
|
|
status: string;
|
|
scheduledDepartureDate: string | null;
|
|
scheduledArrivalDate: string | null;
|
|
} | null;
|
|
wagon?: {
|
|
wagonNumber: string | null;
|
|
sequenceNo: number | null;
|
|
} | null;
|
|
}
|
|
|
|
export const warehouseService = {
|
|
listInventory: async (filter?: InventoryFilter): Promise<WarehouseInventoryItem[]> => {
|
|
const { data } = await client.get("/warehouse-inventory", {
|
|
params: filter,
|
|
});
|
|
return data?.data ?? data ?? [];
|
|
},
|
|
|
|
bookingSchedule: async (bookingId: string): Promise<BookingScheduleView> => {
|
|
const { data } = await client.get(`/warehouse-inventory/booking-schedule/${bookingId}`);
|
|
return data?.data ?? data ?? { schedule: null, wagon: null };
|
|
},
|
|
};
|