automation

This commit is contained in:
Hagernesh
2026-06-17 22:00:53 +00:00
parent 1db1467ea1
commit 5b8cb16c1a
12 changed files with 705 additions and 1 deletions

View File

@@ -2,6 +2,12 @@ import { api as apiClient } from '../auth/http';
import { URL_CONSTANTS } from '@/constants/URLS';
import type {
ArrivalQueueItem,
AutoLoadResult,
AutoUnloadResult,
InspectionAttachment,
InspectionReport,
InspectionReportPayload,
BookingScheduleView,
InventoryFilter,
InventoryInquiryFilter,
@@ -106,4 +112,37 @@ export const warehouseService = {
apiClient.get<WarehouseLoading[]>(URL_CONSTANTS.WAREHOUSE_LOADINGS.BASE, {
params: cleanParams(params ?? {}),
}),
// ── Batch 4.5: Arrival / Unload / Load automation ──────────────────────────
arrivalQueue: () =>
apiClient.get<ArrivalQueueItem[]>(URL_CONSTANTS.WAREHOUSE_INVENTORY.ARRIVAL_QUEUE),
autoUnloadArrived: () =>
apiClient.post<AutoUnloadResult>(URL_CONSTANTS.WAREHOUSE_INVENTORY.AUTO_UNLOAD_ARRIVED),
autoLoadReady: () =>
apiClient.post<AutoLoadResult>(URL_CONSTANTS.WAREHOUSE_INVENTORY.AUTO_LOAD_READY),
unloadBooking: (bookingId: string, payload?: Record<string, unknown>) =>
apiClient.post<WarehouseInventoryItem>(
URL_CONSTANTS.WAREHOUSE_INVENTORY.UNLOAD_BOOKING(bookingId),
payload ?? {},
),
// ── Batch 4.5: Inspection reports ──────────────────────────────────────────
listInspectionReports: (inventoryId: string) =>
apiClient.get<InspectionReport[]>(URL_CONSTANTS.WAREHOUSE_INVENTORY.INSPECTION_REPORTS(inventoryId)),
createInspectionReport: (inventoryId: string, payload: InspectionReportPayload) =>
apiClient.post<InspectionReport>(
URL_CONSTANTS.WAREHOUSE_INVENTORY.INSPECTION_REPORTS(inventoryId),
payload,
),
getInspectionReport: (id: string) =>
apiClient.get<InspectionReport>(URL_CONSTANTS.WAREHOUSE_INSPECTION.BY_ID(id)),
uploadInspectionAttachments: (id: string, files: File[]) => {
const form = new FormData();
files.forEach((file) => form.append('files', file));
return apiClient.post<InspectionAttachment[]>(
URL_CONSTANTS.WAREHOUSE_INSPECTION.ATTACHMENTS(id),
form,
{ headers: { 'Content-Type': 'multipart/form-data' } },
);
},
};