This commit is contained in:
seb
2026-10-12 20:03:43 +02:00
parent 6b0839639d
commit 21663e4681
17 changed files with 2030 additions and 1 deletions

24
src/api/account.js Normal file
View File

@@ -0,0 +1,24 @@
import { http } from './http.js';
/**
* Company payment accounts.
*/
export const account = {
// #region GET /api/account — list
list() {
return http('/api/account');
},
// #endregion
// #region POST /api/account — create
create(body) {
return http('/api/account', { method: 'POST', body });
},
// #endregion
// #region DELETE /api/account/:id — delete
delete(id) {
return http(`/api/account/${id}`, { method: 'DELETE' });
},
// #endregion
};

View File

@@ -26,3 +26,8 @@ export { vfs } from './vfs.js';
export { warehouse } from './warehouse.js';
export { stock } from './stock.js';
export { globalHistory } from './globalHistory.js';
export { shipment } from './shipment.js';
export { shipping } from './shipping.js';
export { payment } from './payment.js';
export { account } from './account.js';

24
src/api/payment.js Normal file
View File

@@ -0,0 +1,24 @@
import { http } from './http.js';
/**
* Payments linked to orders (manifests).
*/
export const payment = {
// #region GET /api/order/:id/payment — listByOrder
listByOrder(orderId) {
return http(`/api/order/${orderId}/payment`);
},
// #endregion
// #region POST /api/order/:id/payment — create
create(orderId, body) {
return http(`/api/order/${orderId}/payment`, { method: 'POST', body });
},
// #endregion
// #region DELETE /api/payment/:id — delete
delete(id) {
return http(`/api/payment/${id}`, { method: 'DELETE' });
},
// #endregion
};

31
src/api/shipment.js Normal file
View File

@@ -0,0 +1,31 @@
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
};

30
src/api/shipping.js Normal file
View File

@@ -0,0 +1,30 @@
import { http } from './http.js';
/**
* Packages / logistics shipments attached to a shipment manifest.
*/
export const shipping = {
// #region GET /api/shipment/:id/shipping — listByShipment
listByShipment(shipmentId) {
return http(`/api/shipment/${shipmentId}/shipping`);
},
// #endregion
// #region POST /api/shipment/:id/shipping — create
create(shipmentId, body) {
return http(`/api/shipment/${shipmentId}/shipping`, { method: 'POST', body });
},
// #endregion
// #region PATCH /api/shipping/:id — update
update(id, body) {
return http(`/api/shipping/${id}`, { method: 'PATCH', body });
},
// #endregion
// #region DELETE /api/shipping/:id — delete
delete(id) {
return http(`/api/shipping/${id}`, { method: 'DELETE' });
},
// #endregion
};