@arascreative/erp-api-client 2.0.0 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +13 -11
- package/dist/index.d.ts +13 -11
- package/dist/index.js +6 -5
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +6 -5
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -468,15 +468,15 @@ var useCreateBatch = (options, queryClient) => {
|
|
|
468
468
|
const mutationOptions = getCreateBatchMutationOptions(options);
|
|
469
469
|
return useMutation(mutationOptions, queryClient);
|
|
470
470
|
};
|
|
471
|
-
var consumeBatch = (
|
|
472
|
-
return axios.post(`/api/batches/${
|
|
471
|
+
var consumeBatch = (itemId, consumeBatchRequest, options) => {
|
|
472
|
+
return axios.post(`/api/batches/${itemId}/consume`, consumeBatchRequest, options);
|
|
473
473
|
};
|
|
474
474
|
var getConsumeBatchMutationOptions = (options) => {
|
|
475
475
|
const mutationKey = ["consumeBatch"];
|
|
476
476
|
const { mutation: mutationOptions, axios: axiosOptions } = options ? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey ? options : { ...options, mutation: { ...options.mutation, mutationKey } } : { mutation: { mutationKey }, axios: void 0 };
|
|
477
477
|
const mutationFn = (props) => {
|
|
478
|
-
const {
|
|
479
|
-
return consumeBatch(
|
|
478
|
+
const { itemId, data } = props ?? {};
|
|
479
|
+
return consumeBatch(itemId, data, axiosOptions);
|
|
480
480
|
};
|
|
481
481
|
return { mutationFn, ...mutationOptions };
|
|
482
482
|
};
|
|
@@ -1301,9 +1301,10 @@ var createBatchBody = zod.strictObject({
|
|
|
1301
1301
|
receivedBy: zod.string().nullish()
|
|
1302
1302
|
});
|
|
1303
1303
|
var consumeBatchParams = zod.strictObject({
|
|
1304
|
-
|
|
1304
|
+
itemId: zod.uuid().describe("Stock item identifier.")
|
|
1305
1305
|
});
|
|
1306
1306
|
var consumeBatchBody = zod.strictObject({
|
|
1307
|
+
warehouseId: zod.uuid(),
|
|
1307
1308
|
quantity: zod.number(),
|
|
1308
1309
|
sourceType: zod.enum([
|
|
1309
1310
|
"LOAN_OUT",
|