erp-pos-ecommerce-shared 0.2.0 → 0.2.1

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.
@@ -1,7 +1,7 @@
1
- export { B as BatchData, I as IAttribute, a as IAttributeResponse, b as IAttributeValue, c as IBatch, d as IBatchResponse, e as ICategory, f as ICategoryResponse, g as IFilterSelectOption, h as IFilterType, i as IProduct, j as IProductDetails, k as IProductDetailsResponse, l as IProductResponse, m as IProductVariantRequest, n as IStock, o as ITableFilterConfig, P as ProdStats, p as ProdStock, q as ProductOptions, T as TblCategories, r as TblMaterials, s as TblProductsImage, t as TblProductsTag, u as TblTags } from './filters.interface-Cx-AXMPz.js';
2
- export { A as AgentResponse, B as BankTerminalQuery, a as BankTerminalResponse, C as CalculatePriceRequest, b as ChartType, c as ComparisonBy, D as DateRange, I as IAgent, d as IBankTerminal, e as IBankTerminalForm, f as IBankTerminalOption, g as IBankTerminalResponse, h as IClient, i as IClientDataForTable, j as IClientRequest, k as IClientResponse, l as IClientResponseById, m as IGender, n as ILocation, o as ILocationResponse, p as IMaterial, q as IMeta, r as IModule, s as IMovement, t as IMovementResponse, u as IOrder, v as IOrderResponse, w as IPayment, x as IPaymentMethod, y as IPaymentMethodAmountExpected, z as IPermissionRole, E as IPricePerGramHistory, F as IPriceType, G as IPriceTypeResponse, H as IPromotion, J as IPromotionResponse, K as IPromotionType, L as IProvider, M as IProviderForSelect, N as IProviderRequest, O as IProviderResponse, P as IReportComparisonByTimeFrame, Q as IReportInventory, R as IReportX, S as IReportZ, T as IReview, U as IRole, V as IStockByWarehouseReport, W as IStockMovement, X as IStockMovementResponse, Y as ITag, Z as ITax, _ as ITaxResponse, $ as IUser, a0 as IUserForm, a1 as IWareHouse, a2 as IWareHouseResponse, a3 as IWareHouseSelect, a4 as MaterialSummary, a5 as PaymentOptions, a6 as Period, a7 as Permission, a8 as PermissionRole, a9 as PriceCalculationResponse, aa as PricePerGramForm, ab as PricePerGramResponse, ac as ProductInfo, ad as PromotionTypeEnum, ae as ReportData, af as ReportDataProduct, ag as SchedulePriceRequest, ah as TblModules, ai as TblMoneyTransactionTypes, aj as TblMoneyTransactions, ak as TblOrderDetail, al as TblOrderDetailsMoneyTransactions, am as TblOrderStatus, an as TblPermissions, ao as TblPriceTypes, ap as TblProducts, aq as TblPromotionTypes, ar as TblPromotionsTargetProductIDTotblProduct, as as TblProvidersTblProvidersUserIDTotblUser, at as TblReturn, au as TblReturnDetail, av as TblRoles, aw as TblRolesTblUsersRoleIDTotblRoles, ax as TblUsersTblProvidersUserIDTotblUsers, ay as TblUsersTblTotblUsers, az as UpdatePriceRequest, aA as UserResponse, aB as WeightBasedSale } from './warehouse.interface-BRPPyPIC.js';
1
+ export { B as BatchData, I as IAttribute, a as IAttributeFilter, b as IAttributeQueryParams, c as IAttributeResponse, d as IAttributeValue, e as IBatch, f as IBatchResponse, g as ICategory, h as ICategoryResponse, i as IFilterSelectOption, j as IFilterType, k as IProduct, l as IProductDetails, m as IProductDetailsResponse, n as IProductResponse, o as IProductVariantRequest, p as IStock, q as ITableFilterConfig, P as ProdStats, r as ProdStock, s as ProductOptions, T as TblCategories, t as TblMaterials, u as TblProductsImage, v as TblProductsTag, w as TblTags } from './filters.interface-glhGBJfx.js';
2
+ export { A as AgentResponse, B as BankTerminalQuery, a as BankTerminalResponse, C as CalculatePriceRequest, b as ChartType, c as ComparisonBy, D as DateRange, I as IAgent, d as IBankTerminal, e as IBankTerminalForm, f as IBankTerminalOption, g as IBankTerminalResponse, h as IClient, i as IClientDataForTable, j as IClientRequest, k as IClientResponse, l as IClientResponseById, m as IGender, n as ILocation, o as ILocationResponse, p as IMaterial, q as IMeta, r as IModule, s as IMovement, t as IMovementResponse, u as IOrder, v as IOrderResponse, w as IPayment, x as IPaymentMethod, y as IPaymentMethodAmountExpected, z as IPermissionRole, E as IPricePerGramHistory, F as IPriceType, G as IPriceTypeResponse, H as IPromotion, J as IPromotionResponse, K as IPromotionType, L as IProvider, M as IProviderForSelect, N as IProviderRequest, O as IProviderResponse, P as IReportComparisonByTimeFrame, Q as IReportInventory, R as IReportX, S as IReportZ, T as IReview, U as IRole, V as IStockByWarehouseReport, W as IStockMovement, X as IStockMovementResponse, Y as ITag, Z as ITax, _ as ITaxResponse, $ as IUser, a0 as IUserForm, a1 as IWareHouse, a2 as IWareHouseResponse, a3 as IWareHouseSelect, a4 as MaterialSummary, a5 as PaymentOptions, a6 as Period, a7 as Permission, a8 as PermissionRole, a9 as PriceCalculationResponse, aa as PricePerGramForm, ab as PricePerGramResponse, ac as ProductInfo, ad as PromotionTypeEnum, ae as ReportData, af as ReportDataProduct, ag as SchedulePriceRequest, ah as TblModules, ai as TblMoneyTransactionTypes, aj as TblMoneyTransactions, ak as TblOrderDetail, al as TblOrderDetailsMoneyTransactions, am as TblOrderStatus, an as TblPermissions, ao as TblPriceTypes, ap as TblProducts, aq as TblPromotionTypes, ar as TblPromotionsTargetProductIDTotblProduct, as as TblProvidersTblProvidersUserIDTotblUser, at as TblReturn, au as TblReturnDetail, av as TblRoles, aw as TblRolesTblUsersRoleIDTotblRoles, ax as TblUsersTblProvidersUserIDTotblUsers, ay as TblUsersTblTotblUsers, az as UpdatePriceRequest, aA as UserResponse, aB as WeightBasedSale } from './warehouse.interface-fnr42ygU.js';
3
3
  export { D as DataTableConfig, S as ServerTableState, T as TableHeaderStyle, d as defaultDataTableConfig } from './datatable.interface-DbB5oxj-.js';
