@omniumretail/shared-resources 0.3.47 → 0.3.49
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/Astt/get/getBarcodesListingByPackageQuery.hook.d.ts +3 -0
- package/dist/types/hooks/Astt/mutate/postMatchingPackageQuery.hook.d.ts +6 -0
- package/dist/types/hooks/index.d.ts +2 -0
- package/dist/types/interfaces/TransferPickProducts.d.ts +4 -0
- package/package.json +1 -1
- package/src/hooks/Astt/get/getBarcodesListingByPackageQuery.hook.ts +14 -0
- package/src/hooks/Astt/mutate/postMatchingPackageQuery.hook.ts +22 -0
- package/src/hooks/index.ts +2 -0
- package/src/interfaces/TransferPickProducts.ts +5 -0
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { TransferPackage } from '../../..';
|
|
2
|
+
import { UseQueryOptions } from '@tanstack/react-query';
|
|
3
|
+
export declare const getBarcodesListingByPackageQueryHook: (transferId: string, packageId: string, { ...options }: UseQueryOptions<TransferPackage>) => import("@tanstack/react-query").UseQueryResult<TransferPackage, unknown>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { UseQueryOptions } from '@tanstack/react-query';
|
|
2
|
+
import { TransferPickProductsList, TransferPickProductsMatched } from '../../../interfaces/TransferPickProducts';
|
|
3
|
+
export interface MatchingPackageMutateProps extends UseQueryOptions<TransferPickProductsMatched> {
|
|
4
|
+
transferDocumentId: string;
|
|
5
|
+
}
|
|
6
|
+
export declare const postMatchingPackageQueryHook: ({ transferDocumentId }: MatchingPackageMutateProps) => import("@tanstack/react-query").UseMutationResult<TransferPickProductsMatched, unknown, TransferPickProductsList[], unknown>;
|
|
@@ -134,6 +134,8 @@ export * from "./Astt/get/getRfidQuery.hook";
|
|
|
134
134
|
export * from "./Astt/get/getProductsListingQuery.hook";
|
|
135
135
|
export * from "./Astt/get/getBarcodesPrintQuery.hook";
|
|
136
136
|
export * from "./Astt/get/getBarcodesListingQuery.hook";
|
|
137
|
+
export * from "./Astt/get/getBarcodesListingByPackageQuery.hook";
|
|
138
|
+
export * from "./Astt/mutate/postMatchingPackageQuery.hook";
|
|
137
139
|
export * from "./Astt/Asgt/get/getTransferDocumentsASTTQuery.hook";
|
|
138
140
|
export * from "./Astt/Asgt/get/getTransferDocumentsByIdASTTQuery.hook";
|
|
139
141
|
export * from "./Astt/Asgt/get/getTransferDocumentsByPackageASTTQuery.hook";
|
package/package.json
CHANGED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { getAuth0, TransferPackage } from '../../..';
|
|
2
|
+
import { useQuery, UseQueryOptions } from '@tanstack/react-query';
|
|
3
|
+
|
|
4
|
+
export const getBarcodesListingByPackageQueryHook = (transferId: string, packageId: string, { ...options }: UseQueryOptions<TransferPackage>) => {
|
|
5
|
+
return useQuery(
|
|
6
|
+
['ASTT_BARCODES_LISTING_BY_PACKAGE', transferId, packageId, options],
|
|
7
|
+
() => getAuth0<TransferPackage>(`/ASTT/TransferDocuments/BarcodesListing/ByPackage`, {
|
|
8
|
+
pTransferDocumentId: transferId,
|
|
9
|
+
pPackageId: packageId
|
|
10
|
+
}),
|
|
11
|
+
options
|
|
12
|
+
);
|
|
13
|
+
};
|
|
14
|
+
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { UseQueryOptions, useMutation, useQueryClient } from '@tanstack/react-query';
|
|
2
|
+
import { TransferPickProductsList, TransferPickProductsMatched } from '../../../interfaces/TransferPickProducts';
|
|
3
|
+
import { postAuth0 } from '../../../services/ApiService';
|
|
4
|
+
|
|
5
|
+
export interface MatchingPackageMutateProps extends UseQueryOptions<TransferPickProductsMatched> {
|
|
6
|
+
transferDocumentId: string;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export const postMatchingPackageQueryHook = ({ transferDocumentId }: MatchingPackageMutateProps) => {
|
|
10
|
+
const queryClient = useQueryClient();
|
|
11
|
+
return useMutation<TransferPickProductsMatched, unknown, TransferPickProductsList[]>((data: TransferPickProductsList[]) => {
|
|
12
|
+
return postAuth0(`/ASTT/TransferDocuments/MatchingPackage?`, {
|
|
13
|
+
pTransferDocumentId: transferDocumentId,
|
|
14
|
+
}, data);
|
|
15
|
+
}, {
|
|
16
|
+
onSuccess: (data: TransferPickProductsMatched) => {
|
|
17
|
+
queryClient.setQueryData(
|
|
18
|
+
['MATCHING_PACKAGE_QUERY'], data);
|
|
19
|
+
},
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
|
package/src/hooks/index.ts
CHANGED
|
@@ -157,6 +157,8 @@ export * from "./Astt/get/getRfidQuery.hook";
|
|
|
157
157
|
export * from "./Astt/get/getProductsListingQuery.hook";
|
|
158
158
|
export * from "./Astt/get/getBarcodesPrintQuery.hook";
|
|
159
159
|
export * from "./Astt/get/getBarcodesListingQuery.hook";
|
|
160
|
+
export * from "./Astt/get/getBarcodesListingByPackageQuery.hook";
|
|
161
|
+
export * from "./Astt/mutate/postMatchingPackageQuery.hook";
|
|
160
162
|
|
|
161
163
|
//Astt Asgt
|
|
162
164
|
export * from "./Astt/Asgt/get/getTransferDocumentsASTTQuery.hook";
|