erp-pos-ecommerce-shared 0.2.20 → 0.2.22

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-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';
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, e as LoginResponse, S as StateResponse, f as PrintQRResponse, G as GetReturnsByOrderIdResponse, d as IUserSettings } from './warehouse.service-D5fHR5E3.js';
8
+ import { F as FolioResponse } from './shift.queries-MPSeGMrR.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-MPSeGMrR.js';
10
10
  import '@tanstack/react-table';
11
11
 
12
12
  declare const attributeQueryKeys: {
@@ -2162,4 +2162,24 @@ declare const stockMovements: {
2162
2162
  };
2163
2163
  };
2164
2164
 
2165
- export { TableQueryParams, attributeQueryKeys, attributes, auth, bankTerminalQueryKeys, bankTerminals, batchQueryKeys, batches, categories, categoryQueryKeys, clientQueryKeys, clients, exchange, exchangeQueryKeys, folioQueryKeys, folios, locationQueryKeys, locations, materialQueryKeys, materials, moduleQueryKeys, modules, paymentQueryKeys, payments, permissionQueryKeys, permissions, pricePerGram, pricePerGramQueryKeys, priceTypeQueryKeys, priceTypes, productTagQueryKeys, productTags, promotionQueryKeys, promotions, providerQueryKeys, providers, qr, qrQueryKeys, reportQueryKeys, reports, returnQueryKeys, returns, roleQueryKeys, roles, stateQueryKeys, states, stockMovementQueryKeys, stockMovements, taxQueryKeys, taxes, userQueryKeys, users, warehouseQueryKeys, warehouses };
2165
+ declare const userSettingsQueryKeys: {
2166
+ all: readonly ["userSettings"];
2167
+ detail: () => readonly ["userSettings", "detail"];
2168
+ };
2169
+ declare const userSettingsConfig: {
2170
+ queries: {
2171
+ getUserSettings: () => _tanstack_query_core.OmitKeyof<_tanstack_react_query.UseQueryOptions<IUserSettings, Error, IUserSettings, readonly ["userSettings", "detail"]>, "queryFn"> & {
2172
+ queryFn?: _tanstack_query_core.QueryFunction<IUserSettings, readonly ["userSettings", "detail"], never> | undefined;
2173
+ } & {
2174
+ queryKey: readonly ["userSettings", "detail"] & {
2175
+ [dataTagSymbol]: IUserSettings;
2176
+ [dataTagErrorSymbol]: Error;
2177
+ };
2178
+ };
2179
+ };
2180
+ mutations: {
2181
+ updateUserSettings: (queryClient: QueryClient) => UseMutationOptions<IUserSettings, Error, Partial<IUserSettings>>;
2182
+ };
2183
+ };
2184
+
2185
+ export { TableQueryParams, attributeQueryKeys, attributes, auth, bankTerminalQueryKeys, bankTerminals, batchQueryKeys, batches, categories, categoryQueryKeys, clientQueryKeys, clients, exchange, exchangeQueryKeys, folioQueryKeys, folios, locationQueryKeys, locations, materialQueryKeys, materials, moduleQueryKeys, modules, paymentQueryKeys, payments, permissionQueryKeys, permissions, pricePerGram, pricePerGramQueryKeys, priceTypeQueryKeys, priceTypes, productTagQueryKeys, productTags, promotionQueryKeys, promotions, providerQueryKeys, providers, qr, qrQueryKeys, reportQueryKeys, reports, returnQueryKeys, returns, roleQueryKeys, roles, stateQueryKeys, states, stockMovementQueryKeys, stockMovements, taxQueryKeys, taxes, userQueryKeys, userSettingsConfig, userSettingsQueryKeys, users, warehouseQueryKeys, warehouses };
package/dist/queries.js CHANGED
@@ -3650,6 +3650,51 @@ var stockMovements = {
3650
3650
  }
3651
3651
  };
3652
3652
 
