erp-pos-ecommerce-shared 0.2.18 → 0.2.19

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/queries.d.ts CHANGED
@@ -4,9 +4,9 @@ import * as _tanstack_react_query from '@tanstack/react-query';
4
4
  import { QueryClient, UseMutationOptions } from '@tanstack/react-query';
5
5
  import { b as IAttributeQueryParams, c as IAttributeResponse, I as IAttribute, d as IAttributeValue, i as ICategoryResponse, g as ICategory, f as IBatchResponse, e as IBatch } from './filters.interface-BwMi9FRP.js';
6
6
  import { aA as UserResponse, $ as IUser, A as AgentResponse, a0 as IUserForm, a2 as IWareHouseResponse, a1 as IWareHouse, k as IClientResponse, l as IClientResponseById, h as IClient, j as IClientRequest, g as IBankTerminalResponse, d as IBankTerminal, a as BankTerminalResponse, e as IBankTerminalForm, U as IRole, O as IProviderResponse, L as IProvider, M as IProviderForSelect, N as IProviderRequest, o as ILocationResponse, n as ILocation, p as IMaterial, G as IPriceTypeResponse, F as IPriceType, z as IPermissionRole, a8 as PermissionRole, J as IPromotionResponse, H as IPromotion, K as IPromotionType, x as IPaymentMethod, y as IPaymentMethodAmountExpected, w as IPayment, Z as ITax, r as IModule, Y as ITag, ab as PricePerGramResponse, E as IPricePerGramHistory, az as UpdatePriceRequest, ag as SchedulePriceRequest, a9 as PriceCalculationResponse, C as CalculatePriceRequest, c as ComparisonBy, V as IStockByWarehouseReport, R as IReportX, P as IReportComparisonByTimeFrame, Q as IReportInventory, S as IReportZ, ak as TblOrderDetail, X as IStockMovementResponse, W as IStockMovement } from './warehouse.interface-S5seQY-_.js';
7
- import { W as WarehouseResponse, U as UpdateBatchData, L as LocationResponse, M as MaterialResponse, b as IExchangeResponse, I as IExchange, P as PaymentType, c as IUpdatePermission, d as LoginResponse, S as StateResponse, e as PrintQRResponse, G as GetReturnsByOrderIdResponse } from './warehouse.service-C51KYjQB.js';
8
- import { F as FolioResponse } from './shift.queries-Cy85o6l8.js';
9
- export { C as CloseShiftData, G as GenderResponse, H as HealthCheckResponse, P as ProductQueryParams, U as UseOrdersParams, g as genderQueryKeys, a as genders, h as health, b as healthQueryKeys, o as orderQueryKeys, c as orders, p as productQueryKeys, d as products, s as shifts } from './shift.queries-Cy85o6l8.js';
7
+ import { W as WarehouseResponse, U as UpdateBatchData, L as LocationResponse, M as MaterialResponse, b as IExchangeResponse, I as IExchange, P as PaymentType, c as IUpdatePermission, d as LoginResponse, S as StateResponse, e as PrintQRResponse, G as GetReturnsByOrderIdResponse } from './warehouse.service-CV2UDqAD.js';
8
+ import { F as FolioResponse } from './shift.queries-CaMY7FWd.js';
9
+ export { C as CloseShiftData, G as GenderResponse, H as HealthCheckResponse, P as ProductQueryParams, U as UseOrdersParams, g as genderQueryKeys, a as genders, h as health, b as healthQueryKeys, o as orderQueryKeys, c as orders, p as productQueryKeys, d as products, s as shifts } from './shift.queries-CaMY7FWd.js';
10
10
  import '@tanstack/react-table';
11
11
 
12
12
  declare const attributeQueryKeys: {
@@ -764,6 +764,7 @@ declare const batchQueryKeys: {
764
764
  productId?: number;
765
765
  };
766
766
  }];
767
+ detail: (batchId: number) => readonly ["batches", "detail", number];
767
768
  forSelect: () => readonly ["batches", "select"];
768
769
  matched: (productDetailId: number) => readonly ["batches", "matched", number];
769
770
  };
@@ -804,6 +805,14 @@ declare const batches: {
804
805
  [dataTagErrorSymbol]: Error;
805
806
  };
806
807
  };
808
+ getBatchById: (batchId: number) => _tanstack_query_core.OmitKeyof<_tanstack_react_query.UseQueryOptions<IBatch, Error, IBatch, readonly ["batches", "detail", number]>, "queryFn"> & {
809
+ queryFn?: _tanstack_query_core.QueryFunction<IBatch, readonly ["batches", "detail", number], never> | undefined;
810
+ } & {
811
+ queryKey: readonly ["batches", "detail", number] & {
812
+ [dataTagSymbol]: IBatch;
813
+ [dataTagErrorSymbol]: Error;
814
+ };
815
+ };
807
816
  getBatchesForTable: (params: TableQueryParams & {
808
817
  productId?: number;
809
818
  }) => _tanstack_query_core.OmitKeyof<_tanstack_react_query.UseQueryOptions<IBatchResponse, Error, IBatchResponse, readonly ["batches", "list", {
package/dist/queries.js CHANGED
@@ -1226,6 +1226,10 @@ var createBatchAndUpdateOtherBatches = async (batch) => {
1226
1226
  const { data } = await api.post("batch/create-batch-and-update-other-batches", batch);
1227
1227
  return data;
1228
1228
  };
1229
+ var getBatchById = async (batchId) => {
1230
+ const { data } = await api.get(`batch/${batchId}`);
1231
+ return data;
1232
+ };
1229
1233
  var getMatchedBatches = async ({
1230
1234
  productDetailId
1231
1235
  }) => {
@@ -1247,6 +1251,7 @@ var batchQueryKeys = {
1247
1251
  all: ["batches"],
1248
1252
  lists: () => [...batchQueryKeys.all, "list"],
1249
1253
  list: (params) => [...batchQueryKeys.lists(), { filters: params }],
1254
+ detail: (batchId) => [...batchQueryKeys.all, "detail", batchId],
1250
1255
  forSelect: () => [...batchQueryKeys.all, "select"],
1251
1256
  matched: (productDetailId) => [...batchQueryKeys.all, "matched", productDetailId]
1252
1257
  };
@@ -1263,6 +1268,12 @@ var batches = {
1263
1268
  queryKey: batchQueryKeys.list(params),
1264
1269
  staleTime: 3e4
1265
1270
  }),
1271
+ getBatchById: (batchId) => queryOptions({
1272
+ queryFn: () => getBatchById(batchId),
1273
+ queryKey: batchQueryKeys.detail(batchId),
1274
+ enabled: !!batchId && batchId > 0,
1275
+ staleTime: 3e4
1276
+ }),
1266
1277
  getBatchesForTable: (params) => queryOptions({
1267
1278
  queryFn: () => getBatches({
1268
1279
  skip: params.skip ?? 0,