38 lines
994 B
JavaScript
38 lines
994 B
JavaScript
import { http } from './http.js';
|
|
|
|
/**
|
|
* Outbound shipments (manifest type = shipment).
|
|
* Manifest number format: <orderNumber><shipmentPrefix><index>, e.g. AU-1001-L-1.
|
|
*/
|
|
export const shipment = {
|
|
// #region GET /api/order/:id/shipment — listByOrder
|
|
listByOrder(orderId) {
|
|
return http(`/api/order/${orderId}/shipment`);
|
|
},
|
|
// #endregion
|
|
|
|
// #region POST /api/order/:id/shipment — create
|
|
create(orderId, body) {
|
|
return http(`/api/order/${orderId}/shipment`, { method: 'POST', body });
|
|
},
|
|
// #endregion
|
|
|
|
// #region GET /api/shipment/:id — get
|
|
get(id) {
|
|
return http(`/api/shipment/${id}`);
|
|
},
|
|
// #endregion
|
|
|
|
// #region DELETE /api/shipment/:id — delete
|
|
delete(id) {
|
|
return http(`/api/shipment/${id}`, { method: 'DELETE' });
|
|
},
|
|
// #endregion
|
|
|
|
// #region DELETE /api/shipment/:id/file/:fileId — deleteFile
|
|
deleteFile(id, fileId) {
|
|
return http(`/api/shipment/${id}/file/${fileId}`, { method: 'DELETE' });
|
|
},
|
|
// #endregion
|
|
};
|