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.
- package/dist/components.d.ts +2 -2
- package/dist/{filters.interface-Cx-AXMPz.d.ts → filters.interface-glhGBJfx.d.ts} +59 -47
- package/dist/{form.interface-CqnTdmc8.d.ts → form.interface-CO6P9ez0.d.ts} +1 -1
- package/dist/hooks.d.ts +17 -10
- package/dist/hooks.js +70 -12
- package/dist/hooks.js.map +1 -1
- package/dist/index.d.ts +7 -7
- package/dist/index.js +72 -14
- package/dist/index.js.map +1 -1
- package/dist/interfaces.d.ts +3 -3
- package/dist/queries.d.ts +30 -5
- package/dist/queries.js +26 -0
- package/dist/queries.js.map +1 -1
- package/dist/services.d.ts +9 -4
- package/dist/services.js +17 -1
- package/dist/services.js.map +1 -1
- package/dist/{shift.queries-DF8gfQOQ.d.ts → shift.queries-ul2JnMAU.d.ts} +3 -3
- package/dist/{warehouse.interface-BRPPyPIC.d.ts → warehouse.interface-fnr42ygU.d.ts} +1 -1
- package/dist/{warehouse.service-geeduO1g.d.ts → warehouse.service-CDDl5yeV.d.ts} +2 -2
- package/package.json +1 -1
package/dist/components.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React$1, { ReactNode } from 'react';
|
|
2
|
-
import { e as IField, b as IButton } from './form.interface-
|
|
2
|
+
import { e as IField, b as IButton } from './form.interface-CO6P9ez0.js';
|
|
3
3
|
import { ReactFormExtendedApi, FormValidateOrFn, FormAsyncValidateOrFn } from '@tanstack/react-form';
|
|
4
4
|
import { UseMutationResult, UseQueryOptions } from '@tanstack/react-query';
|
|
5
|
-
import {
|
|
5
|
+
import { u as TblProductsImage, q as ITableFilterConfig, i as IFilterSelectOption } from './filters.interface-glhGBJfx.js';
|
|
6
6
|
import * as z from 'zod';
|
|
7
7
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
8
8
|
import { ColumnDef, useReactTable, Row } from '@tanstack/react-table';
|
|
@@ -17,39 +17,41 @@ interface ICategory {
|
|
|
17
17
|
tblAttributes?: IAttribute[];
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
interface
|
|
21
|
-
data: ICategory[];
|
|
20
|
+
interface IBatchResponse {
|
|
22
21
|
total: number;
|
|
22
|
+
data: IBatch[];
|
|
23
23
|
skip: number;
|
|
24
24
|
limit: number;
|
|
25
25
|
}
|
|
26
|
-
interface
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
26
|
+
interface IStock {
|
|
27
|
+
stockID: number;
|
|
28
|
+
productID: number;
|
|
29
|
+
wareHouseID: number;
|
|
30
|
+
batchID: number;
|
|
31
|
+
quantity: number;
|
|
30
32
|
syncStatusID: number;
|
|
31
33
|
masterCodeID: null;
|
|
32
|
-
savedBy:
|
|
33
|
-
savedDate:
|
|
34
|
-
deletedBy: null;
|
|
35
|
-
deletedDate: null;
|
|
36
|
-
categoryID: number | null;
|
|
37
|
-
productID: number | null;
|
|
38
|
-
materialID: number | null;
|
|
39
|
-
tblAttributeValues: IAttributeValue[];
|
|
40
|
-
tblCategories: ICategory;
|
|
34
|
+
savedBy: null;
|
|
35
|
+
savedDate: null;
|
|
41
36
|
}
|
|
42
|
-
interface
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
37
|
+
interface IBatch {
|
|
38
|
+
batchID: number;
|
|
39
|
+
batchCode: string;
|
|
40
|
+
entryDate: string;
|
|
41
|
+
expirationDate: string | null;
|
|
42
|
+
providerID: number;
|
|
43
|
+
unitCost: number;
|
|
44
|
+
unitSellingPrice: number;
|
|
45
|
+
taxID: number;
|
|
46
|
+
productDetailID: number;
|
|
46
47
|
syncStatusID: number;
|
|
47
48
|
masterCodeID: null;
|
|
48
|
-
savedBy:
|
|
49
|
-
savedDate:
|
|
49
|
+
savedBy: null;
|
|
50
|
+
savedDate: null;
|
|
50
51
|
deletedBy: null;
|
|
51
52
|
deletedDate: null;
|
|
52
|
-
|
|
53
|
+
tblStocks: IStock[];
|
|
54
|
+
tblProductDetails?: IProductDetails;
|
|
53
55
|
}
|
|
54
56
|
|
|
55
57
|
interface IProductResponse {
|
|
@@ -196,41 +198,51 @@ interface IProductVariantRequest {
|
|
|
196
198
|
};
|
|
197
199
|
}
|
|
198
200
|
|
|
199
|
-
interface
|
|
201
|
+
interface IAttributeFilter {
|
|
202
|
+
query: string | null;
|
|
203
|
+
categoryId: number | null;
|
|
204
|
+
productId: number | null;
|
|
205
|
+
materialId: number | null;
|
|
206
|
+
}
|
|
207
|
+
interface IAttributeQueryParams {
|
|
208
|
+
skip?: number;
|
|
209
|
+
limit?: number;
|
|
210
|
+
filters?: IAttributeFilter;
|
|
211
|
+
}
|
|
212
|
+
interface IAttributeResponse {
|
|
213
|
+
data: ICategory[];
|
|
200
214
|
total: number;
|
|
201
|
-
data: IBatch[];
|
|
202
215
|
skip: number;
|
|
203
216
|
limit: number;
|
|
204
217
|
}
|
|
205
|
-
interface
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
batchID: number;
|
|
210
|
-
quantity: number;
|
|
218
|
+
interface IAttribute {
|
|
219
|
+
attributeID: number;
|
|
220
|
+
name: string;
|
|
221
|
+
pricePerGram?: number | null;
|
|
211
222
|
syncStatusID: number;
|
|
212
223
|
masterCodeID: null;
|
|
213
|
-
savedBy:
|
|
214
|
-
savedDate:
|
|
224
|
+
savedBy: number;
|
|
225
|
+
savedDate: Date;
|
|
226
|
+
deletedBy: null;
|
|
227
|
+
deletedDate: null;
|
|
228
|
+
categoryID: number | null;
|
|
229
|
+
productID: number | null;
|
|
230
|
+
materialID: number | null;
|
|
231
|
+
tblAttributeValues: IAttributeValue[];
|
|
232
|
+
tblCategories?: ICategory;
|
|
233
|
+
tblProducts?: IProduct;
|
|
215
234
|
}
|
|
216
|
-
interface
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
expirationDate: string | null;
|
|
221
|
-
providerID: number;
|
|
222
|
-
unitCost: number;
|
|
223
|
-
unitSellingPrice: number;
|
|
224
|
-
taxID: number;
|
|
225
|
-
productDetailID: number;
|
|
235
|
+
interface IAttributeValue {
|
|
236
|
+
valueID: number;
|
|
237
|
+
attributeID: number;
|
|
238
|
+
value: string;
|
|
226
239
|
syncStatusID: number;
|
|
227
240
|
masterCodeID: null;
|
|
228
|
-
savedBy:
|
|
229
|
-
savedDate:
|
|
241
|
+
savedBy: number;
|
|
242
|
+
savedDate: Date;
|
|
230
243
|
deletedBy: null;
|
|
231
244
|
deletedDate: null;
|
|
232
|
-
|
|
233
|
-
tblProductDetails?: IProductDetails;
|
|
245
|
+
tblAttributes?: IAttribute;
|
|
234
246
|
}
|
|
235
247
|
|
|
236
248
|
interface IFilterSelectOption {
|
|
@@ -263,4 +275,4 @@ interface IFilterType {
|
|
|
263
275
|
priceRangeMax: number | null;
|
|
264
276
|
}
|
|
265
277
|
|
|
266
|
-
export type { BatchData as B, IAttribute as I, ProdStats as P, TblCategories as T,
|
|
278
|
+
export type { BatchData as B, IAttribute as I, ProdStats as P, TblCategories as T, IAttributeFilter as a, IAttributeQueryParams as b, IAttributeResponse as c, IAttributeValue as d, IBatch as e, IBatchResponse as f, ICategory as g, ICategoryResponse as h, IFilterSelectOption as i, IFilterType as j, IProduct as k, IProductDetails as l, IProductDetailsResponse as m, IProductResponse as n, IProductVariantRequest as o, IStock as p, ITableFilterConfig as q, ProdStock as r, ProductOptions as s, TblMaterials as t, TblProductsImage as u, TblProductsTag as v, TblTags as w };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { u as TblProductsImage } from './filters.interface-glhGBJfx.js';
|
|
2
2
|
|
|
3
3
|
type IField = ITextField | IPasswordField | INumberField | ISelectField | IMultiSelectField | IDateField | IEmailField | IHiddenField | ISwitchField | IFileField | ITagField;
|
|
4
4
|
interface IHiddenField extends IBaseField {
|
package/dist/hooks.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
2
2
|
import { UseMutationOptions, UseQueryOptions } from '@tanstack/react-query';
|
|
3
|
-
import { d as LoginResponse, U as UpdateBatchData, I as IExchange, b as IExchangeResponse, P as PaymentType, L as LocationResponse, M as MaterialResponse, a as ChangeProductResponse, C as ChangeProductRequest, c as IUpdatePermission, e as PrintQRResponse, G as GetReturnsByOrderIdResponse, R as Response, S as StateResponse, W as WarehouseResponse } from './warehouse.service-
|
|
4
|
-
import { I as IAttribute,
|
|
3
|
+
import { d as LoginResponse, U as UpdateBatchData, I as IExchange, b as IExchangeResponse, P as PaymentType, L as LocationResponse, M as MaterialResponse, a as ChangeProductResponse, C as ChangeProductRequest, c as IUpdatePermission, e as PrintQRResponse, G as GetReturnsByOrderIdResponse, R as Response, S as StateResponse, W as WarehouseResponse } from './warehouse.service-CDDl5yeV.js';
|
|
4
|
+
import { b as IAttributeQueryParams, I as IAttribute, d as IAttributeValue, c as IAttributeResponse, f as IBatchResponse, e as IBatch, g as ICategory, h as ICategoryResponse, j as IFilterType, k as IProduct, l as IProductDetails, m as IProductDetailsResponse, n as IProductResponse } from './filters.interface-glhGBJfx.js';
|
|
5
5
|
import { T as TableQueryParams } from './types-CiX8AkJA.js';
|
|
6
6
|
import { ColumnDef, useReactTable, ColumnFiltersState } from '@tanstack/react-table';
|
|
7
7
|
import { D as DataTableConfig, S as ServerTableState } from './datatable.interface-DbB5oxj-.js';
|
|
8
|
-
import { a as BankTerminalResponse, d as IBankTerminal, g as IBankTerminalResponse, e as IBankTerminalForm, l as IClientResponseById, k as IClientResponse, h as IClient, j as IClientRequest, n as ILocation, o as ILocationResponse, p as IMaterial, r as IModule, u as IOrder, v as IOrderResponse, am as TblOrderStatus, x as IPaymentMethod, y as IPaymentMethodAmountExpected, w as IPayment, a8 as PermissionRole, z as IPermissionRole, a9 as PriceCalculationResponse, C as CalculatePriceRequest, ab as PricePerGramResponse, E as IPricePerGramHistory, ag as SchedulePriceRequest, az as UpdatePriceRequest, F as IPriceType, G as IPriceTypeResponse, Y as ITag, H as IPromotion, J as IPromotionResponse, K as IPromotionType, O as IProviderResponse, N as IProviderRequest, L as IProvider, M as IProviderForSelect, c as ComparisonBy, Q as IReportInventory, P as IReportComparisonByTimeFrame, R as IReportX, S as IReportZ, V as IStockByWarehouseReport, ak as TblOrderDetail, U as IRole, W as IStockMovement, X as IStockMovementResponse, Z as ITax, A as AgentResponse, a0 as IUserForm, $ as IUser, aA as UserResponse, a1 as IWareHouse, a2 as IWareHouseResponse } from './warehouse.interface-
|
|
9
|
-
import { F as FolioResponse, G as GenderResponse, H as HealthCheckResponse, U as UseOrdersParams$1, P as ProductQueryParams$1, C as CloseShiftData } from './shift.queries-
|
|
8
|
+
import { a as BankTerminalResponse, d as IBankTerminal, g as IBankTerminalResponse, e as IBankTerminalForm, l as IClientResponseById, k as IClientResponse, h as IClient, j as IClientRequest, n as ILocation, o as ILocationResponse, p as IMaterial, r as IModule, u as IOrder, v as IOrderResponse, am as TblOrderStatus, x as IPaymentMethod, y as IPaymentMethodAmountExpected, w as IPayment, a8 as PermissionRole, z as IPermissionRole, a9 as PriceCalculationResponse, C as CalculatePriceRequest, ab as PricePerGramResponse, E as IPricePerGramHistory, ag as SchedulePriceRequest, az as UpdatePriceRequest, F as IPriceType, G as IPriceTypeResponse, Y as ITag, H as IPromotion, J as IPromotionResponse, K as IPromotionType, O as IProviderResponse, N as IProviderRequest, L as IProvider, M as IProviderForSelect, c as ComparisonBy, Q as IReportInventory, P as IReportComparisonByTimeFrame, R as IReportX, S as IReportZ, V as IStockByWarehouseReport, ak as TblOrderDetail, U as IRole, W as IStockMovement, X as IStockMovementResponse, Z as ITax, A as AgentResponse, a0 as IUserForm, $ as IUser, aA as UserResponse, a1 as IWareHouse, a2 as IWareHouseResponse } from './warehouse.interface-fnr42ygU.js';
|
|
9
|
+
import { F as FolioResponse, G as GenderResponse, H as HealthCheckResponse, U as UseOrdersParams$1, P as ProductQueryParams$1, C as CloseShiftData } from './shift.queries-ul2JnMAU.js';
|
|
10
10
|
import '@tanstack/query-core';
|
|
11
11
|
|
|
12
12
|
declare const useLogin: (options?: UseMutationOptions<LoginResponse, Error, {
|
|
@@ -19,6 +19,11 @@ declare const useLogin: (options?: UseMutationOptions<LoginResponse, Error, {
|
|
|
19
19
|
|
|
20
20
|
declare const attributeKeys: {
|
|
21
21
|
all: readonly ["attributes"];
|
|
22
|
+
table: (params?: IAttributeQueryParams) => readonly ["attributes", "table", {
|
|
23
|
+
readonly skip: number | undefined;
|
|
24
|
+
readonly limit: number | undefined;
|
|
25
|
+
readonly filters: {};
|
|
26
|
+
}];
|
|
22
27
|
lists: () => readonly ["attributes", "list"];
|
|
23
28
|
list: (params: TableQueryParams) => readonly ["attributes", "list", {
|
|
24
29
|
readonly skip: number | undefined;
|
|
@@ -32,17 +37,19 @@ declare const attributeKeys: {
|
|
|
32
37
|
byCategory: (categoryId: string) => readonly ["attributes", "category", string];
|
|
33
38
|
values: (attributeId: string) => readonly ["attributes", "values", string];
|
|
34
39
|
};
|
|
40
|
+
interface AttributeFilterColumnMap {
|
|
41
|
+
categoryId?: string;
|
|
42
|
+
productId?: string;
|
|
43
|
+
materialId?: string;
|
|
44
|
+
}
|
|
45
|
+
declare const mapTableParamsToAttributeParams: (params: TableQueryParams, columnMap?: Partial<AttributeFilterColumnMap>) => IAttributeQueryParams;
|
|
35
46
|
declare const useAttributes: (params: {
|
|
36
47
|
skip: number;
|
|
37
48
|
limit: number;
|
|
38
49
|
query: string;
|
|
39
50
|
}, options?: Omit<UseQueryOptions<IAttributeResponse>, "queryKey" | "queryFn">) => _tanstack_react_query.UseQueryResult<IAttributeResponse, Error>;
|
|
40
51
|
/** Alias for useAttributes - paginated list for tables */
|
|
41
|
-
declare const useAttributesTable: (params
|
|
42
|
-
skip: number;
|
|
43
|
-
limit: number;
|
|
44
|
-
query: string;
|
|
45
|
-
}, options?: Omit<UseQueryOptions<IAttributeResponse>, "queryKey" | "queryFn">) => _tanstack_react_query.UseQueryResult<IAttributeResponse, Error>;
|
|
52
|
+
declare const useAttributesTable: (params?: IAttributeQueryParams, options?: Omit<UseQueryOptions<IAttributeResponse>, "queryKey" | "queryFn">) => _tanstack_react_query.UseQueryResult<IAttributeResponse, Error>;
|
|
46
53
|
declare const useAttributesForSelect: (options?: Omit<UseQueryOptions<IAttribute[]>, "queryKey" | "queryFn">) => _tanstack_react_query.UseQueryResult<IAttribute[], Error>;
|
|
47
54
|
declare const useAttribute: (attributeId: string | undefined, options?: Omit<UseQueryOptions<IAttribute>, "queryKey" | "queryFn">) => _tanstack_react_query.UseQueryResult<IAttribute, Error>;
|
|
48
55
|
declare const useAttributesByProductID: (productId: string | undefined, options?: Omit<UseQueryOptions<IAttribute[]>, "queryKey" | "queryFn">) => _tanstack_react_query.UseQueryResult<IAttribute[], Error>;
|
|
@@ -1192,4 +1199,4 @@ declare const usePrefetchWarehouse: () => {
|
|
|
1192
1199
|
prefetchWarehouse: (warehouseId: number) => Promise<void>;
|
|
1193
1200
|
};
|
|
1194
1201
|
|
|
1195
|
-
export { type ProductFilterColumnMap, type UseDataTableOptions, type UseDataTableReturn, attributeKeys, bankTerminalKeys, batchKeys, categoryKeys, clientKeys, exchangeKeys, folioKeys, genderKeys, healthKeys, locationKeys, mapTableParamsToProductParams, materialKeys, moduleKeys, orderKeys, paymentKeys, permissionKeys, pricePerGramKeys, priceTypeKeys, productKeys, productTagKeys, promotionKeys, providerKeys, qrKeys, reportKeys, returnKeys, roleKeys, stateKeys, stockMovementKeys, taxKeys, useAllAgents, useAllBankTerminals, useAllCategories, useAllGenders, useAllLocations, useAllMaterials, useAllModules, useAllProductTags, useAllStates, useAttribute, useAttributeValues, useAttributes, useAttributesByCategoryID, useAttributesByProductID, useAttributesForSelect, useAttributesTable, useBankTerminal, useBankTerminals, useBankTerminalsForSelect, useBankTerminalsTable, useBatches, useBatchesForSelect, useBatchesTable, useCalculatePricePerGram, useCategories, useCategoriesForSelect, useCategoriesTable, useCategory, useChangeOrderProduct, useClient, useClients, useClientsForSelect, useClientsTable, useCloseShift, useCreateAttribute, useCreateAttributeValue, useCreateAttributesForCategory, useCreateAttributesValuesBatch, useCreateBankTerminal, useCreateBatch, useCreateBatchAndUpdateOtherBatches, useCreateCategory, useCreateClient, useCreateExchangeRate, useCreateLocation, useCreateMaterial, useCreateMovement, useCreatePriceType, useCreateProduct, useCreateProductVariant, useCreatePromotion, useCreateProvider, useCreateReturn, useCreateRole, useCreateUser, useCreateWarehouse, useDataTable, useDeleteAttribute, useDeleteBankTerminal, useDeleteCategory, useDeleteClient, useDeleteFuturePricePerGram, useDeleteImageFromProduct, useDeleteLocation, useDeleteMaterial, useDeletePriceType, useDeleteProduct, useDeleteProductVariant, useDeleteProvider, useDeleteRole, useDeleteUser, useDeleteWarehouse, useExchangeRate, useExchangeRates, useExchangeRatesTable, useHealthCheck, useInventoryTable, useIsWeightBased, useLocation, useLocations, useLocationsForSelect, useLocationsTable, useLogin, useMakeNewCashMovement, useMatchedBatches, useMaterial, useMaterials, useMaterialsForSelect, useMaterialsTable, useMovements, useMovementsTable, useNextFolioToUseInBatches, useOrder, useOrders, useOrdersStatusForSelect, useOrdersTable, usePaymentMethods, usePaymentMethodsWithAmount, usePaymentMethodsWithAmountExpected, usePaymentTypes, usePendingReportZ, usePermissionRoleByRoleID, usePermissions, usePrefetchAttribute, usePrefetchBankTerminal, usePrefetchCategory, usePrefetchClient, usePrefetchLocation, usePrefetchMaterial, usePrefetchOrder, usePrefetchPriceType, usePrefetchProduct, usePrefetchPromotion, usePrefetchProvider, usePrefetchRole, usePrefetchUser, usePrefetchWarehouse, usePricePerGram, usePricePerGramHistory, usePriceType, usePriceTypes, usePriceTypesForSelect, usePriceTypesTable, usePrintQR, usePrintReportX, usePrintReportZ, useProduct, useProductVariant, useProductVariants, useProductVariantsForSelect, useProducts, useProductsByCategory, useProductsForSelect, useProductsTable, usePromotion, usePromotions, usePromotionsTable, usePromotionsTypeForSelect, useProvider, useProviders, useProvidersForSelect, useProvidersTable, useQRBaseUrl, useReportByInventory, useReportComparisonByTimeFrame, useReportX, useReportZ, useRestoreBankTerminal, useRestoreCategory, useRestoreClient, useRestoreLocation, useRestoreProduct, useRestoreProductVariant, useRestoreProvider, useRestoreUser, useRestoreWarehouse, useReturnsByOrderId, useRole, useRoles, useRolesTable, useSchedulePricePerGram, useSellersOfDayForSelect, useSellersWithShift, useSendCreditPayment, useSendPayment, useSetNewShift, useStockByWarehouseReport, useTaxesForSelect, useUndeleteAttribute, useUndeleteMaterial, useUndeletePriceType, useUpdateAttribute, useUpdateAttributesForCategory, useUpdateBankTerminal, useUpdateBatch, useUpdateCategory, useUpdateClient, useUpdateFuturePricePerGram, useUpdateLocation, useUpdateMaterial, useUpdatePermission, useUpdatePricePerGram, useUpdatePriceType, useUpdateProduct, useUpdateProductVariant, useUpdatePromotion, useUpdateProvider, useUpdateRole, useUpdateUser, useUpdateWarehouse, useUser, useUsers, useUsersTable, useValidateDiscountCode, useWarehouse, useWarehouses, useWarehousesForSelect, useWarehousesTable, userKeys, warehouseKeys };
|
|
1202
|
+
export { type AttributeFilterColumnMap, type ProductFilterColumnMap, type UseDataTableOptions, type UseDataTableReturn, attributeKeys, bankTerminalKeys, batchKeys, categoryKeys, clientKeys, exchangeKeys, folioKeys, genderKeys, healthKeys, locationKeys, mapTableParamsToAttributeParams, mapTableParamsToProductParams, materialKeys, moduleKeys, orderKeys, paymentKeys, permissionKeys, pricePerGramKeys, priceTypeKeys, productKeys, productTagKeys, promotionKeys, providerKeys, qrKeys, reportKeys, returnKeys, roleKeys, stateKeys, stockMovementKeys, taxKeys, useAllAgents, useAllBankTerminals, useAllCategories, useAllGenders, useAllLocations, useAllMaterials, useAllModules, useAllProductTags, useAllStates, useAttribute, useAttributeValues, useAttributes, useAttributesByCategoryID, useAttributesByProductID, useAttributesForSelect, useAttributesTable, useBankTerminal, useBankTerminals, useBankTerminalsForSelect, useBankTerminalsTable, useBatches, useBatchesForSelect, useBatchesTable, useCalculatePricePerGram, useCategories, useCategoriesForSelect, useCategoriesTable, useCategory, useChangeOrderProduct, useClient, useClients, useClientsForSelect, useClientsTable, useCloseShift, useCreateAttribute, useCreateAttributeValue, useCreateAttributesForCategory, useCreateAttributesValuesBatch, useCreateBankTerminal, useCreateBatch, useCreateBatchAndUpdateOtherBatches, useCreateCategory, useCreateClient, useCreateExchangeRate, useCreateLocation, useCreateMaterial, useCreateMovement, useCreatePriceType, useCreateProduct, useCreateProductVariant, useCreatePromotion, useCreateProvider, useCreateReturn, useCreateRole, useCreateUser, useCreateWarehouse, useDataTable, useDeleteAttribute, useDeleteBankTerminal, useDeleteCategory, useDeleteClient, useDeleteFuturePricePerGram, useDeleteImageFromProduct, useDeleteLocation, useDeleteMaterial, useDeletePriceType, useDeleteProduct, useDeleteProductVariant, useDeleteProvider, useDeleteRole, useDeleteUser, useDeleteWarehouse, useExchangeRate, useExchangeRates, useExchangeRatesTable, useHealthCheck, useInventoryTable, useIsWeightBased, useLocation, useLocations, useLocationsForSelect, useLocationsTable, useLogin, useMakeNewCashMovement, useMatchedBatches, useMaterial, useMaterials, useMaterialsForSelect, useMaterialsTable, useMovements, useMovementsTable, useNextFolioToUseInBatches, useOrder, useOrders, useOrdersStatusForSelect, useOrdersTable, usePaymentMethods, usePaymentMethodsWithAmount, usePaymentMethodsWithAmountExpected, usePaymentTypes, usePendingReportZ, usePermissionRoleByRoleID, usePermissions, usePrefetchAttribute, usePrefetchBankTerminal, usePrefetchCategory, usePrefetchClient, usePrefetchLocation, usePrefetchMaterial, usePrefetchOrder, usePrefetchPriceType, usePrefetchProduct, usePrefetchPromotion, usePrefetchProvider, usePrefetchRole, usePrefetchUser, usePrefetchWarehouse, usePricePerGram, usePricePerGramHistory, usePriceType, usePriceTypes, usePriceTypesForSelect, usePriceTypesTable, usePrintQR, usePrintReportX, usePrintReportZ, useProduct, useProductVariant, useProductVariants, useProductVariantsForSelect, useProducts, useProductsByCategory, useProductsForSelect, useProductsTable, usePromotion, usePromotions, usePromotionsTable, usePromotionsTypeForSelect, useProvider, useProviders, useProvidersForSelect, useProvidersTable, useQRBaseUrl, useReportByInventory, useReportComparisonByTimeFrame, useReportX, useReportZ, useRestoreBankTerminal, useRestoreCategory, useRestoreClient, useRestoreLocation, useRestoreProduct, useRestoreProductVariant, useRestoreProvider, useRestoreUser, useRestoreWarehouse, useReturnsByOrderId, useRole, useRoles, useRolesTable, useSchedulePricePerGram, useSellersOfDayForSelect, useSellersWithShift, useSendCreditPayment, useSendPayment, useSetNewShift, useStockByWarehouseReport, useTaxesForSelect, useUndeleteAttribute, useUndeleteMaterial, useUndeletePriceType, useUpdateAttribute, useUpdateAttributesForCategory, useUpdateBankTerminal, useUpdateBatch, useUpdateCategory, useUpdateClient, useUpdateFuturePricePerGram, useUpdateLocation, useUpdateMaterial, useUpdatePermission, useUpdatePricePerGram, useUpdatePriceType, useUpdateProduct, useUpdateProductVariant, useUpdatePromotion, useUpdateProvider, useUpdateRole, useUpdateUser, useUpdateWarehouse, useUser, useUsers, useUsersTable, useValidateDiscountCode, useWarehouse, useWarehouses, useWarehousesForSelect, useWarehousesTable, userKeys, warehouseKeys };
|
package/dist/hooks.js
CHANGED
|
@@ -49,6 +49,22 @@ var getAttributesForSelect = async () => {
|
|
|
49
49
|
const { data } = await api.get("/attribute/select");
|
|
50
50
|
return data;
|
|
51
51
|
};
|
|
52
|
+
var getAttributesTable = async ({
|
|
53
|
+
skip,
|
|
54
|
+
limit,
|
|
55
|
+
filters
|
|
56
|
+
}) => {
|
|
57
|
+
const queryParams = new URLSearchParams({
|
|
58
|
+
skip: skip?.toString() ?? "",
|
|
59
|
+
limit: limit?.toString() ?? "",
|
|
60
|
+
...filters?.query && { query: filters.query },
|
|
61
|
+
...filters?.categoryId && { categoryId: filters.categoryId.toString() },
|
|
62
|
+
...filters?.productId && { productId: filters.productId.toString() },
|
|
63
|
+
...filters?.materialId && { materialId: filters.materialId.toString() }
|
|
64
|
+
});
|
|
65
|
+
const { data } = await api.get(`/attribute?${queryParams}`);
|
|
66
|
+
return data;
|
|
67
|
+
};
|
|
52
68
|
var getAttributeById = async ({
|
|
53
69
|
attributeId
|
|
54
70
|
}) => {
|
|
@@ -164,6 +180,7 @@ var errorNotification = ({
|
|
|
164
180
|
// src/queries/attributes.queries.ts
|
|
165
181
|
var attributeQueryKeys = {
|
|
166
182
|
all: ["attributes"],
|
|
183
|
+
table: (params = {}) => [...attributeQueryKeys.all, "table", { skip: params.skip, limit: params.limit, filters: params.filters ?? {} }],
|
|
167
184
|
lists: () => [...attributeQueryKeys.all, "list"],
|
|
168
185
|
list: (params) => [
|
|
169
186
|
...attributeQueryKeys.lists(),
|
|
@@ -188,6 +205,15 @@ var attributes = {
|
|
|
188
205
|
queryKey: attributeQueryKeys.list(params),
|
|
189
206
|
staleTime: 3e4
|
|
190
207
|
}),
|
|
208
|
+
getAttributesTable: (params = {}) => queryOptions({
|
|
209
|
+
queryFn: () => getAttributesTable({
|
|
210
|
+
skip: params.skip ?? 0,
|
|
211
|
+
limit: params.limit ?? 10,
|
|
212
|
+
filters: params.filters ?? void 0
|
|
213
|
+
}),
|
|
214
|
+
queryKey: attributeQueryKeys.table(params),
|
|
215
|
+
staleTime: 3e4
|
|
216
|
+
}),
|
|
191
217
|
getAttributesForSelect: () => queryOptions({
|
|
192
218
|
queryFn: getAttributesForSelect,
|
|
193
219
|
queryKey: attributeQueryKeys.forSelect(),
|
|
@@ -361,11 +387,43 @@ var attributes = {
|
|
|
361
387
|
|
|
362
388
|
// src/hooks/attributes.hooks.ts
|
|
363
389
|
var attributeKeys = attributeQueryKeys;
|
|
390
|
+
var defaultColumnMap = {
|
|
391
|
+
categoryId: "categoryID",
|
|
392
|
+
productId: "productID",
|
|
393
|
+
materialId: "materialID"
|
|
394
|
+
};
|
|
395
|
+
function getFilterValue(columnFilters, columnId) {
|
|
396
|
+
const filter = columnFilters?.find((f) => f.id === columnId);
|
|
397
|
+
if (filter?.value == null) return null;
|
|
398
|
+
return typeof filter.value === "string" ? filter.value : String(filter.value);
|
|
399
|
+
}
|
|
400
|
+
function parseNumber(value) {
|
|
401
|
+
if (value == null || value === "") return null;
|
|
402
|
+
const n = Number.parseInt(value, 10);
|
|
403
|
+
return Number.isNaN(n) ? null : n;
|
|
404
|
+
}
|
|
405
|
+
var mapTableParamsToAttributeParams = (params, columnMap) => {
|
|
406
|
+
const map = { ...defaultColumnMap, ...columnMap };
|
|
407
|
+
const cf = params.columnFilters;
|
|
408
|
+
return {
|
|
409
|
+
skip: params.skip,
|
|
410
|
+
limit: params.limit,
|
|
411
|
+
filters: {
|
|
412
|
+
query: params.query ?? null,
|
|
413
|
+
categoryId: parseNumber(getFilterValue(cf, map.categoryId)),
|
|
414
|
+
productId: parseNumber(getFilterValue(cf, map.productId)),
|
|
415
|
+
materialId: parseNumber(getFilterValue(cf, map.materialId))
|
|
416
|
+
}
|
|
417
|
+
};
|
|
418
|
+
};
|
|
364
419
|
var useAttributes = (params, options) => useQuery({
|
|
365
420
|
...attributes.queries.getAttributes(params),
|
|
366
421
|
...options
|
|
367
422
|
});
|
|
368
|
-
var useAttributesTable =
|
|
423
|
+
var useAttributesTable = (params, options) => useQuery({
|
|
424
|
+
...attributes.queries.getAttributesTable(params),
|
|
425
|
+
...options
|
|
426
|
+
});
|
|
369
427
|
var useAttributesForSelect = (options) => useQuery({
|
|
370
428
|
...attributes.queries.getAttributesForSelect(),
|
|
371
429
|
staleTime: 10 * 60 * 1e3,
|
|
@@ -3095,7 +3153,7 @@ var products = {
|
|
|
3095
3153
|
|
|
3096
3154
|
// src/hooks/product.hooks.ts
|
|
3097
3155
|
var productKeys = productQueryKeys;
|
|
3098
|
-
var
|
|
3156
|
+
var defaultColumnMap2 = {
|
|
3099
3157
|
categoryId: "tblCategories.categoryName",
|
|
3100
3158
|
batchId: "batchId",
|
|
3101
3159
|
supplierId: "supplierId",
|
|
@@ -3103,25 +3161,25 @@ var defaultColumnMap = {
|
|
|
3103
3161
|
priceRangeMin: "priceRangeMin",
|
|
3104
3162
|
priceRangeMax: "priceRangeMax"
|
|
3105
3163
|
};
|
|
3106
|
-
function
|
|
3164
|
+
function getFilterValue2(columnFilters, columnId) {
|
|
3107
3165
|
const filter = columnFilters?.find((f) => f.id === columnId);
|
|
3108
3166
|
if (filter?.value == null) return null;
|
|
3109
3167
|
return typeof filter.value === "string" ? filter.value : String(filter.value);
|
|
3110
3168
|
}
|
|
3111
|
-
function
|
|
3169
|
+
function parseNumber2(value) {
|
|
3112
3170
|
if (value == null || value === "") return null;
|
|
3113
3171
|
const n = Number.parseInt(value, 10);
|
|
3114
3172
|
return Number.isNaN(n) ? null : n;
|
|
3115
3173
|
}
|
|
3116
3174
|
var mapTableParamsToProductParams = (params, columnMap) => {
|
|
3117
|
-
const map = { ...
|
|
3175
|
+
const map = { ...defaultColumnMap2, ...columnMap };
|
|
3118
3176
|
const cf = params.columnFilters;
|
|
3119
|
-
const categoryId =
|
|
3120
|
-
const supplierId =
|
|
3121
|
-
const warehouseId =
|
|
3122
|
-
const priceRangeMin =
|
|
3123
|
-
const priceRangeMax =
|
|
3124
|
-
const batchRaw =
|
|
3177
|
+
const categoryId = parseNumber2(getFilterValue2(cf, map.categoryId));
|
|
3178
|
+
const supplierId = parseNumber2(getFilterValue2(cf, map.supplierId));
|
|
3179
|
+
const warehouseId = parseNumber2(getFilterValue2(cf, map.warehouseId));
|
|
3180
|
+
const priceRangeMin = parseNumber2(getFilterValue2(cf, map.priceRangeMin));
|
|
3181
|
+
const priceRangeMax = parseNumber2(getFilterValue2(cf, map.priceRangeMax));
|
|
3182
|
+
const batchRaw = getFilterValue2(cf, map.batchId);
|
|
3125
3183
|
const batchId = batchRaw !== null ? batchRaw : null;
|
|
3126
3184
|
return {
|
|
3127
3185
|
skip: params.skip,
|
|
@@ -4797,6 +4855,6 @@ var usePrefetchWarehouse = () => {
|
|
|
4797
4855
|
return { prefetchWarehouse };
|
|
4798
4856
|
};
|
|
4799
4857
|
|
|
4800
|
-
export { attributeKeys, bankTerminalKeys, batchKeys, categoryKeys, clientKeys, exchangeKeys, folioKeys, genderKeys, healthKeys, locationKeys, mapTableParamsToProductParams, materialKeys, moduleKeys, orderKeys, paymentKeys, permissionKeys, pricePerGramKeys, priceTypeKeys, productKeys, productTagKeys, promotionKeys, providerKeys, qrKeys, reportKeys, returnKeys, roleKeys, stateKeys, stockMovementKeys, taxKeys, useAllAgents, useAllBankTerminals, useAllCategories, useAllGenders, useAllLocations, useAllMaterials, useAllModules, useAllProductTags, useAllStates, useAttribute, useAttributeValues, useAttributes, useAttributesByCategoryID, useAttributesByProductID, useAttributesForSelect, useAttributesTable, useBankTerminal, useBankTerminals, useBankTerminalsForSelect, useBankTerminalsTable, useBatches, useBatchesForSelect, useBatchesTable, useCalculatePricePerGram, useCategories, useCategoriesForSelect, useCategoriesTable, useCategory, useChangeOrderProduct, useClient, useClients, useClientsForSelect, useClientsTable, useCloseShift, useCreateAttribute, useCreateAttributeValue, useCreateAttributesForCategory, useCreateAttributesValuesBatch, useCreateBankTerminal, useCreateBatch, useCreateBatchAndUpdateOtherBatches, useCreateCategory, useCreateClient, useCreateExchangeRate, useCreateLocation, useCreateMaterial, useCreateMovement, useCreatePriceType, useCreateProduct, useCreateProductVariant, useCreatePromotion, useCreateProvider, useCreateReturn, useCreateRole, useCreateUser, useCreateWarehouse, useDataTable, useDeleteAttribute, useDeleteBankTerminal, useDeleteCategory, useDeleteClient, useDeleteFuturePricePerGram, useDeleteImageFromProduct, useDeleteLocation, useDeleteMaterial, useDeletePriceType, useDeleteProduct, useDeleteProductVariant, useDeleteProvider, useDeleteRole, useDeleteUser, useDeleteWarehouse, useExchangeRate, useExchangeRates, useExchangeRatesTable, useHealthCheck, useInventoryTable, useIsWeightBased, useLocation, useLocations, useLocationsForSelect, useLocationsTable, useLogin, useMakeNewCashMovement, useMatchedBatches, useMaterial, useMaterials, useMaterialsForSelect, useMaterialsTable, useMovements, useMovementsTable, useNextFolioToUseInBatches, useOrder, useOrders, useOrdersStatusForSelect, useOrdersTable, usePaymentMethods, usePaymentMethodsWithAmount, usePaymentMethodsWithAmountExpected, usePaymentTypes, usePendingReportZ, usePermissionRoleByRoleID, usePermissions, usePrefetchAttribute, usePrefetchBankTerminal, usePrefetchCategory, usePrefetchClient, usePrefetchLocation, usePrefetchMaterial, usePrefetchOrder, usePrefetchPriceType, usePrefetchProduct, usePrefetchPromotion, usePrefetchProvider, usePrefetchRole, usePrefetchUser, usePrefetchWarehouse, usePricePerGram, usePricePerGramHistory, usePriceType, usePriceTypes, usePriceTypesForSelect, usePriceTypesTable, usePrintQR, usePrintReportX, usePrintReportZ, useProduct, useProductVariant, useProductVariants, useProductVariantsForSelect, useProducts, useProductsByCategory, useProductsForSelect, useProductsTable, usePromotion, usePromotions, usePromotionsTable, usePromotionsTypeForSelect, useProvider, useProviders, useProvidersForSelect, useProvidersTable, useQRBaseUrl, useReportByInventory, useReportComparisonByTimeFrame, useReportX, useReportZ, useRestoreBankTerminal, useRestoreCategory, useRestoreClient, useRestoreLocation, useRestoreProduct, useRestoreProductVariant, useRestoreProvider, useRestoreUser, useRestoreWarehouse, useReturnsByOrderId, useRole, useRoles, useRolesTable, useSchedulePricePerGram, useSellersOfDayForSelect, useSellersWithShift, useSendCreditPayment, useSendPayment, useSetNewShift, useStockByWarehouseReport, useTaxesForSelect, useUndeleteAttribute, useUndeleteMaterial, useUndeletePriceType, useUpdateAttribute, useUpdateAttributesForCategory, useUpdateBankTerminal, useUpdateBatch, useUpdateCategory, useUpdateClient, useUpdateFuturePricePerGram, useUpdateLocation, useUpdateMaterial, useUpdatePermission, useUpdatePricePerGram, useUpdatePriceType, useUpdateProduct, useUpdateProductVariant, useUpdatePromotion, useUpdateProvider, useUpdateRole, useUpdateUser, useUpdateWarehouse, useUser, useUsers, useUsersTable, useValidateDiscountCode, useWarehouse, useWarehouses, useWarehousesForSelect, useWarehousesTable, userKeys, warehouseKeys };
|
|
4858
|
+
export { attributeKeys, bankTerminalKeys, batchKeys, categoryKeys, clientKeys, exchangeKeys, folioKeys, genderKeys, healthKeys, locationKeys, mapTableParamsToAttributeParams, mapTableParamsToProductParams, materialKeys, moduleKeys, orderKeys, paymentKeys, permissionKeys, pricePerGramKeys, priceTypeKeys, productKeys, productTagKeys, promotionKeys, providerKeys, qrKeys, reportKeys, returnKeys, roleKeys, stateKeys, stockMovementKeys, taxKeys, useAllAgents, useAllBankTerminals, useAllCategories, useAllGenders, useAllLocations, useAllMaterials, useAllModules, useAllProductTags, useAllStates, useAttribute, useAttributeValues, useAttributes, useAttributesByCategoryID, useAttributesByProductID, useAttributesForSelect, useAttributesTable, useBankTerminal, useBankTerminals, useBankTerminalsForSelect, useBankTerminalsTable, useBatches, useBatchesForSelect, useBatchesTable, useCalculatePricePerGram, useCategories, useCategoriesForSelect, useCategoriesTable, useCategory, useChangeOrderProduct, useClient, useClients, useClientsForSelect, useClientsTable, useCloseShift, useCreateAttribute, useCreateAttributeValue, useCreateAttributesForCategory, useCreateAttributesValuesBatch, useCreateBankTerminal, useCreateBatch, useCreateBatchAndUpdateOtherBatches, useCreateCategory, useCreateClient, useCreateExchangeRate, useCreateLocation, useCreateMaterial, useCreateMovement, useCreatePriceType, useCreateProduct, useCreateProductVariant, useCreatePromotion, useCreateProvider, useCreateReturn, useCreateRole, useCreateUser, useCreateWarehouse, useDataTable, useDeleteAttribute, useDeleteBankTerminal, useDeleteCategory, useDeleteClient, useDeleteFuturePricePerGram, useDeleteImageFromProduct, useDeleteLocation, useDeleteMaterial, useDeletePriceType, useDeleteProduct, useDeleteProductVariant, useDeleteProvider, useDeleteRole, useDeleteUser, useDeleteWarehouse, useExchangeRate, useExchangeRates, useExchangeRatesTable, useHealthCheck, useInventoryTable, useIsWeightBased, useLocation, useLocations, useLocationsForSelect, useLocationsTable, useLogin, useMakeNewCashMovement, useMatchedBatches, useMaterial, useMaterials, useMaterialsForSelect, useMaterialsTable, useMovements, useMovementsTable, useNextFolioToUseInBatches, useOrder, useOrders, useOrdersStatusForSelect, useOrdersTable, usePaymentMethods, usePaymentMethodsWithAmount, usePaymentMethodsWithAmountExpected, usePaymentTypes, usePendingReportZ, usePermissionRoleByRoleID, usePermissions, usePrefetchAttribute, usePrefetchBankTerminal, usePrefetchCategory, usePrefetchClient, usePrefetchLocation, usePrefetchMaterial, usePrefetchOrder, usePrefetchPriceType, usePrefetchProduct, usePrefetchPromotion, usePrefetchProvider, usePrefetchRole, usePrefetchUser, usePrefetchWarehouse, usePricePerGram, usePricePerGramHistory, usePriceType, usePriceTypes, usePriceTypesForSelect, usePriceTypesTable, usePrintQR, usePrintReportX, usePrintReportZ, useProduct, useProductVariant, useProductVariants, useProductVariantsForSelect, useProducts, useProductsByCategory, useProductsForSelect, useProductsTable, usePromotion, usePromotions, usePromotionsTable, usePromotionsTypeForSelect, useProvider, useProviders, useProvidersForSelect, useProvidersTable, useQRBaseUrl, useReportByInventory, useReportComparisonByTimeFrame, useReportX, useReportZ, useRestoreBankTerminal, useRestoreCategory, useRestoreClient, useRestoreLocation, useRestoreProduct, useRestoreProductVariant, useRestoreProvider, useRestoreUser, useRestoreWarehouse, useReturnsByOrderId, useRole, useRoles, useRolesTable, useSchedulePricePerGram, useSellersOfDayForSelect, useSellersWithShift, useSendCreditPayment, useSendPayment, useSetNewShift, useStockByWarehouseReport, useTaxesForSelect, useUndeleteAttribute, useUndeleteMaterial, useUndeletePriceType, useUpdateAttribute, useUpdateAttributesForCategory, useUpdateBankTerminal, useUpdateBatch, useUpdateCategory, useUpdateClient, useUpdateFuturePricePerGram, useUpdateLocation, useUpdateMaterial, useUpdatePermission, useUpdatePricePerGram, useUpdatePriceType, useUpdateProduct, useUpdateProductVariant, useUpdatePromotion, useUpdateProvider, useUpdateRole, useUpdateUser, useUpdateWarehouse, useUser, useUsers, useUsersTable, useValidateDiscountCode, useWarehouse, useWarehouses, useWarehousesForSelect, useWarehousesTable, userKeys, warehouseKeys };
|
|
4801
4859
|
//# sourceMappingURL=hooks.js.map
|
|
4802
4860
|
//# sourceMappingURL=hooks.js.map
|