@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.
- package/dist/bundle.js +1 -1
- package/dist/types/hooks/ACB/get/getClientBalance.hook.d.ts +7 -0
- package/dist/types/hooks/ACB/mutate/postClientBalance.hook.d.ts +2 -0
- package/dist/types/hooks/index.d.ts +2 -0
- package/dist/types/interfaces/ACB.d.ts +19 -0
- package/dist/types/interfaces/index.d.ts +1 -0
- package/package.json +1 -1
- package/src/hooks/ACB/get/getClientBalance.hook.ts +20 -0
- package/src/hooks/ACB/mutate/postClientBalance.hook.ts +16 -0
- package/src/hooks/index.ts +7 -1
- package/src/interfaces/ACB.ts +21 -0
- package/src/interfaces/index.ts +2 -1
|
@@ -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 {};
|
|
@@ -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
|
+
}
|
package/package.json
CHANGED
|
@@ -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
|
+
}
|
package/src/hooks/index.ts
CHANGED
|
@@ -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
|
+
}
|
package/src/interfaces/index.ts
CHANGED