@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.
@@ -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";
@@ -23,3 +23,7 @@ export interface TransferPickProductsRemoved {
23
23
  Quantity: number;
24
24
  PickedMethod: string;
25
25
  }
26
+ export interface TransferPickProductsMatched {
27
+ MatchFound: boolean;
28
+ PackageId: string | null;
29
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@omniumretail/shared-resources",
3
- "version": "0.3.47",
3
+ "version": "0.3.49",
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,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
+
@@ -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";
@@ -26,4 +26,9 @@ export interface TransferPickProductsRemoved {
26
26
  Barcode: string;
27
27
  Quantity: number;
28
28
  PickedMethod: string;
29
+ }
30
+
31
+ export interface TransferPickProductsMatched {
32
+ MatchFound: boolean;
33
+ PackageId: string | null;
29
34
  }