4
- export { B as ButtonTypes, F as FieldTypes, a as FileType, I as IBaseField, b as IButton, c as IDateField, d as IEmailField, e as IField, f as IFileField, g as IHiddenField, h as IMultiSelectField, i as INumberField, j as IOptions, k as IPasswordField, l as ISelect, m as ISelectField, n as ISwitchField, o as ITagField, p as ITextField, T as TagData } from './form.interface-CqnTdmc8.js';
4
+ export { B as ButtonTypes, F as FieldTypes, a as FileType, I as IBaseField, b as IButton, c as IDateField, d as IEmailField, e as IField, f as IFileField, g as IHiddenField, h as IMultiSelectField, i as INumberField, j as IOptions, k as IPasswordField, l as ISelect, m as ISelectField, n as ISwitchField, o as ITagField, p as ITextField, T as TagData } from './form.interface-CO6P9ez0.js';
5
5
  import { ElementType } from 'react';
6
6
  export { I as IRequest } from './util.interface-AOzOjHR0.js';
7
7
  import '@tanstack/react-table';
package/dist/queries.d.ts CHANGED
@@ -2,15 +2,20 @@ import { T as TableQueryParams } from './types-CiX8AkJA.js';
2
2
  import * as _tanstack_query_core from '@tanstack/query-core';
3
3
  import * as _tanstack_react_query from '@tanstack/react-query';
4
4
  import { QueryClient, UseMutationOptions } from '@tanstack/react-query';
5
- import { a as IAttributeResponse, I as IAttribute, b as IAttributeValue, f as ICategoryResponse, e as ICategory, d as IBatchResponse, c as IBatch } from './filters.interface-Cx-AXMPz.js';
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-BRPPyPIC.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-geeduO1g.js';
8
- import { F as FolioResponse } from './shift.queries-DF8gfQOQ.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-DF8gfQOQ.js';
5
+ import { b as IAttributeQueryParams, c as IAttributeResponse, I as IAttribute, d as IAttributeValue, h as ICategoryResponse, g as ICategory, f as IBatchResponse, e as IBatch } from './filters.interface-glhGBJfx.js';
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-fnr42ygU.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-CDDl5yeV.js';
8
+ import { F as FolioResponse } from './shift.queries-ul2JnMAU.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-ul2JnMAU.js';
10
10
  import '@tanstack/react-table';
