Warehouse

This commit is contained in:
Hagernesh
2026-06-17 12:44:57 +00:00
parent d5a536956f
commit f528b75737
26 changed files with 790 additions and 51 deletions

View File

@@ -15,6 +15,15 @@ export interface Cargo {
status: 'PENDING' | 'LOADED' | 'IN_TRANSIT' | 'DELIVERED' | 'UNLOADED';
loadedAt?: string;
unloadedAt?: string;
receiverName?: string | null;
deliveredAt?: string | null;
deliveryRemarks?: string | null;
}
export interface DeliverCargoPayload {
receiverName?: string;
pickupDate?: string;
deliveryRemarks?: string;
}
export const cargoService = {
@@ -26,6 +35,7 @@ export const cargoService = {
delete: (id: string) => apiClient.delete(`/cargoes/${id}`),
load: (cargoId: string, quantity: number, weight: number, volume?: number) =>
apiClient.post(`/cargoes/${cargoId}/load`, { quantity, weight, volume }),
deliver: (cargoId: string) => apiClient.post(`/cargoes/${cargoId}/deliver`),
deliver: (cargoId: string, payload?: DeliverCargoPayload) =>
apiClient.post(`/cargoes/${cargoId}/deliver`, payload ?? {}),
unload: (cargoId: string) => apiClient.post(`/cargoes/${cargoId}/unload`),
};