@omniumretail/shared-resources 0.2.80 → 0.2.82
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/Acls/get/getVoucherLoyaltyQuery.hook.d.ts +7 -0
- package/dist/types/hooks/Acls/get/getVoucherSitooQuery.hook.d.ts +7 -0
- package/dist/types/hooks/Acls/mutate/postSaldoVoucherQuery.hook.d.ts +2 -0
- package/dist/types/hooks/Acls/mutate/postSalesAssociationQuery.hook.d.ts +8 -0
- package/dist/types/hooks/Acls/mutate/postVoucherSitooQuery.hook.d.ts +2 -0
- package/dist/types/hooks/Asgt/get/getProductWarningASGTQuery.hook.d.ts +11 -0
- package/dist/types/hooks/Asgt/get/getProductsMovementsASGTQuery.hook.d.ts +11 -0
- package/dist/types/hooks/Users/get/useApplicationQuery.hook.d.ts +11 -0
- package/dist/types/hooks/Users/get/useUserListQuery.hook.d.ts +2 -2
- package/dist/types/hooks/Users/mutate/deletePermissionMutateQuery.hook.d.ts +2 -0
- package/dist/types/hooks/index.d.ts +9 -0
- package/dist/types/interfaces/Acls.d.ts +16 -0
- package/dist/types/interfaces/Permissions.d.ts +5 -0
- package/dist/types/interfaces/TransferDocuments.d.ts +22 -0
- package/dist/types/interfaces/index.d.ts +1 -0
- package/package.json +1 -1
- package/src/hooks/Acls/get/getVoucherLoyaltyQuery.hook.ts +23 -0
- package/src/hooks/Acls/get/getVoucherSitooQuery.hook.ts +21 -0
- package/src/hooks/Acls/mutate/postSaldoVoucherQuery.hook.ts +16 -0
- package/src/hooks/Acls/mutate/postSalesAssociationQuery.hook.ts +25 -0
- package/src/hooks/Acls/mutate/postVoucherSitooQuery.hook.ts +16 -0
- package/src/hooks/Asgt/get/getProductWarningASGTQuery.hook.ts +27 -0
- package/src/hooks/Asgt/get/getProductsMovementsASGTQuery.hook.ts +27 -0
- package/src/hooks/Users/get/useApplicationQuery.hook.ts +29 -0
- package/src/hooks/Users/get/usePermissionsQuery.hook.ts +2 -1
- package/src/hooks/Users/get/useUserListQuery.hook.ts +4 -6
- package/src/hooks/Users/mutate/deletePermissionMutateQuery.hook.ts +15 -0
- package/src/hooks/index.ts +12 -0
- package/src/interfaces/Acls.ts +19 -0
- package/src/interfaces/Permissions.ts +6 -0
- package/src/interfaces/TransferDocuments.ts +28 -1
- package/src/interfaces/index.ts +1 -0
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { UseQueryOptions } from '@tanstack/react-query';
|
|
2
|
+
import { VouchersMimo } from '../../../interfaces';
|
|
3
|
+
interface GetVoucherLoyaltyProps extends UseQueryOptions<VouchersMimo> {
|
|
4
|
+
voucherCode?: string;
|
|
5
|
+
}
|
|
6
|
+
export declare const getVoucherLoyaltyQueryHook: ({ voucherCode, ...options }: GetVoucherLoyaltyProps) => import("@tanstack/react-query").UseQueryResult<VouchersMimo, unknown>;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { UseQueryOptions } from '@tanstack/react-query';
|
|
2
|
+
import { VouchersMimo } from '../../../interfaces';
|
|
3
|
+
interface GetVoucherSitooProps extends UseQueryOptions<VouchersMimo> {
|
|
4
|
+
id?: string;
|
|
5
|
+
}
|
|
6
|
+
export declare const getVoucherSitooQueryHook: ({ id, ...options }: GetVoucherSitooProps) => import("@tanstack/react-query").UseQueryResult<VouchersMimo, unknown>;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { UseQueryOptions } from '@tanstack/react-query';
|
|
2
|
+
import { VouchersMimo } from '../../../interfaces';
|
|
3
|
+
interface PostSalesAssociationProps extends UseQueryOptions<VouchersMimo> {
|
|
4
|
+
salesId?: string;
|
|
5
|
+
customerId?: string;
|
|
6
|
+
}
|
|
7
|
+
export declare const postSalesAssociationQueryHook: ({ salesId, customerId }: PostSalesAssociationProps) => import("@tanstack/react-query").UseMutationResult<VouchersMimo, unknown, VouchersMimo, unknown>;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { UseQueryOptions } from "@tanstack/react-query";
|
|
2
|
+
import { TransferDocument, ResponseList } from "../../../interfaces";
|
|
3
|
+
export interface ProductWarningASGTProps extends UseQueryOptions<ResponseList<"ProductWarning", TransferDocument>> {
|
|
4
|
+
page: number;
|
|
5
|
+
records: number;
|
|
6
|
+
sortBy: string;
|
|
7
|
+
sortDirection: string;
|
|
8
|
+
terms?: string;
|
|
9
|
+
query?: string;
|
|
10
|
+
}
|
|
11
|
+
export declare const getProductWarningASGTQueryHook: ({ page, records, sortBy, sortDirection, terms, query, ...options }: ProductWarningASGTProps) => import("@tanstack/react-query").UseQueryResult<ResponseList<"ProductWarning", TransferDocument>, unknown>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { UseQueryOptions } from "@tanstack/react-query";
|
|
2
|
+
import { ProductMovement, ResponseList } from "../../../interfaces";
|
|
3
|
+
export interface ProductsMovementsASGTProps extends UseQueryOptions<ResponseList<"ProductsMovements", ProductMovement>> {
|
|
4
|
+
page: number;
|
|
5
|
+
records: number;
|
|
6
|
+
sortBy: string;
|
|
7
|
+
sortDirection: string;
|
|
8
|
+
terms?: string;
|
|
9
|
+
query?: string;
|
|
10
|
+
}
|
|
11
|
+
export declare const getProductsMovementsASGTQueryHook: ({ page, records, sortBy, sortDirection, terms, query, ...options }: ProductsMovementsASGTProps) => import("@tanstack/react-query").UseQueryResult<ResponseList<"ProductsMovements", ProductMovement>, unknown>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { UseQueryOptions } from "@tanstack/react-query";
|
|
2
|
+
import { Applications, ResponseList } from "../../../interfaces";
|
|
3
|
+
export interface ApplicationQuery extends UseQueryOptions<ResponseList<"Applications", Applications>> {
|
|
4
|
+
tags?: string;
|
|
5
|
+
page?: number;
|
|
6
|
+
records?: number;
|
|
7
|
+
queryField?: string;
|
|
8
|
+
sortBy?: string;
|
|
9
|
+
sortDirection?: string;
|
|
10
|
+
}
|
|
11
|
+
export declare const useApplicationQuery: ({ tags, page, records, queryField, sortBy, sortDirection }: ApplicationQuery) => import("@tanstack/react-query").UseQueryResult<ResponseList<"Applications", Applications>, unknown>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { UseQueryOptions } from "@tanstack/react-query";
|
|
2
2
|
import { User, ResponseList } from "../../../interfaces";
|
|
3
|
-
export interface UserListQuery extends UseQueryOptions<ResponseList<"Users", User
|
|
3
|
+
export interface UserListQuery extends Omit<UseQueryOptions<ResponseList<"Users", User>>, "queryKey"> {
|
|
4
4
|
tags?: string;
|
|
5
5
|
records: number;
|
|
6
6
|
page: number;
|
|
@@ -8,4 +8,4 @@ export interface UserListQuery extends UseQueryOptions<ResponseList<"Users", Use
|
|
|
8
8
|
sortBy?: string;
|
|
9
9
|
sortDirection?: string;
|
|
10
10
|
}
|
|
11
|
-
export declare const useUserListQueryHook: ({ tags, page, records, queryField, sortBy, sortDirection }: UserListQuery) => import("@tanstack/react-query").UseQueryResult<ResponseList<"Users", User>, unknown>;
|
|
11
|
+
export declare const useUserListQueryHook: ({ tags, page, records, queryField, sortBy, sortDirection, ...options }: UserListQuery) => import("@tanstack/react-query").UseQueryResult<ResponseList<"Users", User>, unknown>;
|
|
@@ -63,6 +63,8 @@ export * from "./Users/get/getUserAndSupervisorQuery.hook";
|
|
|
63
63
|
export * from "./Users/get/usePermissionsQuery.hook";
|
|
64
64
|
export * from "./Users/mutate/useUpdatePermissionsMutateQuery.hook";
|
|
65
65
|
export * from "./Users/get/usePermissionByIdQuery.hook";
|
|
66
|
+
export * from "./Users/get/useApplicationQuery.hook";
|
|
67
|
+
export * from "./Users/mutate/deletePermissionMutateQuery.hook";
|
|
66
68
|
export * from "./Analytics/get/useAnalyticsEvaluationCyclesQuery.hook";
|
|
67
69
|
export * from "./Analytics/get/useAnalyticsUserIdQuery.hook";
|
|
68
70
|
export * from "./Analytics/get/useAnalyticsQuestionsQuery.hook";
|
|
@@ -139,7 +141,9 @@ export * from "./Asgt/mutate/createPackageASGTMutateQuery.hook";
|
|
|
139
141
|
export * from "./Asgt/mutate/createTransferASGTMutateQuery.hook";
|
|
140
142
|
export * from "./Asgt/get/getProductsPickedASGTQuery.hook";
|
|
141
143
|
export * from "./Asgt/get/getIdProductsPickedASGTQuery.hook";
|
|
144
|
+
export * from "./Asgt/get/getProductWarningASGTQuery.hook";
|
|
142
145
|
export * from "./Asgt/mutate/removeProductASGTQuery.hook";
|
|
146
|
+
export * from "./Asgt/get/getProductsMovementsASGTQuery.hook";
|
|
143
147
|
export * from "./ATIM/PicaPonto/get/getEmployeesWithTimekeeping.hook";
|
|
144
148
|
export * from "./ATIM/PicaPonto/get/getEmployeesWithTimekeeping.hook";
|
|
145
149
|
export * from "./ATIM/PicaPonto/mutate/postVerifyUserQuery.hook";
|
|
@@ -248,6 +252,11 @@ export * from "./BigWin/get/getBwgAllEmployeesQuery.hook";
|
|
|
248
252
|
export * from "./BigWin/get/getBwgBackOfficeQuery.hook";
|
|
249
253
|
export * from "./BigWin/others/importRegulationQuery.hook";
|
|
250
254
|
export * from "./BigWin/others/importABWGQuery.hook";
|
|
255
|
+
export * from "./Acls/get/getVoucherLoyaltyQuery.hook";
|
|
256
|
+
export * from "./Acls/get/getVoucherSitooQuery.hook";
|
|
257
|
+
export * from "./Acls/mutate/postSaldoVoucherQuery.hook";
|
|
258
|
+
export * from "./Acls/mutate/postSalesAssociationQuery.hook";
|
|
259
|
+
export * from "./Acls/mutate/postVoucherSitooQuery.hook";
|
|
251
260
|
export * from "./OSUA/get/documentos/getGngDocumentos.hook";
|
|
252
261
|
export * from "./OSUA/get/documentos/getSitooDocumentos.hook";
|
|
253
262
|
export * from "./OSUA/get/vouchers/getGngVoucher.hook";
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export interface Vouchers {
|
|
2
|
+
Id: string;
|
|
3
|
+
CreateDate: string;
|
|
4
|
+
UpdateDate: string;
|
|
5
|
+
CustomerId: string;
|
|
6
|
+
VoucherTemplateId: string;
|
|
7
|
+
UsageDate: string;
|
|
8
|
+
}
|
|
9
|
+
export interface VouchersMimo {
|
|
10
|
+
Id: string;
|
|
11
|
+
CreateDate: string;
|
|
12
|
+
UpdateDate: string;
|
|
13
|
+
CustomerId: string;
|
|
14
|
+
VoucherTemplate: Vouchers[];
|
|
15
|
+
UsageDate: string;
|
|
16
|
+
}
|
|
@@ -22,3 +22,25 @@ export interface TransferDocumentsDetails {
|
|
|
22
22
|
PackageState: string;
|
|
23
23
|
Notes: string;
|
|
24
24
|
}
|
|
25
|
+
export interface TransferDocument {
|
|
26
|
+
Ean: string;
|
|
27
|
+
Reference: string;
|
|
28
|
+
ProductName: string;
|
|
29
|
+
StoreName: string;
|
|
30
|
+
ProductImage: string;
|
|
31
|
+
Notes: string;
|
|
32
|
+
Stock: number;
|
|
33
|
+
MovementType: string;
|
|
34
|
+
DocumentNumber: string;
|
|
35
|
+
DocumentDate: number;
|
|
36
|
+
}
|
|
37
|
+
export interface ProductMovement {
|
|
38
|
+
DocNr: string;
|
|
39
|
+
TypeOfDocument: string;
|
|
40
|
+
Date: string;
|
|
41
|
+
Store: string;
|
|
42
|
+
StoreFrom: string;
|
|
43
|
+
ProductTitle: string;
|
|
44
|
+
Image: string | null;
|
|
45
|
+
Movement: number;
|
|
46
|
+
}
|
package/package.json
CHANGED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { useQuery, UseQueryOptions } from '@tanstack/react-query';
|
|
2
|
+
import { VouchersMimo } from '../../../interfaces';
|
|
3
|
+
import { getAuth0 } from '../../../services/ApiService';
|
|
4
|
+
|
|
5
|
+
interface GetVoucherLoyaltyProps extends UseQueryOptions<VouchersMimo>{
|
|
6
|
+
voucherCode?: string;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export const getVoucherLoyaltyQueryHook = ({ voucherCode, ...options }: GetVoucherLoyaltyProps) => {
|
|
10
|
+
return useQuery(
|
|
11
|
+
['LOYALTY_VOUCHERS', voucherCode],
|
|
12
|
+
|
|
13
|
+
() => getAuth0<VouchersMimo>(`/ACUL/Vouchers`,{
|
|
14
|
+
pVoucherCode: voucherCode
|
|
15
|
+
}),
|
|
16
|
+
{
|
|
17
|
+
...options,
|
|
18
|
+
retry: false,
|
|
19
|
+
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
);
|
|
23
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { useQuery, UseQueryOptions } from '@tanstack/react-query';
|
|
2
|
+
import { getAuth0 } from "../../../services/ApiService";
|
|
3
|
+
import { VouchersMimo } from '../../../interfaces';
|
|
4
|
+
|
|
5
|
+
interface GetVoucherSitooProps extends UseQueryOptions<VouchersMimo>{
|
|
6
|
+
id?: string;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export const getVoucherSitooQueryHook = ({ id, ...options }: GetVoucherSitooProps) => {
|
|
10
|
+
return useQuery(
|
|
11
|
+
['SITOO_MIMO_VOUCHERS', id],
|
|
12
|
+
|
|
13
|
+
() => getAuth0<VouchersMimo>(`/GNG/ACUL/GiftCard/${id}`),
|
|
14
|
+
{
|
|
15
|
+
...options,
|
|
16
|
+
retry: false,
|
|
17
|
+
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
);
|
|
21
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { useMutation, useQueryClient } from '@tanstack/react-query';
|
|
2
|
+
import { VouchersMimo } from '../../../interfaces';
|
|
3
|
+
import { post } from '../../../services/ApiService';
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
export const postSaldoVoucherQueryHook = ( Id: string) => {
|
|
7
|
+
const queryClient = useQueryClient();
|
|
8
|
+
return useMutation<VouchersMimo, unknown, VouchersMimo>((data: VouchersMimo) => {
|
|
9
|
+
return post(`/ACUL/${Id}`, data)
|
|
10
|
+
}, {
|
|
11
|
+
onSuccess: (data: VouchersMimo) => {
|
|
12
|
+
queryClient.setQueryData(
|
|
13
|
+
['CREATE_VOUCHER_SITOO_MIMO'], data);
|
|
14
|
+
},
|
|
15
|
+
});
|
|
16
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
import { useMutation, useQueryClient, UseQueryOptions } from '@tanstack/react-query';
|
|
4
|
+
import { VouchersMimo } from '../../../interfaces';
|
|
5
|
+
import { postWithParameters } from "../../../services/ApiService";
|
|
6
|
+
|
|
7
|
+
interface PostSalesAssociationProps extends UseQueryOptions<VouchersMimo> {
|
|
8
|
+
salesId?: string;
|
|
9
|
+
customerId?: string;
|
|
10
|
+
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export const postSalesAssociationQueryHook = ({salesId, customerId }: PostSalesAssociationProps) => {
|
|
14
|
+
const queryClient = useQueryClient();
|
|
15
|
+
return useMutation<VouchersMimo, unknown, VouchersMimo>(() => {
|
|
16
|
+
return postWithParameters('/GNG/ACUL/SalesAssociation?', {
|
|
17
|
+
psalesId: salesId ,
|
|
18
|
+
pcustomerId: customerId
|
|
19
|
+
});
|
|
20
|
+
}, {
|
|
21
|
+
onSuccess: (data: VouchersMimo) => {
|
|
22
|
+
queryClient.setQueryData(['CREATE_INTEGRATION_REQUEST'], data);
|
|
23
|
+
},
|
|
24
|
+
});
|
|
25
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { useMutation, useQueryClient } from '@tanstack/react-query';
|
|
2
|
+
import { VouchersMimo } from '../../../interfaces';
|
|
3
|
+
import { post } from '../../../services/ApiService';
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
export const postVoucherSitooQueryHook = ( Id: string) => {
|
|
7
|
+
const queryClient = useQueryClient();
|
|
8
|
+
return useMutation<VouchersMimo, unknown, VouchersMimo>((data: VouchersMimo) => {
|
|
9
|
+
return post(`/ACUL/${Id}/transaction`, data)
|
|
10
|
+
}, {
|
|
11
|
+
onSuccess: (data: VouchersMimo) => {
|
|
12
|
+
queryClient.setQueryData(
|
|
13
|
+
['CREATE_VOUCHER_SITOO_MIMO'], data);
|
|
14
|
+
},
|
|
15
|
+
});
|
|
16
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { useQuery, UseQueryOptions } from "@tanstack/react-query";
|
|
2
|
+
import { TransferDocument, ResponseList } from "../../../interfaces";
|
|
3
|
+
import { getAuth0 } from "../../../services/ApiService";
|
|
4
|
+
|
|
5
|
+
export interface ProductWarningASGTProps extends UseQueryOptions<ResponseList<"ProductWarning", TransferDocument>> {
|
|
6
|
+
page: number;
|
|
7
|
+
records: number;
|
|
8
|
+
sortBy: string;
|
|
9
|
+
sortDirection: string;
|
|
10
|
+
terms?: string;
|
|
11
|
+
query?: string;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export const getProductWarningASGTQueryHook = ({ page, records, sortBy, sortDirection, terms, query, ...options }: ProductWarningASGTProps) => {
|
|
15
|
+
return useQuery(
|
|
16
|
+
['ASGT_PRODUCT_WARNING_TRANSFER_DOCUMENTS', page, records, sortBy, sortDirection, terms, query, options],
|
|
17
|
+
() => getAuth0<ResponseList<"ProductWarning", TransferDocument>>('/ASGT/ProductWarning', {
|
|
18
|
+
pPage: page,
|
|
19
|
+
pRecords: records,
|
|
20
|
+
pSortBy: sortBy,
|
|
21
|
+
pSortDirection: sortDirection,
|
|
22
|
+
pTerms: terms,
|
|
23
|
+
pQuery: query
|
|
24
|
+
}),
|
|
25
|
+
options
|
|
26
|
+
);
|
|
27
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { useQuery, UseQueryOptions } from "@tanstack/react-query";
|
|
2
|
+
import { ProductMovement, ResponseList } from "../../../interfaces";
|
|
3
|
+
import { getAuth0 } from "../../../services/ApiService";
|
|
4
|
+
|
|
5
|
+
export interface ProductsMovementsASGTProps extends UseQueryOptions<ResponseList<"ProductsMovements", ProductMovement>> {
|
|
6
|
+
page: number;
|
|
7
|
+
records: number;
|
|
8
|
+
sortBy: string;
|
|
9
|
+
sortDirection: string;
|
|
10
|
+
terms?: string;
|
|
11
|
+
query?: string;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export const getProductsMovementsASGTQueryHook = ({ page, records, sortBy, sortDirection, terms, query, ...options }: ProductsMovementsASGTProps) => {
|
|
15
|
+
return useQuery(
|
|
16
|
+
['ASGT_PRODUCT_MOVEMENTS_DOCUMENTS', page, records, sortBy, sortDirection, terms, query, options],
|
|
17
|
+
() => getAuth0<ResponseList<"ProductsMovements", ProductMovement>>('/ASGT/ProductsMovements', {
|
|
18
|
+
pPage: page,
|
|
19
|
+
pRecords: records,
|
|
20
|
+
pSortBy: sortBy,
|
|
21
|
+
pSortDirection: sortDirection,
|
|
22
|
+
pTerms: terms,
|
|
23
|
+
pQuery: query
|
|
24
|
+
}),
|
|
25
|
+
options
|
|
26
|
+
);
|
|
27
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { useQuery, UseQueryOptions } from "@tanstack/react-query";
|
|
2
|
+
import { Applications, ResponseList } from "../../../interfaces";
|
|
3
|
+
import { getAuth0 } from "../../../services/ApiService";
|
|
4
|
+
|
|
5
|
+
export interface ApplicationQuery extends UseQueryOptions<ResponseList<"Applications", Applications>> {
|
|
6
|
+
tags?: string;
|
|
7
|
+
page?: number;
|
|
8
|
+
records?: number;
|
|
9
|
+
queryField?: string;
|
|
10
|
+
sortBy?: string;
|
|
11
|
+
sortDirection?: string;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export const useApplicationQuery = ({ tags, page, records, queryField, sortBy, sortDirection }: ApplicationQuery) => {
|
|
15
|
+
return useQuery(
|
|
16
|
+
['APPLICATION_QUERY', tags, page, records, queryField],
|
|
17
|
+
() => getAuth0<ResponseList<"Applications", Applications>>('/AACP/Permissions/Applications', {
|
|
18
|
+
pPage: page,
|
|
19
|
+
pRecords: records,
|
|
20
|
+
pSortBy: sortBy,
|
|
21
|
+
pSortDirection: sortDirection ,
|
|
22
|
+
pTerms: tags,
|
|
23
|
+
pQuery: queryField
|
|
24
|
+
}),
|
|
25
|
+
{
|
|
26
|
+
keepPreviousData: true,
|
|
27
|
+
}
|
|
28
|
+
);
|
|
29
|
+
}
|
|
@@ -13,12 +13,13 @@ export interface PermissionQuery extends UseQueryOptions<ResponseList<"Permissio
|
|
|
13
13
|
|
|
14
14
|
export const usePermissionsQuery = ({ tags, page, records, queryField, sortBy, sortDirection }: PermissionQuery) => {
|
|
15
15
|
return useQuery(
|
|
16
|
-
['
|
|
16
|
+
['PERMISSION_QUERY', tags, page, records, queryField],
|
|
17
17
|
() => getAuth0<ResponseList<"Permissions", Permissions>>('/AACP/Permissions', {
|
|
18
18
|
pPage: page,
|
|
19
19
|
pRecords: records,
|
|
20
20
|
pSortBy: sortBy,
|
|
21
21
|
pSortDirection: sortDirection ,
|
|
22
|
+
pTerms: tags,
|
|
22
23
|
pQuery: queryField
|
|
23
24
|
}),
|
|
24
25
|
{
|
|
@@ -2,7 +2,7 @@ import { useQuery, UseQueryOptions } from "@tanstack/react-query";
|
|
|
2
2
|
import { User, ResponseList } from "../../../interfaces";
|
|
3
3
|
import { getAuth0 } from "../../../services/ApiService";
|
|
4
4
|
|
|
5
|
-
export interface UserListQuery extends UseQueryOptions<ResponseList<"Users", User
|
|
5
|
+
export interface UserListQuery extends Omit<UseQueryOptions<ResponseList<"Users", User>>, "queryKey"> {
|
|
6
6
|
tags?: string;
|
|
7
7
|
records: number;
|
|
8
8
|
page: number;
|
|
@@ -11,9 +11,9 @@ export interface UserListQuery extends UseQueryOptions<ResponseList<"Users", Use
|
|
|
11
11
|
sortDirection?: string;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
export const useUserListQueryHook = ({ tags, page, records, queryField, sortBy, sortDirection }: UserListQuery) => {
|
|
14
|
+
export const useUserListQueryHook = ({ tags, page, records, queryField, sortBy, sortDirection, ...options }: UserListQuery) => {
|
|
15
15
|
return useQuery(
|
|
16
|
-
['USER_LIST_QUERY', tags, page, records, sortBy, sortDirection, queryField],
|
|
16
|
+
['USER_LIST_QUERY', tags, page, records, sortBy, sortDirection, queryField, options],
|
|
17
17
|
() => getAuth0<ResponseList<"Users", User>>('/AACP/Users', {
|
|
18
18
|
pPage: page || 1,
|
|
19
19
|
pRecords: records || 50,
|
|
@@ -22,8 +22,6 @@ export const useUserListQueryHook = ({ tags, page, records, queryField, sortBy,
|
|
|
22
22
|
pTerms: tags,
|
|
23
23
|
pQuery: queryField
|
|
24
24
|
}),
|
|
25
|
-
|
|
26
|
-
keepPreviousData: true,
|
|
27
|
-
},
|
|
25
|
+
options
|
|
28
26
|
);
|
|
29
27
|
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { useMutation, useQueryClient } from '@tanstack/react-query';
|
|
2
|
+
import { Permissions } from '../../../interfaces';
|
|
3
|
+
import { toDeleteAuth0 } from '../../../services/ApiService';
|
|
4
|
+
|
|
5
|
+
export const deletePermissionMutateHook = () => {
|
|
6
|
+
const queryClient = useQueryClient();
|
|
7
|
+
return useMutation<Permissions, unknown, Permissions>((data: Permissions) => {
|
|
8
|
+
return toDeleteAuth0(`/AACP/Permissions/${data.Id}`)
|
|
9
|
+
}, {
|
|
10
|
+
onSuccess: () => {
|
|
11
|
+
queryClient.invalidateQueries(
|
|
12
|
+
['DELETE_PERMISSIONS_QUERY']);
|
|
13
|
+
},
|
|
14
|
+
});
|
|
15
|
+
}
|
package/src/hooks/index.ts
CHANGED
|
@@ -70,6 +70,8 @@ export * from "./Users/get/getUserAndSupervisorQuery.hook";
|
|
|
70
70
|
export * from "./Users/get/usePermissionsQuery.hook";
|
|
71
71
|
export * from "./Users/mutate/useUpdatePermissionsMutateQuery.hook";
|
|
72
72
|
export * from "./Users/get/usePermissionByIdQuery.hook";
|
|
73
|
+
export * from "./Users/get/useApplicationQuery.hook";
|
|
74
|
+
export * from "./Users/mutate/deletePermissionMutateQuery.hook";
|
|
73
75
|
|
|
74
76
|
//Analytics
|
|
75
77
|
export * from "./Analytics/get/useAnalyticsEvaluationCyclesQuery.hook";
|
|
@@ -164,7 +166,9 @@ export * from "./Asgt/mutate/createPackageASGTMutateQuery.hook";
|
|
|
164
166
|
export * from "./Asgt/mutate/createTransferASGTMutateQuery.hook";
|
|
165
167
|
export * from "./Asgt/get/getProductsPickedASGTQuery.hook";
|
|
166
168
|
export * from "./Asgt/get/getIdProductsPickedASGTQuery.hook";
|
|
169
|
+
export * from "./Asgt/get/getProductWarningASGTQuery.hook";
|
|
167
170
|
export * from "./Asgt/mutate/removeProductASGTQuery.hook";
|
|
171
|
+
export * from "./Asgt/get/getProductsMovementsASGTQuery.hook";
|
|
168
172
|
|
|
169
173
|
//ATIM
|
|
170
174
|
export * from "./ATIM/PicaPonto/get/getEmployeesWithTimekeeping.hook";
|
|
@@ -288,6 +292,14 @@ export * from "./BigWin/get/getBwgBackOfficeQuery.hook";
|
|
|
288
292
|
export * from "./BigWin/others/importRegulationQuery.hook";
|
|
289
293
|
export * from "./BigWin/others/importABWGQuery.hook";
|
|
290
294
|
|
|
295
|
+
//ACLS
|
|
296
|
+
|
|
297
|
+
export * from "./Acls/get/getVoucherLoyaltyQuery.hook";
|
|
298
|
+
export * from "./Acls/get/getVoucherSitooQuery.hook";
|
|
299
|
+
export * from "./Acls/mutate/postSaldoVoucherQuery.hook";
|
|
300
|
+
export * from "./Acls/mutate/postSalesAssociationQuery.hook";
|
|
301
|
+
export * from "./Acls/mutate/postVoucherSitooQuery.hook";
|
|
302
|
+
|
|
291
303
|
//OSUA
|
|
292
304
|
export * from "./OSUA/get/documentos/getGngDocumentos.hook";
|
|
293
305
|
export * from "./OSUA/get/documentos/getSitooDocumentos.hook";
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export interface Vouchers {
|
|
2
|
+
Id : string;
|
|
3
|
+
CreateDate : string;
|
|
4
|
+
UpdateDate : string;
|
|
5
|
+
CustomerId : string;
|
|
6
|
+
VoucherTemplateId : string;
|
|
7
|
+
UsageDate : string;
|
|
8
|
+
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
export interface VouchersMimo {
|
|
13
|
+
Id : string;
|
|
14
|
+
CreateDate : string;
|
|
15
|
+
UpdateDate : string;
|
|
16
|
+
CustomerId : string;
|
|
17
|
+
VoucherTemplate: Vouchers[];
|
|
18
|
+
UsageDate : string;
|
|
19
|
+
}
|
|
@@ -23,4 +23,31 @@ export interface TransferDocumentsDetails {
|
|
|
23
23
|
PickedProductsCount: number;
|
|
24
24
|
PackageState: string;
|
|
25
25
|
Notes: string;
|
|
26
|
-
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export interface TransferDocument {
|
|
29
|
+
Ean: string;
|
|
30
|
+
Reference: string;
|
|
31
|
+
ProductName: string;
|
|
32
|
+
StoreName: string;
|
|
33
|
+
ProductImage: string;
|
|
34
|
+
Notes: string;
|
|
35
|
+
Stock: number;
|
|
36
|
+
MovementType: string;
|
|
37
|
+
DocumentNumber: string;
|
|
38
|
+
DocumentDate: number;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export interface ProductMovement {
|
|
42
|
+
DocNr: string;
|
|
43
|
+
TypeOfDocument: string;
|
|
44
|
+
Date: string;
|
|
45
|
+
Store: string;
|
|
46
|
+
StoreFrom: string;
|
|
47
|
+
ProductTitle: string;
|
|
48
|
+
Image: string | null;
|
|
49
|
+
Movement: number;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
|
package/src/interfaces/index.ts
CHANGED