@omniumretail/shared-resources 0.3.61 → 0.3.63
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/getManualPackagesListQuery.hook.d.ts +5 -1
- package/dist/types/hooks/Astt/get/getReconciliationDocumentsQuery.hook.d.ts +6 -2
- package/dist/types/hooks/Astt/mutate/updateDocumentIdQuery.hook.d.ts +7 -0
- package/dist/types/interfaces/AsttReconciliationDocuments.d.ts +3 -0
- package/package.json +1 -1
- package/src/hooks/Astt/get/getManualPackagesListQuery.hook.ts +11 -3
- package/src/hooks/Astt/get/getReconciliationDocumentsQuery.hook.ts +11 -6
- package/src/hooks/Astt/mutate/updateDocumentIdQuery.hook.ts +23 -0
- package/src/interfaces/AsttReconciliationDocuments.ts +4 -0
|
@@ -1,3 +1,7 @@
|
|
|
1
1
|
import { UseQueryOptions } from '@tanstack/react-query';
|
|
2
2
|
import { AsttManualVsYetToBePickedResponse } from '../../../interfaces/AsttReconciliationDocuments';
|
|
3
|
-
export
|
|
3
|
+
export interface ManualPackagesListQueryHookProps extends UseQueryOptions<AsttManualVsYetToBePickedResponse> {
|
|
4
|
+
terms: string;
|
|
5
|
+
query: string;
|
|
6
|
+
}
|
|
7
|
+
export declare const getManualPackagesListQueryHook: ({ terms, query, ...options }: ManualPackagesListQueryHookProps) => import("@tanstack/react-query").UseQueryResult<AsttManualVsYetToBePickedResponse, unknown>;
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AsttReconciliationDocumentsResponse } from '../../..';
|
|
2
2
|
import { UseQueryOptions } from '@tanstack/react-query';
|
|
3
|
-
export
|
|
3
|
+
export interface ReconciliationDocumentsHookProps extends UseQueryOptions<AsttReconciliationDocumentsResponse> {
|
|
4
|
+
page: number;
|
|
5
|
+
records: number;
|
|
6
|
+
}
|
|
7
|
+
export declare const getReconciliationDocumentsQueryHook: ({ page, records, ...options }: ReconciliationDocumentsHookProps) => import("@tanstack/react-query").UseQueryResult<AsttReconciliationDocumentsResponse, unknown>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { UseQueryOptions } from '@tanstack/react-query';
|
|
2
|
+
import { TransferDocuments } from '../../../interfaces/TransferDocuments';
|
|
3
|
+
export interface UpdateDocumentIdProps extends UseQueryOptions<TransferDocuments> {
|
|
4
|
+
oldDocumentNumber: string;
|
|
5
|
+
newDocumentNumber: string;
|
|
6
|
+
}
|
|
7
|
+
export declare const updateDocumentIdQueryHook: ({ oldDocumentNumber, newDocumentNumber }: UpdateDocumentIdProps) => import("@tanstack/react-query").UseMutationResult<TransferDocuments, unknown, void, unknown>;
|
|
@@ -11,6 +11,9 @@ export interface AsttReconciliationDocuments {
|
|
|
11
11
|
DestinationLocationCode: string;
|
|
12
12
|
}[];
|
|
13
13
|
}
|
|
14
|
+
export interface AsttReconciliationDocumentsResponse {
|
|
15
|
+
ReconciliationTransferDocuments: AsttReconciliationDocuments[];
|
|
16
|
+
}
|
|
14
17
|
export interface AsttManualVsYetToBePicked {
|
|
15
18
|
TransferDocumentId: string | null;
|
|
16
19
|
DocumentNumber: string;
|
package/package.json
CHANGED
|
@@ -2,10 +2,18 @@ import { getAuth0 } from '../../..';
|
|
|
2
2
|
import { useQuery, UseQueryOptions } from '@tanstack/react-query';
|
|
3
3
|
import { AsttManualVsYetToBePickedResponse } from '../../../interfaces/AsttReconciliationDocuments';
|
|
4
4
|
|
|
5
|
-
export
|
|
5
|
+
export interface ManualPackagesListQueryHookProps extends UseQueryOptions<AsttManualVsYetToBePickedResponse> {
|
|
6
|
+
terms: string;
|
|
7
|
+
query: string;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export const getManualPackagesListQueryHook = ({ terms, query, ...options }: ManualPackagesListQueryHookProps) => {
|
|
6
11
|
return useQuery(
|
|
7
|
-
['ASTT_MANUAL_PACKAGES_LIST', options],
|
|
8
|
-
() => getAuth0<AsttManualVsYetToBePickedResponse>(`/ASTT/TransferDocuments/ManualVsYetToBePicked`,
|
|
12
|
+
['ASTT_MANUAL_PACKAGES_LIST', options, terms, query],
|
|
13
|
+
() => getAuth0<AsttManualVsYetToBePickedResponse>(`/ASTT/TransferDocuments/ManualVsYetToBePicked`, {
|
|
14
|
+
pTerms: terms,
|
|
15
|
+
pQuery: query
|
|
16
|
+
}),
|
|
9
17
|
options
|
|
10
18
|
);
|
|
11
19
|
};
|
|
@@ -1,13 +1,18 @@
|
|
|
1
|
-
import { getAuth0,
|
|
1
|
+
import { getAuth0, AsttReconciliationDocumentsResponse } from '../../..';
|
|
2
2
|
import { useQuery, UseQueryOptions } from '@tanstack/react-query';
|
|
3
3
|
|
|
4
|
-
export
|
|
4
|
+
export interface ReconciliationDocumentsHookProps extends UseQueryOptions<AsttReconciliationDocumentsResponse> {
|
|
5
|
+
page: number;
|
|
6
|
+
records: number;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export const getReconciliationDocumentsQueryHook = ({ page, records, ...options }: ReconciliationDocumentsHookProps) => {
|
|
5
10
|
return useQuery(
|
|
6
|
-
['ASTT_RECONCILIATION_DOCUMENTS',
|
|
7
|
-
() => getAuth0<
|
|
8
|
-
|
|
11
|
+
['ASTT_RECONCILIATION_DOCUMENTS', page, records, options],
|
|
12
|
+
() => getAuth0<AsttReconciliationDocumentsResponse>(`/ASTT/TransferDocuments/ReconciliationDocuments`, {
|
|
13
|
+
pPage: page || 1,
|
|
14
|
+
pRecords: records || 50,
|
|
9
15
|
}),
|
|
10
16
|
options
|
|
11
17
|
);
|
|
12
18
|
};
|
|
13
|
-
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { UseQueryOptions, useMutation, useQueryClient } from '@tanstack/react-query';
|
|
2
|
+
import { putAuth0 } from '../../../services/ApiService';
|
|
3
|
+
import { TransferDocuments } from '../../../interfaces/TransferDocuments';
|
|
4
|
+
|
|
5
|
+
export interface UpdateDocumentIdProps extends UseQueryOptions<TransferDocuments> {
|
|
6
|
+
oldDocumentNumber: string;
|
|
7
|
+
newDocumentNumber: string;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export const updateDocumentIdQueryHook = ({ oldDocumentNumber, newDocumentNumber }: UpdateDocumentIdProps) => {
|
|
11
|
+
const queryClient = useQueryClient();
|
|
12
|
+
return useMutation<TransferDocuments, unknown, void>(() => {
|
|
13
|
+
return putAuth0(`/ASTT/TransferDocuments/Manual?`, {
|
|
14
|
+
pOldDocumentNumber: oldDocumentNumber,
|
|
15
|
+
pNewDocumentNumber: newDocumentNumber
|
|
16
|
+
});
|
|
17
|
+
}, {
|
|
18
|
+
onSuccess: (data: TransferDocuments) => {
|
|
19
|
+
queryClient.setQueryData(
|
|
20
|
+
['UPDATE_DOCUMENT_ID_QUERY'], data);
|
|
21
|
+
},
|
|
22
|
+
});
|
|
23
|
+
}
|
|
@@ -13,6 +13,10 @@ export interface AsttReconciliationDocuments {
|
|
|
13
13
|
}[];
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
+
export interface AsttReconciliationDocumentsResponse {
|
|
17
|
+
ReconciliationTransferDocuments: AsttReconciliationDocuments[];
|
|
18
|
+
}
|
|
19
|
+
|
|
16
20
|
export interface AsttManualVsYetToBePicked {
|
|
17
21
|
TransferDocumentId: string | null;
|
|
18
22
|
DocumentNumber: string;
|