@omniumretail/shared-resources 0.2.0 → 0.2.2
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/package.json +1 -1
- package/src/hooks/Asta/Actions/others/deleteActionQuery.hook.ts +2 -2
- package/src/hooks/Asta/AnswerType/others/deleteAnswerTypeQuery.hook.ts +2 -2
- package/src/hooks/Asta/Inspection/others/deleteInspectionQuery.hook.ts +2 -2
- package/src/hooks/Asta/Template/others/deleteTemplateQuery.hook.ts +2 -2
- package/src/hooks/Astt/get/getProductsListingQuery.hook.ts +2 -2
- package/src/hooks/Astt/get/getReportsBuilderQuery.hook.ts +2 -2
- package/src/hooks/Astt/get/getRfidQuery.hook.ts +2 -2
- package/src/hooks/Astt/get/getTransferAllProductsQuery.hook.ts +2 -2
- package/src/hooks/Astt/get/getTransferDocumentsByIdQuery.hook.ts +2 -2
- package/src/hooks/Astt/get/getTransferDocumentsByPackageQuery.hook.ts +2 -2
- package/src/hooks/Astt/get/getTransferDocumentsPackagesQuery.hook.ts +2 -2
- package/src/hooks/Astt/get/getTransferDocumentsQuery.hook.ts +2 -2
- package/src/hooks/Astt/get/getTransferReportDiff.hook.ts +2 -2
- package/src/hooks/Astt/get/getTransferStatesQuery.hook.ts +2 -2
- package/src/hooks/Astt/mutate/postTransferDocumentsMutateQuery.hook.ts +2 -2
- package/src/hooks/Astt/mutate/putTransferDocumentsStateMutateQuery.hook.ts +2 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { UseQueryOptions, useMutation, useQueryClient } from '@tanstack/react-query';
|
|
2
2
|
import { Actions } from '../../../../interfaces';
|
|
3
|
-
import {
|
|
3
|
+
import { putAuth0 } from '../../../../services/ApiService';
|
|
4
4
|
|
|
5
5
|
export interface DeleteActionProps extends UseQueryOptions<Actions> {
|
|
6
6
|
actionsIds: string[];
|
|
@@ -9,7 +9,7 @@ export interface DeleteActionProps extends UseQueryOptions<Actions> {
|
|
|
9
9
|
export const deleteActionMutateHook = ({ actionsIds }: DeleteActionProps) => {
|
|
10
10
|
const queryClient = useQueryClient();
|
|
11
11
|
return useMutation<Actions, unknown, string[]>(() => {
|
|
12
|
-
return
|
|
12
|
+
return putAuth0(`/ASTA/Actions/DeleteActionList`, undefined, actionsIds)
|
|
13
13
|
}, {
|
|
14
14
|
onSuccess: () => {
|
|
15
15
|
queryClient.invalidateQueries(
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { UseQueryOptions, useMutation, useQueryClient } from '@tanstack/react-query';
|
|
2
2
|
import { AnswerType } from '../../../../interfaces';
|
|
3
|
-
import {
|
|
3
|
+
import { putAuth0 } from '../../../../services/ApiService';
|
|
4
4
|
|
|
5
5
|
export interface DeleteAnswerTypeProps extends UseQueryOptions<AnswerType> {
|
|
6
6
|
answerTypeIds: string[];
|
|
@@ -9,7 +9,7 @@ export interface DeleteAnswerTypeProps extends UseQueryOptions<AnswerType> {
|
|
|
9
9
|
export const deleteAnswerTypeHook = ({ answerTypeIds }: DeleteAnswerTypeProps) => {
|
|
10
10
|
const queryClient = useQueryClient();
|
|
11
11
|
return useMutation<AnswerType, unknown, string[]>(() => {
|
|
12
|
-
return
|
|
12
|
+
return putAuth0(`/ASTA/AnswerType/Delete`, undefined, answerTypeIds)
|
|
13
13
|
}, {
|
|
14
14
|
onSuccess: () => {
|
|
15
15
|
queryClient.invalidateQueries(
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { UseQueryOptions, useMutation, useQueryClient } from '@tanstack/react-query';
|
|
2
2
|
import { Inspection } from '../../../../interfaces';
|
|
3
|
-
import {
|
|
3
|
+
import { putAuth0 } from '../../../../services/ApiService';
|
|
4
4
|
|
|
5
5
|
export interface DeleteInspectionProps extends UseQueryOptions<Inspection> {
|
|
6
6
|
inspectionIds: string[];
|
|
@@ -9,7 +9,7 @@ export interface DeleteInspectionProps extends UseQueryOptions<Inspection> {
|
|
|
9
9
|
export const deleteInspectionMutateHook = ({ inspectionIds }: DeleteInspectionProps) => {
|
|
10
10
|
const queryClient = useQueryClient();
|
|
11
11
|
return useMutation<Inspection, unknown, string[]>(() => {
|
|
12
|
-
return
|
|
12
|
+
return putAuth0(`/ASTA/Inspection/DeleteInspectionList`, undefined, inspectionIds)
|
|
13
13
|
}, {
|
|
14
14
|
onSuccess: () => {
|
|
15
15
|
queryClient.invalidateQueries(
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { UseQueryOptions, useMutation, useQueryClient } from '@tanstack/react-query';
|
|
2
2
|
import { Template } from '../../../../interfaces';
|
|
3
|
-
import {
|
|
3
|
+
import { putAuth0 } from '../../../../services/ApiService';
|
|
4
4
|
|
|
5
5
|
export interface DeleteTemplateProps extends UseQueryOptions<Template> {
|
|
6
6
|
templatesIds: string[];
|
|
@@ -9,7 +9,7 @@ export interface DeleteTemplateProps extends UseQueryOptions<Template> {
|
|
|
9
9
|
export const deleteTemplateMutateHook = ({ templatesIds }: DeleteTemplateProps) => {
|
|
10
10
|
const queryClient = useQueryClient();
|
|
11
11
|
return useMutation<Template, unknown, string[]>(() => {
|
|
12
|
-
return
|
|
12
|
+
return putAuth0(`/ASTA/Template/DeleteTemplateList`, undefined, templatesIds)
|
|
13
13
|
}, {
|
|
14
14
|
onSuccess: () => {
|
|
15
15
|
queryClient.invalidateQueries(
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { getAuth0, ReportBuilder } from '../../..';
|
|
2
2
|
import { useQuery, UseQueryOptions } from '@tanstack/react-query';
|
|
3
3
|
|
|
4
4
|
export const getProductsListingQueryHook = (transferId: string, transferPackageId: string, { ...options }: UseQueryOptions<ReportBuilder>) => {
|
|
5
5
|
return useQuery(
|
|
6
6
|
['ASTT_PRODUCTS_LISTING', transferId, transferPackageId],
|
|
7
|
-
() =>
|
|
7
|
+
() => getAuth0<ReportBuilder>(`/ASTT/ReportsBuilder/${transferId}/${transferPackageId}/ProductsListing`),
|
|
8
8
|
options
|
|
9
9
|
);
|
|
10
10
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { getAuth0, ReportBuilder } from '../../..';
|
|
2
2
|
import { useQuery, UseQueryOptions } from '@tanstack/react-query';
|
|
3
3
|
|
|
4
4
|
export const getReportsBuilderQueryHook = (transferId: string, {...options} : UseQueryOptions<ReportBuilder>) => {
|
|
5
5
|
return useQuery(
|
|
6
6
|
['ASTT_REPORTS_BUILDER', transferId],
|
|
7
|
-
() =>
|
|
7
|
+
() => getAuth0<ReportBuilder>(`/ASTT/ReportsBuilder/${transferId}/DifferencesReport`),
|
|
8
8
|
options
|
|
9
9
|
);
|
|
10
10
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useQuery, UseQueryOptions } from "@tanstack/react-query";
|
|
2
2
|
import { Rfid, ResponseList } from "../../../interfaces";
|
|
3
|
-
import {
|
|
3
|
+
import { getAuth0 } from "../../../services/ApiService";
|
|
4
4
|
|
|
5
5
|
export interface RfidQueryHookProps extends UseQueryOptions<ResponseList<"Barcodes", Rfid>> {
|
|
6
6
|
delay: number;
|
|
@@ -9,7 +9,7 @@ export interface RfidQueryHookProps extends UseQueryOptions<ResponseList<"Barcod
|
|
|
9
9
|
export const getRfidQueryHook = ({ delay, ...options }: RfidQueryHookProps) => {
|
|
10
10
|
return useQuery(
|
|
11
11
|
['ASTT_RFID', delay, options],
|
|
12
|
-
() =>
|
|
12
|
+
() => getAuth0<ResponseList<"Barcodes", Rfid>>('/ASTT/RFID', {
|
|
13
13
|
pDelay: delay|| 3,
|
|
14
14
|
}),
|
|
15
15
|
options
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useQuery, UseQueryOptions } from "@tanstack/react-query";
|
|
2
2
|
import { TransferAllProducts, ResponseList } from "../../../interfaces";
|
|
3
|
-
import {
|
|
3
|
+
import { getAuth0 } from "../../../services/ApiService";
|
|
4
4
|
|
|
5
5
|
export interface TransferAllProductsProps extends UseQueryOptions<ResponseList<"Products", TransferAllProducts>> {
|
|
6
6
|
page: number;
|
|
@@ -13,7 +13,7 @@ export interface TransferAllProductsProps extends UseQueryOptions<ResponseList<"
|
|
|
13
13
|
export const getTransferAllProductsQueryHook = ({ page, records, sortBy, sortDirection, query }: TransferAllProductsProps) => {
|
|
14
14
|
return useQuery(
|
|
15
15
|
['ASTT_TRANSFER_ALL_PRODUCTS', page, records, sortBy, sortDirection, query],
|
|
16
|
-
() =>
|
|
16
|
+
() => getAuth0<ResponseList<"Products", TransferAllProducts>>('/Product/Products', {
|
|
17
17
|
pPage: page|| 1,
|
|
18
18
|
pRecords: records || 50,
|
|
19
19
|
pSortBy: sortBy || "Name",
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { getAuth0, TransferDocuments } from '../../..';
|
|
2
2
|
import { useQuery, UseQueryOptions } from '@tanstack/react-query';
|
|
3
3
|
|
|
4
4
|
export const getTransferDocumentsByIdQueryHook = (transferId: string, {...options} : UseQueryOptions<TransferDocuments>) => {
|
|
5
5
|
return useQuery(
|
|
6
6
|
['ASTT_TRANSFER_DOCUMENTS_BY_ID', transferId],
|
|
7
|
-
() =>
|
|
7
|
+
() => getAuth0<TransferDocuments>(`/ASTT/TransferDocuments/${transferId}`),
|
|
8
8
|
options
|
|
9
9
|
);
|
|
10
10
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { getAuth0, TransferPackage } from '../../..';
|
|
2
2
|
import { useQuery, UseQueryOptions } from '@tanstack/react-query';
|
|
3
3
|
|
|
4
4
|
export const getTransferDocumentsByPackageQueryHook = (transferId: string, transferPackageId: string, {...options} : UseQueryOptions<TransferPackage>) => {
|
|
5
5
|
return useQuery(
|
|
6
6
|
['ASTT_TRANSFER_DOCUMENTS_BY_PACKAGE', transferId, transferPackageId],
|
|
7
|
-
() =>
|
|
7
|
+
() => getAuth0<TransferPackage>(`/ASTT/TransferDocuments/${transferId}/${transferPackageId}/Products`),
|
|
8
8
|
options
|
|
9
9
|
);
|
|
10
10
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useQuery, UseQueryOptions } from "@tanstack/react-query";
|
|
2
2
|
import { TransferDocumentsDetails, ResponseList } from "../../../interfaces";
|
|
3
|
-
import {
|
|
3
|
+
import { getAuth0 } from "../../../services/ApiService";
|
|
4
4
|
|
|
5
5
|
export interface TransferDocumentsPackagesProps extends UseQueryOptions<ResponseList<"TransferDocumentDetails", TransferDocumentsDetails>> {
|
|
6
6
|
sortBy?: string;
|
|
@@ -12,7 +12,7 @@ export interface TransferDocumentsPackagesProps extends UseQueryOptions<Response
|
|
|
12
12
|
export const getTransferDocumentsPackagesQueryHook = ({ sortBy, sortDirection, terms, transferDocumentId }: TransferDocumentsPackagesProps) => {
|
|
13
13
|
return useQuery(
|
|
14
14
|
['ASTT_TRANSFER_PACKAGES', sortBy, sortDirection, terms, transferDocumentId],
|
|
15
|
-
() =>
|
|
15
|
+
() => getAuth0<ResponseList<"TransferDocumentDetails", TransferDocumentsDetails>>(`/ASTT/TransferDocuments/${transferDocumentId}/Packages`, {
|
|
16
16
|
pSortBy: sortBy || "PackageId",
|
|
17
17
|
pSortDirection: sortDirection || "asc",
|
|
18
18
|
pTerms: terms
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useQuery, UseQueryOptions } from "@tanstack/react-query";
|
|
2
2
|
import { TransferDocuments, ResponseList } from "../../../interfaces";
|
|
3
|
-
import {
|
|
3
|
+
import { getAuth0 } from "../../../services/ApiService";
|
|
4
4
|
|
|
5
5
|
export interface TransferDocumentsProps extends UseQueryOptions<ResponseList<"TransferDocuments", TransferDocuments>> {
|
|
6
6
|
page: number;
|
|
@@ -14,7 +14,7 @@ export interface TransferDocumentsProps extends UseQueryOptions<ResponseList<"Tr
|
|
|
14
14
|
export const getTransferDocumentsQueryHook = ({ page, records, sortBy, sortDirection, terms, query }: TransferDocumentsProps) => {
|
|
15
15
|
return useQuery(
|
|
16
16
|
['ASTT_TRANSFER_DOCUMENTS', page, records, sortBy, sortDirection, terms, query],
|
|
17
|
-
() =>
|
|
17
|
+
() => getAuth0<ResponseList<"TransferDocuments", TransferDocuments>>('/ASTT/TransferDocuments', {
|
|
18
18
|
pPage: page|| 1,
|
|
19
19
|
pRecords: records || 50,
|
|
20
20
|
pSortBy: sortBy || "DocumentCreationDate",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useQuery, UseQueryOptions } from "@tanstack/react-query";
|
|
2
2
|
import { TransferReportDiff, ResponseList } from "../../../interfaces";
|
|
3
|
-
import {
|
|
3
|
+
import { getAuth0 } from "../../../services/ApiService";
|
|
4
4
|
|
|
5
5
|
export interface TransferReportDiffProps extends UseQueryOptions<ResponseList<"ProductsToBePicked", TransferReportDiff>> {
|
|
6
6
|
transferDocumentId?: string;
|
|
@@ -9,7 +9,7 @@ export interface TransferReportDiffProps extends UseQueryOptions<ResponseList<"P
|
|
|
9
9
|
export const getTransferReportDiffQueryHook = ({ transferDocumentId }: TransferReportDiffProps) => {
|
|
10
10
|
return useQuery(
|
|
11
11
|
['ASTT_TRANSFER_REPORT_DIFF', transferDocumentId],
|
|
12
|
-
() =>
|
|
12
|
+
() => getAuth0<{ ProductsToBePicked: TransferReportDiff[]; FalsePositiveProducts?: TransferReportDiff[] }>(`/ASTT/TransferDocuments/${transferDocumentId}/DifferencesReport`,
|
|
13
13
|
{}),
|
|
14
14
|
{
|
|
15
15
|
keepPreviousData: true,
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { useQuery } from "@tanstack/react-query";
|
|
2
2
|
import { TransferStates } from "../../../interfaces";
|
|
3
|
-
import {
|
|
3
|
+
import { getAuth0 } from "../../../services/ApiService";
|
|
4
4
|
|
|
5
5
|
export const getTransfeStatesQueryHook = () => {
|
|
6
6
|
return useQuery(
|
|
7
7
|
['ASTT_STATUS'],
|
|
8
|
-
() =>
|
|
8
|
+
() => getAuth0<TransferStates[]>('/ASTT/TransferStates'),
|
|
9
9
|
{
|
|
10
10
|
keepPreviousData: true,
|
|
11
11
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { UseQueryOptions, useMutation, useQueryClient } from '@tanstack/react-query';
|
|
2
2
|
import { TransferPickProducts } from '../../../interfaces/TransferPickProducts';
|
|
3
|
-
import {
|
|
3
|
+
import { postAuth0 } from '../../../services/ApiService';
|
|
4
4
|
|
|
5
5
|
export interface TransferDocumentsMutateProps extends UseQueryOptions<TransferPickProducts> {
|
|
6
6
|
transferDocumentId: string;
|
|
@@ -10,7 +10,7 @@ export interface TransferDocumentsMutateProps extends UseQueryOptions<TransferPi
|
|
|
10
10
|
export const postTransferDocumentsMutateQueryHook = ({ transferDocumentId, packageId }: TransferDocumentsMutateProps) => {
|
|
11
11
|
const queryClient = useQueryClient();
|
|
12
12
|
return useMutation<TransferPickProducts, unknown, TransferPickProducts>((data: TransferPickProducts) => {
|
|
13
|
-
return
|
|
13
|
+
return postAuth0(`/ASTT/TransferDocuments/${transferDocumentId}/${packageId}/Products/Picking`, undefined, data);
|
|
14
14
|
}, {
|
|
15
15
|
onSuccess: (data: TransferPickProducts) => {
|
|
16
16
|
queryClient.setQueryData(
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { UseQueryOptions, useMutation, useQueryClient } from '@tanstack/react-query';
|
|
2
2
|
import { TransferDocumentState } from '../../../interfaces/TransferDocumentState';
|
|
3
|
-
import {
|
|
3
|
+
import { putAuth0 } from '../../../services/ApiService';
|
|
4
4
|
|
|
5
5
|
export interface TransferDocumentsStateMutateProps extends UseQueryOptions<TransferDocumentState> {
|
|
6
6
|
transferDocumentId: string;
|
|
@@ -9,7 +9,7 @@ export interface TransferDocumentsStateMutateProps extends UseQueryOptions<Trans
|
|
|
9
9
|
export const putTransferDocumentsStateMutateQueryHook = ({ transferDocumentId }: TransferDocumentsStateMutateProps) => {
|
|
10
10
|
const queryClient = useQueryClient();
|
|
11
11
|
return useMutation<TransferDocumentState, unknown, TransferDocumentState>((data: TransferDocumentState) => {
|
|
12
|
-
return
|
|
12
|
+
return putAuth0(`/ASTT/TransferDocuments/${transferDocumentId}`, undefined, data);
|
|
13
13
|
}, {
|
|
14
14
|
onSuccess: (data: TransferDocumentState) => {
|
|
15
15
|
queryClient.setQueryData(
|