@omniumretail/shared-resources 0.3.23 → 0.3.24
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/types/hooks/Astt/Asgt/get/getAllAdidasProductsQuery.hook.d.ts +10 -0
- package/dist/types/hooks/Astt/Asgt/get/getReprocessNeededASTTQuery.hook.d.ts +2 -0
- package/dist/types/hooks/Astt/Asgt/mutate/deleteProductASTTQuery.hook.d.ts +8 -0
- package/dist/types/hooks/Astt/Asgt/mutate/postReprocessASTTQuery.hook.d.ts +5 -0
- package/dist/types/hooks/Astt/Asgt/mutate/restartProductASTTQuery.hook.d.ts +6 -0
- package/package.json +1 -1
- package/src/hooks/Astt/Asgt/get/getAllAdidasProductsQuery.hook.ts +25 -0
- package/src/hooks/Astt/Asgt/get/getReprocessNeededASTTQuery.hook.ts +12 -0
- package/src/hooks/Astt/Asgt/mutate/deleteProductASTTQuery.hook.ts +25 -0
- package/src/hooks/Astt/Asgt/mutate/postReprocessASTTQuery.hook.ts +20 -0
- package/src/hooks/Astt/Asgt/mutate/restartProductASTTQuery.hook.ts +22 -0
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { UseQueryOptions } from "@tanstack/react-query";
|
|
2
|
+
import { TransferAllProducts, ResponseList } from "../../../../interfaces";
|
|
3
|
+
export interface GetAdidasAllProductsProps extends UseQueryOptions<ResponseList<"Products", TransferAllProducts>> {
|
|
4
|
+
page: number;
|
|
5
|
+
records: number;
|
|
6
|
+
sortBy: string;
|
|
7
|
+
sortDirection: string;
|
|
8
|
+
query?: string;
|
|
9
|
+
}
|
|
10
|
+
export declare const getAdidasAllProductsQuery: ({ page, records, sortBy, sortDirection, query, ...options }: GetAdidasAllProductsProps) => import("@tanstack/react-query").UseQueryResult<ResponseList<"Products", TransferAllProducts>, unknown>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { UseQueryOptions } from '@tanstack/react-query';
|
|
2
|
+
import { TransferPickProductsRemoved } from '../../../../interfaces/TransferPickProducts';
|
|
3
|
+
export interface RfidDeleteProps extends UseQueryOptions<TransferPickProductsRemoved> {
|
|
4
|
+
transferDocumentId: string;
|
|
5
|
+
packageId: string;
|
|
6
|
+
barcode: string;
|
|
7
|
+
}
|
|
8
|
+
export declare const deleteProductASTTQuery: ({ transferDocumentId, packageId, barcode }: RfidDeleteProps) => import("@tanstack/react-query").UseMutationResult<TransferPickProductsRemoved, unknown, TransferPickProductsRemoved, unknown>;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { UseQueryOptions } from '@tanstack/react-query';
|
|
2
|
+
export interface ReprocessProps extends UseQueryOptions<any> {
|
|
3
|
+
transferDocumentId: string;
|
|
4
|
+
}
|
|
5
|
+
export declare const postReprocessQuery: ({ transferDocumentId }: ReprocessProps) => import("@tanstack/react-query").UseMutationResult<any, unknown, any, unknown>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { UseQueryOptions } from '@tanstack/react-query';
|
|
2
|
+
export interface RfidRestartProps extends UseQueryOptions<any> {
|
|
3
|
+
transferDocumentId: string;
|
|
4
|
+
packageId: string;
|
|
5
|
+
}
|
|
6
|
+
export declare const restartProductASTTQuery: ({ transferDocumentId, packageId }: RfidRestartProps) => import("@tanstack/react-query").UseMutationResult<any, unknown, any, unknown>;
|
package/package.json
CHANGED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { useQuery, UseQueryOptions } from "@tanstack/react-query";
|
|
2
|
+
import { TransferAllProducts, ResponseList } from "../../../../interfaces";
|
|
3
|
+
import { getAuth0 } from "../../../../services/ApiService";
|
|
4
|
+
|
|
5
|
+
export interface GetAdidasAllProductsProps extends UseQueryOptions<ResponseList<"Products", TransferAllProducts>> {
|
|
6
|
+
page: number;
|
|
7
|
+
records: number;
|
|
8
|
+
sortBy: string;
|
|
9
|
+
sortDirection: string;
|
|
10
|
+
query?: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export const getAdidasAllProductsQuery = ({ page, records, sortBy, sortDirection, query, ...options }: GetAdidasAllProductsProps) => {
|
|
14
|
+
return useQuery(
|
|
15
|
+
['ASTT_ADIDAS_TRANSFER_ALL_PRODUCTS', page, records, sortBy, sortDirection, query, options],
|
|
16
|
+
() => getAuth0<ResponseList<"Products", TransferAllProducts>>('/ASTT/Products', {
|
|
17
|
+
pPage: page || 1,
|
|
18
|
+
pRecords: records || 50,
|
|
19
|
+
pSortBy: sortBy || "Name",
|
|
20
|
+
pSortDirection: sortDirection || "asc",
|
|
21
|
+
pQuery: query
|
|
22
|
+
}),
|
|
23
|
+
options
|
|
24
|
+
);
|
|
25
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { getAuth0 } from '../../../..';
|
|
2
|
+
import { useQuery, UseQueryOptions } from '@tanstack/react-query';
|
|
3
|
+
|
|
4
|
+
export const getReprocessNeededASTTQueryHook = (transferId: string, {...options} : UseQueryOptions<any>) => {
|
|
5
|
+
return useQuery(
|
|
6
|
+
['ASTT_REPROCESS_NEEDED', transferId, options],
|
|
7
|
+
() => getAuth0<any>(`/ASTT/RFID/ReprocessNeeded`, {
|
|
8
|
+
pTransferDocumentId: transferId,
|
|
9
|
+
}),
|
|
10
|
+
options
|
|
11
|
+
);
|
|
12
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { useMutation, useQueryClient, UseQueryOptions } from '@tanstack/react-query';
|
|
2
|
+
import { toDeleteAuth0 } from '../../../../services/ApiService';
|
|
3
|
+
import { TransferPickProductsRemoved } from '../../../../interfaces/TransferPickProducts';
|
|
4
|
+
|
|
5
|
+
export interface RfidDeleteProps extends UseQueryOptions<TransferPickProductsRemoved> {
|
|
6
|
+
transferDocumentId: string;
|
|
7
|
+
packageId: string;
|
|
8
|
+
barcode: string;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export const deleteProductASTTQuery = ({ transferDocumentId, packageId, barcode }: RfidDeleteProps) => {
|
|
12
|
+
const queryClient = useQueryClient();
|
|
13
|
+
return useMutation<TransferPickProductsRemoved, unknown, TransferPickProductsRemoved>((data: TransferPickProductsRemoved) => {
|
|
14
|
+
return toDeleteAuth0(`/ASTT/RFID/byBarcode?`, {
|
|
15
|
+
pTransferDocumentId: transferDocumentId,
|
|
16
|
+
pPackageId: packageId,
|
|
17
|
+
pBarcode: barcode
|
|
18
|
+
}, data);
|
|
19
|
+
}, {
|
|
20
|
+
onSuccess: (data: TransferPickProductsRemoved) => {
|
|
21
|
+
queryClient.setQueryData(
|
|
22
|
+
['ASTT_DELETE_PRODUCT_QUERY'], data);
|
|
23
|
+
},
|
|
24
|
+
});
|
|
25
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { useMutation, useQueryClient, UseQueryOptions } from '@tanstack/react-query';
|
|
2
|
+
import { postAuth0 } from '../../../../services/ApiService';
|
|
3
|
+
|
|
4
|
+
export interface ReprocessProps extends UseQueryOptions<any> {
|
|
5
|
+
transferDocumentId: string;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export const postReprocessQuery = ({ transferDocumentId }: ReprocessProps) => {
|
|
9
|
+
const queryClient = useQueryClient();
|
|
10
|
+
return useMutation<any, unknown, any>((data) => {
|
|
11
|
+
return postAuth0(`/ASTT/RFID/Reprocess?`, {
|
|
12
|
+
pTransferDocumentId: transferDocumentId,
|
|
13
|
+
}, data);
|
|
14
|
+
}, {
|
|
15
|
+
onSuccess: (data: any) => {
|
|
16
|
+
queryClient.setQueryData(
|
|
17
|
+
['ASTT_REPROCESS_QUERY'], data);
|
|
18
|
+
},
|
|
19
|
+
});
|
|
20
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { useMutation, useQueryClient, UseQueryOptions } from '@tanstack/react-query';
|
|
2
|
+
import { toDeleteAuth0 } from '../../../../services/ApiService';
|
|
3
|
+
|
|
4
|
+
export interface RfidRestartProps extends UseQueryOptions<any> {
|
|
5
|
+
transferDocumentId: string;
|
|
6
|
+
packageId: string;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export const restartProductASTTQuery = ({ transferDocumentId, packageId }: RfidRestartProps) => {
|
|
10
|
+
const queryClient = useQueryClient();
|
|
11
|
+
return useMutation<any, unknown, any>((data: any) => {
|
|
12
|
+
return toDeleteAuth0(`/ASTT/RFID?`, {
|
|
13
|
+
pTransferDocumentId: transferDocumentId,
|
|
14
|
+
pPackageId: packageId
|
|
15
|
+
}, data);
|
|
16
|
+
}, {
|
|
17
|
+
onSuccess: (data: any) => {
|
|
18
|
+
queryClient.setQueryData(
|
|
19
|
+
['ASTT_RESTART_PRODUCT_QUERY'], data);
|
|
20
|
+
},
|
|
21
|
+
});
|
|
22
|
+
}
|