Warehouse zone occupancy heatmap

Visualize live per-zone occupancy on the warehouse detail page.
This commit is contained in:
Hagernesh
2026-07-13 11:38:23 +00:00
parent 1034756bab
commit 4e8d35a7fb
18 changed files with 550 additions and 1 deletions

View File

@@ -108,6 +108,20 @@ export const lastMileService = {
) => api.post<LastMileRecord>(`${LM.BASE}/${id}/distances`, { distances, remainingPayment }),
generateInvoice: (id: string) =>
api.post<{ id: string; invoiceNumber?: string } | null>(`${LM.BASE}/${id}/invoice`),
/** Record proof of delivery (recipient signature + photos) and complete the leg. */
recordProofOfDelivery: (
id: string,
payload: { recipientName: string; notes?: string; signature?: Blob | null; photos?: File[] },
) => {
const form = new FormData();
form.append("recipientName", payload.recipientName);
if (payload.notes) form.append("notes", payload.notes);
if (payload.signature) form.append("signature", payload.signature, "signature.png");
(payload.photos ?? []).forEach((photo) => form.append("photos", photo));
return api.post<LastMileRecord>(LM.PROOF_OF_DELIVERY(id), form, {
headers: { "Content-Type": "multipart/form-data" },
});
},
/** Generate a truck-detention invoice (per truck per day after the grace window). */
generateTruckDetentionInvoice: (id: string) =>
api.post<{ id: string; invoiceNumber?: string } | null>(

View File

@@ -4,6 +4,7 @@ import { api as apiClient } from '../auth/http';
import { URL_CONSTANTS } from '@/constants/URLS';
import type {
ZoneOccupancy,
AllocationCriteria,
AllocationPreviewResult,
AllocationRule,
@@ -365,6 +366,10 @@ export const warehouseService = {
// ── Batch 4.5: Arrival / Unload / Load automation ──────────────────────────
arrivalQueue: () =>
apiClient.get<ArrivalQueueItem[]>(URL_CONSTANTS.WAREHOUSE_INVENTORY.ARRIVAL_QUEUE),
zoneOccupancy: (yardId?: string) =>
apiClient.get<ZoneOccupancy[]>(
URL_CONSTANTS.WAREHOUSE_INVENTORY.ZONE_OCCUPANCY(yardId),
),
autoUnloadArrived: () =>
apiClient.post<AutoUnloadResult>(URL_CONSTANTS.WAREHOUSE_INVENTORY.AUTO_UNLOAD_ARRIVED),
autoLoadReady: () =>