u
This commit is contained in:
@@ -633,6 +633,58 @@ export const supplier = {
|
||||
},
|
||||
};
|
||||
|
||||
/**
|
||||
* Company-scoped warehouses / Lager (selectedCompanyId from session).
|
||||
* Shape: Warehouse = { id, name }
|
||||
*/
|
||||
export const warehouse = {
|
||||
/** GET /api/warehouse → { warehouses: Warehouse[] } */
|
||||
list() {
|
||||
return http('/api/warehouse');
|
||||
},
|
||||
|
||||
/** GET /api/warehouse/:id → { warehouse: Warehouse } */
|
||||
getById(id) {
|
||||
return http(`/api/warehouse/${id}`);
|
||||
},
|
||||
|
||||
/**
|
||||
* POST /api/warehouse
|
||||
* Body: { name } — empty name ⇒ 400 Name required.
|
||||
* → 201 { warehouse: Warehouse }
|
||||
*/
|
||||
create(body) {
|
||||
return http('/api/warehouse', { method: 'POST', body });
|
||||
},
|
||||
|
||||
/**
|
||||
* PATCH /api/warehouse/:id
|
||||
* Body: { name } — empty name ⇒ 400 Name required.
|
||||
* → 200 { warehouse: Warehouse }
|
||||
*/
|
||||
update(id, body) {
|
||||
return http(`/api/warehouse/${id}`, { method: 'PATCH', body });
|
||||
},
|
||||
|
||||
/** DELETE /api/warehouse/:id → 204 */
|
||||
delete(id) {
|
||||
return http(`/api/warehouse/${id}`, { method: 'DELETE' });
|
||||
},
|
||||
};
|
||||
|
||||
/**
|
||||
* Stock operations (manual stock adjustment).
|
||||
*/
|
||||
export const stock = {
|
||||
/**
|
||||
* POST /api/stock/adjust
|
||||
* Body: { sku, warehouseId, amount, text?, date?, externalNumber?, lines? }
|
||||
*/
|
||||
adjust(body) {
|
||||
return http('/api/stock/adjust', { method: 'POST', body });
|
||||
},
|
||||
};
|
||||
|
||||
/**
|
||||
* Company-scoped goods receipts (manifest type = delivery).
|
||||
* DeliverySummary = { id, number, externalNumber, type: 'delivery', supplierId, date }
|
||||
@@ -1264,4 +1316,6 @@ export default {
|
||||
supplier,
|
||||
thumb,
|
||||
unit,
|
||||
warehouse,
|
||||
stock,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user