mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-30 12:18:11 +00:00
automation
This commit is contained in:
@@ -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' } },
|
||||
);
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user