u
This commit is contained in:
@@ -87,4 +87,17 @@ export const order = {
|
||||
return http(`/api/order/${id}/pdf`, { method: 'POST' });
|
||||
},
|
||||
// #endregion
|
||||
|
||||
/**
|
||||
* POST /api/order/:id/shipment
|
||||
* Creates shipment from order.
|
||||
* @param {number|string} id Order ID
|
||||
* @param {object} [body] Optional payload: { date?, externalNumber?, lines?: Array<{ sku: string, amount?: number }> }
|
||||
* → 201 { shipment: Shipment }
|
||||
*/
|
||||
// #region POST /api/order/:id/shipment — createShipment
|
||||
createShipment(id, body = {}) {
|
||||
return http(`/api/order/${id}/shipment`, { method: 'POST', body });
|
||||
},
|
||||
// #endregion
|
||||
};
|
||||
|
||||
@@ -86,5 +86,18 @@ export const quote = {
|
||||
return http(`/api/quote/${id}/file/${fileId}`, { method: 'DELETE' });
|
||||
},
|
||||
// #endregion
|
||||
|
||||
/**
|
||||
* POST /api/quote/:id/order
|
||||
* Converts quote into sales order.
|
||||
* @param {number|string} id Quote ID
|
||||
* @param {object} [body] Optional overrides: { number, date, entityId, externalNumber, lines }
|
||||
* → 201 { order: Order }
|
||||
*/
|
||||
// #region POST /api/quote/:id/order — createOrder
|
||||
createOrder(id, body = {}) {
|
||||
return http(`/api/quote/${id}/order`, { method: 'POST', body });
|
||||
},
|
||||
// #endregion
|
||||
};
|
||||
|
||||
|
||||
@@ -5,6 +5,26 @@ import { http } from './http.js';
|
||||
* Manifest number format: <orderNumber><shipmentPrefix><index>, e.g. AU-1001-L-1.
|
||||
*/
|
||||
export const shipment = {
|
||||
// #region GET /api/shipment — list
|
||||
list(params = {}) {
|
||||
const q = new URLSearchParams();
|
||||
if (params.offset != null) q.set('offset', String(params.offset));
|
||||
if (params.limit != null) q.set('limit', String(params.limit));
|
||||
if (params.search) q.set('search', String(params.search));
|
||||
if (params.state) q.set('state', String(params.state));
|
||||
if (params.orderId != null) q.set('orderId', String(params.orderId));
|
||||
if (params.seekMonths != null) q.set('seekMonths', String(params.seekMonths));
|
||||
const qs = q.toString();
|
||||
return http(`/api/shipment${qs ? `?${qs}` : ''}`);
|
||||
},
|
||||
// #endregion
|
||||
|
||||
// #region PATCH /api/shipment/:id — update
|
||||
update(id, body) {
|
||||
return http(`/api/shipment/${id}`, { method: 'PATCH', body });
|
||||
},
|
||||
// #endregion
|
||||
|
||||
// #region GET /api/order/:id/shipment — listByOrder
|
||||
listByOrder(orderId) {
|
||||
return http(`/api/order/${orderId}/shipment`);
|
||||
|
||||
Reference in New Issue
Block a user