11
11
 
12
12
  declare const attributeQueryKeys: {
13
13
  all: readonly ["attributes"];
14
+ table: (params?: IAttributeQueryParams) => readonly ["attributes", "table", {
15
+ readonly skip: number | undefined;
16
+ readonly limit: number | undefined;
17
+ readonly filters: {};
18
+ }];
14
19
  lists: () => readonly ["attributes", "list"];
15
20
  list: (params: TableQueryParams) => readonly ["attributes", "list", {
16
21
  readonly skip: number | undefined;
@@ -47,6 +52,26 @@ declare const attributes: {
47
52
  [dataTagErrorSymbol]: Error;
48
53
  };
49
54
  };
55
+ getAttributesTable: (params?: IAttributeQueryParams) => _tanstack_query_core.OmitKeyof<_tanstack_react_query.UseQueryOptions<IAttributeResponse, Error, IAttributeResponse, readonly ["attributes", "table", {
56
+ readonly skip: number | undefined;
57
+ readonly limit: number | undefined;
58
+ readonly filters: {};
59
+ }]>, "queryFn"> & {
60
+ queryFn?: _tanstack_query_core.QueryFunction<IAttributeResponse, readonly ["attributes", "table", {
61
+ readonly skip: number | undefined;
62
+ readonly limit: number | undefined;
63
+ readonly filters: {};
64
+ }], never> | undefined;
65
+ } & {
66
+ queryKey: readonly ["attributes", "table", {
67
+ readonly skip: number | undefined;
68
+ readonly limit: number | undefined;
69
+ readonly filters: {};
70
+ }] & {
71
+ [dataTagSymbol]: IAttributeResponse;
72
+ [dataTagErrorSymbol]: Error;
73
+ };
74
+ };
50
75
  getAttributesForSelect: () => _tanstack_query_core.OmitKeyof<_tanstack_react_query.UseQueryOptions<IAttribute[], Error, IAttribute[], readonly ["attributes", "select"]>, "queryFn"> & {
51
76
  queryFn?: _tanstack_query_core.QueryFunction<IAttribute[], readonly ["attributes", "select"], never> | undefined;
52
77
  } & {
package/dist/queries.js CHANGED
@@ -23,6 +23,22 @@ var getAttributesForSelect = async () => {
23
23
  const { data } = await api.get("/attribute/select");
24
24
  return data;
25
25
  };
26
+ var getAttributesTable = async ({
27
+ skip,
28
+ limit,
29
+ filters
30
+ }) => {
31
+ const queryParams = new URLSearchParams({
32
+ skip: skip?.toString() ?? "",
33
+ limit: limit?.toString() ?? "",
34
+ ...filters?.query && { query: filters.query },
35
+ ...filters?.categoryId && { categoryId: filters.categoryId.toString() },
36
+ ...filters?.productId && { productId: filters.productId.toString() },
37
+ ...filters?.materialId && { materialId: filters.materialId.toString() }
38
+ });
39
+ const { data } = await api.get(`/attribute?${queryParams}`);
40
+ return data;
41
+ };
26
42
  var getAttributeById = async ({
27
43
  attributeId
28
44
  }) => {
@@ -138,6 +154,7 @@ var errorNotification = ({
138
154
  // src/queries/attributes.queries.ts
139
155
  var attributeQueryKeys = {
140
156
  all: ["attributes"],
157
+ table: (params = {}) => [...attributeQueryKeys.all, "table", { skip: params.skip, limit: params.limit, filters: params.filters ?? {} }],
141
158
  lists: () => [...attributeQueryKeys.all, "list"],
142
159
  list: (params) => [
143
160
  ...attributeQueryKeys.lists(),
@@ -162,6 +179,15 @@ var attributes = {
162
179
  queryKey: attributeQueryKeys.list(params),
163
180
  staleTime: 3e4
164
181
  }),
182
+ getAttributesTable: (params = {}) => queryOptions({
183
+ queryFn: () => getAttributesTable({
184
+ skip: params.skip ?? 0,
185
+ limit: params.limit ?? 10,
186
+ filters: params.filters ?? void 0
187
+ }),
188
+ queryKey: attributeQueryKeys.table(params),
189
+ staleTime: 3e4
190
+ }),
165
191
  getAttributesForSelect: () => queryOptions({
166
192
  queryFn: getAttributesForSelect,
167
193
  queryKey: attributeQueryKeys.forSelect(),