@omniumretail/shared-resources 0.2.71 → 0.2.73
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/Asta/Answer/others/sendInspectionEmailQuery.hook.d.ts +2 -0
- package/dist/types/hooks/Asta/Inspection/others/exportInspectionQuery.hook.d.ts +2 -0
- package/dist/types/hooks/OSUA/get/eventos/getSitooErrorEvents.hook.d.ts +10 -0
- package/dist/types/hooks/OSUA/mutate/postEventsRep.hook.d.ts +1 -0
- package/dist/types/hooks/index.d.ts +4 -0
- package/dist/types/interfaces/Inspection.d.ts +1 -0
- package/dist/types/interfaces/OSUA.d.ts +6 -0
- package/package.json +1 -1
- package/src/hooks/Asta/Answer/others/sendInspectionEmailQuery.hook.ts +21 -0
- package/src/hooks/Asta/Inspection/others/exportInspectionQuery.hook.ts +19 -0
- package/src/hooks/OSUA/get/eventos/getSitooErrorEvents.hook.ts +30 -0
- package/src/hooks/OSUA/mutate/postEventsRep.hook.ts +16 -0
- package/src/hooks/index.ts +5 -0
- package/src/interfaces/Inspection.ts +1 -0
- package/src/interfaces/OSUA.ts +8 -0
- package/src/interfaces/ResponseList.ts +1 -0
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { Inspection } from '../../../../interfaces';
|
|
2
|
+
export declare const sendInspectionEmailMutateHook: (answerId: string, userName: string, email: string, storeId: string, pdfUrl: string) => import("@tanstack/react-query").UseMutationResult<Inspection, unknown, Inspection, unknown>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { UseQueryOptions } from '@tanstack/react-query';
|
|
2
|
+
import { ResponseList, DocumentErrorEvent } from '../../../../interfaces';
|
|
3
|
+
interface GetSitooErrorEventsProps extends UseQueryOptions<ResponseList<"Events", DocumentErrorEvent>> {
|
|
4
|
+
page?: number;
|
|
5
|
+
records?: number;
|
|
6
|
+
sortBy?: string;
|
|
7
|
+
sortDirection?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare const getSitooErrorEvents: ({ page, records, sortBy, sortDirection, ...options }: GetSitooErrorEventsProps) => import("@tanstack/react-query").UseQueryResult<ResponseList<"Events", DocumentErrorEvent>, unknown>;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const postEventsRep: () => import("@tanstack/react-query").UseMutationResult<string, unknown, void, unknown>;
|
|
@@ -177,6 +177,7 @@ export * from "./Asta/Inspection/others/deleteInspectionQuery.hook";
|
|
|
177
177
|
export * from "./Asta/Inspection/others/finishInspectionQuery.hook";
|
|
178
178
|
export * from "./Asta/Inspection/others/archiveTemplateQuery.hook";
|
|
179
179
|
export * from "./Asta/Inspection/others/extractTemplateQuery.hook";
|
|
180
|
+
export * from "./Asta/Inspection/others/exportInspectionQuery.hook";
|
|
180
181
|
export * from "./Asta/Answer/get/getAstaAnswerQuery.hook";
|
|
181
182
|
export * from "./Asta/Answer/get/getAstaAnswerByIdQuery.hook";
|
|
182
183
|
export * from "./Asta/Answer/mutate/useAstaAnswersMutateQuery.hook";
|
|
@@ -187,6 +188,7 @@ export * from "./Asta/Answer/get/getAstaAnswerByIdQuery.hook";
|
|
|
187
188
|
export * from "./Asta/Answer/mutate/useAstaAnswersMutateQuery.hook";
|
|
188
189
|
export * from "./Asta/Answer/others/finishAstaAnswersQuery.hook";
|
|
189
190
|
export * from "./Asta/Answer/others/putAnswerImageQuery.hook";
|
|
191
|
+
export * from "./Asta/Answer/others/sendInspectionEmailQuery.hook";
|
|
190
192
|
export * from "./Asta/AnswerType/get/getAnswerTypeQuery.hook";
|
|
191
193
|
export * from "./Asta/AnswerType/get/getAllAnswerTypeQuery.hook";
|
|
192
194
|
export * from "./Asta/AnswerType/get/getAnswerColorsQuery.hook";
|
|
@@ -249,10 +251,12 @@ export * from "./OSUA/get/vouchers/getSitooVouchers.hook";
|
|
|
249
251
|
export * from "./OSUA/get/vouchers/getVoucherIntegrationRequestStatus.hook";
|
|
250
252
|
export * from "./OSUA/get/orders/getOrderDocuments.hook";
|
|
251
253
|
export * from "./OSUA/get/faqs/getFaqsQuery.hook";
|
|
254
|
+
export * from "./OSUA/get/eventos/getSitooErrorEvents.hook";
|
|
252
255
|
export * from "./OSUA/mutate/postCreateIntegrationRequest.hook";
|
|
253
256
|
export * from "./OSUA/mutate/useSetIntegrationToFinished.hook";
|
|
254
257
|
export * from "./OSUA/mutate/postCreateIntegrationRequest.hook";
|
|
255
258
|
export * from "./OSUA/mutate/postCreateIntegrationRequest.hook";
|
|
259
|
+
export * from "./OSUA/mutate/postEventsRep.hook";
|
|
256
260
|
export * from "./OSUA/MIMO/get/getIntegrationByName.hook";
|
|
257
261
|
export * from "./OSUA/MIMO/get/getProductIntegrationHistory.hook";
|
|
258
262
|
export * from "./OSUA/MIMO/get/useIntegrationDataQuery.hook";
|
package/package.json
CHANGED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { useMutation, useQueryClient } from '@tanstack/react-query';
|
|
2
|
+
import { Inspection } from '../../../../interfaces';
|
|
3
|
+
import { postAuth0 } from '../../../../services/ApiService';
|
|
4
|
+
|
|
5
|
+
export const sendInspectionEmailMutateHook = (answerId: string, userName: string, email: string, storeId: string, pdfUrl: string) => {
|
|
6
|
+
const queryClient = useQueryClient();
|
|
7
|
+
return useMutation<Inspection, unknown, Inspection>((data: Inspection) => {
|
|
8
|
+
return postAuth0(`/ASTA/Answers/SendEmail?`, {
|
|
9
|
+
pAnswerId: answerId,
|
|
10
|
+
pUserName: userName,
|
|
11
|
+
pEmail: email,
|
|
12
|
+
pStoreId: storeId,
|
|
13
|
+
pPDFUrl: pdfUrl
|
|
14
|
+
}, data);
|
|
15
|
+
}, {
|
|
16
|
+
onSuccess: (data: Inspection) => {
|
|
17
|
+
queryClient.setQueryData(
|
|
18
|
+
['SEND_INSPECTION_EMAIL_QUERY'], data);
|
|
19
|
+
},
|
|
20
|
+
});
|
|
21
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { useMutation, useQueryClient } from '@tanstack/react-query';
|
|
2
|
+
import { Inspection } from '../../../../interfaces';
|
|
3
|
+
import { postAuth0 } from '../../../../services/ApiService';
|
|
4
|
+
|
|
5
|
+
export const exportInspectionMutateHook = (inspectionId: string, userName: string, language?: string) => {
|
|
6
|
+
const queryClient = useQueryClient();
|
|
7
|
+
return useMutation<Inspection, unknown, Inspection>((data: Inspection) => {
|
|
8
|
+
return postAuth0(`/ASTA/Inspection/AnswerExport?`, {
|
|
9
|
+
pInspectionId: inspectionId,
|
|
10
|
+
pUserName: userName,
|
|
11
|
+
pLanguage: language || "PT"
|
|
12
|
+
}, data);
|
|
13
|
+
}, {
|
|
14
|
+
onSuccess: (data: Inspection) => {
|
|
15
|
+
queryClient.setQueryData(
|
|
16
|
+
['EXPORT_INSPECTION_QUERY'], data);
|
|
17
|
+
},
|
|
18
|
+
});
|
|
19
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { useQuery, UseQueryOptions } from '@tanstack/react-query';
|
|
2
|
+
import { get } from "../../../../services/ApiService";
|
|
3
|
+
import { ResponseList, DocumentErrorEvent} from '../../../../interfaces';
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
interface GetSitooErrorEventsProps extends UseQueryOptions<ResponseList<"Events", DocumentErrorEvent>> {
|
|
7
|
+
page?: number;
|
|
8
|
+
records?: number;
|
|
9
|
+
sortBy?: string;
|
|
10
|
+
sortDirection?: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export const getSitooErrorEvents = ({
|
|
14
|
+
page,
|
|
15
|
+
records,
|
|
16
|
+
sortBy,
|
|
17
|
+
sortDirection,
|
|
18
|
+
...options
|
|
19
|
+
}: GetSitooErrorEventsProps) => {
|
|
20
|
+
return useQuery(
|
|
21
|
+
['SITOO_ERROR_EVENTS', page, records, sortBy, sortDirection],
|
|
22
|
+
() => get<ResponseList<"Events", DocumentErrorEvent>>('/Sitoo/Document/Events/Error', {
|
|
23
|
+
pPage: page,
|
|
24
|
+
pRecords: records,
|
|
25
|
+
pSortBy: sortBy || "EventDate",
|
|
26
|
+
pSortDirection: sortDirection || "desc",
|
|
27
|
+
}),
|
|
28
|
+
options
|
|
29
|
+
);
|
|
30
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { useQueryClient, useMutation } from "@tanstack/react-query";
|
|
2
|
+
import { post } from "../../../services/ApiService";
|
|
3
|
+
|
|
4
|
+
export const postEventsRep = () => {
|
|
5
|
+
const queryClient = useQueryClient();
|
|
6
|
+
return useMutation<string, unknown, void>(
|
|
7
|
+
() => {
|
|
8
|
+
return post("/Sitoo/Document/EventsReprocessing");
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
onSuccess: (data: string) => {
|
|
12
|
+
queryClient.setQueryData(["POST_EVENTS_REPROCESSING"], data);
|
|
13
|
+
},
|
|
14
|
+
}
|
|
15
|
+
);
|
|
16
|
+
};
|
package/src/hooks/index.ts
CHANGED
|
@@ -209,6 +209,7 @@ export * from "./Asta/Inspection/others/deleteInspectionQuery.hook";
|
|
|
209
209
|
export * from "./Asta/Inspection/others/finishInspectionQuery.hook";
|
|
210
210
|
export * from "./Asta/Inspection/others/archiveTemplateQuery.hook";
|
|
211
211
|
export * from "./Asta/Inspection/others/extractTemplateQuery.hook";
|
|
212
|
+
export * from "./Asta/Inspection/others/exportInspectionQuery.hook";
|
|
212
213
|
|
|
213
214
|
export * from "./Asta/Answer/get/getAstaAnswerQuery.hook";
|
|
214
215
|
export * from "./Asta/Answer/get/getAstaAnswerByIdQuery.hook";
|
|
@@ -220,6 +221,7 @@ export * from "./Asta/Answer/get/getAstaAnswerByIdQuery.hook";
|
|
|
220
221
|
export * from "./Asta/Answer/mutate/useAstaAnswersMutateQuery.hook";
|
|
221
222
|
export * from "./Asta/Answer/others/finishAstaAnswersQuery.hook";
|
|
222
223
|
export * from "./Asta/Answer/others/putAnswerImageQuery.hook";
|
|
224
|
+
export * from "./Asta/Answer/others/sendInspectionEmailQuery.hook";
|
|
223
225
|
|
|
224
226
|
export * from "./Asta/AnswerType/get/getAnswerTypeQuery.hook";
|
|
225
227
|
export * from "./Asta/AnswerType/get/getAllAnswerTypeQuery.hook";
|
|
@@ -290,11 +292,14 @@ export * from "./OSUA/get/vouchers/getSitooVouchers.hook";
|
|
|
290
292
|
export * from "./OSUA/get/vouchers/getVoucherIntegrationRequestStatus.hook";
|
|
291
293
|
export * from "./OSUA/get/orders/getOrderDocuments.hook";
|
|
292
294
|
export * from "./OSUA/get/faqs/getFaqsQuery.hook";
|
|
295
|
+
export * from "./OSUA/get/eventos/getSitooErrorEvents.hook";
|
|
293
296
|
|
|
294
297
|
export * from "./OSUA/mutate/postCreateIntegrationRequest.hook";
|
|
295
298
|
export * from "./OSUA/mutate/useSetIntegrationToFinished.hook";
|
|
296
299
|
export * from "./OSUA/mutate/postCreateIntegrationRequest.hook";
|
|
297
300
|
export * from "./OSUA/mutate/postCreateIntegrationRequest.hook";
|
|
301
|
+
export * from "./OSUA/mutate/postEventsRep.hook";
|
|
302
|
+
|
|
298
303
|
|
|
299
304
|
//MIMO
|
|
300
305
|
export * from "./OSUA/MIMO/get/getIntegrationByName.hook";
|
package/src/interfaces/OSUA.ts
CHANGED