3653
- export { attributeQueryKeys, attributes, auth, bankTerminalQueryKeys, bankTerminals, batchQueryKeys, batches, categories, categoryQueryKeys, clientQueryKeys, clients, exchange, exchangeQueryKeys, folioQueryKeys, folios, genderQueryKeys, genders, health, healthQueryKeys, locationQueryKeys, locations, materialQueryKeys, materials, moduleQueryKeys, modules, orderQueryKeys, orders, paymentQueryKeys, payments, permissionQueryKeys, permissions, pricePerGram, pricePerGramQueryKeys, priceTypeQueryKeys, priceTypes, productQueryKeys, productTagQueryKeys, productTags, products, promotionQueryKeys, promotions, providerQueryKeys, providers, qr, qrQueryKeys, reportQueryKeys, reports, returnQueryKeys, returns, roleQueryKeys, roles, shifts, stateQueryKeys, states, stockMovementQueryKeys, stockMovements, taxQueryKeys, taxes, userQueryKeys, users, warehouseQueryKeys, warehouses };
3653
+ // src/services/userSettings.service.ts
3654
+ var getUserSettings = async () => {
3655
+ const { data } = await api.get("user-settings");
3656
+ return data.data;
3657
+ };
3658
+ var updateUserSettings = async (settings) => {
3659
+ const { data } = await api.put("user-settings", settings);
3660
+ return data.data;
3661
+ };
3662
+
3663
+ // src/queries/userSettings.queries.ts
3664
+ var userSettingsQueryKeys = {
3665
+ all: ["userSettings"],
3666
+ detail: () => [...userSettingsQueryKeys.all, "detail"]
3667
+ };
3668
+ var userSettingsConfig = {
3669
+ queries: {
3670
+ getUserSettings: () => queryOptions({
3671
+ queryFn: getUserSettings,
3672
+ queryKey: userSettingsQueryKeys.detail(),
3673
+ staleTime: 10 * 60 * 1e3
3674
+ })
3675
+ },
3676
+ mutations: {
3677
+ updateUserSettings: (queryClient) => ({
3678
+ mutationFn: updateUserSettings,
3679
+ onSuccess: () => {
3680
+ queryClient.invalidateQueries({
3681
+ queryKey: userSettingsQueryKeys.all
3682
+ });
3683
+ successNotification({
3684
+ title: "Configuraci\xF3n guardada",
3685
+ message: "Tu configuraci\xF3n se ha actualizado correctamente."
3686
+ });
3687
+ },
3688
+ onError: (error) => {
3689
+ errorNotification({
3690
+ title: "Error",
3691
+ message: error.message || "No se pudo guardar la configuraci\xF3n."
3692
+ });
3693
+ }
3694
+ })
3695
+ }
3696
+ };
3697
+
3698
+ export { attributeQueryKeys, attributes, auth, bankTerminalQueryKeys, bankTerminals, batchQueryKeys, batches, categories, categoryQueryKeys, clientQueryKeys, clients, exchange, exchangeQueryKeys, folioQueryKeys, folios, genderQueryKeys, genders, health, healthQueryKeys, locationQueryKeys, locations, materialQueryKeys, materials, moduleQueryKeys, modules, orderQueryKeys, orders, paymentQueryKeys, payments, permissionQueryKeys, permissions, pricePerGram, pricePerGramQueryKeys, priceTypeQueryKeys, priceTypes, productQueryKeys, productTagQueryKeys, productTags, products, promotionQueryKeys, promotions, providerQueryKeys, providers, qr, qrQueryKeys, reportQueryKeys, reports, returnQueryKeys, returns, roleQueryKeys, roles, shifts, stateQueryKeys, states, stockMovementQueryKeys, stockMovements, taxQueryKeys, taxes, userQueryKeys, userSettingsConfig, userSettingsQueryKeys, users, warehouseQueryKeys, warehouses };
3654
3699
  //# sourceMappingURL=queries.js.map
3655
3700
  //# sourceMappingURL=queries.js.map