@omniumretail/shared-resources 0.2.50 → 0.2.52
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/ATIM/BackOffice/get/useAttendancesSummarySearch.hook.d.ts +8 -5
- package/dist/types/hooks/ATIM/BackOffice/get/useEmployeeWorklogDetails.hook.d.ts +1 -3
- package/dist/types/hooks/ATIM/BackOffice/mutate/useAttendancesById.hook.d.ts +2 -0
- package/dist/types/hooks/Asgt/get/getProductsListingQuery.hook.d.ts +3 -0
- package/dist/types/hooks/Asgt/get/getReportsBuilderQuery.hook.d.ts +3 -0
- package/dist/types/hooks/Asgt/get/getTransferAllProductsQuery.hook.d.ts +10 -0
- package/dist/types/hooks/Asgt/get/getTransferDocumentsByIdQuery.hook.d.ts +3 -0
- package/dist/types/hooks/Asgt/get/getTransferDocumentsByPackageQuery.hook.d.ts +3 -0
- package/dist/types/hooks/Asgt/get/getTransferDocumentsPackagesQuery.hook.d.ts +9 -0
- package/dist/types/hooks/Asgt/get/getTransferDocumentsQuery.hook.d.ts +11 -0
- package/dist/types/hooks/Asgt/get/getTransferReportDiff.hook.d.ts +12 -0
- package/dist/types/hooks/Asgt/mutate/postTransferDocumentsMutateQuery.hook.d.ts +7 -0
- package/dist/types/hooks/Asgt/mutate/putTransferDocumentsStateMutateQuery.hook.d.ts +6 -0
- package/dist/types/hooks/OSUA/MIMO/get/useErrorHistory.hook.d.ts +7 -0
- package/dist/types/hooks/OSUA/MIMO/get/useIntegrationDataQuery.hook.d.ts +2 -0
- package/dist/types/hooks/OSUA/MIMO/mutate/updateErrorHistory.hook.d.ts +2 -0
- package/dist/types/hooks/index.d.ts +5 -3
- package/package.json +1 -1
- package/src/hooks/ATIM/BackOffice/get/useAttendancesSummarySearch.hook.ts +22 -13
- package/src/hooks/ATIM/BackOffice/get/useEmployeeWorklogDetails.hook.ts +9 -20
- package/src/hooks/ATIM/BackOffice/mutate/useAttendancesById.hook.ts +21 -0
- package/src/hooks/Asgt/get/getProductsListingQuery.hook.ts +14 -0
- package/src/hooks/Asgt/get/getReportsBuilderQuery.hook.ts +12 -0
- package/src/hooks/Asgt/get/getTransferAllProductsQuery.hook.ts +25 -0
- package/src/hooks/Asgt/get/getTransferDocumentsByIdQuery.hook.ts +12 -0
- package/src/hooks/Asgt/get/getTransferDocumentsByPackageQuery.hook.ts +13 -0
- package/src/hooks/Asgt/get/getTransferDocumentsPackagesQuery.hook.ts +23 -0
- package/src/hooks/Asgt/get/getTransferDocumentsQuery.hook.ts +27 -0
- package/src/hooks/Asgt/get/getTransferReportDiff.hook.ts +17 -0
- package/src/hooks/Asgt/mutate/postTransferDocumentsMutateQuery.hook.ts +23 -0
- package/src/hooks/Asgt/mutate/putTransferDocumentsStateMutateQuery.hook.ts +21 -0
- package/src/hooks/BigWin/others/importRegulationQuery.hook.ts +1 -4
- package/src/hooks/OSUA/MIMO/mutate/updateErrorHistory.hook.ts +25 -0
- package/src/hooks/index.ts +8 -3
- /package/src/hooks/OSUA/{get/mimo → MIMO/get}/useErrorHistory.hook.ts +0 -0
- /package/src/hooks/OSUA/{get/mimo → MIMO/get}/useIntegrationDataQuery.hook.ts +0 -0
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import { UseQueryOptions } from "@tanstack/react-query";
|
|
2
|
-
import { AttendancesSummary
|
|
2
|
+
import { AttendancesSummary } from "../../../../interfaces";
|
|
3
|
+
import { ResponseList } from "../../../../interfaces";
|
|
3
4
|
interface EmployeeQueryOptions extends UseQueryOptions<ResponseList<'AttendanceSummarys', AttendancesSummary>> {
|
|
4
|
-
|
|
5
|
-
beginWorkPeriod?: number;
|
|
6
|
-
endWorkPeriod?: number;
|
|
5
|
+
userId?: string;
|
|
7
6
|
page: number;
|
|
8
7
|
record: number;
|
|
8
|
+
sortBy?: string;
|
|
9
|
+
sortDirection?: string;
|
|
10
|
+
terms?: string;
|
|
11
|
+
query?: string;
|
|
9
12
|
}
|
|
10
|
-
export declare const useAttendancesSummarySearch: ({
|
|
13
|
+
export declare const useAttendancesSummarySearch: ({ userId, page, record, sortBy, sortDirection, terms, query, ...options }: EmployeeQueryOptions) => import("@tanstack/react-query").UseQueryResult<ResponseList<"AttendanceSummarys", AttendancesSummary>, unknown>;
|
|
11
14
|
export {};
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { UseQueryOptions } from "@tanstack/react-query";
|
|
2
2
|
import { ResponseList, EmployeesWorklog } from "../../../../interfaces";
|
|
3
3
|
interface EmployeesWithTimekeepingProps extends UseQueryOptions<ResponseList<"EmployeesWorkLog", EmployeesWorklog>> {
|
|
4
|
-
startDate?: number;
|
|
5
|
-
endDate?: number;
|
|
6
4
|
search?: string;
|
|
7
5
|
page?: number;
|
|
8
6
|
records?: number;
|
|
@@ -11,5 +9,5 @@ interface EmployeesWithTimekeepingProps extends UseQueryOptions<ResponseList<"Em
|
|
|
11
9
|
terms?: string;
|
|
12
10
|
query?: string;
|
|
13
11
|
}
|
|
14
|
-
export declare const useEmployeeWorklogDetails: ({
|
|
12
|
+
export declare const useEmployeeWorklogDetails: ({ search, page, records, sortBy, sortDirection, terms, query, }: EmployeesWithTimekeepingProps) => import("@tanstack/react-query").UseQueryResult<ResponseList<"EmployeesWorklog", EmployeesWorklog>, unknown>;
|
|
15
13
|
export {};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { ReportBuilder } from '../../..';
|
|
2
|
+
import { UseQueryOptions } from '@tanstack/react-query';
|
|
3
|
+
export declare const getProductsListingQueryHook: (transferId: string, transferPackageId: string, { ...options }: UseQueryOptions<ReportBuilder>) => import("@tanstack/react-query").UseQueryResult<ReportBuilder, unknown>;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { ReportBuilder } from '../../..';
|
|
2
|
+
import { UseQueryOptions } from '@tanstack/react-query';
|
|
3
|
+
export declare const getReportsBuilderQueryHook: (transferId: string, { ...options }: UseQueryOptions<ReportBuilder>) => import("@tanstack/react-query").UseQueryResult<ReportBuilder, unknown>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { UseQueryOptions } from "@tanstack/react-query";
|
|
2
|
+
import { TransferAllProducts, ResponseList } from "../../../interfaces";
|
|
3
|
+
export interface TransferAllProductsProps 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 getTransferAllProductsQueryHook: ({ page, records, sortBy, sortDirection, query, ...options }: TransferAllProductsProps) => import("@tanstack/react-query").UseQueryResult<ResponseList<"Products", TransferAllProducts>, unknown>;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { TransferDocuments } from '../../..';
|
|
2
|
+
import { UseQueryOptions } from '@tanstack/react-query';
|
|
3
|
+
export declare const getTransferDocumentsByIdQueryHook: (transferId: string, { ...options }: UseQueryOptions<TransferDocuments>) => import("@tanstack/react-query").UseQueryResult<TransferDocuments, unknown>;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { TransferPackage } from '../../..';
|
|
2
|
+
import { UseQueryOptions } from '@tanstack/react-query';
|
|
3
|
+
export declare const getTransferDocumentsByPackageQueryHook: (transferId: string, transferPackageId: string, { ...options }: UseQueryOptions<TransferPackage>) => import("@tanstack/react-query").UseQueryResult<TransferPackage, unknown>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { UseQueryOptions } from "@tanstack/react-query";
|
|
2
|
+
import { TransferDocumentsDetails, ResponseList } from "../../../interfaces";
|
|
3
|
+
export interface TransferDocumentsPackagesProps extends UseQueryOptions<ResponseList<"TransferDocumentDetails", TransferDocumentsDetails>> {
|
|
4
|
+
sortBy?: string;
|
|
5
|
+
sortDirection?: string;
|
|
6
|
+
terms?: string;
|
|
7
|
+
transferDocumentId?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare const getTransferDocumentsPackagesQueryHook: ({ sortBy, sortDirection, terms, transferDocumentId, ...options }: TransferDocumentsPackagesProps) => import("@tanstack/react-query").UseQueryResult<ResponseList<"TransferDocumentDetails", TransferDocumentsDetails>, unknown>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { UseQueryOptions } from "@tanstack/react-query";
|
|
2
|
+
import { TransferDocuments, ResponseList } from "../../../interfaces";
|
|
3
|
+
export interface TransferDocumentsProps extends UseQueryOptions<ResponseList<"TransferDocuments", TransferDocuments>> {
|
|
4
|
+
page: number;
|
|
5
|
+
records: number;
|
|
6
|
+
sortBy: string;
|
|
7
|
+
sortDirection: string;
|
|
8
|
+
terms?: string;
|
|
9
|
+
query?: string;
|
|
10
|
+
}
|
|
11
|
+
export declare const getTransferDocumentsQueryHook: ({ page, records, sortBy, sortDirection, terms, query, ...options }: TransferDocumentsProps) => import("@tanstack/react-query").UseQueryResult<ResponseList<"TransferDocuments", TransferDocuments>, unknown>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { UseQueryOptions } from "@tanstack/react-query";
|
|
2
|
+
import { TransferReportDiff } from "../../../interfaces";
|
|
3
|
+
export interface TransferReportDiffProps extends UseQueryOptions<{
|
|
4
|
+
ProductsToBePicked: TransferReportDiff[];
|
|
5
|
+
FalsePositiveProducts?: TransferReportDiff[];
|
|
6
|
+
}> {
|
|
7
|
+
transferDocumentId?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare const getTransferReportDiffQueryHook: ({ transferDocumentId, ...options }: TransferReportDiffProps) => import("@tanstack/react-query").UseQueryResult<{
|
|
10
|
+
ProductsToBePicked: TransferReportDiff[];
|
|
11
|
+
FalsePositiveProducts?: TransferReportDiff[];
|
|
12
|
+
}, unknown>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { UseQueryOptions } from '@tanstack/react-query';
|
|
2
|
+
import { TransferPickProducts } from '../../../interfaces/TransferPickProducts';
|
|
3
|
+
export interface TransferDocumentsMutateProps extends UseQueryOptions<TransferPickProducts> {
|
|
4
|
+
transferDocumentId: string;
|
|
5
|
+
packageId: string;
|
|
6
|
+
}
|
|
7
|
+
export declare const postTransferDocumentsMutateQueryHook: ({ transferDocumentId, packageId }: TransferDocumentsMutateProps) => import("@tanstack/react-query").UseMutationResult<TransferPickProducts, unknown, TransferPickProducts, unknown>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { UseQueryOptions } from '@tanstack/react-query';
|
|
2
|
+
import { TransferDocumentState } from '../../../interfaces/TransferDocumentState';
|
|
3
|
+
export interface TransferDocumentsStateMutateProps extends UseQueryOptions<TransferDocumentState> {
|
|
4
|
+
transferDocumentId: string;
|
|
5
|
+
}
|
|
6
|
+
export declare const putTransferDocumentsStateMutateQueryHook: ({ transferDocumentId }: TransferDocumentsStateMutateProps) => import("@tanstack/react-query").UseMutationResult<TransferDocumentState, unknown, TransferDocumentState, unknown>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { UseQueryOptions } from "@tanstack/react-query";
|
|
2
|
+
import { ErrorHistoryItem } from "../../../../interfaces";
|
|
3
|
+
interface GetErrorHistoryProps extends UseQueryOptions<ErrorHistoryItem[]> {
|
|
4
|
+
query?: string;
|
|
5
|
+
}
|
|
6
|
+
export declare const useErrorHistory: (options?: GetErrorHistoryProps) => import("@tanstack/react-query").UseQueryResult<ErrorHistoryItem[], unknown>;
|
|
7
|
+
export {};
|
|
@@ -243,15 +243,16 @@ export * from "./OSUA/get/vouchers/getSitooVouchers.hook";
|
|
|
243
243
|
export * from "./OSUA/get/vouchers/getVoucherIntegrationRequestStatus.hook";
|
|
244
244
|
export * from "./OSUA/get/orders/getOrderDocuments.hook";
|
|
245
245
|
export * from "./OSUA/get/faqs/getFaqsQuery.hook";
|
|
246
|
-
export * from "./OSUA/get/mimo/useIntegrationDataQuery.hook";
|
|
247
|
-
export * from "./OSUA/get/mimo/useErrorHistory.hook";
|
|
248
246
|
export * from "./OSUA/mutate/postCreateIntegrationRequest.hook";
|
|
249
247
|
export * from "./OSUA/mutate/useSetIntegrationToFinished.hook";
|
|
248
|
+
export * from "./OSUA/mutate/postCreateIntegrationRequest.hook";
|
|
250
249
|
export * from "./OSUA/MIMO/get/getIntegrationByName.hook";
|
|
251
250
|
export * from "./OSUA/MIMO/get/getProductIntegrationHistory.hook";
|
|
251
|
+
export * from "./OSUA/MIMO/get/useIntegrationDataQuery.hook";
|
|
252
|
+
export * from "./OSUA/MIMO/get/useErrorHistory.hook";
|
|
252
253
|
export * from "./OSUA/MIMO/mutate/postProductVendusIntegration.hook";
|
|
253
254
|
export * from "./OSUA/MIMO/mutate/postDagsAdjustStock.hook";
|
|
254
|
-
export * from "./OSUA/mutate/
|
|
255
|
+
export * from "./OSUA/MIMO/mutate/updateErrorHistory.hook";
|
|
255
256
|
export * from "./OSUA/MIMO/get/getIntegrationByName.hook";
|
|
256
257
|
export * from "./OSUA/MIMO/mutate/postProductVendusIntegration.hook";
|
|
257
258
|
export * from "./OSUA/MIMO/mutate/postDagsAdjustStock.hook";
|
|
@@ -279,6 +280,7 @@ export * from "./ATIM/BackOffice/get/useAttendancesSummary.hook";
|
|
|
279
280
|
export * from "./ATIM/BackOffice/get/useAttendancesSummarySearch.hook";
|
|
280
281
|
export * from "./ATIM/BackOffice/get/useWorkMonths.hook";
|
|
281
282
|
export * from "./ATIM/BackOffice/mutate/useUpdateAttendancesSummary.hook";
|
|
283
|
+
export * from "./ATIM/BackOffice/mutate/useAttendancesById.hook";
|
|
282
284
|
export * from "./Others/useJobTitlesQuery.hook";
|
|
283
285
|
export * from "./Others/useContractStatesQuery.hook";
|
|
284
286
|
export * from "./Others/useApplicationDataQuery.hook";
|
package/package.json
CHANGED
|
@@ -1,40 +1,49 @@
|
|
|
1
1
|
import { useQuery, UseQueryOptions } from "@tanstack/react-query";
|
|
2
2
|
import { getAuth0 } from "../../../../services/ApiService";
|
|
3
|
-
import { AttendancesSummary
|
|
3
|
+
import { AttendancesSummary } from "../../../../interfaces";
|
|
4
|
+
import { ResponseList } from "../../../../interfaces";
|
|
4
5
|
|
|
5
6
|
interface EmployeeQueryOptions
|
|
6
7
|
extends UseQueryOptions<ResponseList<'AttendanceSummarys', AttendancesSummary>>{
|
|
7
|
-
|
|
8
|
-
beginWorkPeriod?: number;
|
|
9
|
-
endWorkPeriod?: number;
|
|
8
|
+
userId?: string;
|
|
10
9
|
page: number;
|
|
11
10
|
record: number;
|
|
11
|
+
sortBy?: string;
|
|
12
|
+
sortDirection?: string;
|
|
13
|
+
terms?: string;
|
|
14
|
+
query?: string;
|
|
12
15
|
}
|
|
13
16
|
|
|
14
17
|
export const useAttendancesSummarySearch = ({
|
|
15
|
-
|
|
16
|
-
beginWorkPeriod,
|
|
17
|
-
endWorkPeriod,
|
|
18
|
+
userId,
|
|
18
19
|
page,
|
|
19
20
|
record,
|
|
21
|
+
sortBy,
|
|
22
|
+
sortDirection,
|
|
23
|
+
terms,
|
|
24
|
+
query,
|
|
20
25
|
...options
|
|
21
26
|
}: EmployeeQueryOptions) => {
|
|
22
27
|
return useQuery<ResponseList<'AttendanceSummarys', AttendancesSummary>>(
|
|
23
28
|
[
|
|
24
29
|
"ATTENDANCES_SUMMARY",
|
|
25
|
-
|
|
26
|
-
beginWorkPeriod,
|
|
27
|
-
endWorkPeriod,
|
|
30
|
+
userId,
|
|
28
31
|
page,
|
|
29
32
|
record,
|
|
33
|
+
sortBy,
|
|
34
|
+
sortDirection,
|
|
35
|
+
terms,
|
|
36
|
+
query
|
|
30
37
|
],
|
|
31
38
|
() =>
|
|
32
39
|
getAuth0<ResponseList<'AttendanceSummarys', AttendancesSummary>>(`/ATIM/AttendancesSummary`, {
|
|
33
|
-
|
|
34
|
-
pBeginWorkDate: beginWorkPeriod,
|
|
35
|
-
pEndWorkDate: endWorkPeriod,
|
|
40
|
+
pUserId: userId,
|
|
36
41
|
pPage: page,
|
|
37
42
|
pRecords: record,
|
|
43
|
+
pSortBy: sortBy,
|
|
44
|
+
pSortDirection: sortDirection,
|
|
45
|
+
pTerms: terms,
|
|
46
|
+
pQuery: query,
|
|
38
47
|
}),
|
|
39
48
|
{
|
|
40
49
|
...options,
|
|
@@ -5,8 +5,6 @@ import { ResponseList, EmployeesWorklog } from "../../../../interfaces";
|
|
|
5
5
|
|
|
6
6
|
interface EmployeesWithTimekeepingProps
|
|
7
7
|
extends UseQueryOptions<ResponseList<"EmployeesWorkLog", EmployeesWorklog>> {
|
|
8
|
-
startDate?: number;
|
|
9
|
-
endDate?: number;
|
|
10
8
|
search?: string;
|
|
11
9
|
page?: number;
|
|
12
10
|
records?: number;
|
|
@@ -17,8 +15,6 @@ interface EmployeesWithTimekeepingProps
|
|
|
17
15
|
}
|
|
18
16
|
|
|
19
17
|
export const useEmployeeWorklogDetails = ({
|
|
20
|
-
startDate,
|
|
21
|
-
endDate,
|
|
22
18
|
search,
|
|
23
19
|
page,
|
|
24
20
|
records,
|
|
@@ -30,8 +26,6 @@ export const useEmployeeWorklogDetails = ({
|
|
|
30
26
|
return useQuery<ResponseList<"EmployeesWorklog", EmployeesWorklog>>(
|
|
31
27
|
[
|
|
32
28
|
"EMPLOYEES_WITH_TIMEKEEPING",
|
|
33
|
-
startDate,
|
|
34
|
-
endDate,
|
|
35
29
|
search,
|
|
36
30
|
page,
|
|
37
31
|
records,
|
|
@@ -41,22 +35,17 @@ export const useEmployeeWorklogDetails = ({
|
|
|
41
35
|
query,
|
|
42
36
|
],
|
|
43
37
|
() =>
|
|
44
|
-
getAuth0
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
pSortDirection: sortDirection,
|
|
53
|
-
pTerms: terms,
|
|
54
|
-
pQuery: query,
|
|
55
|
-
}
|
|
56
|
-
),
|
|
38
|
+
getAuth0("/ATIM/EmployeesWorklogDetails", {
|
|
39
|
+
pPage: page || 1,
|
|
40
|
+
pRecords: records,
|
|
41
|
+
pSortBy: sortBy,
|
|
42
|
+
pSortDirection: sortDirection,
|
|
43
|
+
pTerms: terms,
|
|
44
|
+
pQuery: query,
|
|
45
|
+
}),
|
|
57
46
|
{
|
|
58
47
|
suspense: false,
|
|
59
|
-
enabled: !!
|
|
48
|
+
enabled: !!query,
|
|
60
49
|
}
|
|
61
50
|
);
|
|
62
51
|
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { useMutation, useQueryClient } from "@tanstack/react-query";
|
|
2
|
+
import { putWithParameters } from "../../../../services/ApiService";
|
|
3
|
+
import { WorkLogDetail } from "../../../../interfaces";
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
export const useAttendancesById = () => {
|
|
7
|
+
const queryClient = useQueryClient();
|
|
8
|
+
|
|
9
|
+
return useMutation<WorkLogDetail, unknown, WorkLogDetail>(
|
|
10
|
+
(data: WorkLogDetail) => {
|
|
11
|
+
return putWithParameters(`/ATIM/Attendances/${data.Id}?`, {
|
|
12
|
+
pDate: data.Date,
|
|
13
|
+
});
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
onSuccess: (data: WorkLogDetail) => {
|
|
17
|
+
queryClient.setQueryData(["INTEGRATION_DATA_QUERY"], data);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
);
|
|
21
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { getAuth0, ReportBuilder } from '../../..';
|
|
2
|
+
import { useQuery, UseQueryOptions } from '@tanstack/react-query';
|
|
3
|
+
|
|
4
|
+
export const getProductsListingQueryHook = (transferId: string, transferPackageId: string, { ...options }: UseQueryOptions<ReportBuilder>) => {
|
|
5
|
+
return useQuery(
|
|
6
|
+
['ASTT_PRODUCTS_LISTING', transferId, transferPackageId, options],
|
|
7
|
+
() => getAuth0<ReportBuilder>(`/ASGT/ReportsBuilder/ProductsListing`, {
|
|
8
|
+
pTransferDocumentId: transferId,
|
|
9
|
+
pPackageId: transferPackageId
|
|
10
|
+
}),
|
|
11
|
+
options
|
|
12
|
+
);
|
|
13
|
+
};
|
|
14
|
+
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { getAuth0, ReportBuilder } from '../../..';
|
|
2
|
+
import { useQuery, UseQueryOptions } from '@tanstack/react-query';
|
|
3
|
+
|
|
4
|
+
export const getReportsBuilderQueryHook = (transferId: string, {...options} : UseQueryOptions<ReportBuilder>) => {
|
|
5
|
+
return useQuery(
|
|
6
|
+
['ASTT_REPORTS_BUILDER', transferId, options],
|
|
7
|
+
() => getAuth0<ReportBuilder>(`/ASGT/ReportsBuilder/DifferencesReport`, {
|
|
8
|
+
pTransferDocumentId: transferId
|
|
9
|
+
}),
|
|
10
|
+
options
|
|
11
|
+
);
|
|
12
|
+
};
|
|
@@ -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 TransferAllProductsProps 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 getTransferAllProductsQueryHook = ({ page, records, sortBy, sortDirection, query, ...options }: TransferAllProductsProps) => {
|
|
14
|
+
return useQuery(
|
|
15
|
+
['ASTT_TRANSFER_ALL_PRODUCTS', page, records, sortBy, sortDirection, query, options],
|
|
16
|
+
() => getAuth0<ResponseList<"Products", TransferAllProducts>>('/Product/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, TransferDocuments } from '../../..';
|
|
2
|
+
import { useQuery, UseQueryOptions } from '@tanstack/react-query';
|
|
3
|
+
|
|
4
|
+
export const getTransferDocumentsByIdQueryHook = (transferId: string, {...options} : UseQueryOptions<TransferDocuments>) => {
|
|
5
|
+
return useQuery(
|
|
6
|
+
['ASTT_TRANSFER_DOCUMENTS_BY_ID', transferId, options],
|
|
7
|
+
() => getAuth0<TransferDocuments>(`/ASGT/TransferDocuments`, {
|
|
8
|
+
pTransferDocumentId: transferId
|
|
9
|
+
}),
|
|
10
|
+
options
|
|
11
|
+
);
|
|
12
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { getAuth0, TransferPackage } from '../../..';
|
|
2
|
+
import { useQuery, UseQueryOptions } from '@tanstack/react-query';
|
|
3
|
+
|
|
4
|
+
export const getTransferDocumentsByPackageQueryHook = (transferId: string, transferPackageId: string, {...options} : UseQueryOptions<TransferPackage>) => {
|
|
5
|
+
return useQuery(
|
|
6
|
+
['ASTT_TRANSFER_DOCUMENTS_BY_PACKAGE', transferId, transferPackageId, options],
|
|
7
|
+
() => getAuth0<TransferPackage>(`/ASGT/TransferDocuments/Products`, {
|
|
8
|
+
pTransferDocumentId: transferId,
|
|
9
|
+
pPackageId: transferPackageId
|
|
10
|
+
}),
|
|
11
|
+
options
|
|
12
|
+
);
|
|
13
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { useQuery, UseQueryOptions } from "@tanstack/react-query";
|
|
2
|
+
import { TransferDocumentsDetails, ResponseList } from "../../../interfaces";
|
|
3
|
+
import { getAuth0 } from "../../../services/ApiService";
|
|
4
|
+
|
|
5
|
+
export interface TransferDocumentsPackagesProps extends UseQueryOptions<ResponseList<"TransferDocumentDetails", TransferDocumentsDetails>> {
|
|
6
|
+
sortBy?: string;
|
|
7
|
+
sortDirection?: string;
|
|
8
|
+
terms?: string;
|
|
9
|
+
transferDocumentId?: string;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export const getTransferDocumentsPackagesQueryHook = ({ sortBy, sortDirection, terms, transferDocumentId, ...options }: TransferDocumentsPackagesProps) => {
|
|
13
|
+
return useQuery(
|
|
14
|
+
['ASTT_TRANSFER_PACKAGES', sortBy, sortDirection, terms, transferDocumentId, options],
|
|
15
|
+
() => getAuth0<ResponseList<"TransferDocumentDetails", TransferDocumentsDetails>>(`/ASGT/TransferDocuments/Packages`, {
|
|
16
|
+
pTransferDocumentId: transferDocumentId,
|
|
17
|
+
pSortBy: sortBy || "PackageId",
|
|
18
|
+
pSortDirection: sortDirection || "asc",
|
|
19
|
+
pTerms: terms
|
|
20
|
+
}),
|
|
21
|
+
options
|
|
22
|
+
);
|
|
23
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { useQuery, UseQueryOptions } from "@tanstack/react-query";
|
|
2
|
+
import { TransferDocuments, ResponseList } from "../../../interfaces";
|
|
3
|
+
import { getAuth0 } from "../../../services/ApiService";
|
|
4
|
+
|
|
5
|
+
export interface TransferDocumentsProps extends UseQueryOptions<ResponseList<"TransferDocuments", TransferDocuments>> {
|
|
6
|
+
page: number;
|
|
7
|
+
records: number;
|
|
8
|
+
sortBy: string;
|
|
9
|
+
sortDirection: string;
|
|
10
|
+
terms?: string;
|
|
11
|
+
query?: string;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export const getTransferDocumentsQueryHook = ({ page, records, sortBy, sortDirection, terms, query, ...options }: TransferDocumentsProps) => {
|
|
15
|
+
return useQuery(
|
|
16
|
+
['ASTT_TRANSFER_DOCUMENTS', page, records, sortBy, sortDirection, terms, query, options],
|
|
17
|
+
() => getAuth0<ResponseList<"TransferDocuments", TransferDocuments>>('/ASGT/TransferDocuments', {
|
|
18
|
+
pPage: page || 1,
|
|
19
|
+
pRecords: records || 50,
|
|
20
|
+
pSortBy: sortBy || "DocumentCreationDate",
|
|
21
|
+
pSortDirection: sortDirection || "asc",
|
|
22
|
+
pTerms: terms,
|
|
23
|
+
pQuery: query
|
|
24
|
+
}),
|
|
25
|
+
options
|
|
26
|
+
);
|
|
27
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { useQuery, UseQueryOptions } from "@tanstack/react-query";
|
|
2
|
+
import { TransferReportDiff } from "../../../interfaces";
|
|
3
|
+
import { getAuth0 } from "../../../services/ApiService";
|
|
4
|
+
|
|
5
|
+
export interface TransferReportDiffProps extends UseQueryOptions<{ ProductsToBePicked: TransferReportDiff[]; FalsePositiveProducts?: TransferReportDiff[] }> {
|
|
6
|
+
transferDocumentId?: string;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export const getTransferReportDiffQueryHook = ({ transferDocumentId, ...options }: TransferReportDiffProps) => {
|
|
10
|
+
return useQuery(
|
|
11
|
+
['ASTT_TRANSFER_REPORT_DIFF', transferDocumentId, options],
|
|
12
|
+
() => getAuth0<{ ProductsToBePicked: TransferReportDiff[]; FalsePositiveProducts?: TransferReportDiff[] }>(`/ASGT/TransferDocuments/DifferencesReport`, {
|
|
13
|
+
pTransferDocumentId: transferDocumentId
|
|
14
|
+
}),
|
|
15
|
+
options
|
|
16
|
+
);
|
|
17
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { UseQueryOptions, useMutation, useQueryClient } from '@tanstack/react-query';
|
|
2
|
+
import { TransferPickProducts } from '../../../interfaces/TransferPickProducts';
|
|
3
|
+
import { postAuth0 } from '../../../services/ApiService';
|
|
4
|
+
|
|
5
|
+
export interface TransferDocumentsMutateProps extends UseQueryOptions<TransferPickProducts> {
|
|
6
|
+
transferDocumentId: string;
|
|
7
|
+
packageId: string;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export const postTransferDocumentsMutateQueryHook = ({ transferDocumentId, packageId }: TransferDocumentsMutateProps) => {
|
|
11
|
+
const queryClient = useQueryClient();
|
|
12
|
+
return useMutation<TransferPickProducts, unknown, TransferPickProducts>((data: TransferPickProducts) => {
|
|
13
|
+
return postAuth0(`/ASGT/TransferDocuments/Products/Picking?`, {
|
|
14
|
+
pTransferDocumentId: transferDocumentId,
|
|
15
|
+
pPackageId: packageId
|
|
16
|
+
}, data);
|
|
17
|
+
}, {
|
|
18
|
+
onSuccess: (data: TransferPickProducts) => {
|
|
19
|
+
queryClient.setQueryData(
|
|
20
|
+
['TRANSFER_PICKED_PRODUCTS_QUERY'], data);
|
|
21
|
+
},
|
|
22
|
+
});
|
|
23
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { UseQueryOptions, useMutation, useQueryClient } from '@tanstack/react-query';
|
|
2
|
+
import { TransferDocumentState } from '../../../interfaces/TransferDocumentState';
|
|
3
|
+
import { putAuth0 } from '../../../services/ApiService';
|
|
4
|
+
|
|
5
|
+
export interface TransferDocumentsStateMutateProps extends UseQueryOptions<TransferDocumentState> {
|
|
6
|
+
transferDocumentId: string;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export const putTransferDocumentsStateMutateQueryHook = ({ transferDocumentId }: TransferDocumentsStateMutateProps) => {
|
|
10
|
+
const queryClient = useQueryClient();
|
|
11
|
+
return useMutation<TransferDocumentState, unknown, TransferDocumentState>((data: TransferDocumentState) => {
|
|
12
|
+
return putAuth0(`/ASGT/TransferDocuments?`, {
|
|
13
|
+
pTransferDocumentId: transferDocumentId
|
|
14
|
+
}, data);
|
|
15
|
+
}, {
|
|
16
|
+
onSuccess: (data: TransferDocumentState) => {
|
|
17
|
+
queryClient.setQueryData(
|
|
18
|
+
['TRANSFER_PACKAGE_STATE_QUERY'], data);
|
|
19
|
+
},
|
|
20
|
+
});
|
|
21
|
+
}
|
|
@@ -5,10 +5,7 @@ import { postAuth0 } from '../../../services/ApiService';
|
|
|
5
5
|
export const importRegulationHook = (bodyType?: string) => {
|
|
6
6
|
const queryClient = useQueryClient();
|
|
7
7
|
return useMutation<string, unknown, BwgFile>((data: BwgFile | any) => {
|
|
8
|
-
return postAuth0(`/ABWG/File
|
|
9
|
-
pCountry: data.Country,
|
|
10
|
-
pFile: data.File
|
|
11
|
-
}, data, bodyType);
|
|
8
|
+
return postAuth0(`/ABWG/File`, undefined, data, bodyType);
|
|
12
9
|
}, {
|
|
13
10
|
onSuccess: (data: string) => {
|
|
14
11
|
queryClient.setQueryData(
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { useMutation, useQueryClient } from "@tanstack/react-query";
|
|
2
|
+
import { putWithParameters } from "../../../../services/ApiService";
|
|
3
|
+
import { ErrorHistoryItem } from "../../../../interfaces";
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
export const updateErrorHistory = () => {
|
|
7
|
+
const queryClient = useQueryClient();
|
|
8
|
+
|
|
9
|
+
return useMutation<ErrorHistoryItem, unknown, ErrorHistoryItem>(
|
|
10
|
+
(data: ErrorHistoryItem) => {
|
|
11
|
+
return putWithParameters(`/MIMO/ErrorHistory?`, {
|
|
12
|
+
pId: data.Id,
|
|
13
|
+
pFlow: data.Flow,
|
|
14
|
+
pMessage: data.ErrorMessage,
|
|
15
|
+
pDate: data.CreateDate,
|
|
16
|
+
|
|
17
|
+
});
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
onSuccess: (data: ErrorHistoryItem) => {
|
|
21
|
+
queryClient.setQueryData(["INTEGRATION_DATA_QUERY"], data);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
);
|
|
25
|
+
};
|
package/src/hooks/index.ts
CHANGED
|
@@ -282,18 +282,22 @@ export * from "./OSUA/get/vouchers/getSitooVouchers.hook";
|
|
|
282
282
|
export * from "./OSUA/get/vouchers/getVoucherIntegrationRequestStatus.hook";
|
|
283
283
|
export * from "./OSUA/get/orders/getOrderDocuments.hook";
|
|
284
284
|
export * from "./OSUA/get/faqs/getFaqsQuery.hook";
|
|
285
|
-
export * from "./OSUA/get/mimo/useIntegrationDataQuery.hook";
|
|
286
|
-
export * from "./OSUA/get/mimo/useErrorHistory.hook";
|
|
287
285
|
|
|
288
286
|
export * from "./OSUA/mutate/postCreateIntegrationRequest.hook";
|
|
289
287
|
export * from "./OSUA/mutate/useSetIntegrationToFinished.hook";
|
|
288
|
+
export * from "./OSUA/mutate/postCreateIntegrationRequest.hook";
|
|
290
289
|
|
|
291
290
|
//MIMO
|
|
292
291
|
export * from "./OSUA/MIMO/get/getIntegrationByName.hook";
|
|
293
292
|
export * from "./OSUA/MIMO/get/getProductIntegrationHistory.hook";
|
|
293
|
+
export * from "./OSUA/MIMO/get/useIntegrationDataQuery.hook";
|
|
294
|
+
export * from "./OSUA/MIMO/get/useErrorHistory.hook";
|
|
295
|
+
|
|
294
296
|
export * from "./OSUA/MIMO/mutate/postProductVendusIntegration.hook";
|
|
295
297
|
export * from "./OSUA/MIMO/mutate/postDagsAdjustStock.hook";
|
|
296
|
-
export * from "./OSUA/mutate/
|
|
298
|
+
export * from "./OSUA/MIMO/mutate/updateErrorHistory.hook";
|
|
299
|
+
|
|
300
|
+
|
|
297
301
|
|
|
298
302
|
//MIMO
|
|
299
303
|
export * from "./OSUA/MIMO/get/getIntegrationByName.hook";
|
|
@@ -329,6 +333,7 @@ export * from "./ATIM/BackOffice/get/useAttendancesSummary.hook";
|
|
|
329
333
|
export * from "./ATIM/BackOffice/get/useAttendancesSummarySearch.hook";
|
|
330
334
|
export * from "./ATIM/BackOffice/get/useWorkMonths.hook";
|
|
331
335
|
export * from "./ATIM/BackOffice/mutate/useUpdateAttendancesSummary.hook";
|
|
336
|
+
export * from "./ATIM/BackOffice/mutate/useAttendancesById.hook";
|
|
332
337
|
|
|
333
338
|
//Others
|
|
334
339
|
export * from "./Others/useJobTitlesQuery.hook";
|
|
File without changes
|
|
File without changes
|