@omniumretail/shared-resources 0.2.21 → 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.
@@ -0,0 +1,7 @@
1
+ import { UseQueryOptions } from '@tanstack/react-query';
2
+ import { ClientResponse } from '../../../interfaces';
3
+ interface ClientBalanceQueryOptions extends UseQueryOptions<'Clients', ClientResponse> {
4
+ fiscalId?: string;
5
+ }
6
+ export declare const getClientBalance: ({ fiscalId, ...options }: ClientBalanceQueryOptions) => import("@tanstack/react-query").UseQueryResult<"Clients", ClientResponse>;
7
+ export {};
@@ -0,0 +1,2 @@
1
+ import { AddClientBalanceRequest } from "../../../interfaces";
2
+ export declare const postClientBalance: () => import("@tanstack/react-query").UseMutationResult<AddClientBalanceRequest, unknown, AddClientBalanceRequest, unknown>;
@@ -117,6 +117,8 @@ export * from './OSUA/get/vouchers/getGngVoucher.hook';
117
117
  export * from './OSUA/get/vouchers/getSitooVouchers.hook';
118
118
  export * from './OSUA/get/vouchers/getVoucherIntegrationRequestStatus.hook';
119
119
  export * from './OSUA/mutate/postCreateIntegrationRequest.hook';
120
+ export * from './ACB/get/getClientBalance.hook';
121
+ export * from './ACB/mutate/postClientBalance.hook';
120
122
  export * from './ATIM/BackOffice/get/useEmployeeTimekeepingDetails.hook';
121
123
  export * from './ATIM/BackOffice/get/useStoresQueryHook.hook';
122
124
  export * from './ATIM/BackOffice/mutate/postAttendanceRange.hook';
@@ -0,0 +1,19 @@
1
+ export interface ClientResponse {
2
+ Id: string;
3
+ FiscalId: string;
4
+ Balance: string;
5
+ Name: string;
6
+ Address: string;
7
+ City: string;
8
+ PostalCode: string;
9
+ Phone: string | null;
10
+ Mobile: string;
11
+ Email: string;
12
+ }
13
+ export interface AddClientBalanceRequest {
14
+ ClientId: number;
15
+ Amount: string;
16
+ OperationType: string;
17
+ Notes: string;
18
+ UserId: string;
19
+ }
@@ -53,3 +53,4 @@ export * from './AstsStock';
53
53
  export * from './UserAuthentication';
54
54
  export * from './OUSA';
55
55
  export * from './BackofficeAtim';
56
+ export * from './ACB';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@omniumretail/shared-resources",
3
- "version": "0.2.21",
3
+ "version": "0.2.22",
4
4
  "private": false,
5
5
  "description": "Shared Components and services or utils to the frontend versions",
6
6
  "main": "dist/bundle.js",
@@ -0,0 +1,20 @@
1
+ import { useQuery, UseQueryOptions } from '@tanstack/react-query';
2
+ import { get } from '../../../services/ApiService';
3
+ import { ClientResponse } from '../../../interfaces';
4
+
5
+ interface ClientBalanceQueryOptions extends UseQueryOptions<'Clients', ClientResponse>{
6
+ fiscalId?: string;
7
+ }
8
+
9
+ export const getClientBalance= ({ fiscalId, ...options }: ClientBalanceQueryOptions) => {
10
+ return useQuery(
11
+ ['EMPLOYEES_QUERY', fiscalId],
12
+ () =>
13
+ get('/ACB/Clients', {
14
+ pFiscalId: fiscalId
15
+ }),
16
+ {
17
+ ...options
18
+ }
19
+ );
20
+ };
@@ -0,0 +1,16 @@
1
+ import { useQueryClient, useMutation } from '@tanstack/react-query';
2
+ import { AddClientBalanceRequest } from "../../../interfaces";
3
+ import { post } from "../../../services/ApiService";
4
+
5
+
6
+ export const postClientBalance = () => {
7
+ const queryClient = useQueryClient();
8
+ return useMutation<AddClientBalanceRequest , unknown, AddClientBalanceRequest >((data: AddClientBalanceRequest ) => {
9
+ return post('/ACB/Clients', data);
10
+ }, {
11
+ onSuccess: (data: AddClientBalanceRequest ) => {
12
+ queryClient.setQueryData(
13
+ ['POST_CLIENT_BALANCE'], data);
14
+ },
15
+ });
16
+ }
@@ -150,16 +150,22 @@ export * from './BigWin/others/publishMonthsManagerQuery.hook';
150
150
  //OSUA
151
151
  export * from './OSUA/get/documentos/getGngDocumentos.hook';
152
152
  export * from './OSUA/get/documentos/getSitooDocumentos.hook';
153
-
154
153
  export * from './OSUA/get/vouchers/getGngVoucher.hook';
155
154
  export * from './OSUA/get/vouchers/getSitooVouchers.hook';
156
155
  export * from './OSUA/get/vouchers/getVoucherIntegrationRequestStatus.hook';
157
156
 
158
157
  export * from './OSUA/mutate/postCreateIntegrationRequest.hook';
159
158
 
159
+ //ACB
160
+ export * from './ACB/get/getClientBalance.hook';
161
+ export * from './ACB/mutate/postClientBalance.hook';
162
+
163
+
164
+
160
165
  //BackofficeAtim
161
166
 
162
167
  export * from './ATIM/BackOffice/get/useEmployeeTimekeepingDetails.hook';
168
+
163
169
  export * from './ATIM/BackOffice/get/useStoresQueryHook.hook';
164
170
  export * from './ATIM/BackOffice/mutate/postAttendanceRange.hook';
165
171
 
@@ -0,0 +1,21 @@
1
+
2
+ export interface ClientResponse {
3
+ Id: string;
4
+ FiscalId: string;
5
+ Balance: string;
6
+ Name: string;
7
+ Address: string;
8
+ City: string;
9
+ PostalCode: string;
10
+ Phone: string | null;
11
+ Mobile: string;
12
+ Email: string;
13
+ }
14
+
15
+ export interface AddClientBalanceRequest {
16
+ ClientId: number;
17
+ Amount: string;
18
+ OperationType: string;
19
+ Notes: string;
20
+ UserId: string;
21
+ }
@@ -52,4 +52,5 @@ export * from './AstsStockInfo';
52
52
  export * from './AstsStock';
53
53
  export * from './UserAuthentication';
54
54
  export * from './OUSA';
55
- export * from './BackofficeAtim';
55
+ export * from './BackofficeAtim';
56
+ export * from './ACB';