@omniumretail/shared-resources 0.2.72 → 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.
@@ -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,2 @@
1
+ import { Inspection } from '../../../../interfaces';
2
+ export declare const exportInspectionMutateHook: (inspectionId: string, userName: string, language?: string) => import("@tanstack/react-query").UseMutationResult<Inspection, unknown, Inspection, 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";
@@ -17,4 +17,5 @@ export interface Inspection {
17
17
  EmployeeId: string;
18
18
  EmployeeName: string;
19
19
  CategoriesDTO: AstaCategories[];
20
+ AnswerExportURL: string;
20
21
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@omniumretail/shared-resources",
3
- "version": "0.2.72",
3
+ "version": "0.2.73",
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,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
+ }
@@ -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";
@@ -18,4 +18,5 @@ export interface Inspection {
18
18
  EmployeeId: string;
19
19
  EmployeeName: string;
20
20
  CategoriesDTO: AstaCategories[];
21
+ AnswerExportURL: string;
21
22
  }