@omniumretail/shared-resources 0.3.84 → 0.3.85

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.
Files changed (434) hide show
  1. package/dist/shared-resources.es.js +4780 -0
  2. package/dist/shared-resources.umd.js +2 -33
  3. package/package.json +40 -17
  4. package/.eslintrc.json +0 -32
  5. package/dist/shared-resources.umd.js.map +0 -1
  6. package/dist/types/index.d.ts +0 -2
  7. package/src/a2ai.scss +0 -130
  8. package/src/assets/omniu-retail_branco_s-fundo.png +0 -0
  9. package/src/assets/sitoo.svg +0 -9
  10. package/src/components/SharedContextProvider/index.tsx +0 -30
  11. package/src/components/index.ts +0 -1
  12. package/src/constants/QueryClient.ts +0 -10
  13. package/src/constants/index.ts +0 -1
  14. package/src/contexts/useStore.tsx +0 -20
  15. package/src/enums/attendence-type.enum.ts +0 -5
  16. package/src/enums/employees-order.enum.ts +0 -7
  17. package/src/enums/index.ts +0 -2
  18. package/src/global.scss +0 -124
  19. package/src/helpers/codeMutation.tsx +0 -19
  20. package/src/helpers/date-unix.helper.ts +0 -28
  21. package/src/helpers/formatted-date.helper.ts +0 -11
  22. package/src/helpers/getChildrenByType.helper.ts +0 -5
  23. package/src/helpers/index.ts +0 -4
  24. package/src/hooks/ACB/get/getClientBalance.hook.ts +0 -20
  25. package/src/hooks/ACB/mutate/postClientBalance.hook.ts +0 -16
  26. package/src/hooks/ASAEGNG/get/getCustomerHistoryQuery.hook.ts +0 -24
  27. package/src/hooks/ASAEGNG/get/getCustomerVouchersQuery.hook.ts +0 -24
  28. package/src/hooks/ASAEGNG/get/getCustomersQuery.hook.ts +0 -28
  29. package/src/hooks/ATIM/BackOffice/get/useAbsenceTypes.hook.ts +0 -33
  30. package/src/hooks/ATIM/BackOffice/get/useAttendancesSummary.hook.ts +0 -38
  31. package/src/hooks/ATIM/BackOffice/get/useAttendancesSummarySearch.hook.ts +0 -52
  32. package/src/hooks/ATIM/BackOffice/get/useEmployeeQueryHook.hook.ts +0 -29
  33. package/src/hooks/ATIM/BackOffice/get/useEmployeeWorklogDetails.hook.ts +0 -51
  34. package/src/hooks/ATIM/BackOffice/get/useEmployeesQuery.hook.ts +0 -36
  35. package/src/hooks/ATIM/BackOffice/get/useKPIsQuery.hook.ts +0 -36
  36. package/src/hooks/ATIM/BackOffice/get/useSchedulePeriodQuery.hook.ts +0 -16
  37. package/src/hooks/ATIM/BackOffice/get/useSchedulePeriodTypesQuery.hook.ts +0 -36
  38. package/src/hooks/ATIM/BackOffice/get/useSchedulesQuery.hook.ts +0 -28
  39. package/src/hooks/ATIM/BackOffice/get/useStoresQueryHook.hook.ts +0 -27
  40. package/src/hooks/ATIM/BackOffice/get/useWorkMonths.hook.ts +0 -31
  41. package/src/hooks/ATIM/BackOffice/get/useWorkWeekSchedule.hook.ts +0 -31
  42. package/src/hooks/ATIM/BackOffice/mutate/postAttendanceRange.hook.ts +0 -16
  43. package/src/hooks/ATIM/BackOffice/mutate/useAttendancesById.hook.ts +0 -21
  44. package/src/hooks/ATIM/BackOffice/mutate/useScheduleMutateQuery.hook.ts +0 -25
  45. package/src/hooks/ATIM/BackOffice/mutate/useUpdateAttendancesSummary.hook.ts +0 -17
  46. package/src/hooks/ATIM/PicaPonto/get/getEmployeesWithTimekeeping.hook.ts +0 -35
  47. package/src/hooks/ATIM/PicaPonto/mutate/postAttendance.hook.ts +0 -16
  48. package/src/hooks/ATIM/PicaPonto/mutate/postTogglePinCode.ts +0 -33
  49. package/src/hooks/ATIM/PicaPonto/mutate/postVerifyUserQuery.hook.ts +0 -15
  50. package/src/hooks/Acls/get/getCustomersLoyaltyQuery.hook.ts +0 -22
  51. package/src/hooks/Acls/get/getVoucherLoyaltyQuery.hook.ts +0 -25
  52. package/src/hooks/Acls/get/getVoucherSitooQuery.hook.ts +0 -22
  53. package/src/hooks/Acls/get/getVoucherTemplatesQuery.hook.ts +0 -29
  54. package/src/hooks/Acls/mutate/postCreateVoucherTemplates.hook.ts +0 -19
  55. package/src/hooks/Acls/mutate/postSaldoVoucherQuery.hook.ts +0 -21
  56. package/src/hooks/Acls/mutate/postSalesAssociationQuery.hook.ts +0 -20
  57. package/src/hooks/Acls/mutate/postVerificationEmailQuery.hook.ts +0 -23
  58. package/src/hooks/Acls/mutate/postVerificationUserQuery.hook.ts +0 -23
  59. package/src/hooks/Acls/mutate/postVoucherSitooQuery.hook.ts +0 -21
  60. package/src/hooks/Acls/mutate/reactivateVoucherQuery.hook.ts +0 -27
  61. package/src/hooks/Acls/mutate/updateDisabledVoucherTemplates.hook.ts +0 -25
  62. package/src/hooks/Aexp/get/getFlowExecutionByIdQuery.hook.ts +0 -13
  63. package/src/hooks/Aexp/get/getFlowExecutionQuery.hook.ts +0 -27
  64. package/src/hooks/Aexp/get/getFlowListByIdQuery.hook.ts +0 -13
  65. package/src/hooks/Aexp/get/getFlowListQuery.hook.ts +0 -29
  66. package/src/hooks/Aexp/get/getTagsFlowQuery.hook.ts +0 -11
  67. package/src/hooks/Aexp/mutate/deleteFlowConfigurationQuery.hook.ts +0 -17
  68. package/src/hooks/Aexp/mutate/inactivateFlowConfigurationQuery.hook.ts +0 -18
  69. package/src/hooks/Aexp/mutate/runFlowExecutionQuery.hook.ts +0 -20
  70. package/src/hooks/Aexp/mutate/useFlowConfigurationQuery.hook.ts +0 -17
  71. package/src/hooks/Aexp/mutate/useFlowExecutionQuery.hook.ts +0 -22
  72. package/src/hooks/Aexp/mutate/validateExecutionFileQuery.hook.ts +0 -15
  73. package/src/hooks/Analytics/get/getArchivedAnalyticsQuery.hook.ts +0 -32
  74. package/src/hooks/Analytics/get/useAnalyticsEvaluationCyclesQuery.hook.ts +0 -21
  75. package/src/hooks/Analytics/get/useAnalyticsQuestionsQuery.hook.ts +0 -23
  76. package/src/hooks/Analytics/get/useAnalyticsSideBarQuery.hook.ts +0 -21
  77. package/src/hooks/Analytics/get/useAnalyticsUserIdQuery.hook.ts +0 -32
  78. package/src/hooks/Analytics/get/useAnalyticsUserQuery.hook.ts +0 -35
  79. package/src/hooks/Anot/get/getNotificationApplicationsQuery.hook.ts +0 -13
  80. package/src/hooks/Anot/get/getNotificationCriticalitiesQuery.hook.ts +0 -13
  81. package/src/hooks/Anot/get/getNotificationHeadersQuery.hook.ts +0 -33
  82. package/src/hooks/Anot/get/getNotificationLanguagesQuery.hook.ts +0 -15
  83. package/src/hooks/Anot/get/getNotificationTypeByIdQuery.hook.ts +0 -11
  84. package/src/hooks/Anot/get/getNotificationsQuery.hook.ts +0 -29
  85. package/src/hooks/Anot/get/getNotificationsTypeQuery.hook.ts +0 -27
  86. package/src/hooks/Anot/mutate/useNotificationTypeQuery.hook.ts +0 -18
  87. package/src/hooks/Answer/get/useAnswerIdQuery.hook.ts +0 -13
  88. package/src/hooks/Answer/get/useAnswersUserSupervisorQuery.hook.ts +0 -21
  89. package/src/hooks/Answer/mutate/useAnswerMutateQuery.hook.ts +0 -31
  90. package/src/hooks/Answer/others/openAnswerQuery.hook.ts +0 -19
  91. package/src/hooks/Answer/others/postAnswersExportQuery.hook.ts +0 -26
  92. package/src/hooks/Answer/others/showAnswerQuery.hook.ts +0 -18
  93. package/src/hooks/AprProduct/get/useProductHierarchies.hook.ts +0 -19
  94. package/src/hooks/AprProduct/get/useProductRecommendations.hook.ts +0 -27
  95. package/src/hooks/AprProduct/get/useProductsByRefQuery.hook.ts +0 -18
  96. package/src/hooks/AprProduct/get/useProductsQuery.hook.ts +0 -46
  97. package/src/hooks/Aprc/get/getPriceChangePinQuery.hook.ts +0 -16
  98. package/src/hooks/Aprc/others/postPriceChangePinQuery.hook.ts +0 -19
  99. package/src/hooks/Aprc/others/sendEmailWithPinQuery.hook.ts +0 -19
  100. package/src/hooks/Asgt/get/getIdProductsPickedASGTQuery.hook.ts +0 -10
  101. package/src/hooks/Asgt/get/getProductWarningASGTQuery.hook.ts +0 -27
  102. package/src/hooks/Asgt/get/getProductsListingASGTQuery.hook.ts +0 -14
  103. package/src/hooks/Asgt/get/getProductsMovementsASGTQuery.hook.ts +0 -27
  104. package/src/hooks/Asgt/get/getProductsPickedASGTQuery.hook.ts +0 -19
  105. package/src/hooks/Asgt/get/getReportsBuilderASGTQuery.hook.ts +0 -12
  106. package/src/hooks/Asgt/get/getTransferAllProductsASGTQuery.hook.ts +0 -25
  107. package/src/hooks/Asgt/get/getTransferDocumentsASGTQuery.hook.ts +0 -27
  108. package/src/hooks/Asgt/get/getTransferDocumentsByIdASGTQuery.hook.ts +0 -12
  109. package/src/hooks/Asgt/get/getTransferDocumentsByPackageASGTQuery.hook.ts +0 -13
  110. package/src/hooks/Asgt/get/getTransferDocumentsPackagesASGTQuery.hook.ts +0 -23
  111. package/src/hooks/Asgt/get/getTransferReportDiffASGT.hook.ts +0 -17
  112. package/src/hooks/Asgt/mutate/autoSaveASGTQuery.hook.ts +0 -23
  113. package/src/hooks/Asgt/mutate/createPackageASGTMutateQuery.hook.ts +0 -21
  114. package/src/hooks/Asgt/mutate/createTransferASGTMutateQuery.hook.ts +0 -15
  115. package/src/hooks/Asgt/mutate/postTransferDocumentsASGTMutateQuery.hook.ts +0 -23
  116. package/src/hooks/Asgt/mutate/putTransferDocumentsStateASGTMutateQuery.hook.ts +0 -21
  117. package/src/hooks/Asgt/mutate/removeProductASGTQuery.hook.ts +0 -15
  118. package/src/hooks/Ass/get/getAssProductsByRefQuery.hook.ts +0 -23
  119. package/src/hooks/Ass/get/getAssProductsByStoreQuery.hook.ts +0 -29
  120. package/src/hooks/Ass/get/getAssProductsStockDetailsQuery.hook.ts +0 -21
  121. package/src/hooks/Asta/Actions/get/getActionByIdQuery.hook.ts +0 -15
  122. package/src/hooks/Asta/Actions/get/getActionPriorityQuery.hook.ts +0 -10
  123. package/src/hooks/Asta/Actions/get/getActionQuery.hook.ts +0 -29
  124. package/src/hooks/Asta/Actions/get/getActionStagesQuery.hook.ts +0 -10
  125. package/src/hooks/Asta/Actions/mutate/useActionMutateQuery.hook.ts +0 -20
  126. package/src/hooks/Asta/Actions/others/archiveActionQuery.hook.ts +0 -19
  127. package/src/hooks/Asta/Actions/others/deleteActionQuery.hook.ts +0 -19
  128. package/src/hooks/Asta/Actions/others/extractActionQuery.hook.ts +0 -19
  129. package/src/hooks/Asta/Actions/others/finishActionQuery.hook.ts +0 -17
  130. package/src/hooks/Asta/Actions/others/selectActionStatusQuery.hook.ts +0 -18
  131. package/src/hooks/Asta/Actions/others/startActionQuery.hook.ts +0 -17
  132. package/src/hooks/Asta/Answer/get/getAstaAnswerByIdQuery.hook.ts +0 -15
  133. package/src/hooks/Asta/Answer/get/getAstaAnswerQuery.hook.ts +0 -29
  134. package/src/hooks/Asta/Answer/mutate/useAstaAnswersMutateQuery.hook.ts +0 -20
  135. package/src/hooks/Asta/Answer/others/finishAstaAnswersQuery.hook.ts +0 -15
  136. package/src/hooks/Asta/Answer/others/finishGNGAstaAnswersQuery.hook.ts +0 -18
  137. package/src/hooks/Asta/Answer/others/putAnswerImageQuery.hook.ts +0 -15
  138. package/src/hooks/Asta/Answer/others/sendInspectionEmailQuery.hook.ts +0 -21
  139. package/src/hooks/Asta/Answer/others/sendInspectionEmailStoreQuery.hook.ts +0 -20
  140. package/src/hooks/Asta/AnswerType/get/getAllAnswerTypeQuery.hook.ts +0 -29
  141. package/src/hooks/Asta/AnswerType/get/getAnswerColorsQuery.hook.ts +0 -10
  142. package/src/hooks/Asta/AnswerType/get/getAnswerTypeByIdQuery.hook.ts +0 -15
  143. package/src/hooks/Asta/AnswerType/get/getAnswerTypeQuery.hook.ts +0 -10
  144. package/src/hooks/Asta/AnswerType/mutate/useAnswerTypeMutateQuery.hook.ts +0 -20
  145. package/src/hooks/Asta/AnswerType/others/deleteAnswerTypeQuery.hook.ts +0 -19
  146. package/src/hooks/Asta/AnswerType/others/finishAnswerTypeQuery.hook.ts +0 -17
  147. package/src/hooks/Asta/AnswerType/others/selectAnswerNameQuery.hook.ts +0 -18
  148. package/src/hooks/Asta/Inspection/get/getInspectionQuery.hook.ts +0 -29
  149. package/src/hooks/Asta/Inspection/mutate/useInspectionMutateQuery.hook.ts +0 -24
  150. package/src/hooks/Asta/Inspection/others/archiveTemplateQuery.hook.ts +0 -19
  151. package/src/hooks/Asta/Inspection/others/deleteInspectionQuery.hook.ts +0 -19
  152. package/src/hooks/Asta/Inspection/others/exportInspectionQuery.hook.ts +0 -19
  153. package/src/hooks/Asta/Inspection/others/extractTemplateQuery.hook.ts +0 -19
  154. package/src/hooks/Asta/Inspection/others/finishInspectionQuery.hook.ts +0 -17
  155. package/src/hooks/Asta/Template/get/getTemplateByIdQuery.hook.ts +0 -15
  156. package/src/hooks/Asta/Template/get/getTemplateHeadersQuery.hook.ts +0 -10
  157. package/src/hooks/Asta/Template/get/getTemplateQuery.hook.ts +0 -29
  158. package/src/hooks/Asta/Template/mutate/useTemplateMutateQuery.hook.ts +0 -20
  159. package/src/hooks/Asta/Template/others/archiveTemplateQuery.hook.ts +0 -19
  160. package/src/hooks/Asta/Template/others/deleteTemplateQuery.hook.ts +0 -19
  161. package/src/hooks/Asta/Template/others/duplicateTemplateQuery.hook.ts +0 -19
  162. package/src/hooks/Asta/Template/others/extractTemplateQuery.hook.ts +0 -19
  163. package/src/hooks/Asta/Template/others/finishTemplateQuery.hook.ts +0 -17
  164. package/src/hooks/Asts/get/getProductInfoQuery.hook.ts +0 -19
  165. package/src/hooks/Asts/get/getStockQuery.hook.ts +0 -21
  166. package/src/hooks/Asts/others/postAudioFileQuery.hook.ts +0 -14
  167. package/src/hooks/Astt/Asgt/get/getAllAdidasProductsQuery.hook.ts +0 -25
  168. package/src/hooks/Astt/Asgt/get/getIdProductsPickedASTTQuery.hook.ts +0 -10
  169. package/src/hooks/Astt/Asgt/get/getProductWarningASTTQuery.hook.ts +0 -27
  170. package/src/hooks/Astt/Asgt/get/getProductsListingASTTQuery.hook.ts +0 -14
  171. package/src/hooks/Astt/Asgt/get/getProductsMovementsASTTQuery.hook.ts +0 -27
  172. package/src/hooks/Astt/Asgt/get/getProductsPickedASTTQuery.hook.ts +0 -19
  173. package/src/hooks/Astt/Asgt/get/getReportsBuilderASTTQuery.hook.ts +0 -12
  174. package/src/hooks/Astt/Asgt/get/getReprocessNeededASTTQuery.hook.ts +0 -12
  175. package/src/hooks/Astt/Asgt/get/getTransferAllProductsASTTQuery.hook.ts +0 -25
  176. package/src/hooks/Astt/Asgt/get/getTransferDocumentsASTTQuery.hook.ts +0 -27
  177. package/src/hooks/Astt/Asgt/get/getTransferDocumentsByIdASTTQuery.hook.ts +0 -12
  178. package/src/hooks/Astt/Asgt/get/getTransferDocumentsByPackageASTTQuery.hook.ts +0 -13
  179. package/src/hooks/Astt/Asgt/get/getTransferDocumentsPackagesASTTQuery.hook.ts +0 -23
  180. package/src/hooks/Astt/Asgt/get/getTransferReportDiffASTT.hook.ts +0 -17
  181. package/src/hooks/Astt/Asgt/mutate/autoSaveASTTQuery.hook.ts +0 -23
  182. package/src/hooks/Astt/Asgt/mutate/createPackageASTTMutateQuery.hook.ts +0 -21
  183. package/src/hooks/Astt/Asgt/mutate/createTransferASTTMutateQuery.hook.ts +0 -15
  184. package/src/hooks/Astt/Asgt/mutate/deleteProductASTTQuery.hook.ts +0 -25
  185. package/src/hooks/Astt/Asgt/mutate/finishPackageASTTQuery.hook.ts +0 -21
  186. package/src/hooks/Astt/Asgt/mutate/postMissingProductsASTTQuery.hook.ts +0 -21
  187. package/src/hooks/Astt/Asgt/mutate/postReprocessASTTQuery.hook.ts +0 -20
  188. package/src/hooks/Astt/Asgt/mutate/postRfidASGTMutateQuery.hook.ts +0 -28
  189. package/src/hooks/Astt/Asgt/mutate/postTransferDocumentsASTTMutateQuery.hook.ts +0 -23
  190. package/src/hooks/Astt/Asgt/mutate/putTransferDocumentsStateASTTMutateQuery.hook.ts +0 -21
  191. package/src/hooks/Astt/Asgt/mutate/removeProductASTTQuery.hook.ts +0 -15
  192. package/src/hooks/Astt/Asgt/mutate/restartProductASTTQuery.hook.ts +0 -22
  193. package/src/hooks/Astt/get/getBarcodesListingByPackageQuery.hook.ts +0 -14
  194. package/src/hooks/Astt/get/getBarcodesListingQuery.hook.ts +0 -13
  195. package/src/hooks/Astt/get/getBarcodesPrintQuery.hook.ts +0 -12
  196. package/src/hooks/Astt/get/getDocumentsFindByIdQuery.hook.ts +0 -12
  197. package/src/hooks/Astt/get/getManualPackagesListQuery.hook.ts +0 -20
  198. package/src/hooks/Astt/get/getProductsListingQuery.hook.ts +0 -14
  199. package/src/hooks/Astt/get/getReconciliationDocumentsQuery.hook.ts +0 -18
  200. package/src/hooks/Astt/get/getReportsBuilderQuery.hook.ts +0 -12
  201. package/src/hooks/Astt/get/getRfidQuery.hook.ts +0 -23
  202. package/src/hooks/Astt/get/getTransferAllProductsQuery.hook.ts +0 -25
  203. package/src/hooks/Astt/get/getTransferDocumentsByIdQuery.hook.ts +0 -12
  204. package/src/hooks/Astt/get/getTransferDocumentsByPackageQuery.hook.ts +0 -13
  205. package/src/hooks/Astt/get/getTransferDocumentsPackagesQuery.hook.ts +0 -23
  206. package/src/hooks/Astt/get/getTransferDocumentsQuery.hook.ts +0 -27
  207. package/src/hooks/Astt/get/getTransferReportDiff.hook.ts +0 -17
  208. package/src/hooks/Astt/get/getTransferStatesQuery.hook.ts +0 -10
  209. package/src/hooks/Astt/mutate/deleteManualPackageQuery.hook.ts +0 -23
  210. package/src/hooks/Astt/mutate/notifyMissingProductsQuery.hook.ts +0 -36
  211. package/src/hooks/Astt/mutate/postAsttActionsQuery.hook.ts +0 -18
  212. package/src/hooks/Astt/mutate/postManualPackageQuery.hook.ts +0 -18
  213. package/src/hooks/Astt/mutate/postManualTransferQuery.hook.ts +0 -16
  214. package/src/hooks/Astt/mutate/postMatchingPackageQuery.hook.ts +0 -22
  215. package/src/hooks/Astt/mutate/postTransferDocumentsMutateQuery.hook.ts +0 -23
  216. package/src/hooks/Astt/mutate/putTransferDocumentFinishQuery.hook.ts +0 -21
  217. package/src/hooks/Astt/mutate/putTransferDocumentsPartiallyQuery.hook.ts +0 -21
  218. package/src/hooks/Astt/mutate/putTransferDocumentsStateMutateQuery.hook.ts +0 -21
  219. package/src/hooks/Astt/mutate/updateDocumentIdQuery.hook.ts +0 -23
  220. package/src/hooks/Astt/mutate/updatePackageIdQuery.hook.ts +0 -25
  221. package/src/hooks/AsvProduct/get/getProductsByRefQuery.hook.ts +0 -23
  222. package/src/hooks/AsvProduct/get/getProductsByStoreQuery.hook.ts +0 -29
  223. package/src/hooks/AsvProduct/get/getProductsStockDetailsQuery.hook.ts +0 -21
  224. package/src/hooks/BigWin/get/getBwgAllEmployeesQuery.hook.ts +0 -29
  225. package/src/hooks/BigWin/get/getBwgBackOfficeQuery.hook.ts +0 -29
  226. package/src/hooks/BigWin/get/getMonthsListQuery.hook.ts +0 -10
  227. package/src/hooks/BigWin/others/importABWGQuery.hook.ts +0 -20
  228. package/src/hooks/BigWin/others/importRegulationQuery.hook.ts +0 -15
  229. package/src/hooks/BigWin/others/publishMonthsEmployeeQuery.hook.ts +0 -19
  230. package/src/hooks/BigWin/others/publishMonthsManagerQuery.hook.ts +0 -19
  231. package/src/hooks/EvaluationCycle/get/useEvaluationCycleIdQuery.hook.ts +0 -13
  232. package/src/hooks/EvaluationCycle/get/useEvaluationCycleQuery.hook.ts +0 -29
  233. package/src/hooks/EvaluationCycle/mutate/useEvaluationCycleMutateQuery.hook.ts +0 -17
  234. package/src/hooks/EvaluationCycle/others/activateEvaluationCycleQuery.hook.ts +0 -15
  235. package/src/hooks/EvaluationCycle/others/cancelEvaluationCycleQuery.hook.ts +0 -15
  236. package/src/hooks/EvaluationCycle/others/deleteEvaluationCycleQuery.hook.ts +0 -15
  237. package/src/hooks/EvaluationCycle/others/finishEvaluationCycleQuery.hook.ts +0 -15
  238. package/src/hooks/OSUA/MIMO/get/getIntegrationByName.hook.ts +0 -19
  239. package/src/hooks/OSUA/MIMO/get/getProductIntegrationHistory.hook.ts +0 -25
  240. package/src/hooks/OSUA/MIMO/get/useErrorHistory.hook.ts +0 -21
  241. package/src/hooks/OSUA/MIMO/get/useIntegrationDataQuery.hook.ts +0 -15
  242. package/src/hooks/OSUA/MIMO/mutate/postDagsAdjustStock.hook.ts +0 -13
  243. package/src/hooks/OSUA/MIMO/mutate/postIntegrationDag.hook.ts +0 -18
  244. package/src/hooks/OSUA/MIMO/mutate/postProductVendusIntegration.hook.ts +0 -15
  245. package/src/hooks/OSUA/MIMO/mutate/updateErrorHistory.hook.ts +0 -25
  246. package/src/hooks/OSUA/MIMO/mutate/updateIntegrationProcess.hook.ts +0 -30
  247. package/src/hooks/OSUA/get/documentos/getGngDocumentos.hook.ts +0 -28
  248. package/src/hooks/OSUA/get/documentos/getSitooDocumentos.hook.ts +0 -21
  249. package/src/hooks/OSUA/get/eventos/getSitooErrorEvents.hook.ts +0 -30
  250. package/src/hooks/OSUA/get/faqs/getFaqsQuery.hook.ts +0 -33
  251. package/src/hooks/OSUA/get/orders/getOrderDocuments.hook.ts +0 -21
  252. package/src/hooks/OSUA/get/queue/getQueues.hook.ts +0 -15
  253. package/src/hooks/OSUA/get/queue/getQueuesMessages.hook.ts +0 -28
  254. package/src/hooks/OSUA/get/vouchers/getGngVoucher.hook.ts +0 -21
  255. package/src/hooks/OSUA/get/vouchers/getOsuaVouchersQuery.hook.ts +0 -27
  256. package/src/hooks/OSUA/get/vouchers/getSalesNumberOsua.hook.ts +0 -26
  257. package/src/hooks/OSUA/get/vouchers/getSitooVouchers.hook.ts +0 -22
  258. package/src/hooks/OSUA/get/vouchers/getVoucherIntegrationRequestStatus.hook.ts +0 -23
  259. package/src/hooks/OSUA/mutate/activateOsuaVoucherQuery.hook.ts +0 -24
  260. package/src/hooks/OSUA/mutate/postCreateIntegrationRequest.hook.ts +0 -28
  261. package/src/hooks/OSUA/mutate/postEventsRep.hook.ts +0 -16
  262. package/src/hooks/OSUA/mutate/postQueuesMessages.hook.ts +0 -21
  263. package/src/hooks/OSUA/mutate/postVoucher.hook.ts +0 -16
  264. package/src/hooks/OSUA/mutate/putBalanceVouchers.hook.ts +0 -25
  265. package/src/hooks/OSUA/mutate/useSetIntegrationToFinished.hook.ts +0 -21
  266. package/src/hooks/Orch/get/getAuth0ConfigQuery.hook.ts +0 -11
  267. package/src/hooks/Orch/get/getInstanceByIdQuery.hook.ts +0 -14
  268. package/src/hooks/Orch/get/getInstancesQuery.hook.ts +0 -27
  269. package/src/hooks/Orch/get/getMacrosInstancesQuery.hook.ts +0 -19
  270. package/src/hooks/Orch/get/getMacrosQuery.hook.ts +0 -27
  271. package/src/hooks/Orch/get/getMacrosUserQuery.hook.ts +0 -11
  272. package/src/hooks/Orch/get/getMonitoringComponents.hook.ts +0 -29
  273. package/src/hooks/Orch/others/reprocessingInstanceQuery.hook.ts +0 -14
  274. package/src/hooks/Orch/others/runMacrosQuery.hook.ts +0 -23
  275. package/src/hooks/Orch/others/stopInstanceQuery.hook.ts +0 -16
  276. package/src/hooks/Orch/others/updateMacroStatusQuery.hook.ts +0 -23
  277. package/src/hooks/Others/Vacation/get/getVacationPlanQuery.hook.ts +0 -20
  278. package/src/hooks/Others/Vacation/get/getVacationTemplateQuery.hook.ts +0 -11
  279. package/src/hooks/Others/Vacation/others/aproveVacationPlanQuery.hook.ts +0 -23
  280. package/src/hooks/Others/Vacation/others/postVacationPlanQuery.hook.ts +0 -20
  281. package/src/hooks/Others/Vacation/others/rejectVacationPlanQuery.hook.ts +0 -25
  282. package/src/hooks/Others/changePasswordQuery.hook.ts +0 -21
  283. package/src/hooks/Others/editAllBellNotificationsStatusQuery.hook.ts +0 -19
  284. package/src/hooks/Others/editBellNotificationsStatusQuery.hook.ts +0 -22
  285. package/src/hooks/Others/editFieldsByBulkQuery.hook.ts +0 -15
  286. package/src/hooks/Others/getBellNotificationsQuery.hook.ts +0 -28
  287. package/src/hooks/Others/getNotificationTitleQuery.hook.ts +0 -19
  288. package/src/hooks/Others/getRegulationQuery.hook.ts +0 -14
  289. package/src/hooks/Others/getUserEmailStatusQuery.hook.ts +0 -21
  290. package/src/hooks/Others/getWeeklyWorkloadQuery.hook.ts +0 -23
  291. package/src/hooks/Others/oneSignalUserQuery.hook.ts +0 -14
  292. package/src/hooks/Others/postCheckoutsMutateQuery.hook.ts +0 -15
  293. package/src/hooks/Others/postUserAuthenticationQuery.hook.ts +0 -19
  294. package/src/hooks/Others/postVerifyImageQuery.hook.ts +0 -15
  295. package/src/hooks/Others/unblockUserQuery.hook.ts +0 -14
  296. package/src/hooks/Others/useApplicationDataQuery.hook.ts +0 -10
  297. package/src/hooks/Others/useContractStatesQuery.hook.ts +0 -15
  298. package/src/hooks/Others/useCountriesQuery.hook.ts +0 -15
  299. package/src/hooks/Others/useCreateNotification.hook.ts +0 -24
  300. package/src/hooks/Others/useCustomersQuery.hook.ts +0 -40
  301. package/src/hooks/Others/useJobTitlesQuery.hook.ts +0 -17
  302. package/src/hooks/Others/useRegulationQuery.hook.ts +0 -24
  303. package/src/hooks/Others/useTermNotificationQuery.hook.ts +0 -11
  304. package/src/hooks/Questionnaire/get/useQuestionnaireIdQuery.hook.ts +0 -13
  305. package/src/hooks/Questionnaire/get/useQuestionnaireQuery.hook.ts +0 -29
  306. package/src/hooks/Questionnaire/mutate/useQuestionnaireMutateQuery.hook.ts +0 -17
  307. package/src/hooks/Questionnaire/others/activateQuestionnaireQuery.hook.ts +0 -15
  308. package/src/hooks/Questionnaire/others/cancelQuestionnaireQuery.hook.ts +0 -15
  309. package/src/hooks/Questionnaire/others/deleteQuestionnaireQuery.hook.ts +0 -15
  310. package/src/hooks/Questionnaire/others/duplicateQuestionnaireQuery.hook.ts +0 -15
  311. package/src/hooks/Questionnaire/others/finishQuestionnaireQuery.hook.ts +0 -15
  312. package/src/hooks/Roles/get/useAllRolesQuery.hook.ts +0 -30
  313. package/src/hooks/Store/getLocationsByUser.hook.ts +0 -37
  314. package/src/hooks/Store/useAllStoreQuery.hook.ts +0 -37
  315. package/src/hooks/Store/useStoreByCodeQuery.hook.ts +0 -21
  316. package/src/hooks/Store/useStoreQuery.ts +0 -13
  317. package/src/hooks/Users/get/getUserAndSupervisorQuery.hook.ts +0 -21
  318. package/src/hooks/Users/get/getUsersReadmissionQuery.hook.ts +0 -27
  319. package/src/hooks/Users/get/useApplicationQuery.hook.ts +0 -29
  320. package/src/hooks/Users/get/useExpUsersAnswersQuery.hook.ts +0 -25
  321. package/src/hooks/Users/get/usePermissionByIdQuery.hook.ts +0 -15
  322. package/src/hooks/Users/get/usePermissionsQuery.hook.ts +0 -29
  323. package/src/hooks/Users/get/useSingleUserIdQuery.hook.ts +0 -15
  324. package/src/hooks/Users/get/useUserIdQuery.hook.ts +0 -14
  325. package/src/hooks/Users/get/useUserListQuery.hook.ts +0 -27
  326. package/src/hooks/Users/get/useUserQuery.hook.ts +0 -31
  327. package/src/hooks/Users/mutate/deletePermissionMutateQuery.hook.ts +0 -15
  328. package/src/hooks/Users/mutate/useSingleUserIdMutateQuery.hook.ts +0 -18
  329. package/src/hooks/Users/mutate/useUpdatePermissionsMutateQuery.hook.ts +0 -17
  330. package/src/hooks/Users/mutate/useUpdateSupervisorMutateQuery.hook.ts +0 -27
  331. package/src/hooks/Users/others/useSingleUserResetPassword.hook.ts +0 -18
  332. package/src/hooks/Users/others/useUserBlockQuery.hook.ts +0 -15
  333. package/src/hooks/Users/others/useUserEmailVerifQuery.hook.ts +0 -15
  334. package/src/hooks/Users/others/useUserResetPassByEmail.hook.ts +0 -14
  335. package/src/hooks/Watson/get/getCloseSession.hook.ts +0 -15
  336. package/src/hooks/Watson/mutate/mutateCloseSession.hook.ts +0 -18
  337. package/src/hooks/Watson/mutate/mutateNotificationRequest.hook.ts +0 -18
  338. package/src/hooks/WidgetPicaPonto/get/getAttendanceIssuesByIdQuery.hook.ts +0 -15
  339. package/src/hooks/WidgetPicaPonto/get/getAttendanceIssuesQuery.hook.ts +0 -27
  340. package/src/hooks/WidgetPicaPonto/get/getCriticaliesQuery.hook.ts +0 -27
  341. package/src/hooks/WidgetPicaPonto/get/getReasonCodesQuery.hook.ts +0 -27
  342. package/src/hooks/WidgetPicaPonto/get/getSchedulesStoresQuery.hook.ts +0 -28
  343. package/src/hooks/WidgetPicaPonto/mutate/useAttendanceIssuesQuery.hook.ts +0 -18
  344. package/src/hooks/index.ts +0 -505
  345. package/src/index.ts +0 -11
  346. package/src/interfaces/ACB.ts +0 -21
  347. package/src/interfaces/ASAECustomer.ts +0 -28
  348. package/src/interfaces/Acls.ts +0 -84
  349. package/src/interfaces/Actions.ts +0 -20
  350. package/src/interfaces/AnalyticsEvaluationCycle.ts +0 -24
  351. package/src/interfaces/AnalyticsUserId.ts +0 -14
  352. package/src/interfaces/Anot.ts +0 -79
  353. package/src/interfaces/Answer.ts +0 -14
  354. package/src/interfaces/AnswerType.ts +0 -22
  355. package/src/interfaces/AnswersUserSupervisor.ts +0 -45
  356. package/src/interfaces/ApplicationsByCategory.ts +0 -19
  357. package/src/interfaces/AstaQuestions.ts +0 -10
  358. package/src/interfaces/AstsStock.ts +0 -17
  359. package/src/interfaces/AstsStockInfo.ts +0 -14
  360. package/src/interfaces/AsttReconciliationDocuments.ts +0 -32
  361. package/src/interfaces/AsvProductsByReference.ts +0 -14
  362. package/src/interfaces/AsvProductsByStore.ts +0 -13
  363. package/src/interfaces/AsvProductsStockDetails.ts +0 -20
  364. package/src/interfaces/Atim.ts +0 -123
  365. package/src/interfaces/AtimScheduling.ts +0 -64
  366. package/src/interfaces/AttendanceIssues.ts +0 -20
  367. package/src/interfaces/Auth0Config.ts +0 -6
  368. package/src/interfaces/BellNotification.ts +0 -17
  369. package/src/interfaces/Brand.ts +0 -5
  370. package/src/interfaces/Bulk.ts +0 -11
  371. package/src/interfaces/Bwg.ts +0 -25
  372. package/src/interfaces/Cart.ts +0 -14
  373. package/src/interfaces/Checkout.ts +0 -15
  374. package/src/interfaces/Configuration.ts +0 -8
  375. package/src/interfaces/ContractStates.ts +0 -7
  376. package/src/interfaces/Countries.ts +0 -10
  377. package/src/interfaces/CreateNotification.ts +0 -18
  378. package/src/interfaces/Customer.ts +0 -23
  379. package/src/interfaces/CustomerHistory.ts +0 -11
  380. package/src/interfaces/CustomerVoucher.ts +0 -12
  381. package/src/interfaces/Employee.ts +0 -18
  382. package/src/interfaces/EvaluationCycle.ts +0 -34
  383. package/src/interfaces/ExpUsersAnswers.ts +0 -16
  384. package/src/interfaces/FlowExecution.ts +0 -33
  385. package/src/interfaces/FlowList.ts +0 -32
  386. package/src/interfaces/GetMonths.ts +0 -8
  387. package/src/interfaces/Inspection.ts +0 -22
  388. package/src/interfaces/Instances.ts +0 -25
  389. package/src/interfaces/JobTitles.ts +0 -7
  390. package/src/interfaces/MIMO.ts +0 -19
  391. package/src/interfaces/MacroInstance.ts +0 -11
  392. package/src/interfaces/Macros.ts +0 -19
  393. package/src/interfaces/MonitoringComponent.ts +0 -6
  394. package/src/interfaces/NotificationTitle.ts +0 -8
  395. package/src/interfaces/OSUA.ts +0 -363
  396. package/src/interfaces/Permissions.ts +0 -16
  397. package/src/interfaces/PriceChange.ts +0 -7
  398. package/src/interfaces/Product.ts +0 -17
  399. package/src/interfaces/ProductsHierarchies.ts +0 -6
  400. package/src/interfaces/ProductsPickedTransfers.ts +0 -13
  401. package/src/interfaces/Questionnaire.ts +0 -39
  402. package/src/interfaces/ReasonCodes.ts +0 -9
  403. package/src/interfaces/ReportBuilder.ts +0 -5
  404. package/src/interfaces/ResponseList.ts +0 -7
  405. package/src/interfaces/Responses.ts +0 -50
  406. package/src/interfaces/Rfid.ts +0 -10
  407. package/src/interfaces/Roles.ts +0 -5
  408. package/src/interfaces/Store.ts +0 -35
  409. package/src/interfaces/TagsFlow.ts +0 -5
  410. package/src/interfaces/Template.ts +0 -33
  411. package/src/interfaces/TermNotification.ts +0 -6
  412. package/src/interfaces/TimeKeeping.ts +0 -7
  413. package/src/interfaces/TransferAllProducts.ts +0 -39
  414. package/src/interfaces/TransferDocumentState.ts +0 -5
  415. package/src/interfaces/TransferDocuments.ts +0 -62
  416. package/src/interfaces/TransferPackage.ts +0 -19
  417. package/src/interfaces/TransferPickProducts.ts +0 -34
  418. package/src/interfaces/TransferReportDiff.ts +0 -9
  419. package/src/interfaces/TransferStates.ts +0 -8
  420. package/src/interfaces/User.ts +0 -75
  421. package/src/interfaces/UserAuthentication.ts +0 -7
  422. package/src/interfaces/UserEmailStatus.ts +0 -14
  423. package/src/interfaces/VacationPlan.ts +0 -13
  424. package/src/interfaces/VerifyImage.ts +0 -49
  425. package/src/interfaces/VerifyUser.ts +0 -5
  426. package/src/interfaces/Watson.ts +0 -76
  427. package/src/interfaces/Workload.ts +0 -8
  428. package/src/interfaces/index.ts +0 -81
  429. package/src/services/ApiService/index.ts +0 -185
  430. package/src/services/InitService/index.ts +0 -7
  431. package/src/services/index.ts +0 -3
  432. package/src/types/Global.d.ts +0 -4
  433. package/tsconfig.json +0 -24
  434. package/vite.config.js +0 -49
@@ -0,0 +1,4780 @@
1
+ !function(){"use strict";try{if("undefined"!=typeof document){var o=document.createElement("style");o.appendChild(document.createTextNode(":root{--primary-color: red;--white-color: white;--grad-bg-button-color: #DADADA;--button-border-color: #707070;--button-color: #37383A;--customer-icon-color: #63B299;--default-background-image-color: #D9D9D9;--field-border-color: #D5D8D7;--page-bg-color: #F9F9F9;--page-border-color: #CECECE;--page-footer-bg-color: #DEDEDE;--app-footer-bg-color: #2C2D2E;--app-footer-color: #F5F6F7;--app-header-bg-1-color: #F7F7F7;--app-header-bg-2-color: #E3E3E3;--app-header-bg-3-color: #797979;--app-header-bt-border-color: #090909;--page-header-bg-color: #282c34;--success-color: #64B298;--error-color: #E05151;--disabled-input: #E8E8E8;--job-title-bg: #A83D3D;--job-date-info-bg: #E0F0EA;--job-date-edit-bg: #F0F0F0;--header-border-color: #C7CAC9;--grey: #E6E6E6;--active-button-color: #35779D;--sf-pro: normal normal bold 12px/14px SF Pro Text;--delete-bg: #E15151;--color-black: #2c2d2e;--color-black-rgb: 44, 45, 46;--color-white: #FFFFFF;--color-white-rgb: 255, 255, 255;--color-orange: #FF674C;--color-orange-rgb: 255, 103, 76;--color-blue: #09168B;--color-blue-rgb: 9, 22, 139;--color-grey-light: #D9D9D9;--color-grey-light-rgb: 217, 217, 217;--color-grey: #C7CAC9;--color-grey-rgb: 199, 202, 201;--color-grey-dark: #797979;--color-grey-dark-rgb: 121, 121, 121;--color-warning-400: #E36262;--color-warning-500: #E05151;--color-confirmation-400: #73b9a2;--color-confirmation-600: #64B298;--font-family-primary: SF Pro;--font-weight-light: 300;--font-weight-regular: 400;--font-weight-medium: 500;--font-weight-semibold: 600;--font-weight-bold: 700;--font-style-normal: normal;--font-style-italic: italic;--font-size-body-1: 10px;--font-size-body-2: 12px;--font-size-body-3: 14px;--font-size-body-4: 16px;--font-size-body-5: 18px;--font-size-body-6: 20px;--font-size-h1: 46px;--font-size-h2: 40px;--font-size-h3: 36px;--font-size-h4: 30px;--font-size-h5: 24px;--font-size-body-base: var(--font-size-body-4);--font-size-label: var(--font-size-body-3);--button-default-background: var(--color-orange);--button-default-text-color: var(--color-white);--button-default-background-hover-color: rgba(var(--color-orange-rgb), .9);--button-default-text-hover-color: var(--color-white);--button-default-background-focus-color: var(--color-grey-dark);--button-default-text-focus-color: rgba(var(--color-white-rgb), .8);--button-style-1-background: var(--color-black);--button-style-1-text-color: var(--color-white);--button-style-1-background-hover-color: rgba(var(--color-black-rgb), .9);--button-style-1-text-hover-color: var(--color-white);--button-style-1-background-focus-color: var(--color-grey-dark);--button-style-1-text-focus-color: rgba(var(--color-white-rgb), .8);--button-disabled-background-color: var(--color-grey-dark);--button-disabled-default-text-color: var(--color-white);--link-color: var(--color-orange);--link-hover-color: var(--color-black);--link-focus-color: rgba(var(--color-orange), .9);--link-disabled-color: rgba(var(--color-grey), .2);--transition-slow: .2s;--transition: .6s;--transition-fast: 1s}body.a2aiStyle{--primary-color: red;--white-color: white;--grad-bg-button-color: #DADADA;--button-border-color: #707070;--button-color: #37383A;--customer-icon-color: #63B299;--default-background-image-color: #D9D9D9;--field-border-color: #D5D8D7;--page-bg-color: #F9F9F9;--page-border-color: #CECECE;--page-footer-bg-color: #DEDEDE;--app-footer-bg-color: #2C2D2E;--app-footer-color: #F5F6F7;--app-header-bg-1-color: #F7F7F7;--app-header-bg-2-color: #E3E3E3;--app-header-bg-3-color: #797979;--app-header-bt-border-color: #090909;--page-header-bg-color: #282c34;--success-color: #64B298;--error-color: #E05151;--disabled-input: #E8E8E8;--job-title-bg: #A83D3D;--job-date-info-bg: #E0F0EA;--job-date-edit-bg: #F0F0F0;--header-border-color: #C7CAC9;--grey: #E6E6E6;--active-button-color: #35779D;--sf-pro: normal normal bold 12px/14px SF Pro Text;--delete-bg: #E15151;--color-black: #2c2d2e;--color-black-rgb: 44, 45, 46;--color-white: #FFFFFF;--color-white-rgb: 255, 255, 255;--color-orange: #A9D046;--color-orange-rgb: 169, 208, 70;--color-blue: #09168B;--color-blue-rgb: 9, 22, 139;--color-purple-blue: #324A6D;--color-purple-blue-rgb: 50, 74, 109;--color-dark-blue: #1C244B;--color-dark-blue-rgb: 28, 36, 75;--color-grey-light: #D9D9D9;--color-grey-light-rgb: 217, 217, 217;--color-grey: #C7CAC9;--color-grey-rgb: 199, 202, 201;--color-grey-dark: #797979;--color-grey-dark-rgb: 121, 121, 121;--color-warning-400: #E36262;--color-warning-500: #E05151;--color-confirmation-400: #73b9a2;--color-confirmation-600: #64B298;--font-family-primary: SF Pro;--font-weight-light: 300;--font-weight-regular: 400;--font-weight-medium: 500;--font-weight-semibold: 600;--font-weight-bold: 700;--font-style-normal: normal;--font-style-italic: italic;--font-size-body-1: 10px;--font-size-body-2: 12px;--font-size-body-3: 14px;--font-size-body-4: 16px;--font-size-body-5: 18px;--font-size-body-6: 20px;--font-size-h1: 46px;--font-size-h2: 40px;--font-size-h3: 36px;--font-size-h4: 30px;--font-size-h5: 24px;--font-size-body-base: var(--font-size-body-4);--font-size-label: var(--font-size-body-3);--button-default-background: var(--color-orange);--button-default-text-color: var(--color-white);--button-default-background-hover-color: rgba(var(--color-orange-rgb), .9);--button-default-text-hover-color: var(--color-white);--button-default-background-focus-color: var(--color-orange-rgb);--button-default-text-focus-color: rgba(var(--color-white-rgb), .8);--button-style-1-background: var(--color-black);--button-style-1-text-color: var(--color-white);--button-style-1-background-hover-color: rgba(var(--color-black-rgb), .9);--button-style-1-text-hover-color: var(--color-white);--button-style-1-background-focus-color: var(--color-grey-dark);--button-style-1-text-focus-color: rgba(var(--color-white-rgb), .8);--button-disabled-background-color: var(--color-grey);--button-disabled-default-text-color: var(--color-white);--link-color: var(--color-orange);--link-hover-color: var(--color-black);--link-focus-color: rgba(var(--color-orange), .9);--link-disabled-color: rgba(var(--color-grey), .2);--transition-slow: .2s;--transition: .6s;--transition-fast: 1s}")),document.head.appendChild(o)}}catch(r){console.error("vite-plugin-css-injected-by-js",r)}}();
2
+ import "whatwg-fetch";
3
+ import { jsxs, jsx } from "react/jsx-runtime";
4
+ import React from "react";
5
+ import { QueryClient, useQuery, QueryClientProvider, useQueryClient, useMutation, useInfiniteQuery } from "@tanstack/react-query";
6
+ import { useSearchParams } from "react-router-dom";
7
+ import dayjs from "dayjs";
8
+ const appConfig = {};
9
+ const initService = (configuration) => {
10
+ Object.assign(appConfig, configuration);
11
+ };
12
+ const get = (path, params) => {
13
+ return buildApiRequest(`${path}?${buildParams(params || {})}`, "GET");
14
+ };
15
+ const getAuth0 = (path, params) => {
16
+ return buildApiRequestForAuth0(`${path}?${buildParams(params || {})}`, "GET");
17
+ };
18
+ const getBasic = (path, params) => {
19
+ return buildApiRequestForBasic(`${path}?${buildParams(params || {})}`, "GET");
20
+ };
21
+ const putAuth0 = (path, params, body, bodyType) => {
22
+ return buildApiRequestForAuth0(`${path}${buildParams(params || {})}`, "PUT", body, bodyType);
23
+ };
24
+ const patchAuth0 = (path, params, body, bodyType) => {
25
+ return buildApiRequestForAuth0(`${path}${buildParams(params || {})}`, "PATCH", body, bodyType);
26
+ };
27
+ const postAuth0 = (path, params, body, bodyType) => {
28
+ return buildApiRequestForAuth0(`${path}${buildParams(params || {})}`, "POST", body, bodyType);
29
+ };
30
+ const toDeleteAuth0 = (path, params, body) => {
31
+ return buildApiRequestForAuth0(`${path}${buildParams(params || {})}`, "DELETE", body);
32
+ };
33
+ const post = (path, body) => {
34
+ return buildApiRequest(path, "POST", body);
35
+ };
36
+ const postWithParameters = (path, params, body) => {
37
+ return buildApiRequest(`${path}${buildParams(params || {})}`, "POST", body);
38
+ };
39
+ const putWithParameters = (path, params, body) => {
40
+ return buildApiRequest(`${path}${buildParams(params || {})}`, "PUT", body);
41
+ };
42
+ const put = (path, body) => {
43
+ return buildApiRequest(path, "PUT", body);
44
+ };
45
+ const patch = (path, body) => {
46
+ return buildApiRequest(path, "PATCH", body);
47
+ };
48
+ const toDelete = (path, body) => {
49
+ return buildApiRequest(path, "DELETE", body);
50
+ };
51
+ const buildParams = (params) => {
52
+ return Object.entries(params).reduce((c, [key, value]) => [...c, `${key}=${value}`], []).join("&");
53
+ };
54
+ const buildApiRequest = (path, method = "GET", data, bodyType) => {
55
+ const requestUri = buildPath(path);
56
+ const headers = {
57
+ Authorization: appConfig.token
58
+ };
59
+ let body;
60
+ if (["POST", "PUT", "PATCH"].includes(method)) {
61
+ {
62
+ headers["Content-Type"] = "application/json";
63
+ body = JSON.stringify(data);
64
+ }
65
+ }
66
+ return fetch(requestUri, {
67
+ method,
68
+ headers,
69
+ body
70
+ }).then((response) => {
71
+ if (response.status >= 200 && response.status <= 300) {
72
+ return response.json();
73
+ }
74
+ return response.json().then((data2) => Promise.reject(data2));
75
+ });
76
+ };
77
+ const buildApiRequestForAuth0 = (path, method = "GET", data, bodyType) => {
78
+ const requestUri = buildPath(path);
79
+ const headers = {
80
+ Authorization: appConfig.tokenAuth0 ? `Bearer ${appConfig.tokenAuth0}` : void 0
81
+ };
82
+ let body;
83
+ if (["POST", "PUT", "PATCH"].includes(method)) {
84
+ if (bodyType === "formdata") {
85
+ body = data;
86
+ } else {
87
+ headers["Content-Type"] = "application/json";
88
+ body = JSON.stringify(data);
89
+ }
90
+ }
91
+ return fetch(requestUri, {
92
+ method,
93
+ headers,
94
+ body
95
+ }).then((response) => {
96
+ if (response.status >= 200 && response.status <= 300) {
97
+ return response.json();
98
+ }
99
+ return response.json().then((data2) => Promise.reject(data2));
100
+ });
101
+ };
102
+ const buildApiRequestForBasic = (path, method = "GET", data, bodyType) => {
103
+ const requestUri = buildPath(path);
104
+ const headers = {
105
+ Authorization: appConfig.basic ? `Basic ${appConfig.basic}` : void 0
106
+ };
107
+ let body;
108
+ if (["POST", "PUT", "PATCH"].includes(method)) {
109
+ {
110
+ headers["Content-Type"] = "application/json";
111
+ body = JSON.stringify(data);
112
+ }
113
+ }
114
+ return fetch(requestUri, {
115
+ method,
116
+ headers,
117
+ body
118
+ }).then((response) => {
119
+ if (response.status >= 200 && response.status <= 300) {
120
+ return response.json();
121
+ }
122
+ return response.json().then((data2) => Promise.reject(data2));
123
+ });
124
+ };
125
+ const buildPath = (path) => {
126
+ return `${appConfig.ApiHost}${appConfig.ApiPath}${path}`;
127
+ };
128
+ const queryClient = new QueryClient({
129
+ defaultOptions: {
130
+ queries: {
131
+ refetchOnWindowFocus: false,
132
+ suspense: true
133
+ }
134
+ }
135
+ });
136
+ const FixedStore = "C62A59C7-DE0C-4EF7-9A5F-1929A4F93F46";
137
+ const useStoreQuery = ({ id, ...options }) => {
138
+ return useQuery(["STORE_QUERY", id], () => get(`/Franchise/Locations/${id || FixedStore}`), options);
139
+ };
140
+ const StoreContext = React.createContext(null);
141
+ const StoreProvider = ({ children, disableInitialStoreRequest }) => {
142
+ const [params] = useSearchParams();
143
+ const { data: store } = useStoreQuery({ id: params.get("storeId"), enabled: !disableInitialStoreRequest });
144
+ return /* @__PURE__ */ jsxs(StoreContext.Provider, { value: store, children: [
145
+ " ",
146
+ children,
147
+ " "
148
+ ] });
149
+ };
150
+ const SharedContextProvider = ({ children, disableInitialStoreRequest }) => {
151
+ return /* @__PURE__ */ jsx(QueryClientProvider, { client: queryClient, children: /* @__PURE__ */ jsx(StoreProvider, { disableInitialStoreRequest, children }) });
152
+ };
153
+ const useStoreByCodeQuery = ({ code, shouldFetch, ...options }) => {
154
+ return useQuery(
155
+ ["STORE_CODE_QUERY", code, shouldFetch],
156
+ () => get("/Franchise/Locations/findByCode", {
157
+ pCode: code
158
+ }),
159
+ {
160
+ enabled: shouldFetch,
161
+ ...options
162
+ }
163
+ );
164
+ };
165
+ const useAllStoreQuery = ({ records, sortBy, sortDirection, tags, advancedTags, filter, page, ...options }) => {
166
+ const pQueryValue = advancedTags && filter ? `${advancedTags} AND ${filter}` : advancedTags ? advancedTags : filter ? filter : null;
167
+ return useQuery(
168
+ ["STORE_QUERY", records, sortBy, sortDirection, tags, advancedTags, filter, page, options],
169
+ () => get(`/Franchise/Locations`, {
170
+ pPage: page || 1,
171
+ pRecords: records || 50,
172
+ pSortBy: sortBy,
173
+ pSortDirection: sortDirection,
174
+ pTerms: tags,
175
+ ...pQueryValue ? { pQuery: pQueryValue } : {}
176
+ }),
177
+ options
178
+ );
179
+ };
180
+ const getLocationsByUserQuery = ({ records, sortBy, sortDirection, tags, advancedTags, filter, page, ...options }, userId) => {
181
+ const pQueryValue = advancedTags && filter ? `${advancedTags} AND ${filter}` : advancedTags ? advancedTags : filter ? filter : null;
182
+ return useQuery(
183
+ ["LOCATIONS_BY_USER_QUERY", records, sortBy, sortDirection, tags, advancedTags, filter, page, userId, options],
184
+ () => getAuth0(`/AACP/Users/${userId}/Locations`, {
185
+ pPage: page || 1,
186
+ pRecords: records || 50,
187
+ pSortBy: sortBy,
188
+ pSortDirection: sortDirection,
189
+ pTerms: tags,
190
+ ...pQueryValue ? { pQuery: pQueryValue } : {}
191
+ }),
192
+ options
193
+ );
194
+ };
195
+ const useEvaluationCycleIdQueryHook = (evaluationId) => {
196
+ return useQuery(
197
+ ["EVALUATION_CYCLE_ID_QUERY", evaluationId],
198
+ () => getAuth0(`/APE/EvaluationCycle/${evaluationId}`),
199
+ {
200
+ enabled: !!evaluationId
201
+ }
202
+ );
203
+ };
204
+ const useEvaluationCycleMutateHook = () => {
205
+ const queryClient2 = useQueryClient();
206
+ return useMutation((data) => {
207
+ return data.Id ? putAuth0(`/APE/EvaluationCycle/${data.Id}`, void 0, data) : postAuth0("/APE/EvaluationCycle", void 0, data);
208
+ }, {
209
+ onSuccess: (data) => {
210
+ queryClient2.setQueryData(
211
+ ["EVALUATION_CYCLE_ID_QUERY"],
212
+ data
213
+ );
214
+ }
215
+ });
216
+ };
217
+ const activateEvaluationCycleQueryHook = () => {
218
+ const queryClient2 = useQueryClient();
219
+ return useMutation((data) => {
220
+ return putAuth0(`/APE/EvaluationCycle/Activate/${data.Id}`, void 0, data);
221
+ }, {
222
+ onSuccess: (data) => {
223
+ queryClient2.setQueryData(
224
+ ["EVALUATION_CYCLE_ID_QUERY"],
225
+ data
226
+ );
227
+ }
228
+ });
229
+ };
230
+ const deleteEvaluationCycleMutateHook = () => {
231
+ const queryClient2 = useQueryClient();
232
+ return useMutation((data) => {
233
+ return toDeleteAuth0(`/APE/EvaluationCycle?pId=${data.Id}`);
234
+ }, {
235
+ onSuccess: () => {
236
+ queryClient2.invalidateQueries(
237
+ ["EVALUATION_CYCLE_QUERY"]
238
+ );
239
+ }
240
+ });
241
+ };
242
+ const useEvaluationCycleQueryHook = ({ tags, page, records, sortBy, sortDirection, query }) => {
243
+ return useQuery(
244
+ ["EVALUATION_CYCLE_QUERY", tags, page, records, sortBy, sortDirection, query],
245
+ () => getAuth0("/APE/EvaluationCycle", {
246
+ pPage: page || 1,
247
+ pRecords: records || 50,
248
+ pSortBy: sortBy || "Type",
249
+ pSortDirection: sortDirection || "asc",
250
+ pTerms: tags,
251
+ pQuery: query
252
+ }),
253
+ {
254
+ keepPreviousData: true
255
+ }
256
+ );
257
+ };
258
+ const cancelEvaluationCycleQueryHook = () => {
259
+ const queryClient2 = useQueryClient();
260
+ return useMutation((data) => {
261
+ return putAuth0(`/APE/EvaluationCycle/Cancel/${data.Id}`, void 0, data);
262
+ }, {
263
+ onSuccess: (data) => {
264
+ queryClient2.setQueryData(
265
+ ["EVALUATION_CYCLE_ID_QUERY"],
266
+ data
267
+ );
268
+ }
269
+ });
270
+ };
271
+ const finishEvaluationCycleQueryHook = () => {
272
+ const queryClient2 = useQueryClient();
273
+ return useMutation((data) => {
274
+ return putAuth0(`/APE/EvaluationCycle/Finish/${data.Id}`, void 0, data);
275
+ }, {
276
+ onSuccess: (data) => {
277
+ queryClient2.setQueryData(
278
+ ["EVALUATION_CYCLE_ID_QUERY"],
279
+ data
280
+ );
281
+ }
282
+ });
283
+ };
284
+ const useQuestionnaireQueryHook = ({ tags, page, records, queryField, sortBy, sortDirection }) => {
285
+ return useQuery(
286
+ ["QUESTIONNAIRE_QUERY", tags, page, records, sortBy, sortDirection, queryField],
287
+ () => getAuth0("/APE/Questionnaire", {
288
+ pPage: page || 1,
289
+ pRecords: records || 50,
290
+ pSortBy: sortBy || "Type",
291
+ pSortDirection: sortDirection || "asc",
292
+ pTerms: tags,
293
+ pQuery: queryField
294
+ }),
295
+ {
296
+ keepPreviousData: true
297
+ }
298
+ );
299
+ };
300
+ const deleteQuestionnaireMutateHook = () => {
301
+ const queryClient2 = useQueryClient();
302
+ return useMutation((data) => {
303
+ return toDeleteAuth0(`/APE/Questionnaire?pId=${data.Id}`);
304
+ }, {
305
+ onSuccess: () => {
306
+ queryClient2.invalidateQueries(
307
+ ["QUESTIONNAIRE_QUERY"]
308
+ );
309
+ }
310
+ });
311
+ };
312
+ const duplicateQuestionnaireMutateHook = () => {
313
+ const queryClient2 = useQueryClient();
314
+ return useMutation((data) => {
315
+ return postAuth0(`/APE/Questionnaire/DuplicateQuestionnaire?pId=${data.Id}`);
316
+ }, {
317
+ onSuccess: (data) => {
318
+ queryClient2.setQueryData(
319
+ ["QUESTIONNAIRE_QUERY"],
320
+ data
321
+ );
322
+ }
323
+ });
324
+ };
325
+ const useQuestionnaireMutateHook = () => {
326
+ const queryClient2 = useQueryClient();
327
+ return useMutation((data) => {
328
+ return data.Id ? putAuth0(`/APE/Questionnaire/${data.Id}`, void 0, data) : postAuth0("/APE/Questionnaire", void 0, data);
329
+ }, {
330
+ onSuccess: (data) => {
331
+ queryClient2.setQueryData(
332
+ ["QUESTIONNAIRE_ID_QUERY"],
333
+ data
334
+ );
335
+ }
336
+ });
337
+ };
338
+ const activateQuestionnaireQueryHook = () => {
339
+ const queryClient2 = useQueryClient();
340
+ return useMutation((data) => {
341
+ return putAuth0(`/APE/Questionnaire/Activate/${data.Id}`, void 0, data);
342
+ }, {
343
+ onSuccess: (data) => {
344
+ queryClient2.setQueryData(
345
+ ["QUESTIONNAIRE_ID_QUERY"],
346
+ data
347
+ );
348
+ }
349
+ });
350
+ };
351
+ const useQuestionnaireIdQueryHook = (surveyId) => {
352
+ return useQuery(
353
+ ["QUESTIONNAIRE_ID_QUERY", surveyId],
354
+ () => getAuth0(`/APE/Questionnaire/${surveyId}`),
355
+ {
356
+ enabled: !!surveyId
357
+ }
358
+ );
359
+ };
360
+ const finishQuestionnaireQueryHook = () => {
361
+ const queryClient2 = useQueryClient();
362
+ return useMutation((data) => {
363
+ return putAuth0(`/APE/Answers/FinishQuestionnaire/${data.Id}`, void 0, data);
364
+ }, {
365
+ onSuccess: (data) => {
366
+ queryClient2.setQueryData(
367
+ ["ANSWER_ID_QUERY"],
368
+ data
369
+ );
370
+ }
371
+ });
372
+ };
373
+ const cancelQuestionnaireQueryHook = () => {
374
+ const queryClient2 = useQueryClient();
375
+ return useMutation((data) => {
376
+ return putAuth0(`/APE/Questionnaire/Cancel/${data.Id}`, void 0, data);
377
+ }, {
378
+ onSuccess: (data) => {
379
+ queryClient2.setQueryData(
380
+ ["QUESTIONNAIRE_ID_QUERY"],
381
+ data
382
+ );
383
+ }
384
+ });
385
+ };
386
+ const useUserQueryHook = ({ tags, evaluationId, page, records, queryField, sortBy, sortDirection }) => {
387
+ return useQuery(
388
+ ["USER_QUERY", tags, evaluationId, page, records, queryField],
389
+ () => getAuth0("/APE/Users", {
390
+ pPage: page || 1,
391
+ pRecords: records || 50,
392
+ pSortBy: sortBy || "DisplayName",
393
+ pSortDirection: sortDirection || "asc",
394
+ pTerms: tags,
395
+ pEvaluationCycleId: evaluationId,
396
+ pQuery: queryField
397
+ }),
398
+ {
399
+ keepPreviousData: true
400
+ }
401
+ );
402
+ };
403
+ const useUserListQueryHook = ({ tags, page, records, queryField, sortBy, sortDirection, ...options }) => {
404
+ return useQuery(
405
+ ["USER_LIST_QUERY", tags, page, records, sortBy, sortDirection, queryField, options],
406
+ () => getAuth0("/AACP/Users", {
407
+ pPage: page || 1,
408
+ pRecords: records || 50,
409
+ pSortBy: sortBy || "DisplayName",
410
+ pSortDirection: sortDirection || "asc",
411
+ pTerms: tags,
412
+ pQuery: queryField
413
+ }),
414
+ options
415
+ );
416
+ };
417
+ const useUserBlockQueryHook = () => {
418
+ const queryClient2 = useQueryClient();
419
+ return useMutation((data) => {
420
+ return putAuth0(`/AACP/Users/${data.UserId}/block`);
421
+ }, {
422
+ onSuccess: (data) => {
423
+ queryClient2.setQueryData(
424
+ ["USER_LIST_QUERY"],
425
+ data
426
+ );
427
+ }
428
+ });
429
+ };
430
+ const useUserEmailVerifQueryHook = () => {
431
+ const queryClient2 = useQueryClient();
432
+ return useMutation((data) => {
433
+ return postAuth0(`/AACP/Users/${data.UserId}/sendVerificationEmail`);
434
+ }, {
435
+ onSuccess: (data) => {
436
+ queryClient2.setQueryData(
437
+ ["USER_LIST_QUERY"],
438
+ data
439
+ );
440
+ }
441
+ });
442
+ };
443
+ const useExpUsersAnswersQueryHook = ({ tags, page, records, queryUser }) => {
444
+ return useQuery(
445
+ ["EXP_USERS_ANSWERS_QUERY", tags, page, records, queryUser],
446
+ () => getAuth0("/APE/Analytics/EvaluationCycles/UsersExperimental", {
447
+ pPage: page || 1,
448
+ pRecords: records || 50,
449
+ pTerms: tags,
450
+ pQueryUser: queryUser
451
+ }),
452
+ {
453
+ keepPreviousData: true
454
+ }
455
+ );
456
+ };
457
+ const useUpdateSupervisorMutateQueryHook = ({ evaluationCycleId, userId, supervisorId }) => {
458
+ const queryClient2 = useQueryClient();
459
+ return useMutation((data) => {
460
+ return putAuth0(
461
+ `/APE/EvaluationCycle/UpdateSupervisor?`,
462
+ {
463
+ pEvaluationCycleId: evaluationCycleId,
464
+ pUserId: userId,
465
+ pSupervisor: supervisorId
466
+ },
467
+ data
468
+ );
469
+ }, {
470
+ onSuccess: (data) => {
471
+ queryClient2.setQueryData(
472
+ ["UPDATE_SUPERVISOR"],
473
+ data
474
+ );
475
+ }
476
+ });
477
+ };
478
+ const useSingleUserResetPasswordHook = () => {
479
+ const queryClient2 = useQueryClient();
480
+ return useMutation((data) => {
481
+ return postAuth0(`/AACP/Users/${data.UserId}/resetPassword`);
482
+ }, {
483
+ onSuccess: (data) => {
484
+ queryClient2.setQueryData(["USER_RESET_PASSWORD_QUERY"], data);
485
+ }
486
+ });
487
+ };
488
+ const useSingleUserIdQueryHook = (userId, options) => {
489
+ return useQuery(
490
+ ["SINGLE_USER_ID_QUERY", userId],
491
+ () => getAuth0(`/AACP/Users/${userId}`),
492
+ {
493
+ enabled: !!userId,
494
+ ...options
495
+ }
496
+ );
497
+ };
498
+ const useSingleUserIdMutateQuery = (bodyType) => {
499
+ const queryClient2 = useQueryClient();
500
+ return useMutation((data) => {
501
+ const userId = bodyType === "formdata" ? data.get("UserId") : data.UserId;
502
+ return userId ? putAuth0(`/AACP/Users/${userId}`, void 0, data, bodyType) : postAuth0("/AACP/Users/", void 0, data, bodyType);
503
+ }, {
504
+ onSuccess: (data) => {
505
+ queryClient2.setQueryData(
506
+ ["SINGLE_USER_ID_QUERY"],
507
+ data
508
+ );
509
+ }
510
+ });
511
+ };
512
+ const useUserIdQueryHook = (userId) => {
513
+ return useQuery(
514
+ ["USER_ID_QUERY", userId],
515
+ () => getAuth0(`/APE/Users/${userId}`),
516
+ {
517
+ enabled: !!userId
518
+ }
519
+ );
520
+ };
521
+ const useUserResetPassByEmailHook = () => {
522
+ const queryClient2 = useQueryClient();
523
+ return useMutation((data) => {
524
+ return postAuth0(`/AACP/Users/${data.UserId}/resetPasswordEmail`);
525
+ }, {
526
+ onSuccess: (data) => {
527
+ queryClient2.setQueryData(["USER_RESET_PASSWORD_BY_EMAIL_QUERY"], data);
528
+ }
529
+ });
530
+ };
531
+ const getUserAndSupervisorQueryHook = ({ evaluactionCycle, userId }) => {
532
+ return useQuery(
533
+ ["GET_USER_AND_SUPERVISOR", evaluactionCycle, userId],
534
+ () => getAuth0("/APE/Users/SupervisorAndUser", {
535
+ pEvaluactionCycle: evaluactionCycle,
536
+ pUserId: userId
537
+ }),
538
+ {
539
+ keepPreviousData: true
540
+ }
541
+ );
542
+ };
543
+ const usePermissionsQuery = ({ tags, page, records, queryField, sortBy, sortDirection }) => {
544
+ return useQuery(
545
+ ["PERMISSION_QUERY", tags, page, records, queryField],
546
+ () => getAuth0("/AACP/Permissions", {
547
+ pPage: page,
548
+ pRecords: records,
549
+ pSortBy: sortBy,
550
+ pSortDirection: sortDirection,
551
+ pTerms: tags,
552
+ pQuery: queryField
553
+ }),
554
+ {
555
+ keepPreviousData: true
556
+ }
557
+ );
558
+ };
559
+ const usePermissionsIdMutateQuery = (bodyType) => {
560
+ const queryClient2 = useQueryClient();
561
+ return useMutation((data) => {
562
+ return data.Id ? putAuth0(`/AACP/Permissions/${data.Id}`, void 0, data) : postAuth0("/AACP/Permissions", void 0, data);
563
+ }, {
564
+ onSuccess: (data) => {
565
+ queryClient2.setQueryData(
566
+ ["UPDATE_PERMISSIONS_ID_QUERY"],
567
+ data
568
+ );
569
+ }
570
+ });
571
+ };
572
+ const usePermissionIdQueryHook = (Id, options) => {
573
+ return useQuery(
574
+ ["PERMISSIONS_ID_QUERY", Id],
575
+ () => getAuth0(`/AACP/Permissions/${Id}`),
576
+ {
577
+ enabled: !!Id,
578
+ ...options
579
+ }
580
+ );
581
+ };
582
+ const useApplicationQuery = ({ tags, page, records, queryField, sortBy, sortDirection }) => {
583
+ return useQuery(
584
+ ["APPLICATION_QUERY", tags, page, records, queryField],
585
+ () => getAuth0("/AACP/Permissions/Applications", {
586
+ pPage: page,
587
+ pRecords: records,
588
+ pSortBy: sortBy,
589
+ pSortDirection: sortDirection,
590
+ pTerms: tags,
591
+ pQuery: queryField
592
+ }),
593
+ {
594
+ keepPreviousData: true
595
+ }
596
+ );
597
+ };
598
+ const deletePermissionMutateHook = () => {
599
+ const queryClient2 = useQueryClient();
600
+ return useMutation((data) => {
601
+ return toDeleteAuth0(`/AACP/Permissions/${data.Id}`);
602
+ }, {
603
+ onSuccess: () => {
604
+ queryClient2.invalidateQueries(
605
+ ["DELETE_PERMISSIONS_QUERY"]
606
+ );
607
+ }
608
+ });
609
+ };
610
+ const getUsersReadmissionQueryHook = ({ tags, page, records, queryField, sortBy, sortDirection, ...options }) => {
611
+ return useQuery(
612
+ ["USER_READMISSION_QUERY", tags, page, records, sortBy, sortDirection, queryField, options],
613
+ () => getAuth0("/AACP/Users/Readmission", {
614
+ pPage: page || 1,
615
+ pRecords: records || 50,
616
+ pSortBy: sortBy || "DisplayName",
617
+ pSortDirection: sortDirection || "asc",
618
+ pTerms: tags,
619
+ pQuery: queryField
620
+ }),
621
+ options
622
+ );
623
+ };
624
+ const useAnalyticsEvaluationCyclesQueryHook = ({ pSortDirection, pFilter }) => {
625
+ return useQuery(
626
+ ["ANALYTICS_EVALUATION_CYCLE_QUERY", pSortDirection, pFilter],
627
+ () => getAuth0(`/APE/Analytics/EvaluationCycles`, {
628
+ pPage: 1,
629
+ pRecords: 50,
630
+ pSortBy: pFilter || "Type",
631
+ pSortDirection: pSortDirection || "asc",
632
+ pFilter: pFilter || "Type"
633
+ })
634
+ );
635
+ };
636
+ const useAnalyticsUserIdQueryHook = ({ page, records, userId, sortBy, sortDirection, terms, query, pYear }) => {
637
+ return useQuery(
638
+ ["ANALYTICS_USER_ID_QUERY", page, records, userId, sortBy, sortDirection, terms, query, pYear],
639
+ () => getAuth0(`/APE/Analytics/EvaluationCycles/User/${userId}`, {
640
+ pPage: page || 1,
641
+ pSortBy: sortBy || "Type",
642
+ pSortDirection: sortDirection || "asc",
643
+ pRecords: records || 50,
644
+ pTerms: terms,
645
+ pQuery: query
646
+ // pYear: pYear
647
+ }),
648
+ {
649
+ keepPreviousData: true
650
+ }
651
+ );
652
+ };
653
+ const useAnalyticsQuestionsQueryHook = ({ page, records, id, tags, ...options }) => {
654
+ return useQuery(
655
+ ["ANALYTICS_QUESTIONS_QUERY", page, records, id, tags, options],
656
+ () => getAuth0(`/APE/Analytics/Questions`, {
657
+ pId: id,
658
+ pPage: page || 1,
659
+ pRecords: records || 50,
660
+ pTerms: tags
661
+ }),
662
+ options
663
+ );
664
+ };
665
+ const useAnalyticsSideBarQueryHook = ({ pSortDirection, pFilter }) => {
666
+ return useQuery(
667
+ ["ANALYTICS_SIDE_BAR_QUERY", pSortDirection, pFilter],
668
+ () => getAuth0(`/APE/Analytics/EvaluationCycles/SideBar`, {
669
+ pPage: 1,
670
+ pRecords: 50,
671
+ pSortBy: pFilter || "Type",
672
+ pSortDirection: pSortDirection || "asc",
673
+ pFilter: pFilter || "Type"
674
+ })
675
+ );
676
+ };
677
+ const useAnalyticsUserQueryHook = ({ tags, page, records, filter, sortByUsers, sortBy, sortDirection, queryUsers, query }) => {
678
+ return useQuery(
679
+ ["ANALYTICS_USER_QUERY", tags, page, records, filter, sortByUsers, sortBy, sortDirection, queryUsers, query],
680
+ () => getAuth0("/APE/Analytics/EvaluationCycles/Users/Informations", {
681
+ pPage: page || 1,
682
+ pRecords: records || 50,
683
+ pSortByUsers: sortByUsers || "DisplayName",
684
+ pSortBy: sortBy || "Type",
685
+ pSortDirection: sortDirection || "asc",
686
+ pTerms: filter,
687
+ pTermsUser: tags,
688
+ pQueryUser: queryUsers,
689
+ pQuery: query
690
+ }),
691
+ {
692
+ keepPreviousData: true
693
+ }
694
+ );
695
+ };
696
+ const getArchivedAnalyticsQueryHook = ({ page, records, userId, sortBy, sortDirection, terms, query, pYear }) => {
697
+ return useQuery(
698
+ ["ARCHIVED_ANALYTICS_QUERY", page, records, userId, sortBy, sortDirection, terms, query, pYear],
699
+ () => getAuth0(`/APE/Analytics/GetArchive/${userId}`, {
700
+ pPage: page || 1,
701
+ pSortBy: sortBy || "Type",
702
+ pSortDirection: sortDirection || "asc",
703
+ pRecords: records || 50,
704
+ pTerms: terms,
705
+ pQuery: query
706
+ // pYear: pYear
707
+ }),
708
+ {
709
+ keepPreviousData: true
710
+ }
711
+ );
712
+ };
713
+ const useAnswerIdQueryHook = (answerId) => {
714
+ return useQuery(
715
+ ["ANSWER_ID_QUERY", answerId],
716
+ () => getAuth0(`/APE/Answers/${answerId}`),
717
+ {
718
+ enabled: !!answerId
719
+ }
720
+ );
721
+ };
722
+ const useAnswerMutateHook = ({ pQuestionnaireId, pEvaluationCycleId, pUserId, pTargetUserId }, answerId) => {
723
+ const queryClient2 = useQueryClient();
724
+ return useMutation((data) => {
725
+ return answerId ? putAuth0(`/APE/Answers/${answerId}`, void 0, data) : postAuth0(
726
+ `/APE/Answers?`,
727
+ {
728
+ pQuestionnaireId,
729
+ pEvaluationCycleId,
730
+ pUserId,
731
+ pTargetUserId
732
+ },
733
+ data
734
+ );
735
+ }, {
736
+ onSuccess: (data) => {
737
+ queryClient2.setQueryData(
738
+ ["ANSWER_ID_QUERY"],
739
+ data
740
+ );
741
+ }
742
+ });
743
+ };
744
+ const useAnswersUserSupervisorQuery = ({ evaluationId, userId }) => {
745
+ return useQuery(
746
+ ["ANSWERS_USER_SUPERVISOR_QUERY", evaluationId, userId],
747
+ () => getAuth0("/APE/Answers/UserAndSupervisor", {
748
+ pUserId: userId,
749
+ pEvaluationCycleId: evaluationId
750
+ }),
751
+ {
752
+ keepPreviousData: true
753
+ }
754
+ );
755
+ };
756
+ const openAnswerQueryHook = () => {
757
+ const queryClient2 = useQueryClient();
758
+ return useMutation((data) => {
759
+ return putAuth0(`/APE/Answers/OpenAnswer?`, {
760
+ pAnswerId: data.Id,
761
+ pUserId: data.UserId,
762
+ pEvaluationCycleId: data.EvaluationCycleId
763
+ }, data);
764
+ }, {
765
+ onSuccess: (data) => {
766
+ queryClient2.setQueryData(
767
+ ["OPEN_ANSWER_QUERY"],
768
+ data
769
+ );
770
+ }
771
+ });
772
+ };
773
+ const showAnswerQueryHook = () => {
774
+ const queryClient2 = useQueryClient();
775
+ return useMutation((data) => {
776
+ return putAuth0(`/APE/Answers/ShowAnswers?`, {
777
+ pUserAnswerId: data.UserGrade,
778
+ pSupervisorAnswerId: data.SupervisorGrade
779
+ }, data);
780
+ }, {
781
+ onSuccess: (data) => {
782
+ queryClient2.setQueryData(
783
+ ["SHOW_ANSWER_QUERY"],
784
+ data
785
+ );
786
+ }
787
+ });
788
+ };
789
+ const postAnswersExportQueryHook = () => {
790
+ const queryClient2 = useQueryClient();
791
+ return useMutation((data) => {
792
+ return postAuth0(`/APE/EvaluationCycle/AnswerExport?`, {
793
+ pEvaluationCycleId: data.evaluationId,
794
+ pLanguage: data.language || "PT",
795
+ pUserId: data.userId
796
+ }, data);
797
+ }, {
798
+ onSuccess: (data) => {
799
+ queryClient2.setQueryData(
800
+ ["POST_ANSWERS_EXPORT"],
801
+ data
802
+ );
803
+ }
804
+ });
805
+ };
806
+ const useProductsQueryHook = ({ page, records, sortBy, sortDirection, terms, query, ...options }) => {
807
+ return useQuery(
808
+ ["PRODUCTS", page, records, sortBy, sortDirection, terms, query],
809
+ () => get("/APRE/Products", {
810
+ pPage: page,
811
+ pRecords: records || 50,
812
+ pSortBy: sortBy,
813
+ pSortDirection: sortDirection,
814
+ pTerms: terms,
815
+ pQuery: query
816
+ }),
817
+ options
818
+ );
819
+ };
820
+ const useProductInfiniteQueryHook = ({ sortBy, sortDirection, terms, query } = {}) => {
821
+ const infiniteQuery = useInfiniteQuery(["PRODUCTS_INFINITE", sortBy, sortDirection, terms, query], ({ pageParam = 1 }) => get("/APRE/Products", {
822
+ pPage: pageParam,
823
+ pRecords: 50,
824
+ pSortBy: sortBy,
825
+ pSortDirection: sortDirection,
826
+ pTerms: terms,
827
+ pQuery: query
828
+ }));
829
+ const pagesMulti = infiniteQuery.data?.pages?.map((page) => page.Products || []) || [];
830
+ const allDataGrouped = [].concat(...pagesMulti);
831
+ return {
832
+ ...infiniteQuery,
833
+ count: infiniteQuery.data?.pages?.[0].Count || 0,
834
+ data: allDataGrouped
835
+ };
836
+ };
837
+ const useProductsHierarchiesQueryHook = ({ terms, query, ...options }) => {
838
+ return useQuery(
839
+ ["PRODUCT_CATEGORIES", terms, query],
840
+ () => get("/APRE/Categories", {
841
+ pTerms: terms,
842
+ pQuery: query
843
+ }),
844
+ options
845
+ );
846
+ };
847
+ const useProductRecommendationsHook = ({ sortBy, sortDirection, reference, category, type, companyId, ...options }) => {
848
+ return useQuery(
849
+ ["PRODUCT_RECOMMENDATIONS", sortBy, sortDirection, reference, category, type, companyId],
850
+ () => get("/APRE/Products/Recommendations", {
851
+ pSortBy: sortBy,
852
+ pSortDirection: sortDirection,
853
+ pReferences: reference,
854
+ pProductHierarchyId: category,
855
+ pType: type,
856
+ pCompanyId: companyId
857
+ }),
858
+ options
859
+ );
860
+ };
861
+ const useProductsByRefQueryHook = (productRef, { storeCode, companyId, ...options }) => {
862
+ return useQuery(
863
+ ["PRODUCT_BY_REF", productRef, storeCode, companyId],
864
+ () => get(`/APRE/Products/${productRef}`, {
865
+ pStoreCode: storeCode,
866
+ pCompanyId: companyId
867
+ }),
868
+ options
869
+ );
870
+ };
871
+ const useAllRolesQuery = ({ records, sortBy, sortDirection, tags, page, onlyApplicationRoles }) => {
872
+ return useQuery(
873
+ ["ROLES_QUERY", records, sortBy, sortDirection, tags, page, onlyApplicationRoles],
874
+ () => getAuth0("/AACP/Roles", {
875
+ pPage: page || 1,
876
+ pRecords: records || 50,
877
+ pSortBy: sortBy,
878
+ pSortDirection: sortDirection,
879
+ pTerms: tags,
880
+ ...onlyApplicationRoles !== void 0 ? { pOnlyApplicationRoles: onlyApplicationRoles } : {}
881
+ }),
882
+ {
883
+ keepPreviousData: true
884
+ }
885
+ );
886
+ };
887
+ const getProductsByRef = ({ reference, sortBy, sortDirection }) => {
888
+ return useQuery(
889
+ ["ASV_PRODUCT_BY_REF", reference, sortBy, sortDirection],
890
+ () => get("/ASV/Products/AllStores", {
891
+ pReference: reference,
892
+ pSortBy: sortBy,
893
+ pSortDirection: sortDirection
894
+ }),
895
+ {
896
+ keepPreviousData: true
897
+ }
898
+ );
899
+ };
900
+ const getProductsByStore = ({ reference, storeCode, hasStock, filterColor, sortBy, sortDirection }) => {
901
+ return useQuery(
902
+ ["ASV_PRODUCT_BY_STORE", reference, storeCode, hasStock, filterColor, sortBy, sortDirection],
903
+ () => get("/ASV/Products", {
904
+ pReference: reference,
905
+ pStoreCode: storeCode,
906
+ pHasStock: hasStock,
907
+ pRefColor: filterColor,
908
+ pSortBy: sortBy,
909
+ pSortDirection: sortDirection
910
+ }),
911
+ {
912
+ keepPreviousData: true
913
+ }
914
+ );
915
+ };
916
+ const getProductsStockDetailsQueryHook = ({ reference, storeCode }) => {
917
+ return useQuery(
918
+ ["ASV_PRODUCT_STOCK_DETAILS", reference, storeCode],
919
+ () => get("/ASV/Products/StockDetails", {
920
+ pReference: reference,
921
+ pStoreCode: storeCode
922
+ }),
923
+ {
924
+ keepPreviousData: true
925
+ }
926
+ );
927
+ };
928
+ const getAssProductsByRef = ({ reference, sortBy, sortDirection }) => {
929
+ return useQuery(
930
+ ["ASS_PRODUCT_BY_REF", reference, sortBy, sortDirection],
931
+ () => get("/ASS/Products/AllStores", {
932
+ pReference: reference,
933
+ pSortBy: sortBy,
934
+ pSortDirection: sortDirection
935
+ }),
936
+ {
937
+ keepPreviousData: true
938
+ }
939
+ );
940
+ };
941
+ const getAssProductsByStore = ({ reference, storeCode, hasStock, filterColor, sortBy, sortDirection }) => {
942
+ return useQuery(
943
+ ["ASS_PRODUCT_BY_STORE", reference, storeCode, hasStock, filterColor, sortBy, sortDirection],
944
+ () => get("/ASS/Products", {
945
+ pReference: reference,
946
+ pStoreCode: storeCode,
947
+ pHasStock: hasStock,
948
+ pRefColor: filterColor,
949
+ pSortBy: sortBy,
950
+ pSortDirection: sortDirection
951
+ }),
952
+ {
953
+ keepPreviousData: true
954
+ }
955
+ );
956
+ };
957
+ const getAssProductsStockDetailsQueryHook = ({ reference, storeCode }) => {
958
+ return useQuery(
959
+ ["ASS_PRODUCT_STOCK_DETAILS", reference, storeCode],
960
+ () => get("/ASS/Products/StockDetails", {
961
+ pReference: reference,
962
+ pStoreCode: storeCode
963
+ }),
964
+ {
965
+ keepPreviousData: true
966
+ }
967
+ );
968
+ };
969
+ const getProductInfoQueryHook = (barcode, { ...options }) => {
970
+ return useQuery(
971
+ ["ASTS_PRODUCT_INFO_QUERY", barcode, options],
972
+ () => getAuth0(`/ASTS/Product`, {
973
+ pBarcode: barcode
974
+ }),
975
+ options
976
+ );
977
+ };
978
+ const getStockQueryHook = ({ reference, countryId, ...options }) => {
979
+ return useQuery(
980
+ ["ASTS_STOCK_QUERY", reference, countryId],
981
+ () => getAuth0("/ASTS/Stock", {
982
+ pReference: reference,
983
+ pCountryId: countryId || "PT"
984
+ }),
985
+ {
986
+ ...options
987
+ }
988
+ );
989
+ };
990
+ const postAudioFileHook = (bodyType) => {
991
+ const queryClient2 = useQueryClient();
992
+ return useMutation((data) => {
993
+ return postAuth0(`/ASTS/Product/FindByAudio`, void 0, data, bodyType);
994
+ }, {
995
+ onSuccess: (data) => {
996
+ queryClient2.setQueryData(
997
+ ["AUDIO_FILE_QUERY"],
998
+ data
999
+ );
1000
+ }
1001
+ });
1002
+ };
1003
+ const getTransferDocumentsQueryHook = ({ page, records, sortBy, sortDirection, terms, query, ...options }) => {
1004
+ return useQuery(
1005
+ ["ASTT_TRANSFER_DOCUMENTS", page, records, sortBy, sortDirection, terms, query, options],
1006
+ () => getAuth0("/ASTT/TransferDocuments", {
1007
+ pPage: page || 1,
1008
+ pRecords: records || 50,
1009
+ pSortBy: sortBy || "DocumentCreationDate",
1010
+ pSortDirection: sortDirection || "asc",
1011
+ pTerms: terms,
1012
+ pQuery: query
1013
+ }),
1014
+ options
1015
+ );
1016
+ };
1017
+ const getTransferDocumentsByIdQueryHook = (transferId, { ...options }) => {
1018
+ return useQuery(
1019
+ ["ASTT_TRANSFER_DOCUMENTS_BY_ID", transferId, options],
1020
+ () => getAuth0(`/ASTT/TransferDocuments`, {
1021
+ pTransferDocumentId: transferId
1022
+ }),
1023
+ options
1024
+ );
1025
+ };
1026
+ const getDocumentsFindByIdQueryHook = (transferId, { ...options }) => {
1027
+ return useQuery(
1028
+ ["ASTT_DOCUMENTS_FIND_BY_ID", transferId, options],
1029
+ () => getAuth0(`/ASTT/TransferDocuments/findById`, {
1030
+ pTransferDocumentId: transferId
1031
+ }),
1032
+ options
1033
+ );
1034
+ };
1035
+ const getTransferDocumentsByPackageQueryHook = (transferId, transferPackageId, { ...options }) => {
1036
+ return useQuery(
1037
+ ["ASTT_TRANSFER_DOCUMENTS_BY_PACKAGE", transferId, transferPackageId, options],
1038
+ () => getAuth0(`/ASTT/TransferDocuments/Products`, {
1039
+ pTransferDocumentId: transferId,
1040
+ pPackageId: transferPackageId
1041
+ }),
1042
+ options
1043
+ );
1044
+ };
1045
+ const getTransfeStatesQueryHook = () => {
1046
+ return useQuery(
1047
+ ["ASTT_STATUS"],
1048
+ () => getAuth0("/ASTT/TransferStates")
1049
+ );
1050
+ };
1051
+ const getTransferDocumentsPackagesQueryHook = ({ sortBy, sortDirection, terms, transferDocumentId, ...options }) => {
1052
+ return useQuery(
1053
+ ["ASTT_TRANSFER_PACKAGES", sortBy, sortDirection, terms, transferDocumentId, options],
1054
+ () => getAuth0(`/ASTT/TransferDocuments/Packages`, {
1055
+ pTransferDocumentId: transferDocumentId,
1056
+ pSortBy: sortBy || "PackageId",
1057
+ pSortDirection: sortDirection || "asc",
1058
+ pTerms: terms
1059
+ }),
1060
+ options
1061
+ );
1062
+ };
1063
+ const getTransferReportDiffQueryHook = ({ transferDocumentId, ...options }) => {
1064
+ return useQuery(
1065
+ ["ASTT_TRANSFER_REPORT_DIFF", transferDocumentId, options],
1066
+ () => getAuth0(`/ASTT/TransferDocuments/DifferencesReport`, {
1067
+ pTransferDocumentId: transferDocumentId
1068
+ }),
1069
+ options
1070
+ );
1071
+ };
1072
+ const getTransferAllProductsQueryHook = ({ page, records, sortBy, sortDirection, query, ...options }) => {
1073
+ return useQuery(
1074
+ ["ASTT_TRANSFER_ALL_PRODUCTS", page, records, sortBy, sortDirection, query, options],
1075
+ () => getAuth0("/Product/Products", {
1076
+ pPage: page || 1,
1077
+ pRecords: records || 50,
1078
+ pSortBy: sortBy || "Name",
1079
+ pSortDirection: sortDirection || "asc",
1080
+ pQuery: query
1081
+ }),
1082
+ options
1083
+ );
1084
+ };
1085
+ const postTransferDocumentsMutateQueryHook = ({ transferDocumentId, packageId }) => {
1086
+ const queryClient2 = useQueryClient();
1087
+ return useMutation((data) => {
1088
+ return postAuth0(`/ASTT/TransferDocuments/Products/Picking?`, {
1089
+ pTransferDocumentId: transferDocumentId,
1090
+ pPackageId: packageId
1091
+ }, data);
1092
+ }, {
1093
+ onSuccess: (data) => {
1094
+ queryClient2.setQueryData(
1095
+ ["TRANSFER_PICKED_PRODUCTS_QUERY"],
1096
+ data
1097
+ );
1098
+ }
1099
+ });
1100
+ };
1101
+ const putTransferDocumentsStateMutateQueryHook = ({ transferDocumentId }) => {
1102
+ const queryClient2 = useQueryClient();
1103
+ return useMutation((data) => {
1104
+ return putAuth0(`/ASTT/TransferDocuments?`, {
1105
+ pTransferDocumentId: transferDocumentId
1106
+ }, data);
1107
+ }, {
1108
+ onSuccess: (data) => {
1109
+ queryClient2.setQueryData(
1110
+ ["TRANSFER_PACKAGE_STATE_QUERY"],
1111
+ data
1112
+ );
1113
+ }
1114
+ });
1115
+ };
1116
+ const notifyMissingProductsQuery = ({ transferDocumentId }) => {
1117
+ const queryClient2 = useQueryClient();
1118
+ return useMutation((data) => {
1119
+ return postAuth0(`/ASTT/TransferDocuments/MissingProducts/Notify?`, {
1120
+ pTransferDocumentId: transferDocumentId
1121
+ }, data);
1122
+ }, {
1123
+ onSuccess: (data) => {
1124
+ queryClient2.setQueryData(
1125
+ ["NOTIFY_MISSING_PRODUCTS_QUERY"],
1126
+ data
1127
+ );
1128
+ }
1129
+ });
1130
+ };
1131
+ const putTransferDocumentsFinishedQuery = ({ transferDocumentId }) => {
1132
+ const queryClient2 = useQueryClient();
1133
+ return useMutation((data) => {
1134
+ return putAuth0(`/ASTT/TransferDocuments/Finish?`, {
1135
+ pTransferDocumentId: transferDocumentId
1136
+ }, data);
1137
+ }, {
1138
+ onSuccess: (data) => {
1139
+ queryClient2.setQueryData(
1140
+ ["TRANSFER_DOCUMENT_FINISHED_QUERY"],
1141
+ data
1142
+ );
1143
+ }
1144
+ });
1145
+ };
1146
+ const putTransferDocumentsPartiallyQuery = ({ transferDocumentId }) => {
1147
+ const queryClient2 = useQueryClient();
1148
+ return useMutation((data) => {
1149
+ return putAuth0(`/ASTT/TransferDocuments/PartialAdding?`, {
1150
+ pTransferDocumentId: transferDocumentId
1151
+ }, data);
1152
+ }, {
1153
+ onSuccess: (data) => {
1154
+ queryClient2.setQueryData(
1155
+ ["TRANSFER_DOCUMENT_PARTIALLY_QUERY"],
1156
+ data
1157
+ );
1158
+ }
1159
+ });
1160
+ };
1161
+ const getReportsBuilderQueryHook = (transferId, { ...options }) => {
1162
+ return useQuery(
1163
+ ["ASTT_REPORTS_BUILDER", transferId, options],
1164
+ () => getAuth0(`/ASTT/ReportsBuilder/DifferencesReport`, {
1165
+ pTransferDocumentId: transferId
1166
+ }),
1167
+ options
1168
+ );
1169
+ };
1170
+ const getRfidQueryHook = ({ delay, storeId, transferDocumentId, packageId, ...options }) => {
1171
+ return useQuery(
1172
+ ["ASTT_RFID", delay, storeId, transferDocumentId, packageId, options],
1173
+ () => getAuth0("/ASTT/RFID", {
1174
+ pDelay: delay || 3,
1175
+ pStoreId: storeId,
1176
+ pTransferDocumentId: transferDocumentId,
1177
+ pPackageId: packageId
1178
+ }),
1179
+ options
1180
+ );
1181
+ };
1182
+ const getProductsListingQueryHook = (transferId, transferPackageId, { ...options }) => {
1183
+ return useQuery(
1184
+ ["ASTT_PRODUCTS_LISTING", transferId, transferPackageId, options],
1185
+ () => getAuth0(`/ASTT/ReportsBuilder/ProductsListing`, {
1186
+ pTransferDocumentId: transferId,
1187
+ pPackageId: transferPackageId
1188
+ }),
1189
+ options
1190
+ );
1191
+ };
1192
+ const getBarcodesPrintQuery = (transferId, { ...options }) => {
1193
+ return useQuery(
1194
+ ["ASTT_BARCODES_PRINT", transferId, options],
1195
+ () => getAuth0(`/ASTT/ReportsBuilder/BarcodesPrinting`, {
1196
+ pTransferDocumentId: transferId
1197
+ }),
1198
+ options
1199
+ );
1200
+ };
1201
+ const getBarcodesListingQueryHook = (transferId, { ...options }) => {
1202
+ return useQuery(
1203
+ ["ASTT_BARCODES_LISTING", transferId, options],
1204
+ () => getAuth0(`/ASTT/TransferDocuments/BarcodesListing`, {
1205
+ pTransferDocumentId: transferId
1206
+ }),
1207
+ options
1208
+ );
1209
+ };
1210
+ const getBarcodesListingByPackageQueryHook = (transferId, packageId, { ...options }) => {
1211
+ return useQuery(
1212
+ ["ASTT_BARCODES_LISTING_BY_PACKAGE", transferId, packageId, options],
1213
+ () => getAuth0(`/ASTT/TransferDocuments/BarcodesListing/ByPackage`, {
1214
+ pTransferDocumentId: transferId,
1215
+ pPackageId: packageId
1216
+ }),
1217
+ options
1218
+ );
1219
+ };
1220
+ const postMatchingPackageQueryHook = ({ transferDocumentId }) => {
1221
+ const queryClient2 = useQueryClient();
1222
+ return useMutation((data) => {
1223
+ return postAuth0(`/ASTT/TransferDocuments/MatchingPackage?`, {
1224
+ pTransferDocumentId: transferDocumentId
1225
+ }, data);
1226
+ }, {
1227
+ onSuccess: (data) => {
1228
+ queryClient2.setQueryData(
1229
+ ["MATCHING_PACKAGE_QUERY"],
1230
+ data
1231
+ );
1232
+ }
1233
+ });
1234
+ };
1235
+ const postManualTransferQueryHook = (bodyType) => {
1236
+ const queryClient2 = useQueryClient();
1237
+ return useMutation((data) => {
1238
+ return postAuth0(`/ASTT/TransferDocuments/Manual`, void 0, data, bodyType);
1239
+ }, {
1240
+ onSuccess: (data) => {
1241
+ queryClient2.setQueryData(
1242
+ ["MANUAL_TRANSFER_QUERY"],
1243
+ data
1244
+ );
1245
+ }
1246
+ });
1247
+ };
1248
+ const postManualPackageQueryHook = (transferDocumentId) => {
1249
+ const queryClient2 = useQueryClient();
1250
+ return useMutation((data) => {
1251
+ return postAuth0(`/ASTT/TransferDocuments/Manual/Packages?`, {
1252
+ pTransferDocumentId: transferDocumentId
1253
+ }, data);
1254
+ }, {
1255
+ onSuccess: (data) => {
1256
+ queryClient2.setQueryData(
1257
+ ["MANUAL_PACKAGE_QUERY"],
1258
+ data
1259
+ );
1260
+ }
1261
+ });
1262
+ };
1263
+ const updatePackageIdQuery = ({ transferDocumentId, oldPackageId, newPackageId }) => {
1264
+ const queryClient2 = useQueryClient();
1265
+ return useMutation((data) => {
1266
+ return putAuth0(`/ASTT/TransferDocuments/Manual/Package/Id?`, {
1267
+ pTransferDocumentId: transferDocumentId,
1268
+ pOldPackageId: oldPackageId,
1269
+ pNewPackageId: newPackageId
1270
+ }, data);
1271
+ }, {
1272
+ onSuccess: (data) => {
1273
+ queryClient2.setQueryData(
1274
+ ["UPDATE_PACKAGE_ID_QUERY"],
1275
+ data
1276
+ );
1277
+ }
1278
+ });
1279
+ };
1280
+ const postAsttActionsQueryHook = (query, actionName) => {
1281
+ const queryClient2 = useQueryClient();
1282
+ return useMutation(() => {
1283
+ return postAuth0(`/ASTT/Actions/GET?`, {
1284
+ pActionName: actionName,
1285
+ pFlow: "TransferDocuments",
1286
+ pFilter: query
1287
+ });
1288
+ }, {
1289
+ onSuccess: (data) => {
1290
+ queryClient2.setQueryData(["ASTT_ACTIONS"], data);
1291
+ }
1292
+ });
1293
+ };
1294
+ const getReconciliationDocumentsQueryHook = ({ page, records, ...options }) => {
1295
+ return useQuery(
1296
+ ["ASTT_RECONCILIATION_DOCUMENTS", page, records, options],
1297
+ () => getAuth0(`/ASTT/TransferDocuments/ReconciliationDocuments`, {
1298
+ pPage: page || 1,
1299
+ pRecords: records || 50
1300
+ }),
1301
+ options
1302
+ );
1303
+ };
1304
+ const getManualPackagesListQueryHook = ({ terms, query, ...options }) => {
1305
+ return useQuery(
1306
+ ["ASTT_MANUAL_PACKAGES_LIST", options, terms, query],
1307
+ () => getAuth0(`/ASTT/TransferDocuments/ManualVsYetToBePicked`, {
1308
+ pTerms: terms,
1309
+ pQuery: query
1310
+ }),
1311
+ options
1312
+ );
1313
+ };
1314
+ const updateDocumentIdQueryHook = ({ oldDocumentNumber, newDocumentNumber }) => {
1315
+ const queryClient2 = useQueryClient();
1316
+ return useMutation(() => {
1317
+ return putAuth0(`/ASTT/TransferDocuments/Manual?`, {
1318
+ pOldDocumentNumber: oldDocumentNumber,
1319
+ pNewDocumentNumber: newDocumentNumber
1320
+ });
1321
+ }, {
1322
+ onSuccess: (data) => {
1323
+ queryClient2.setQueryData(
1324
+ ["UPDATE_DOCUMENT_ID_QUERY"],
1325
+ data
1326
+ );
1327
+ }
1328
+ });
1329
+ };
1330
+ const deleteManualPackageQueryHook = ({ transferDocumentId, packageId }) => {
1331
+ const queryClient2 = useQueryClient();
1332
+ return useMutation(() => {
1333
+ return toDeleteAuth0(`/ASTT/TransferDocuments/Manual/Package?`, {
1334
+ pTransferDocumentId: transferDocumentId,
1335
+ pPackageId: packageId
1336
+ });
1337
+ }, {
1338
+ onSuccess: (data) => {
1339
+ queryClient2.setQueryData(
1340
+ ["DELETE_MANUAL_PACKAGE_QUERY"],
1341
+ data
1342
+ );
1343
+ }
1344
+ });
1345
+ };
1346
+ const getTransferDocumentsASTTQueryHook = ({ page, records, sortBy, sortDirection, terms, query, ...options }) => {
1347
+ return useQuery(
1348
+ ["ASTT_TRANSFER_DOCUMENTS", page, records, sortBy, sortDirection, terms, query, options],
1349
+ () => getAuth0("/ASTT/TransferDocuments", {
1350
+ pPage: page || 1,
1351
+ pRecords: records || 50,
1352
+ pSortBy: sortBy || "DocumentCreationDate",
1353
+ pSortDirection: sortDirection || "asc",
1354
+ pTerms: terms,
1355
+ pQuery: query
1356
+ }),
1357
+ options
1358
+ );
1359
+ };
1360
+ const getTransferDocumentsByIdASTTQueryHook = (transferId, { ...options }) => {
1361
+ return useQuery(
1362
+ ["ASTT_TRANSFER_DOCUMENTS_BY_ID", transferId, options],
1363
+ () => getAuth0(`/ASTT/TransferDocuments`, {
1364
+ pTransferDocumentId: transferId
1365
+ }),
1366
+ options
1367
+ );
1368
+ };
1369
+ const getTransferDocumentsByPackageASTTQueryHook = (transferId, transferPackageId, { ...options }) => {
1370
+ return useQuery(
1371
+ ["ASTT_TRANSFER_DOCUMENTS_BY_PACKAGE", transferId, transferPackageId, options],
1372
+ () => getAuth0(`/ASTT/TransferDocuments/Products`, {
1373
+ pTransferDocumentId: transferId,
1374
+ pPackageId: transferPackageId
1375
+ }),
1376
+ options
1377
+ );
1378
+ };
1379
+ const getTransferDocumentsPackagesASTTQueryHook = ({ sortBy, sortDirection, terms, transferDocumentId, ...options }) => {
1380
+ return useQuery(
1381
+ ["ASTT_TRANSFER_PACKAGES", sortBy, sortDirection, terms, transferDocumentId, options],
1382
+ () => getAuth0(`/ASTT/TransferDocuments/Packages`, {
1383
+ pTransferDocumentId: transferDocumentId,
1384
+ pSortBy: sortBy || "PackageId",
1385
+ pSortDirection: sortDirection || "asc",
1386
+ pTerms: terms
1387
+ }),
1388
+ options
1389
+ );
1390
+ };
1391
+ const getTransferReportDiffASTTQueryHook = ({ transferDocumentId, ...options }) => {
1392
+ return useQuery(
1393
+ ["ASTT_TRANSFER_REPORT_DIFF", transferDocumentId, options],
1394
+ () => getAuth0(`/ASTT/TransferDocuments/DifferencesReport`, {
1395
+ pTransferDocumentId: transferDocumentId
1396
+ }),
1397
+ options
1398
+ );
1399
+ };
1400
+ const getTransferAllProductsASTTQueryHook = ({ page, records, sortBy, sortDirection, query, ...options }) => {
1401
+ return useQuery(
1402
+ ["ASTT_TRANSFER_ALL_PRODUCTS", page, records, sortBy, sortDirection, query, options],
1403
+ () => getAuth0("/Product/Products", {
1404
+ pPage: page || 1,
1405
+ pRecords: records || 50,
1406
+ pSortBy: sortBy || "Name",
1407
+ pSortDirection: sortDirection || "asc",
1408
+ pQuery: query
1409
+ }),
1410
+ options
1411
+ );
1412
+ };
1413
+ const postTransferDocumentsASTTMutateQueryHook = ({ transferDocumentId, packageId }) => {
1414
+ const queryClient2 = useQueryClient();
1415
+ return useMutation((data) => {
1416
+ return postAuth0(`/ASTT/TransferDocuments/Products/Picking?`, {
1417
+ pTransferDocumentId: transferDocumentId,
1418
+ pPackageId: packageId
1419
+ }, data);
1420
+ }, {
1421
+ onSuccess: (data) => {
1422
+ queryClient2.setQueryData(
1423
+ ["ASTT_TRANSFER_PICKED_PRODUCTS_QUERY"],
1424
+ data
1425
+ );
1426
+ }
1427
+ });
1428
+ };
1429
+ const putTransferDocumentsStateASTTMutateQueryHook = ({ transferDocumentId }) => {
1430
+ const queryClient2 = useQueryClient();
1431
+ return useMutation((data) => {
1432
+ return putAuth0(`/ASTT/TransferDocuments?`, {
1433
+ pTransferDocumentId: transferDocumentId
1434
+ }, data);
1435
+ }, {
1436
+ onSuccess: (data) => {
1437
+ queryClient2.setQueryData(
1438
+ ["ASTT_TRANSFER_PACKAGE_STATE_QUERY"],
1439
+ data
1440
+ );
1441
+ }
1442
+ });
1443
+ };
1444
+ const getReportsBuilderASTTQueryHook = (transferId, { ...options }) => {
1445
+ return useQuery(
1446
+ ["ASTT_REPORTS_BUILDER", transferId, options],
1447
+ () => getAuth0(`/ASTT/ReportsBuilder/DifferencesReport`, {
1448
+ pTransferDocumentId: transferId
1449
+ }),
1450
+ options
1451
+ );
1452
+ };
1453
+ const getProductsListingASTTQueryHook = (transferId, transferPackageId, { ...options }) => {
1454
+ return useQuery(
1455
+ ["ASTT_PRODUCTS_LISTING", transferId, transferPackageId, options],
1456
+ () => getAuth0(`/ASTT/ReportsBuilder/ProductsListing`, {
1457
+ pTransferDocumentId: transferId,
1458
+ pPackageId: transferPackageId
1459
+ }),
1460
+ options
1461
+ );
1462
+ };
1463
+ const createPackageASTTMutateQuery = ({ transferDocumentId }) => {
1464
+ const queryClient2 = useQueryClient();
1465
+ return useMutation((data) => {
1466
+ return postAuth0(`/ASTT/TransferDocuments/Packages?`, {
1467
+ pTransferDocumentId: transferDocumentId
1468
+ }, data);
1469
+ }, {
1470
+ onSuccess: (data) => {
1471
+ queryClient2.setQueryData(
1472
+ ["CREATE_PACKAGE_ASTT_QUERY"],
1473
+ data
1474
+ );
1475
+ }
1476
+ });
1477
+ };
1478
+ const createTransferASTTMutateQuery = () => {
1479
+ const queryClient2 = useQueryClient();
1480
+ return useMutation((data) => {
1481
+ return postAuth0(`/ASTT/TransferDocuments`, void 0, data);
1482
+ }, {
1483
+ onSuccess: (data) => {
1484
+ queryClient2.setQueryData(
1485
+ ["CREATE_TRANSFER_ASTT_QUERY"],
1486
+ data
1487
+ );
1488
+ }
1489
+ });
1490
+ };
1491
+ const getProductsPickedASTT = ({ query, ...options }) => {
1492
+ return useQuery(
1493
+ ["ASTT_PICKED_PRODUCTS", query, options],
1494
+ () => getAuth0("/ASTT/TransferDocuments/Products/Picked", {
1495
+ pQuery: query
1496
+ }),
1497
+ options
1498
+ );
1499
+ };
1500
+ const getIdProductsPickedASTT = () => {
1501
+ return useQuery(
1502
+ ["ASTT_ID_PICKED_PRODUCTS"],
1503
+ () => getAuth0("/ASTT/TransferDocuments/TransferDocumentIds")
1504
+ );
1505
+ };
1506
+ const getProductWarningASTTQueryHook = ({ page, records, sortBy, sortDirection, terms, query, ...options }) => {
1507
+ return useQuery(
1508
+ ["ASTT_PRODUCT_WARNING_TRANSFER_DOCUMENTS", page, records, sortBy, sortDirection, terms, query, options],
1509
+ () => getAuth0("/ASTT/ProductWarning", {
1510
+ pPage: page,
1511
+ pRecords: records,
1512
+ pSortBy: sortBy,
1513
+ pSortDirection: sortDirection,
1514
+ pTerms: terms,
1515
+ pQuery: query
1516
+ }),
1517
+ options
1518
+ );
1519
+ };
1520
+ const removeProductASTTQuery = () => {
1521
+ const queryClient2 = useQueryClient();
1522
+ return useMutation((data) => {
1523
+ return postAuth0(`/ASTT/TransferDocuments/DeletePicking`, void 0, data);
1524
+ }, {
1525
+ onSuccess: (data) => {
1526
+ queryClient2.setQueryData(
1527
+ ["ASTT_REMOVE_PRODUCT_QUERY"],
1528
+ data
1529
+ );
1530
+ }
1531
+ });
1532
+ };
1533
+ const autoSaveASTTQueryHook = ({ transferDocumentId, packageId }) => {
1534
+ const queryClient2 = useQueryClient();
1535
+ return useMutation((data) => {
1536
+ return postAuth0(`/ASTT/TransferDocuments/Products/Picking/AutoSave?`, {
1537
+ pTransferDocumentId: transferDocumentId,
1538
+ pPackageId: packageId
1539
+ }, data);
1540
+ }, {
1541
+ onSuccess: (data) => {
1542
+ queryClient2.setQueryData(
1543
+ ["AUTO_SAVE_ASTT_QUERY"],
1544
+ data
1545
+ );
1546
+ }
1547
+ });
1548
+ };
1549
+ const getProductsMovementsASTTQueryHook = ({ page, records, sortBy, sortDirection, terms, query, ...options }) => {
1550
+ return useQuery(
1551
+ ["ASTT_PRODUCT_MOVEMENTS_DOCUMENTS", page, records, sortBy, sortDirection, terms, query, options],
1552
+ () => getAuth0("/ASTT/ProductsMovements", {
1553
+ pPage: page,
1554
+ pRecords: records,
1555
+ pSortBy: sortBy,
1556
+ pSortDirection: sortDirection,
1557
+ pTerms: terms,
1558
+ pQuery: query
1559
+ }),
1560
+ options
1561
+ );
1562
+ };
1563
+ const postRfidInventoryMutateQueryHook = ({ transferDocumentId, packageId }) => {
1564
+ const queryClient2 = useQueryClient();
1565
+ return useMutation((data) => {
1566
+ return postAuth0(`/ASTT/RFID?`, {
1567
+ pTransferDocumentId: transferDocumentId,
1568
+ pPackageId: packageId
1569
+ }, data);
1570
+ }, {
1571
+ onSuccess: (data) => {
1572
+ queryClient2.setQueryData(
1573
+ ["ASTT_RFID_INVENTORY_QUERY"],
1574
+ data
1575
+ );
1576
+ }
1577
+ });
1578
+ };
1579
+ const restartProductASTTQuery = ({ transferDocumentId, packageId }) => {
1580
+ const queryClient2 = useQueryClient();
1581
+ return useMutation((data) => {
1582
+ return toDeleteAuth0(`/ASTT/RFID?`, {
1583
+ pTransferDocumentId: transferDocumentId,
1584
+ pPackageId: packageId
1585
+ }, data);
1586
+ }, {
1587
+ onSuccess: (data) => {
1588
+ queryClient2.setQueryData(
1589
+ ["ASTT_RESTART_PRODUCT_QUERY"],
1590
+ data
1591
+ );
1592
+ }
1593
+ });
1594
+ };
1595
+ const deleteProductASTTQuery = ({ transferDocumentId, packageId, barcode }) => {
1596
+ const queryClient2 = useQueryClient();
1597
+ return useMutation((data) => {
1598
+ return toDeleteAuth0(`/ASTT/RFID/byBarcode?`, {
1599
+ pTransferDocumentId: transferDocumentId,
1600
+ pPackageId: packageId,
1601
+ pBarcode: barcode
1602
+ }, data);
1603
+ }, {
1604
+ onSuccess: (data) => {
1605
+ queryClient2.setQueryData(
1606
+ ["ASTT_DELETE_PRODUCT_QUERY"],
1607
+ data
1608
+ );
1609
+ }
1610
+ });
1611
+ };
1612
+ const postReprocessQuery = ({ transferDocumentId }) => {
1613
+ const queryClient2 = useQueryClient();
1614
+ return useMutation((data) => {
1615
+ return postAuth0(`/ASTT/RFID/Reprocess?`, {
1616
+ pTransferDocumentId: transferDocumentId
1617
+ }, data);
1618
+ }, {
1619
+ onSuccess: (data) => {
1620
+ queryClient2.setQueryData(
1621
+ ["ASTT_REPROCESS_QUERY"],
1622
+ data
1623
+ );
1624
+ }
1625
+ });
1626
+ };
1627
+ const getReprocessNeededASTTQueryHook = (transferId, { ...options }) => {
1628
+ return useQuery(
1629
+ ["ASTT_REPROCESS_NEEDED", transferId, options],
1630
+ () => getAuth0(`/ASTT/RFID/ReprocessNeeded`, {
1631
+ pTransferDocumentId: transferId
1632
+ }),
1633
+ options
1634
+ );
1635
+ };
1636
+ const getAdidasAllProductsQuery = ({ page, records, sortBy, sortDirection, query, ...options }) => {
1637
+ return useQuery(
1638
+ ["ASTT_ADIDAS_TRANSFER_ALL_PRODUCTS", page, records, sortBy, sortDirection, query, options],
1639
+ () => getAuth0("/ASTT/Products", {
1640
+ pPage: page || 1,
1641
+ pRecords: records || 50,
1642
+ pSortBy: sortBy || "Name",
1643
+ pSortDirection: sortDirection || "asc",
1644
+ pQuery: query
1645
+ }),
1646
+ options
1647
+ );
1648
+ };
1649
+ const finishPackageASTTQuery = ({ transferDocumentId }) => {
1650
+ const queryClient2 = useQueryClient();
1651
+ return useMutation((data) => {
1652
+ return putAuth0(`/ASTT/TransferDocuments/StockTaking/Finish?`, {
1653
+ pTransferDocumentId: transferDocumentId
1654
+ }, data);
1655
+ }, {
1656
+ onSuccess: (data) => {
1657
+ queryClient2.setQueryData(
1658
+ ["FINISH_PACKAGE_ASTT_QUERY"],
1659
+ data
1660
+ );
1661
+ }
1662
+ });
1663
+ };
1664
+ const postMissingProductsQuery = ({ transferDocumentId }) => {
1665
+ const queryClient2 = useQueryClient();
1666
+ return useMutation((data) => {
1667
+ return postAuth0(`/ASTT/TransferDocuments/Packages/MissingProducts?`, {
1668
+ pTransferDocumentId: transferDocumentId
1669
+ }, data);
1670
+ }, {
1671
+ onSuccess: (data) => {
1672
+ queryClient2.setQueryData(
1673
+ ["ASTT_MISSING_PRODUCTS_QUERY"],
1674
+ data
1675
+ );
1676
+ }
1677
+ });
1678
+ };
1679
+ const getTransferDocumentsASGTQueryHook = ({ page, records, sortBy, sortDirection, terms, query, ...options }) => {
1680
+ return useQuery(
1681
+ ["ASGT_TRANSFER_DOCUMENTS", page, records, sortBy, sortDirection, terms, query, options],
1682
+ () => getAuth0("/ASGT/TransferDocuments", {
1683
+ pPage: page || 1,
1684
+ pRecords: records || 50,
1685
+ pSortBy: sortBy || "DocumentCreationDate",
1686
+ pSortDirection: sortDirection || "asc",
1687
+ pTerms: terms,
1688
+ pQuery: query
1689
+ }),
1690
+ options
1691
+ );
1692
+ };
1693
+ const getTransferDocumentsByIdASGTQueryHook = (transferId, { ...options }) => {
1694
+ return useQuery(
1695
+ ["ASGT_TRANSFER_DOCUMENTS_BY_ID", transferId, options],
1696
+ () => getAuth0(`/ASGT/TransferDocuments`, {
1697
+ pTransferDocumentId: transferId
1698
+ }),
1699
+ options
1700
+ );
1701
+ };
1702
+ const getTransferDocumentsByPackageASGTQueryHook = (transferId, transferPackageId, { ...options }) => {
1703
+ return useQuery(
1704
+ ["ASGT_TRANSFER_DOCUMENTS_BY_PACKAGE", transferId, transferPackageId, options],
1705
+ () => getAuth0(`/ASGT/TransferDocuments/Products`, {
1706
+ pTransferDocumentId: transferId,
1707
+ pPackageId: transferPackageId
1708
+ }),
1709
+ options
1710
+ );
1711
+ };
1712
+ const getTransferDocumentsPackagesASGTQueryHook = ({ sortBy, sortDirection, terms, transferDocumentId, ...options }) => {
1713
+ return useQuery(
1714
+ ["ASGT_TRANSFER_PACKAGES", sortBy, sortDirection, terms, transferDocumentId, options],
1715
+ () => getAuth0(`/ASGT/TransferDocuments/Packages`, {
1716
+ pTransferDocumentId: transferDocumentId,
1717
+ pSortBy: sortBy || "PackageId",
1718
+ pSortDirection: sortDirection || "asc",
1719
+ pTerms: terms
1720
+ }),
1721
+ options
1722
+ );
1723
+ };
1724
+ const getTransferReportDiffASGTQueryHook = ({ transferDocumentId, ...options }) => {
1725
+ return useQuery(
1726
+ ["ASGT_TRANSFER_REPORT_DIFF", transferDocumentId, options],
1727
+ () => getAuth0(`/ASGT/TransferDocuments/DifferencesReport`, {
1728
+ pTransferDocumentId: transferDocumentId
1729
+ }),
1730
+ options
1731
+ );
1732
+ };
1733
+ const getTransferAllProductsASGTQueryHook = ({ page, records, sortBy, sortDirection, query, ...options }) => {
1734
+ return useQuery(
1735
+ ["ASGT_TRANSFER_ALL_PRODUCTS", page, records, sortBy, sortDirection, query, options],
1736
+ () => getAuth0("/Product/Products", {
1737
+ pPage: page || 1,
1738
+ pRecords: records || 50,
1739
+ pSortBy: sortBy || "Name",
1740
+ pSortDirection: sortDirection || "asc",
1741
+ pQuery: query
1742
+ }),
1743
+ options
1744
+ );
1745
+ };
1746
+ const postTransferDocumentsASGTMutateQueryHook = ({ transferDocumentId, packageId }) => {
1747
+ const queryClient2 = useQueryClient();
1748
+ return useMutation((data) => {
1749
+ return postAuth0(`/ASGT/TransferDocuments/Products/Picking?`, {
1750
+ pTransferDocumentId: transferDocumentId,
1751
+ pPackageId: packageId
1752
+ }, data);
1753
+ }, {
1754
+ onSuccess: (data) => {
1755
+ queryClient2.setQueryData(
1756
+ ["ASGT_TRANSFER_PICKED_PRODUCTS_QUERY"],
1757
+ data
1758
+ );
1759
+ }
1760
+ });
1761
+ };
1762
+ const putTransferDocumentsStateASGTMutateQueryHook = ({ transferDocumentId }) => {
1763
+ const queryClient2 = useQueryClient();
1764
+ return useMutation((data) => {
1765
+ return putAuth0(`/ASGT/TransferDocuments?`, {
1766
+ pTransferDocumentId: transferDocumentId
1767
+ }, data);
1768
+ }, {
1769
+ onSuccess: (data) => {
1770
+ queryClient2.setQueryData(
1771
+ ["ASGT_TRANSFER_PACKAGE_STATE_QUERY"],
1772
+ data
1773
+ );
1774
+ }
1775
+ });
1776
+ };
1777
+ const getReportsBuilderASGTQueryHook = (transferId, { ...options }) => {
1778
+ return useQuery(
1779
+ ["ASGT_REPORTS_BUILDER", transferId, options],
1780
+ () => getAuth0(`/ASGT/ReportsBuilder/DifferencesReport`, {
1781
+ pTransferDocumentId: transferId
1782
+ }),
1783
+ options
1784
+ );
1785
+ };
1786
+ const getProductsListingASGTQueryHook = (transferId, transferPackageId, { ...options }) => {
1787
+ return useQuery(
1788
+ ["ASGT_PRODUCTS_LISTING", transferId, transferPackageId, options],
1789
+ () => getAuth0(`/ASGT/ReportsBuilder/ProductsListing`, {
1790
+ pTransferDocumentId: transferId,
1791
+ pPackageId: transferPackageId
1792
+ }),
1793
+ options
1794
+ );
1795
+ };
1796
+ const createPackageASGTMutateQuery = ({ transferDocumentId }) => {
1797
+ const queryClient2 = useQueryClient();
1798
+ return useMutation((data) => {
1799
+ return postAuth0(`/ASGT/TransferDocuments/Packages?`, {
1800
+ pTransferDocumentId: transferDocumentId
1801
+ }, data);
1802
+ }, {
1803
+ onSuccess: (data) => {
1804
+ queryClient2.setQueryData(
1805
+ ["CREATE_PACKAGE_ASGT_QUERY"],
1806
+ data
1807
+ );
1808
+ }
1809
+ });
1810
+ };
1811
+ const createTransferASGTMutateQuery = () => {
1812
+ const queryClient2 = useQueryClient();
1813
+ return useMutation((data) => {
1814
+ return postAuth0(`/ASGT/TransferDocuments`, void 0, data);
1815
+ }, {
1816
+ onSuccess: (data) => {
1817
+ queryClient2.setQueryData(
1818
+ ["CREATE_TRANSFER_ASGT_QUERY"],
1819
+ data
1820
+ );
1821
+ }
1822
+ });
1823
+ };
1824
+ const getProductsPickedASGT = ({ query, ...options }) => {
1825
+ return useQuery(
1826
+ ["ASGT_PICKED_PRODUCTS", query, options],
1827
+ () => getAuth0("/ASGT/TransferDocuments/Products/Picked", {
1828
+ pQuery: query
1829
+ }),
1830
+ options
1831
+ );
1832
+ };
1833
+ const getIdProductsPickedASGT = () => {
1834
+ return useQuery(
1835
+ ["ASGT_ID_PICKED_PRODUCTS"],
1836
+ () => getAuth0("/ASGT/TransferDocuments/TransferDocumentIds")
1837
+ );
1838
+ };
1839
+ const getProductWarningASGTQueryHook = ({ page, records, sortBy, sortDirection, terms, query, ...options }) => {
1840
+ return useQuery(
1841
+ ["ASGT_PRODUCT_WARNING_TRANSFER_DOCUMENTS", page, records, sortBy, sortDirection, terms, query, options],
1842
+ () => getAuth0("/ASGT/ProductWarning", {
1843
+ pPage: page,
1844
+ pRecords: records,
1845
+ pSortBy: sortBy,
1846
+ pSortDirection: sortDirection,
1847
+ pTerms: terms,
1848
+ pQuery: query
1849
+ }),
1850
+ options
1851
+ );
1852
+ };
1853
+ const removeProductASGTQuery = () => {
1854
+ const queryClient2 = useQueryClient();
1855
+ return useMutation((data) => {
1856
+ return postAuth0(`/ASGT/TransferDocuments/DeletePicking`, void 0, data);
1857
+ }, {
1858
+ onSuccess: (data) => {
1859
+ queryClient2.setQueryData(
1860
+ ["ASGT_REMOVE_PRODUCT_QUERY"],
1861
+ data
1862
+ );
1863
+ }
1864
+ });
1865
+ };
1866
+ const autoSaveASGTQueryHook = ({ transferDocumentId, packageId }) => {
1867
+ const queryClient2 = useQueryClient();
1868
+ return useMutation((data) => {
1869
+ return postAuth0(`/ASGT/TransferDocuments/Products/Picking/AutoSave?`, {
1870
+ pTransferDocumentId: transferDocumentId,
1871
+ pPackageId: packageId
1872
+ }, data);
1873
+ }, {
1874
+ onSuccess: (data) => {
1875
+ queryClient2.setQueryData(
1876
+ ["AUTO_SAVE_ASGT_QUERY"],
1877
+ data
1878
+ );
1879
+ }
1880
+ });
1881
+ };
1882
+ const getProductsMovementsASGTQueryHook = ({ page, records, sortBy, sortDirection, terms, query, ...options }) => {
1883
+ return useQuery(
1884
+ ["ASGT_PRODUCT_MOVEMENTS_DOCUMENTS", page, records, sortBy, sortDirection, terms, query, options],
1885
+ () => getAuth0("/ASGT/ProductsMovements", {
1886
+ pPage: page,
1887
+ pRecords: records,
1888
+ pSortBy: sortBy,
1889
+ pSortDirection: sortDirection,
1890
+ pTerms: terms,
1891
+ pQuery: query
1892
+ }),
1893
+ options
1894
+ );
1895
+ };
1896
+ const getDateFromUnix = (unixDate, formatStr) => {
1897
+ const date = unixDate ? dayjs.unix(unixDate) : null;
1898
+ return formatStr && date ? date.format(formatStr) : date;
1899
+ };
1900
+ const getDateToUnix = (date) => {
1901
+ return date ? dayjs(date).unix() : null;
1902
+ };
1903
+ const getUnixFromDateString = (dateString) => {
1904
+ const date = dayjs(dateString, "YYYY-MM-DD");
1905
+ return date.isValid() ? date.unix() : null;
1906
+ };
1907
+ const getDateStringToUnix = (dateUnix) => {
1908
+ const dateObject = new Date(dateUnix * 1e3);
1909
+ const day = dateObject?.getDate()?.toString()?.padStart(2, "0");
1910
+ const month = (dateObject?.getMonth() + 1)?.toString()?.padStart(2, "0");
1911
+ const year = dateObject?.getFullYear();
1912
+ return `${day}/${month}/${year}`;
1913
+ };
1914
+ const getEmployeesWithTimekeeping = ({ storeId, date, search, page, records, sortBy, sortDirection }) => {
1915
+ return useQuery(
1916
+ ["EMPLOYEES_WITH_TIMEKEEPING", storeId, date, search, page, records, sortBy, sortDirection],
1917
+ () => getAuth0("/ATIM/EmployeesWorklog", {
1918
+ pStoreId: storeId,
1919
+ pDate: date || getDateToUnix(/* @__PURE__ */ new Date()),
1920
+ pPage: page || 1,
1921
+ pRecords: records || 50,
1922
+ pSortBy: sortBy || "DisplayName",
1923
+ pSortDirection: sortDirection || "asc",
1924
+ pSearch: search
1925
+ }),
1926
+ {
1927
+ keepPreviousData: true
1928
+ }
1929
+ );
1930
+ };
1931
+ const postVerifyUserQueryHook = () => {
1932
+ const queryClient2 = useQueryClient();
1933
+ return useMutation((data) => {
1934
+ return post("/ATIM/Youverse/Verify_User", data);
1935
+ }, {
1936
+ onSuccess: (data) => {
1937
+ queryClient2.setQueryData(
1938
+ ["VERIFY_USER"],
1939
+ data
1940
+ );
1941
+ }
1942
+ });
1943
+ };
1944
+ const usePostAttendance = () => {
1945
+ const queryClient2 = useQueryClient();
1946
+ return useMutation((data) => {
1947
+ return postAuth0("/ATIM/Attendances", void 0, data);
1948
+ }, {
1949
+ onSuccess: (data) => {
1950
+ queryClient2.setQueryData(
1951
+ ["POST_ATTENDANCE"],
1952
+ data
1953
+ );
1954
+ }
1955
+ });
1956
+ };
1957
+ const getAttendanceIssuesByIdQueryHook = (userId, options) => {
1958
+ return useQuery(
1959
+ ["ATTENDANCE_ISSUES_ID_QUERY", userId],
1960
+ () => getAuth0(`/ATIM/AttendanceIssues/${userId}`),
1961
+ {
1962
+ enabled: !!userId,
1963
+ ...options
1964
+ }
1965
+ );
1966
+ };
1967
+ const getAttendanceIssuesQueryHook = ({ tags, page, records, sortBy, sortDirection, query, ...options }) => {
1968
+ return useQuery(
1969
+ ["ATTENDANCE_ISSUES_QUERY", tags, page, records, sortBy, sortDirection, query, options],
1970
+ () => getAuth0("/ATIM/AttendanceIssues", {
1971
+ pPage: page || 1,
1972
+ pRecords: records || 50,
1973
+ pSortBy: sortBy || "CreateDate",
1974
+ pSortDirection: sortDirection || "asc",
1975
+ pTerms: tags,
1976
+ pQuery: query
1977
+ }),
1978
+ options
1979
+ );
1980
+ };
1981
+ const useAttendanceIssuesQueryHook = () => {
1982
+ const queryClient2 = useQueryClient();
1983
+ return useMutation((data) => {
1984
+ return data.CriticalityId ? putAuth0(`/ATIM/AttendanceIssues/${data.Id}`, void 0, data) : postAuth0("/ATIM/AttendanceIssues", void 0, data);
1985
+ }, {
1986
+ onSuccess: (data) => {
1987
+ queryClient2.setQueryData(
1988
+ ["ATTENDANCE_ISSUES_QUERY"],
1989
+ data
1990
+ );
1991
+ }
1992
+ });
1993
+ };
1994
+ const getCriticalitiesQuery = ({ tags, page, records, sortBy, sortDirection, query, ...options }) => {
1995
+ return useQuery(
1996
+ ["CRITICALITIES_QUERY", tags, page, records, sortBy, sortDirection, query, options],
1997
+ () => getAuth0("/ATIM/Criticalities", {
1998
+ pPage: page || 1,
1999
+ pRecords: records || 50,
2000
+ pSortBy: sortBy || "Value",
2001
+ pSortDirection: sortDirection || "asc",
2002
+ pTerms: tags,
2003
+ pQuery: query
2004
+ }),
2005
+ options
2006
+ );
2007
+ };
2008
+ const getReasonCodesQuery = ({ tags, page, records, sortBy, sortDirection, query, ...options }) => {
2009
+ return useQuery(
2010
+ ["REASON_CODES_QUERY", tags, page, records, sortBy, sortDirection, query, options],
2011
+ () => getAuth0("/ATIM/ReasonCodes", {
2012
+ pPage: page || 1,
2013
+ pRecords: records || 50,
2014
+ pSortBy: sortBy || "Name",
2015
+ pSortDirection: sortDirection || "asc",
2016
+ pTerms: tags,
2017
+ pQuery: query
2018
+ }),
2019
+ options
2020
+ );
2021
+ };
2022
+ const getScheduleQueryHook = ({
2023
+ date,
2024
+ storeId,
2025
+ ...options
2026
+ }) => {
2027
+ return useQuery(
2028
+ ["SCHEDULES_WIDGET_QUERY", date, storeId],
2029
+ () => getAuth0(`/ATIM/Schedules/StoreSchedule`, {
2030
+ pDate: date,
2031
+ pStoreId: storeId
2032
+ }),
2033
+ {
2034
+ ...options,
2035
+ useErrorBoundary: false,
2036
+ retry: 1
2037
+ }
2038
+ );
2039
+ };
2040
+ const getTemplateByIdQueryHook = (templateId) => {
2041
+ return useQuery(
2042
+ ["TEMPLATE_ID_QUERY", templateId],
2043
+ () => getAuth0(`/ASTA/Template/GetById`, {
2044
+ pId: templateId
2045
+ }),
2046
+ {
2047
+ enabled: !!templateId
2048
+ }
2049
+ );
2050
+ };
2051
+ const getTemplateHeadersQueryHook = () => {
2052
+ return useQuery(
2053
+ ["TEMPLATE_HEADERS_QUERY"],
2054
+ () => getAuth0(`/ASTA/Template/GetHeaders`)
2055
+ );
2056
+ };
2057
+ const getTemplateQueryHook = ({ tags, page, records, sortBy, sortDirection, query }) => {
2058
+ return useQuery(
2059
+ ["TEMPLATES_QUERY", tags, page, records, sortBy, sortDirection, query],
2060
+ () => getAuth0("/ASTA/Template/GetByQuery", {
2061
+ pPage: page || 1,
2062
+ pRecords: records || 50,
2063
+ pSortBy: sortBy || "Type",
2064
+ pSortDirection: sortDirection || "asc",
2065
+ pTerms: tags,
2066
+ pQuery: query
2067
+ }),
2068
+ {
2069
+ keepPreviousData: true
2070
+ }
2071
+ );
2072
+ };
2073
+ const useTemplateMutateHook = () => {
2074
+ const queryClient2 = useQueryClient();
2075
+ return useMutation((data) => {
2076
+ return data.Id ? putAuth0(`/ASTA/Template?`, {
2077
+ pId: data.Id
2078
+ }, data) : postAuth0("/ASTA/Template", void 0, data);
2079
+ }, {
2080
+ onSuccess: (data) => {
2081
+ queryClient2.setQueryData(
2082
+ ["TEMPLATE_ID_QUERY"],
2083
+ data
2084
+ );
2085
+ }
2086
+ });
2087
+ };
2088
+ const deleteTemplateMutateHook = ({ templatesIds }) => {
2089
+ const queryClient2 = useQueryClient();
2090
+ return useMutation(() => {
2091
+ return putAuth0(`/ASTA/Template/DeleteTemplateList`, void 0, templatesIds);
2092
+ }, {
2093
+ onSuccess: () => {
2094
+ queryClient2.invalidateQueries(
2095
+ ["TEMPLATE_QUERY"]
2096
+ );
2097
+ }
2098
+ });
2099
+ };
2100
+ const extractTemplateQueryHook = ({ templatesIds }) => {
2101
+ const queryClient2 = useQueryClient();
2102
+ return useMutation(() => {
2103
+ return putAuth0(`/ASTA/Template/FinishedTemplateList`, void 0, templatesIds);
2104
+ }, {
2105
+ onSuccess: (data) => {
2106
+ queryClient2.setQueryData(
2107
+ ["TEMPLATE_ID_QUERY"],
2108
+ data
2109
+ );
2110
+ }
2111
+ });
2112
+ };
2113
+ const archiveTemplateQueryHook = ({ templatesIds }) => {
2114
+ const queryClient2 = useQueryClient();
2115
+ return useMutation(() => {
2116
+ return putAuth0(`/ASTA/Template/FileTemplateList`, void 0, templatesIds);
2117
+ }, {
2118
+ onSuccess: (data) => {
2119
+ queryClient2.setQueryData(
2120
+ ["TEMPLATE_ID_QUERY"],
2121
+ data
2122
+ );
2123
+ }
2124
+ });
2125
+ };
2126
+ const duplicateTemplateQueryHook = ({ templatesIds }) => {
2127
+ const queryClient2 = useQueryClient();
2128
+ return useMutation(() => {
2129
+ return postAuth0(`/ASTA/Template/DuplicateTemplateList`, void 0, templatesIds);
2130
+ }, {
2131
+ onSuccess: (data) => {
2132
+ queryClient2.setQueryData(
2133
+ ["TEMPLATE_ID_QUERY"],
2134
+ data
2135
+ );
2136
+ }
2137
+ });
2138
+ };
2139
+ const finishTemplateQueryHook = () => {
2140
+ const queryClient2 = useQueryClient();
2141
+ return useMutation((data) => {
2142
+ return putAuth0(`/ASTA/Template/FinishTemplate?`, {
2143
+ pId: data.Id
2144
+ }, data);
2145
+ }, {
2146
+ onSuccess: (data) => {
2147
+ queryClient2.setQueryData(
2148
+ ["TEMPLATE_ID_QUERY"],
2149
+ data
2150
+ );
2151
+ }
2152
+ });
2153
+ };
2154
+ const getInspectionQueryHook = ({ tags, page, records, sortBy, sortDirection, query }) => {
2155
+ return useQuery(
2156
+ ["INSPECTION_QUERY", tags, page, records, sortBy, sortDirection, query],
2157
+ () => getAuth0("/ASTA/Inspection/GetInspection", {
2158
+ pPage: page || 1,
2159
+ pRecords: records || 50,
2160
+ pSortBy: sortBy || "Type",
2161
+ pSortDirection: sortDirection || "asc",
2162
+ pTerms: tags,
2163
+ pQuery: query
2164
+ }),
2165
+ {
2166
+ keepPreviousData: true
2167
+ }
2168
+ );
2169
+ };
2170
+ const useInspectionMutateHook = (templateId, userId, userName) => {
2171
+ const queryClient2 = useQueryClient();
2172
+ return useMutation((data) => {
2173
+ return data.Id ? putAuth0(`/ASTA/Inspection/FileInspection?`, {
2174
+ pId: data.Id
2175
+ }, data) : postAuth0(`/ASTA/Inspection?`, {
2176
+ pId: templateId,
2177
+ pUserId: userId,
2178
+ pUserName: userName
2179
+ }, data);
2180
+ }, {
2181
+ onSuccess: (data) => {
2182
+ queryClient2.setQueryData(
2183
+ ["INSPECTION_ID_QUERY"],
2184
+ data
2185
+ );
2186
+ }
2187
+ });
2188
+ };
2189
+ const deleteInspectionMutateHook = ({ inspectionIds }) => {
2190
+ const queryClient2 = useQueryClient();
2191
+ return useMutation(() => {
2192
+ return putAuth0(`/ASTA/Inspection/DeleteInspectionList`, void 0, inspectionIds);
2193
+ }, {
2194
+ onSuccess: () => {
2195
+ queryClient2.invalidateQueries(
2196
+ ["INSPECTION_QUERY"]
2197
+ );
2198
+ }
2199
+ });
2200
+ };
2201
+ const finishInspectionQueryHook = () => {
2202
+ const queryClient2 = useQueryClient();
2203
+ return useMutation((data) => {
2204
+ return putAuth0(`/ASTA/Inspection/FinishInspection?`, {
2205
+ pId: data.Id
2206
+ }, data);
2207
+ }, {
2208
+ onSuccess: (data) => {
2209
+ queryClient2.setQueryData(
2210
+ ["INSPECTION_ID_QUERY"],
2211
+ data
2212
+ );
2213
+ }
2214
+ });
2215
+ };
2216
+ const archiveInspectionQueryHook = ({ inspectionIds }) => {
2217
+ const queryClient2 = useQueryClient();
2218
+ return useMutation(() => {
2219
+ return putAuth0(`/ASTA/Inspection/FileInspectionList`, void 0, inspectionIds);
2220
+ }, {
2221
+ onSuccess: (data) => {
2222
+ queryClient2.setQueryData(
2223
+ ["INSPECTION_ID_QUERY"],
2224
+ data
2225
+ );
2226
+ }
2227
+ });
2228
+ };
2229
+ const extractInspectionQueryHook = ({ inspectionIds }) => {
2230
+ const queryClient2 = useQueryClient();
2231
+ return useMutation(() => {
2232
+ return putAuth0(`/ASTA/Inspection/FinishedInspectionList`, void 0, inspectionIds);
2233
+ }, {
2234
+ onSuccess: (data) => {
2235
+ queryClient2.setQueryData(
2236
+ ["INSPECTION_ID_QUERY"],
2237
+ data
2238
+ );
2239
+ }
2240
+ });
2241
+ };
2242
+ const exportInspectionMutateHook = (inspectionId, userName, language) => {
2243
+ const queryClient2 = useQueryClient();
2244
+ return useMutation((data) => {
2245
+ return postAuth0(`/ASTA/Inspection/AnswerExport?`, {
2246
+ pInspectionId: inspectionId,
2247
+ pUserName: userName,
2248
+ pLanguage: language || "PT"
2249
+ }, data);
2250
+ }, {
2251
+ onSuccess: (data) => {
2252
+ queryClient2.setQueryData(
2253
+ ["EXPORT_INSPECTION_QUERY"],
2254
+ data
2255
+ );
2256
+ }
2257
+ });
2258
+ };
2259
+ const getAstaAnswersQueryHook = ({ tags, page, records, sortBy, sortDirection, query }) => {
2260
+ return useQuery(
2261
+ ["ASTA_ANSWERS_QUERY", tags, page, records, sortBy, sortDirection, query],
2262
+ () => getAuth0("/ASTA/Answers/GetAnswers", {
2263
+ pPage: page || 1,
2264
+ pRecords: records || 50,
2265
+ pSortBy: sortBy || "Type",
2266
+ pSortDirection: sortDirection || "asc",
2267
+ pTerms: tags,
2268
+ pQuery: query
2269
+ }),
2270
+ {
2271
+ keepPreviousData: true
2272
+ }
2273
+ );
2274
+ };
2275
+ const getAnswerByIdQueryHook = (answerId) => {
2276
+ return useQuery(
2277
+ ["ANSWER_ID_QUERY", answerId],
2278
+ () => getAuth0(`/ASTA/Answers/GetAnswerById`, {
2279
+ pId: answerId
2280
+ }),
2281
+ {
2282
+ enabled: !!answerId
2283
+ }
2284
+ );
2285
+ };
2286
+ const useAstaAnswersMutateHook = (inspectionId, answerId) => {
2287
+ const queryClient2 = useQueryClient();
2288
+ return useMutation((data) => {
2289
+ return inspectionId === "" ? putAuth0(`/ASTA/Answers/${answerId}`, void 0, data) : postAuth0(`/ASTA/Answers?`, {
2290
+ pInspectionId: inspectionId
2291
+ }, data);
2292
+ }, {
2293
+ onSuccess: (data) => {
2294
+ queryClient2.setQueryData(
2295
+ ["ASTA_ANSWERS_ID_QUERY"],
2296
+ data
2297
+ );
2298
+ }
2299
+ });
2300
+ };
2301
+ const finishAstaAnswersQueryHook = () => {
2302
+ const queryClient2 = useQueryClient();
2303
+ return useMutation((data) => {
2304
+ return putAuth0(`/ASTA/Answers/FinishInspectionAnswer/${data.Id}`, void 0, data);
2305
+ }, {
2306
+ onSuccess: (data) => {
2307
+ queryClient2.setQueryData(
2308
+ ["ASTA_ANSWERS_ID_QUERY"],
2309
+ data
2310
+ );
2311
+ }
2312
+ });
2313
+ };
2314
+ const putAnswerImageMutateHook = (questionnaireId) => {
2315
+ const queryClient2 = useQueryClient();
2316
+ return useMutation((data) => {
2317
+ return putAuth0(`/ASTA/Answers/Image/${questionnaireId}`, void 0, data);
2318
+ }, {
2319
+ onSuccess: (data) => {
2320
+ queryClient2.setQueryData(
2321
+ ["ASTA_ANSWER_ID_QUERY"],
2322
+ data
2323
+ );
2324
+ }
2325
+ });
2326
+ };
2327
+ const sendInspectionEmailMutateHook = (answerId, userName, email, storeId, pdfUrl) => {
2328
+ const queryClient2 = useQueryClient();
2329
+ return useMutation((data) => {
2330
+ return putAuth0(`/ASTA/Answers/SendEmail?`, {
2331
+ pAnswerId: answerId,
2332
+ pUserName: userName,
2333
+ pEmail: email,
2334
+ pStoreId: storeId,
2335
+ pPDFUrl: pdfUrl
2336
+ }, data);
2337
+ }, {
2338
+ onSuccess: (data) => {
2339
+ queryClient2.setQueryData(
2340
+ ["SEND_INSPECTION_EMAIL_QUERY"],
2341
+ data
2342
+ );
2343
+ }
2344
+ });
2345
+ };
2346
+ const finishGNGAstaAnswersQueryHook = (answerId, userName) => {
2347
+ const queryClient2 = useQueryClient();
2348
+ return useMutation((data) => {
2349
+ return postAuth0(`/ASTA/Audit?`, {
2350
+ pInspectionAnswerId: answerId,
2351
+ pUserName: userName
2352
+ }, data);
2353
+ }, {
2354
+ onSuccess: (data) => {
2355
+ queryClient2.setQueryData(
2356
+ ["ASTA_GNG_ANSWERS_ID_QUERY"],
2357
+ data
2358
+ );
2359
+ }
2360
+ });
2361
+ };
2362
+ const sendInspectionEmailStoreMutateHook = (answerId, userName, storeId, pdfUrl) => {
2363
+ const queryClient2 = useQueryClient();
2364
+ return useMutation((data) => {
2365
+ return putAuth0(`/ASTA/Answers/SendEmailStore?`, {
2366
+ pAnswerId: answerId,
2367
+ pUserName: userName,
2368
+ pStoreId: storeId,
2369
+ pPDFUrl: pdfUrl
2370
+ }, data);
2371
+ }, {
2372
+ onSuccess: (data) => {
2373
+ queryClient2.setQueryData(
2374
+ ["SEND_INSPECTION_EMAIL_STORE_QUERY"],
2375
+ data
2376
+ );
2377
+ }
2378
+ });
2379
+ };
2380
+ const getAnswerTypeQueryHook = () => {
2381
+ return useQuery(
2382
+ ["ANSWER_TYPE_QUERY"],
2383
+ () => getAuth0(`/ASTA/AnswerType`)
2384
+ );
2385
+ };
2386
+ const getAllAnswerTypeQueryHook = ({ tags, page, records, sortBy, sortDirection, query }) => {
2387
+ return useQuery(
2388
+ ["ALL_ANSWER_TYPE_QUERY", tags, page, records, sortBy, sortDirection, query],
2389
+ () => getAuth0("/ASTA/AnswerType/GetByQuery", {
2390
+ pPage: page || 1,
2391
+ pRecords: records || 50,
2392
+ pSortBy: sortBy || "Type",
2393
+ pSortDirection: sortDirection || "asc",
2394
+ pTerms: tags,
2395
+ pQuery: query
2396
+ }),
2397
+ {
2398
+ keepPreviousData: true
2399
+ }
2400
+ );
2401
+ };
2402
+ const getAnswerColorsQueryHook = () => {
2403
+ return useQuery(
2404
+ ["ANSWER_COLORS_QUERY"],
2405
+ () => getAuth0(`/ASTA/AnswerType/Colors`)
2406
+ );
2407
+ };
2408
+ const getAnswerTypeByIdQueryHook = (answerTypeId) => {
2409
+ return useQuery(
2410
+ ["ANSWER_TYPE_ID_QUERY", answerTypeId],
2411
+ () => getAuth0(`/ASTA/AnswerType/GetById`, {
2412
+ pId: answerTypeId
2413
+ }),
2414
+ {
2415
+ enabled: !!answerTypeId
2416
+ }
2417
+ );
2418
+ };
2419
+ const useAnswerTypeMutateHook = () => {
2420
+ const queryClient2 = useQueryClient();
2421
+ return useMutation((data) => {
2422
+ return data.Id ? putAuth0(`/ASTA/AnswerType?`, {
2423
+ pId: data.Id
2424
+ }, data) : postAuth0("/ASTA/AnswerType", void 0, data);
2425
+ }, {
2426
+ onSuccess: (data) => {
2427
+ queryClient2.setQueryData(
2428
+ ["ANSWER_TYPE_ID_QUERY"],
2429
+ data
2430
+ );
2431
+ }
2432
+ });
2433
+ };
2434
+ const deleteAnswerTypeHook = ({ answerTypeIds }) => {
2435
+ const queryClient2 = useQueryClient();
2436
+ return useMutation(() => {
2437
+ return putAuth0(`/ASTA/AnswerType/Delete`, void 0, answerTypeIds);
2438
+ }, {
2439
+ onSuccess: () => {
2440
+ queryClient2.invalidateQueries(
2441
+ ["ALL_ANSWER_TYPE_QUERY"]
2442
+ );
2443
+ }
2444
+ });
2445
+ };
2446
+ const finishAnswerTypeQueryHook = () => {
2447
+ const queryClient2 = useQueryClient();
2448
+ return useMutation((data) => {
2449
+ return putAuth0(`/ASTA/AnswerType/Finished?`, {
2450
+ pId: data.Id
2451
+ }, data);
2452
+ }, {
2453
+ onSuccess: (data) => {
2454
+ queryClient2.setQueryData(
2455
+ ["ANSWER_TYPE_ID_QUERY"],
2456
+ data
2457
+ );
2458
+ }
2459
+ });
2460
+ };
2461
+ const selectAnswerNameQueryHook = () => {
2462
+ const queryClient2 = useQueryClient();
2463
+ return useMutation((data) => {
2464
+ return putAuth0(`/ASTA/AnswerType/SelectName?`, {
2465
+ pAnswerTypeId: data.Id,
2466
+ pUseName: data.UseName
2467
+ }, data);
2468
+ }, {
2469
+ onSuccess: (data) => {
2470
+ queryClient2.setQueryData(
2471
+ ["ANSWER_NAME_ID_QUERY"],
2472
+ data
2473
+ );
2474
+ }
2475
+ });
2476
+ };
2477
+ const getActionByIdQueryHook = (actionId) => {
2478
+ return useQuery(
2479
+ ["ACTION_ID_QUERY", actionId],
2480
+ () => getAuth0(`/ASTA/Actions/GetById`, {
2481
+ pId: actionId
2482
+ }),
2483
+ {
2484
+ enabled: !!actionId
2485
+ }
2486
+ );
2487
+ };
2488
+ const getActionStageQueryHook = () => {
2489
+ return useQuery(
2490
+ ["ACTION_STAGES_QUERY"],
2491
+ () => getAuth0(`/ASTA/Actions/ActionsStatus`)
2492
+ );
2493
+ };
2494
+ const getActionPriorityQueryHook = () => {
2495
+ return useQuery(
2496
+ ["ACTION_PRIORITY_QUERY"],
2497
+ () => getAuth0(`/ASTA/Actions/Prioritys`)
2498
+ );
2499
+ };
2500
+ const getActionQueryHook = ({ tags, page, records, sortBy, sortDirection, query }) => {
2501
+ return useQuery(
2502
+ ["ACTION_QUERY", tags, page, records, sortBy, sortDirection, query],
2503
+ () => getAuth0("/ASTA/Actions/GetByQuery", {
2504
+ pPage: page || 1,
2505
+ pRecords: records || 50,
2506
+ pSortBy: sortBy || "Type",
2507
+ pSortDirection: sortDirection || "asc",
2508
+ pTerms: tags,
2509
+ pQuery: query
2510
+ }),
2511
+ {
2512
+ keepPreviousData: true
2513
+ }
2514
+ );
2515
+ };
2516
+ const useActionMutateHook = () => {
2517
+ const queryClient2 = useQueryClient();
2518
+ return useMutation((data) => {
2519
+ return data.Id ? putAuth0(`/ASTA/Actions?`, {
2520
+ pId: data.Id
2521
+ }, data) : postAuth0("/ASTA/Actions", void 0, data);
2522
+ }, {
2523
+ onSuccess: (data) => {
2524
+ queryClient2.setQueryData(
2525
+ ["ACTIONS_ID_QUERY"],
2526
+ data
2527
+ );
2528
+ }
2529
+ });
2530
+ };
2531
+ const deleteActionMutateHook = ({ actionsIds }) => {
2532
+ const queryClient2 = useQueryClient();
2533
+ return useMutation(() => {
2534
+ return putAuth0(`/ASTA/Actions/DeleteActionList`, void 0, actionsIds);
2535
+ }, {
2536
+ onSuccess: () => {
2537
+ queryClient2.invalidateQueries(
2538
+ ["ACTION_QUERY"]
2539
+ );
2540
+ }
2541
+ });
2542
+ };
2543
+ const extractActionQueryHook = ({ actionsIds }) => {
2544
+ const queryClient2 = useQueryClient();
2545
+ return useMutation(() => {
2546
+ return putAuth0(`/ASTA/Actions/FinishedActionList`, void 0, actionsIds);
2547
+ }, {
2548
+ onSuccess: (data) => {
2549
+ queryClient2.setQueryData(
2550
+ ["ACTION_ID_QUERY"],
2551
+ data
2552
+ );
2553
+ }
2554
+ });
2555
+ };
2556
+ const archiveActionQueryHook = ({ actionsIds }) => {
2557
+ const queryClient2 = useQueryClient();
2558
+ return useMutation(() => {
2559
+ return putAuth0(`/ASTA/Actions/FileActionList`, void 0, actionsIds);
2560
+ }, {
2561
+ onSuccess: (data) => {
2562
+ queryClient2.setQueryData(
2563
+ ["ACTION_ID_QUERY"],
2564
+ data
2565
+ );
2566
+ }
2567
+ });
2568
+ };
2569
+ const finishActionQueryHook = () => {
2570
+ const queryClient2 = useQueryClient();
2571
+ return useMutation((data) => {
2572
+ return putAuth0(`/ASTA/Actions/FinishAction?`, {
2573
+ pId: data.Id
2574
+ }, data);
2575
+ }, {
2576
+ onSuccess: (data) => {
2577
+ queryClient2.setQueryData(
2578
+ ["ACTION_ID_QUERY"],
2579
+ data
2580
+ );
2581
+ }
2582
+ });
2583
+ };
2584
+ const startActionQueryHook = () => {
2585
+ const queryClient2 = useQueryClient();
2586
+ return useMutation((data) => {
2587
+ return putAuth0(`/ASTA/Actions/StartAction?`, {
2588
+ pId: data.Id
2589
+ }, data);
2590
+ }, {
2591
+ onSuccess: (data) => {
2592
+ queryClient2.setQueryData(
2593
+ ["ACTION_ID_QUERY"],
2594
+ data
2595
+ );
2596
+ }
2597
+ });
2598
+ };
2599
+ const selectActionStatusQueryHook = () => {
2600
+ const queryClient2 = useQueryClient();
2601
+ return useMutation((data) => {
2602
+ return putAuth0(`/ASTA/Actions/SelectStatus?`, {
2603
+ pActionId: data.Id,
2604
+ pStatus: data.Stage
2605
+ }, data);
2606
+ }, {
2607
+ onSuccess: (data) => {
2608
+ queryClient2.setQueryData(
2609
+ ["ACTION_STATUS_ID_QUERY"],
2610
+ data
2611
+ );
2612
+ }
2613
+ });
2614
+ };
2615
+ const getPriceChangePinQueryHook = (storeId, options) => {
2616
+ return useQuery(
2617
+ ["PRICE_CHANGE_PIN_QUERY", storeId],
2618
+ () => getAuth0(`/GNG/Users/Pin/${storeId}`),
2619
+ {
2620
+ enabled: !!storeId,
2621
+ ...options
2622
+ }
2623
+ );
2624
+ };
2625
+ const postPriceChangePinQueryHook = ({ storeId }) => {
2626
+ const queryClient2 = useQueryClient();
2627
+ return useMutation(() => {
2628
+ return postAuth0(`/GNG/Users/Pin/${storeId}`);
2629
+ }, {
2630
+ onSuccess: (data) => {
2631
+ queryClient2.setQueryData(
2632
+ ["PRICE_CHANGE_PIN_QUERY"],
2633
+ data
2634
+ );
2635
+ }
2636
+ });
2637
+ };
2638
+ const sendEmailWithPinQueryHook = ({ storeId }) => {
2639
+ const queryClient2 = useQueryClient();
2640
+ return useMutation(() => {
2641
+ return postAuth0(`/GNG/Users/Pin/Email/${storeId}`);
2642
+ }, {
2643
+ onSuccess: (data) => {
2644
+ queryClient2.setQueryData(
2645
+ ["EMAIL_PIN_QUERY"],
2646
+ data
2647
+ );
2648
+ }
2649
+ });
2650
+ };
2651
+ const getMonthsListQueryHook = () => {
2652
+ return useQuery(
2653
+ ["MONTHS_LIST_QUERY"],
2654
+ () => getAuth0(`/ABWG/BWGEmployees/BackOffice`)
2655
+ );
2656
+ };
2657
+ const publishMonthsEmployeeHook = () => {
2658
+ const queryClient2 = useQueryClient();
2659
+ return useMutation((data) => {
2660
+ return postAuth0(`/ABWG/BWGEmployees?`, {
2661
+ pMonth: data.MonthCode,
2662
+ pUserId: data.UserId,
2663
+ pYear: data.Year
2664
+ }, data);
2665
+ }, {
2666
+ onSuccess: (data) => {
2667
+ queryClient2.setQueryData(
2668
+ ["PUBLISH_MONTH_EMPLOYEE_QUERY"],
2669
+ data
2670
+ );
2671
+ }
2672
+ });
2673
+ };
2674
+ const publishMonthsManagerHook = () => {
2675
+ const queryClient2 = useQueryClient();
2676
+ return useMutation((data) => {
2677
+ return postAuth0(`/ABWG/BWGManager?`, {
2678
+ pMonth: data.MonthCode,
2679
+ pUserId: data.UserId,
2680
+ pYear: data.Year
2681
+ }, data);
2682
+ }, {
2683
+ onSuccess: (data) => {
2684
+ queryClient2.setQueryData(
2685
+ ["PUBLISH_MONTH_MANAGER_QUERY"],
2686
+ data
2687
+ );
2688
+ }
2689
+ });
2690
+ };
2691
+ const getBwgAllEmployeesQuery = ({ tags, page, records, sortBy, sortDirection, query, userId, ...options }) => {
2692
+ return useQuery(
2693
+ ["BWG_ALL_EMPLOYEES", tags, page, records, sortBy, sortDirection, query, userId, options],
2694
+ () => getAuth0("/ABWG/BWGEmployees/AllEmployees/Omnium", {
2695
+ pPage: page || 1,
2696
+ pRecords: records || 50,
2697
+ pSortBy: sortBy || "Points",
2698
+ pSortDirection: sortDirection || "asc",
2699
+ pTerms: tags,
2700
+ pQuery: query,
2701
+ pUserId: userId
2702
+ }),
2703
+ options
2704
+ );
2705
+ };
2706
+ const getBwgBackOfficeQuery = ({ tags, page, records, sortBy, sortDirection, query, userId, ...options }) => {
2707
+ return useQuery(
2708
+ ["BWG_BACK_OFFICE", tags, page, records, sortBy, sortDirection, query, userId, options],
2709
+ () => getAuth0("/ABWG/BWGEmployees/BackOffice/Omnium", {
2710
+ pPage: page || 1,
2711
+ pRecords: records || 50,
2712
+ pSortBy: sortBy || "Points",
2713
+ pSortDirection: sortDirection || "asc",
2714
+ pTerms: tags,
2715
+ pQuery: query,
2716
+ pUserId: userId
2717
+ }),
2718
+ options
2719
+ );
2720
+ };
2721
+ const importRegulationHook = (bodyType) => {
2722
+ const queryClient2 = useQueryClient();
2723
+ return useMutation((data) => {
2724
+ return postAuth0(`/ABWG/File`, void 0, data, bodyType);
2725
+ }, {
2726
+ onSuccess: (data) => {
2727
+ queryClient2.setQueryData(
2728
+ ["IMPORT_REGULATION_QUERY"],
2729
+ data
2730
+ );
2731
+ }
2732
+ });
2733
+ };
2734
+ const importABWGQuery = (integrationType, bodyType) => {
2735
+ const queryClient2 = useQueryClient();
2736
+ return useMutation((data) => {
2737
+ return postAuth0(`/ABWG/IntegrationRequests?`, {
2738
+ pIntegrationType: integrationType
2739
+ }, data, bodyType);
2740
+ }, {
2741
+ onSuccess: (data) => {
2742
+ queryClient2.setQueryData(
2743
+ ["INTEGRATION_REQUEST_QUERY"],
2744
+ data
2745
+ );
2746
+ }
2747
+ });
2748
+ };
2749
+ const getVoucherLoyaltyQueryHook = ({ voucherCode, userId, ...options }) => {
2750
+ return useQuery(
2751
+ ["LOYALTY_VOUCHERS", voucherCode, userId],
2752
+ () => getAuth0(`/ACUL/Vouchers`, {
2753
+ pVoucherCode: voucherCode,
2754
+ pUserId: userId
2755
+ }),
2756
+ {
2757
+ ...options,
2758
+ retry: false
2759
+ }
2760
+ );
2761
+ };
2762
+ const getCustomersLoyaltyQueryHook = ({ email, userId, ...options }) => {
2763
+ return useQuery(
2764
+ ["SITOO_MIMO_CUSTOMERS", email, userId],
2765
+ () => getAuth0(`/ACUL/Customers/${email}`, {
2766
+ pUserId: userId
2767
+ }),
2768
+ {
2769
+ ...options,
2770
+ retry: false
2771
+ }
2772
+ );
2773
+ };
2774
+ const getVoucherSitooQueryHook = ({ id, userId, ...options }) => {
2775
+ return useQuery(
2776
+ ["SITOO_MIMO_VOUCHERS", id, userId],
2777
+ () => getAuth0(`/GNG/ACUL/GiftCard/${id}`, {
2778
+ pUserId: userId
2779
+ }),
2780
+ {
2781
+ ...options,
2782
+ retry: false
2783
+ }
2784
+ );
2785
+ };
2786
+ const getVoucherTemplatesQueryHook = ({ page, records, sortBy, sortDirection, ...options }) => {
2787
+ return useQuery(
2788
+ ["CONFIG_VOUCHER_TEMPLATES", page, records, sortBy, sortDirection],
2789
+ () => getAuth0(`/ACUL/VoucherTemplates`, {
2790
+ pPage: page || 1,
2791
+ pSortField: sortBy || "Name",
2792
+ pSortOrder: sortDirection || "asc",
2793
+ pRecords: records || 50
2794
+ }),
2795
+ {
2796
+ keepPreviousData: true,
2797
+ retry: false,
2798
+ ...options
2799
+ }
2800
+ );
2801
+ };
2802
+ const postSaldoVoucherQueryHook = ({ Id, userId }) => {
2803
+ const queryClient2 = useQueryClient();
2804
+ return useMutation(() => {
2805
+ return postWithParameters(`/GNG/ACUL/GiftCard/${Id}?`, {
2806
+ pUserId: userId
2807
+ });
2808
+ }, {
2809
+ onSuccess: (data) => {
2810
+ queryClient2.setQueryData(["CREATE_VOUCHER_SITOO_MIMO"], data);
2811
+ }
2812
+ });
2813
+ };
2814
+ const postSalesAssociationQueryHook = () => {
2815
+ const queryClient2 = useQueryClient();
2816
+ return useMutation((data) => {
2817
+ return postWithParameters("/ACUL/Sales", void 0, data);
2818
+ }, {
2819
+ onSuccess: (data) => {
2820
+ queryClient2.setQueryData(["CREATE_INTEGRATION_REQUEST"], data);
2821
+ }
2822
+ });
2823
+ };
2824
+ const postVoucherSitooQueryHook = ({ Id, userId }) => {
2825
+ const queryClient2 = useQueryClient();
2826
+ return useMutation(() => {
2827
+ return postWithParameters(`/GNG/ACUL/GiftCard/${Id}/transaction?`, {
2828
+ pUserId: userId
2829
+ });
2830
+ }, {
2831
+ onSuccess: (data) => {
2832
+ queryClient2.setQueryData(["CREATE_VOUCHER_SITOO_MIMO"], data);
2833
+ }
2834
+ });
2835
+ };
2836
+ const postVerificationEmailSitooQueryHook = ({ userId }) => {
2837
+ const queryClient2 = useQueryClient();
2838
+ return useMutation((data) => {
2839
+ return postWithParameters(`/ACUL/Customers/verificationEmail?`, {
2840
+ pUserId: userId
2841
+ }, data);
2842
+ }, {
2843
+ onSuccess: (data) => {
2844
+ queryClient2.setQueryData(["POST_VERIFICATION_EMAIL_SITOO_MIMO"], data);
2845
+ }
2846
+ });
2847
+ };
2848
+ const postVerificationUserSitooQueryHook = ({ userId }) => {
2849
+ const queryClient2 = useQueryClient();
2850
+ return useMutation((data) => {
2851
+ return postWithParameters(`/ACUL/Customers/verifyUser?`, {
2852
+ pUserId: userId
2853
+ }, data);
2854
+ }, {
2855
+ onSuccess: (data) => {
2856
+ queryClient2.setQueryData(["POST_VERIFICATION_EMAIL_SITOO_MIMO"], data);
2857
+ }
2858
+ });
2859
+ };
2860
+ const useDisableVoucherTemplate = () => {
2861
+ const queryClient2 = useQueryClient();
2862
+ return useMutation(
2863
+ (data) => putWithParameters(
2864
+ `/ACUL/VoucherTemplates/Disable?`,
2865
+ {
2866
+ pVoucherTemplateId: data.Id
2867
+ }
2868
+ ),
2869
+ {
2870
+ onSuccess: () => {
2871
+ queryClient2.invalidateQueries(["CONFIG_VOUCHER_TEMPLATES"]);
2872
+ }
2873
+ }
2874
+ );
2875
+ };
2876
+ const postCreateVoucherTemplates = () => {
2877
+ const queryClient2 = useQueryClient();
2878
+ return useMutation(
2879
+ (data) => post("/ACUL/VoucherTemplates", data),
2880
+ {
2881
+ onSuccess: (newTemplate) => {
2882
+ queryClient2.invalidateQueries(["CONFIG_VOUCHER_TEMPLATES"]);
2883
+ }
2884
+ }
2885
+ );
2886
+ };
2887
+ const reactivateVoucher = ({ voucherId, userId }) => {
2888
+ const queryClient2 = useQueryClient();
2889
+ return useMutation(
2890
+ () => putWithParameters(
2891
+ `/ACUL/Vouchers/reactivate?`,
2892
+ {
2893
+ pUserId: userId,
2894
+ pVoucherId: voucherId
2895
+ }
2896
+ ),
2897
+ {
2898
+ onSuccess: (data) => {
2899
+ queryClient2.setQueryData(["REACTIVATE_VOUCHER"], data);
2900
+ }
2901
+ }
2902
+ );
2903
+ };
2904
+ const getGngDocumentos = ({
2905
+ page,
2906
+ records,
2907
+ query,
2908
+ ...options
2909
+ }) => {
2910
+ return useQuery(
2911
+ ["GNG_DOCUMENTOS", page, records, query],
2912
+ () => get("/GNG/Document/Documents", {
2913
+ pPage: page || 1,
2914
+ pRecords: records || 50,
2915
+ pQuery: query
2916
+ }),
2917
+ options
2918
+ );
2919
+ };
2920
+ const getSitooDocumentos = ({ fields, externalid, ...options }) => {
2921
+ return useQuery(
2922
+ ["SITOO_DOCUMENTOS", fields, externalid],
2923
+ () => get("/Sitoo/Orders", {
2924
+ pFields: fields || "externalid,orderid",
2925
+ pExternalid: externalid
2926
+ }),
2927
+ options
2928
+ );
2929
+ };
2930
+ const getGNGVoucher = ({ page, records, query, ...options }) => {
2931
+ return useQuery(
2932
+ ["GNG_VOUCHER", page, records, query],
2933
+ () => get("/GNG/Document/GiftCards", {
2934
+ pPage: page || 1,
2935
+ pRecords: records || 50,
2936
+ pQuery: query
2937
+ }),
2938
+ options
2939
+ );
2940
+ };
2941
+ const getSitooVouchers = ({ id, ...options }) => {
2942
+ return useQuery(
2943
+ ["SITOO_VOUCHERS", id],
2944
+ () => getBasic(`/GNG/GiftCard/SPIGiftCard/giftcards/${id}.json`),
2945
+ {
2946
+ ...options,
2947
+ retry: false
2948
+ }
2949
+ );
2950
+ };
2951
+ const getVoucherIntegrationRequestStatus = ({ pIntegrationType, pSourcePlatformId, ...options }) => {
2952
+ return useQuery(
2953
+ ["INTEGRATION_REQUEST_STATUS", pIntegrationType, pSourcePlatformId],
2954
+ () => get("/Document/IntegrationRequests/latestIntegration", {
2955
+ pIntegrationType,
2956
+ pSourcePlatformId
2957
+ }),
2958
+ {
2959
+ ...options,
2960
+ retry: false
2961
+ }
2962
+ );
2963
+ };
2964
+ const getOrderDocuments = ({ page, records, query, ...options }) => {
2965
+ return useQuery(
2966
+ ["GNG_DOCUMENTOS", page, records, query],
2967
+ () => get("/GNG/Document/Documents/In", {
2968
+ pPage: page || 1,
2969
+ pRecords: records || 50,
2970
+ pQuery: query
2971
+ }),
2972
+ options
2973
+ );
2974
+ };
2975
+ const getFaqsQuery = ({
2976
+ page,
2977
+ records,
2978
+ sortBy,
2979
+ sortDirection,
2980
+ terms,
2981
+ ...options
2982
+ }) => {
2983
+ return useQuery(
2984
+ ["FAQS_DATA", page, records, sortBy, sortDirection, terms],
2985
+ () => getAuth0("/OSUA/Pages", {
2986
+ pPage: page || 1,
2987
+ pRecords: records || 10,
2988
+ pSortBy: sortBy || "Title",
2989
+ pSortDirection: sortDirection || "asc",
2990
+ pTerms: terms
2991
+ }),
2992
+ options
2993
+ );
2994
+ };
2995
+ const getSitooErrorEvents = ({
2996
+ page,
2997
+ records,
2998
+ sortBy,
2999
+ sortDirection,
3000
+ ...options
3001
+ }) => {
3002
+ return useQuery(
3003
+ ["SITOO_ERROR_EVENTS", page, records, sortBy, sortDirection],
3004
+ () => get("/Sitoo/Document/Events/Error", {
3005
+ pPage: page,
3006
+ pRecords: records,
3007
+ pSortBy: sortBy || "EventDate",
3008
+ pSortDirection: sortDirection || "desc"
3009
+ }),
3010
+ options
3011
+ );
3012
+ };
3013
+ const getSalesNumberOsua = ({ pGiftCardNumber, ...options }) => {
3014
+ return useQuery(
3015
+ ["SALES_NUMBER_OSUA_VOUCHERS", pGiftCardNumber],
3016
+ () => getAuth0("/GNG/Document/Documents/findByGiftCardNumber", {
3017
+ pGiftCardNumber
3018
+ }),
3019
+ {
3020
+ ...options,
3021
+ retry: false
3022
+ }
3023
+ );
3024
+ };
3025
+ const getQueuesMessages = ({
3026
+ id,
3027
+ page,
3028
+ records,
3029
+ ...options
3030
+ }) => {
3031
+ return useQuery(
3032
+ ["OSUA_QUEUES_MESSAGES", id, page, records],
3033
+ () => getAuth0(`/OSUA/Queues/Messages`, {
3034
+ pPage: page,
3035
+ pRecords: records,
3036
+ pQueueName: id
3037
+ }),
3038
+ options
3039
+ );
3040
+ };
3041
+ const getQueues = () => {
3042
+ return useQuery(
3043
+ ["OSUA_QUEUES"],
3044
+ () => getAuth0("/OSUA/Queues"),
3045
+ {
3046
+ enabled: true,
3047
+ retry: 1
3048
+ }
3049
+ );
3050
+ };
3051
+ const getOsuaVoucher = ({ page, records, sortBy, sortDirection, terms, query, ...options }) => {
3052
+ return useQuery(
3053
+ ["OSUA_VOUCHER", page, records, sortBy, sortDirection, terms, query, options],
3054
+ () => getAuth0("/OSUA/Vouchers", {
3055
+ pPage: page || 1,
3056
+ pRecords: records || 50,
3057
+ pSortBy: sortBy || "Name",
3058
+ pSortDirection: sortDirection || "asc",
3059
+ pTerms: terms || "",
3060
+ pQuery: query || ""
3061
+ }),
3062
+ options
3063
+ );
3064
+ };
3065
+ const postCreateIntegrationRequest = ({ integrationType, sourcePlatformId, destinations, query }) => {
3066
+ const queryClient2 = useQueryClient();
3067
+ return useMutation(() => {
3068
+ return postWithParameters("/Document/IntegrationRequests?", {
3069
+ pIntegrationType: integrationType,
3070
+ pSourcePlatformId: sourcePlatformId,
3071
+ pDestinations: destinations,
3072
+ pQuery: query
3073
+ });
3074
+ }, {
3075
+ onSuccess: (data) => {
3076
+ queryClient2.setQueryData(["CREATE_INTEGRATION_REQUEST"], data);
3077
+ }
3078
+ });
3079
+ };
3080
+ const useSetIntegrationToFinished = () => {
3081
+ const queryClient2 = useQueryClient();
3082
+ return useMutation(
3083
+ (data) => {
3084
+ return putWithParameters(`/MIMO/IntegrationData/SetToFinished?`, {
3085
+ pName: data.Name
3086
+ }, data);
3087
+ },
3088
+ {
3089
+ onSuccess: (data) => {
3090
+ queryClient2.setQueryData(["INTEGRATION_DATA_QUERY"], data);
3091
+ }
3092
+ }
3093
+ );
3094
+ };
3095
+ const postEventsRep = () => {
3096
+ const queryClient2 = useQueryClient();
3097
+ return useMutation(
3098
+ () => {
3099
+ return post("/Sitoo/Document/EventsReprocessing");
3100
+ },
3101
+ {
3102
+ onSuccess: (data) => {
3103
+ queryClient2.setQueryData(["POST_EVENTS_REPROCESSING"], data);
3104
+ }
3105
+ }
3106
+ );
3107
+ };
3108
+ const postVoucherOsua = () => {
3109
+ const queryClient2 = useQueryClient();
3110
+ return useMutation((data) => {
3111
+ return postAuth0("/OSUA/GiftCards", void 0, data);
3112
+ }, {
3113
+ onSuccess: (data) => {
3114
+ queryClient2.setQueryData(
3115
+ ["POST_VOUCHER_OSUA"],
3116
+ data
3117
+ );
3118
+ }
3119
+ });
3120
+ };
3121
+ const putBalanceVouchers = ({ giftCardNumber }) => {
3122
+ const queryClient2 = useQueryClient();
3123
+ return useMutation(
3124
+ (data) => {
3125
+ return putAuth0(
3126
+ `/OSUA/GiftCards?`,
3127
+ {
3128
+ pGiftCardNumber: giftCardNumber
3129
+ },
3130
+ data
3131
+ );
3132
+ },
3133
+ {
3134
+ onSuccess: (data) => {
3135
+ queryClient2.setQueryData(["UPDATE_VOUCHERS_QUERY"], data);
3136
+ }
3137
+ }
3138
+ );
3139
+ };
3140
+ const postQueesMessages = ({ id }) => {
3141
+ const queryClient2 = useQueryClient();
3142
+ return useMutation((data) => {
3143
+ return postAuth0("/OSUA/Queues/Messages?", {
3144
+ pQueueName: id
3145
+ }, data);
3146
+ }, {
3147
+ onSuccess: (data) => {
3148
+ queryClient2.setQueryData(
3149
+ ["POST_OSUA_QUEUES"],
3150
+ data
3151
+ );
3152
+ }
3153
+ });
3154
+ };
3155
+ const activateOsuaVoucher = ({ customerId, reedemId }) => {
3156
+ const queryClient2 = useQueryClient();
3157
+ return useMutation(() => {
3158
+ return putAuth0("/OSUA/Vouchers/Activate?", {
3159
+ pCustomerId: customerId,
3160
+ pRedeemId: reedemId
3161
+ });
3162
+ }, {
3163
+ onSuccess: (data) => {
3164
+ queryClient2.setQueryData(["ACTIVATE_OSUA_VOUCHER"], data);
3165
+ }
3166
+ });
3167
+ };
3168
+ const getIntegrationByName = ({ name }) => {
3169
+ return useQuery(
3170
+ ["GET_MIMO_INTEGRATION_BY_NAME", name],
3171
+ () => get("/MIMO/IntegrationData/ByName", {
3172
+ pName: name
3173
+ }),
3174
+ {
3175
+ keepPreviousData: true
3176
+ }
3177
+ );
3178
+ };
3179
+ const getIntegrationProductHistory = ({ page, records, sortBy, sortDirection }) => {
3180
+ return useQuery(
3181
+ ["GET_MIMO_INTEGRATION_PROD_HISTORY", page, records, sortBy, sortDirection],
3182
+ () => get("/MIMO/Shopify/Product/ProductIntegrationHistory", {
3183
+ pPage: page,
3184
+ pRecords: records,
3185
+ pSortBy: sortBy,
3186
+ pSortDirection: sortDirection
3187
+ }),
3188
+ {
3189
+ keepPreviousData: true
3190
+ }
3191
+ );
3192
+ };
3193
+ const useIntegrationDataQuery = () => {
3194
+ return useQuery(
3195
+ ["MIMO_INTEGRATION_DATA"],
3196
+ () => get("/MIMO/IntegrationData/ALL"),
3197
+ {
3198
+ enabled: true,
3199
+ retry: 1
3200
+ }
3201
+ );
3202
+ };
3203
+ const useErrorHistory = (options) => {
3204
+ const { query, ...restOptions } = options || {};
3205
+ return useQuery(
3206
+ ["MIMO_ERROR_HISTORY", query],
3207
+ () => get(
3208
+ "/MIMO/ErrorHistory",
3209
+ query ? { pTerms: query } : {}
3210
+ ),
3211
+ restOptions
3212
+ );
3213
+ };
3214
+ const postVendusIntegration = () => {
3215
+ const queryClient2 = useQueryClient();
3216
+ return useMutation((data) => {
3217
+ return post("/MIMO/VendusIntegration/Full", data);
3218
+ }, {
3219
+ onSuccess: (data) => {
3220
+ queryClient2.setQueryData(
3221
+ ["VENDUS_INTEGRATION"],
3222
+ data
3223
+ );
3224
+ }
3225
+ });
3226
+ };
3227
+ const postDagsAdjustStock = () => {
3228
+ const queryClient2 = useQueryClient();
3229
+ return useMutation(() => {
3230
+ return post("/MIMO/Dags/AdjustStock");
3231
+ }, {
3232
+ onSuccess: (data) => {
3233
+ queryClient2.setQueryData(["DAGS_ADJUST_STOCK"], data);
3234
+ }
3235
+ });
3236
+ };
3237
+ const updateErrorHistory = () => {
3238
+ const queryClient2 = useQueryClient();
3239
+ return useMutation(
3240
+ (data) => {
3241
+ return putWithParameters(`/MIMO/ErrorHistory?`, {
3242
+ pId: data.Id,
3243
+ pFlow: data.Flow,
3244
+ pMessage: data.ErrorMessage,
3245
+ pDate: data.CreateDate
3246
+ }, {});
3247
+ },
3248
+ {
3249
+ onSuccess: (data) => {
3250
+ queryClient2.setQueryData(["INTEGRATION_DATA_QUERY"], data);
3251
+ }
3252
+ }
3253
+ );
3254
+ };
3255
+ const putVendusIntegration = () => {
3256
+ const queryClient2 = useQueryClient();
3257
+ return useMutation(
3258
+ (data) => {
3259
+ return putWithParameters(
3260
+ `/MIMO/VendusIntegration/UpdateIntegrationProcess?`,
3261
+ {
3262
+ pType: data.type,
3263
+ pDate: data.date
3264
+ },
3265
+ data
3266
+ );
3267
+ },
3268
+ {
3269
+ onSuccess: (data) => {
3270
+ queryClient2.setQueryData(["UPDATE_VENDUS_INTEGRATION_PROCESS"], data);
3271
+ }
3272
+ }
3273
+ );
3274
+ };
3275
+ const postIntegrationDag = () => {
3276
+ const queryClient2 = useQueryClient();
3277
+ return useMutation(
3278
+ (data) => post("/MIMO/VendusIntegration/DAG", data),
3279
+ {
3280
+ onSuccess: (data) => {
3281
+ queryClient2.setQueryData(["VENDUS_INTEGRATION_DAG"], data);
3282
+ }
3283
+ }
3284
+ );
3285
+ };
3286
+ const getClientBalance = ({ fiscalId, ...options }) => {
3287
+ return useQuery(
3288
+ ["EMPLOYEES_QUERY", fiscalId],
3289
+ () => get("/ACB/Clients", {
3290
+ pFiscalId: fiscalId
3291
+ }),
3292
+ {
3293
+ ...options
3294
+ }
3295
+ );
3296
+ };
3297
+ const postClientBalance = () => {
3298
+ const queryClient2 = useQueryClient();
3299
+ return useMutation((data) => {
3300
+ return post("/ACB/Clients", data);
3301
+ }, {
3302
+ onSuccess: (data) => {
3303
+ queryClient2.setQueryData(
3304
+ ["POST_CLIENT_BALANCE"],
3305
+ data
3306
+ );
3307
+ }
3308
+ });
3309
+ };
3310
+ const getAuth0ConfigQueryHook = ({ ...options }) => {
3311
+ return useQuery(
3312
+ ["AUTH0_CONFIG_QUERY", options],
3313
+ () => get(`/AACP/Authentication/Configuration`),
3314
+ options
3315
+ );
3316
+ };
3317
+ const getMacrosInstancesQueryHook = ({ costumerId, type, ...options }) => {
3318
+ return useQuery(
3319
+ ["MACROS_INSTANCES_QUERY", costumerId, type, options],
3320
+ () => getAuth0(`/ORQ/Instances/Last`, {
3321
+ pCustomerId: costumerId || "GNG",
3322
+ pType: type || "Product"
3323
+ }),
3324
+ options
3325
+ );
3326
+ };
3327
+ const getInstancesQueryHook = ({ page, records, sortBy, sortDirection, terms, query, ...options }) => {
3328
+ return useQuery(
3329
+ ["INSTANCES_QUERY", page, records, sortBy, sortDirection, terms, query, options],
3330
+ () => getAuth0(`/ORQ/Instances`, {
3331
+ pPage: page,
3332
+ pRecords: records,
3333
+ pSortBy: sortBy,
3334
+ pSortDirection: sortDirection,
3335
+ pTerms: terms || "",
3336
+ pQuery: query || ""
3337
+ }),
3338
+ options
3339
+ );
3340
+ };
3341
+ const getMacrosQueryHook = ({ page, records, sortBy, sortDirection, terms, query, ...options }) => {
3342
+ return useQuery(
3343
+ ["MACROS_QUERY", page, records, sortBy, sortDirection, terms, query, options],
3344
+ () => getAuth0(`/ORQ/Macros`, {
3345
+ pPage: page,
3346
+ pRecords: records,
3347
+ pSortBy: sortBy,
3348
+ pSortDirection: sortDirection,
3349
+ pTerms: terms || "",
3350
+ pQuery: query || ""
3351
+ }),
3352
+ options
3353
+ );
3354
+ };
3355
+ const getInstanceByIdQueryHook = (instanceId, { ...options }, userDetails) => {
3356
+ return useQuery(
3357
+ ["INSTANCE_BY_ID_QUERY", instanceId, options, userDetails],
3358
+ () => getAuth0(`/ORQ/Instances/${instanceId}`, {
3359
+ pIncludeUserDetails: userDetails || true
3360
+ }),
3361
+ options
3362
+ );
3363
+ };
3364
+ const runMacrosQueryHook = ({ macroId, filter }) => {
3365
+ const queryClient2 = useQueryClient();
3366
+ return useMutation(() => {
3367
+ return postAuth0(`/ORQ/Macros/Run?`, {
3368
+ pMacroId: macroId,
3369
+ pQuery: filter
3370
+ });
3371
+ }, {
3372
+ onSuccess: (data) => {
3373
+ queryClient2.setQueryData(
3374
+ ["RUN_MACROS_QUERY"],
3375
+ data
3376
+ );
3377
+ }
3378
+ });
3379
+ };
3380
+ const reprocessingInstanceQueryHook = (instanceId) => {
3381
+ const queryClient2 = useQueryClient();
3382
+ return useMutation(() => {
3383
+ return postAuth0(`/ORQ/Instances/Reprocessing?`, void 0, instanceId);
3384
+ }, {
3385
+ onSuccess: (data) => {
3386
+ queryClient2.setQueryData(
3387
+ ["REPROCESSING_INSTANCE_QUERY"],
3388
+ data
3389
+ );
3390
+ }
3391
+ });
3392
+ };
3393
+ const updateMacroStatusQueryHook = ({ macroId, status }) => {
3394
+ const queryClient2 = useQueryClient();
3395
+ return useMutation(() => {
3396
+ return postAuth0(`/ORQ/Macros/UpdateStatus?`, {
3397
+ pMacroId: macroId,
3398
+ pStatus: status
3399
+ });
3400
+ }, {
3401
+ onSuccess: (data) => {
3402
+ queryClient2.setQueryData(
3403
+ ["UPDATE_STATUS_QUERY"],
3404
+ data
3405
+ );
3406
+ }
3407
+ });
3408
+ };
3409
+ const getMacrosUserQueryHook = (instanceId, { ...options }) => {
3410
+ return useQuery(
3411
+ ["MACROS_USER_QUERY", instanceId, options],
3412
+ () => getAuth0(`/ORQ/Instances/${instanceId}/User`, void 0),
3413
+ options
3414
+ );
3415
+ };
3416
+ const getMonitoringComponentQueryHook = ({ page, records, sortBy, sortDirection, terms, query, getStatus, ...options }) => {
3417
+ return useQuery(
3418
+ ["MONITORINGCOMPONENTS_QUERY", page, records, sortBy, sortDirection, terms, query, getStatus, options],
3419
+ () => getAuth0(`/ORQ/Monitoring`, {
3420
+ pPage: page,
3421
+ pRecords: records,
3422
+ pSortBy: sortBy,
3423
+ pSortDirection: sortDirection,
3424
+ pTerms: terms || "",
3425
+ pQuery: query || "",
3426
+ pGetStatus: getStatus
3427
+ }),
3428
+ options
3429
+ );
3430
+ };
3431
+ const stopInstanceQuery = (instanceId) => {
3432
+ const queryClient2 = useQueryClient();
3433
+ return useMutation(() => {
3434
+ return putAuth0(`/ORQ/Instances/Stop?`, {
3435
+ pId: instanceId
3436
+ });
3437
+ }, {
3438
+ onSuccess: (data) => {
3439
+ queryClient2.setQueryData(
3440
+ ["STOP_INSTANCE_QUERY"],
3441
+ data
3442
+ );
3443
+ }
3444
+ });
3445
+ };
3446
+ const getCloseSession = (SessionId, options) => {
3447
+ return useQuery(
3448
+ ["SESSION_ID", SessionId],
3449
+ () => get(`/sessions/${SessionId}`),
3450
+ {
3451
+ enabled: !!SessionId,
3452
+ suspense: false,
3453
+ ...options
3454
+ }
3455
+ );
3456
+ };
3457
+ const mutateCloseSession = (id) => {
3458
+ const queryClient2 = useQueryClient();
3459
+ return useMutation((data) => {
3460
+ return patch(`/sessions/${id}`, data);
3461
+ }, {
3462
+ onSuccess: (data) => {
3463
+ queryClient2.setQueryData(["SESSIONS"], data);
3464
+ }
3465
+ });
3466
+ };
3467
+ const mutateNotificationRequest = () => {
3468
+ const queryClient2 = useQueryClient();
3469
+ return useMutation(
3470
+ (data) => {
3471
+ return post("/notification_requests", data);
3472
+ },
3473
+ {
3474
+ onSuccess: (data) => {
3475
+ queryClient2.setQueryData(["NOTIFICATION_REQUESTS"], data);
3476
+ }
3477
+ }
3478
+ );
3479
+ };
3480
+ const useEmployeeWorklogDetails = ({
3481
+ search,
3482
+ page,
3483
+ records,
3484
+ sortBy,
3485
+ sortDirection,
3486
+ terms,
3487
+ query
3488
+ }) => {
3489
+ return useQuery(
3490
+ [
3491
+ "EMPLOYEES_WITH_TIMEKEEPING",
3492
+ search,
3493
+ page,
3494
+ records,
3495
+ sortBy,
3496
+ sortDirection,
3497
+ terms,
3498
+ query
3499
+ ],
3500
+ () => getAuth0("/ATIM/EmployeesWorklogDetails", {
3501
+ pPage: page || 1,
3502
+ pRecords: records,
3503
+ pSortBy: sortBy,
3504
+ pSortDirection: sortDirection,
3505
+ pTerms: terms,
3506
+ pQuery: query
3507
+ }),
3508
+ {
3509
+ suspense: false,
3510
+ enabled: !!query
3511
+ }
3512
+ );
3513
+ };
3514
+ const useEmployeeQueryHook = ({ query, page, records, sortBy, sortDirection, ...options }) => {
3515
+ return useQuery(
3516
+ ["EMPLOYEES_QUERY", query, page, records, sortBy, sortDirection],
3517
+ () => getAuth0("/AACP/Users", {
3518
+ pPage: page,
3519
+ pRecords: records,
3520
+ pSortBy: sortBy,
3521
+ pSortDirection: sortDirection,
3522
+ pQuery: query
3523
+ }),
3524
+ {
3525
+ ...options
3526
+ }
3527
+ );
3528
+ };
3529
+ const useStoresQueryHook = ({ page, records, sortBy, sortDirection, query, ...options }) => {
3530
+ return useQuery(
3531
+ ["STORE_QUERY"],
3532
+ () => get("/Franchise/Locations", {
3533
+ pPage: page,
3534
+ pRecords: records,
3535
+ pSortBy: sortBy,
3536
+ pSortDirection: sortDirection,
3537
+ pQuery: query
3538
+ }),
3539
+ {
3540
+ ...options
3541
+ }
3542
+ );
3543
+ };
3544
+ const useAbsenceTypes = ({
3545
+ page,
3546
+ records,
3547
+ sortBy,
3548
+ sortDirection,
3549
+ ...options
3550
+ }) => {
3551
+ return useQuery(
3552
+ ["EMPLOYEES_QUERY", page, records, sortBy, sortDirection],
3553
+ () => get("/ATIM/AbsenceTypes", {
3554
+ pPage: page,
3555
+ pRecords: records,
3556
+ pSortBy: sortBy,
3557
+ pSortDirection: sortDirection
3558
+ }),
3559
+ {
3560
+ ...options
3561
+ }
3562
+ );
3563
+ };
3564
+ const useAttendancesSummary = ({
3565
+ employeeId,
3566
+ storeId,
3567
+ beginWorkPeriod,
3568
+ endWorkPeriod,
3569
+ ...options
3570
+ }) => {
3571
+ return useQuery(
3572
+ [
3573
+ "ATTENDANCES_SUMMARY",
3574
+ employeeId,
3575
+ storeId,
3576
+ beginWorkPeriod,
3577
+ endWorkPeriod
3578
+ ],
3579
+ () => getAuth0(`/ATIM/AttendancesSummary/${employeeId}`, {
3580
+ pStoreId: storeId,
3581
+ pBeginWorkPeriod: beginWorkPeriod,
3582
+ pEndWorkPeriod: endWorkPeriod
3583
+ }),
3584
+ {
3585
+ ...options
3586
+ }
3587
+ );
3588
+ };
3589
+ const useWorkMonths = ({
3590
+ year,
3591
+ page,
3592
+ records,
3593
+ ...options
3594
+ }) => {
3595
+ return useQuery(
3596
+ ["WorkMonths", year, page, records],
3597
+ () => get("/ATIM/WorkMonths", {
3598
+ pYear: year,
3599
+ pPage: page,
3600
+ pRecords: records
3601
+ }),
3602
+ {
3603
+ ...options
3604
+ }
3605
+ );
3606
+ };
3607
+ const useAttendancesSummarySearch = ({
3608
+ userId,
3609
+ page,
3610
+ record,
3611
+ sortBy,
3612
+ sortDirection,
3613
+ terms,
3614
+ query,
3615
+ ...options
3616
+ }) => {
3617
+ return useQuery(
3618
+ [
3619
+ "ATTENDANCES_SUMMARY",
3620
+ userId,
3621
+ page,
3622
+ record,
3623
+ sortBy,
3624
+ sortDirection,
3625
+ terms,
3626
+ query
3627
+ ],
3628
+ () => getAuth0(`/ATIM/AttendancesSummary`, {
3629
+ pUserId: userId,
3630
+ pPage: page,
3631
+ pRecords: record,
3632
+ pSortBy: sortBy,
3633
+ pSortDirection: sortDirection,
3634
+ pTerms: terms,
3635
+ pQuery: query
3636
+ }),
3637
+ {
3638
+ ...options
3639
+ }
3640
+ );
3641
+ };
3642
+ const ONE_HOUR = 60 * 60 * 1e3;
3643
+ const useScheduleTimePeriodTypesQueryHook = ({
3644
+ page,
3645
+ records,
3646
+ sortBy,
3647
+ sortDirection,
3648
+ ...options
3649
+ }) => {
3650
+ return useQuery(
3651
+ ["SCHEDULE_TIME_PERIOD_TYPES_QUERY", page, records, sortBy, sortDirection],
3652
+ () => get(`/ATIM/PeriodTypes`, {
3653
+ pPage: page,
3654
+ pRecords: records,
3655
+ pSortBy: sortBy,
3656
+ pSortDirection: sortDirection
3657
+ }),
3658
+ {
3659
+ ...options,
3660
+ staleTime: ONE_HOUR
3661
+ // Cached for one hour
3662
+ }
3663
+ );
3664
+ };
3665
+ const useScheduleTimePeriodsQueryHook = () => {
3666
+ return useQuery(
3667
+ ["SCHEDULE_TIME_PERIODS_QUERY"],
3668
+ () => get(`/ATIM/ScheduleTimePeriods`),
3669
+ {
3670
+ suspense: false,
3671
+ retry: 1
3672
+ }
3673
+ );
3674
+ };
3675
+ const useScheduleQueryHook = ({
3676
+ date,
3677
+ storeId,
3678
+ ...options
3679
+ }) => {
3680
+ return useQuery(
3681
+ ["SCHEDULES_QUERY", date, storeId],
3682
+ () => getAuth0(`/ATIM/Schedules`, {
3683
+ pDate: date,
3684
+ pStoreId: storeId
3685
+ }),
3686
+ {
3687
+ ...options,
3688
+ useErrorBoundary: false,
3689
+ retry: 1
3690
+ }
3691
+ );
3692
+ };
3693
+ const useKpisQueryHook = ({
3694
+ date,
3695
+ storeId,
3696
+ type,
3697
+ sortBy,
3698
+ sortDirection,
3699
+ ...options
3700
+ }) => {
3701
+ return useQuery(
3702
+ ["KPIS_QUERY", date, storeId, type, sortBy, sortDirection],
3703
+ () => get(`/ATIM/KPISchedules`, {
3704
+ pDate: date,
3705
+ pStoreId: storeId,
3706
+ pType: type,
3707
+ pSortBy: sortBy,
3708
+ pSortDirection: sortDirection
3709
+ }),
3710
+ {
3711
+ ...options,
3712
+ retry: 1
3713
+ }
3714
+ );
3715
+ };
3716
+ const useWorkWeekScheduleQueryHook = ({
3717
+ storeId,
3718
+ begin,
3719
+ end,
3720
+ ...options
3721
+ }) => {
3722
+ return useQuery(
3723
+ ["WORK_WEEK_SCHEDULE_QUERY", begin, end],
3724
+ () => getAuth0(`/ATIM/EmployeesWeeklySchedules`, {
3725
+ pStoreId: storeId,
3726
+ pStartDate: begin,
3727
+ pEndDate: end
3728
+ }),
3729
+ {
3730
+ ...options
3731
+ }
3732
+ );
3733
+ };
3734
+ const useEmployeesQuery = ({
3735
+ page,
3736
+ records,
3737
+ storeId,
3738
+ sortBy,
3739
+ sortDirection,
3740
+ ...options
3741
+ }) => {
3742
+ return useQuery(
3743
+ ["EMPLOYEES_QUERY", page, records, storeId, sortBy, sortDirection],
3744
+ () => getAuth0(`/Employees`, {
3745
+ pPage: page,
3746
+ pRecords: records,
3747
+ pStoreId: storeId,
3748
+ pSortBy: sortBy,
3749
+ pSortDirection: sortDirection
3750
+ }),
3751
+ {
3752
+ ...options
3753
+ }
3754
+ );
3755
+ };
3756
+ const postAttendanceRange = () => {
3757
+ const queryClient2 = useQueryClient();
3758
+ return useMutation((data) => {
3759
+ return postAuth0("/ATIM/Attendances/Range", void 0, data);
3760
+ }, {
3761
+ onSuccess: (data) => {
3762
+ queryClient2.setQueryData(
3763
+ ["POST_ATTENDANCE"],
3764
+ data
3765
+ );
3766
+ }
3767
+ });
3768
+ };
3769
+ const useUpdateAttendancesSummary = (id) => {
3770
+ const queryClient2 = useQueryClient();
3771
+ return useMutation((data) => {
3772
+ return id ? putAuth0(`/ATIM/AttendancesSummary/${id}`, void 0, data) : postAuth0(`/ATIM/AttendancesSummary`, void 0, data);
3773
+ }, {
3774
+ onSuccess: (data) => {
3775
+ queryClient2.setQueryData(
3776
+ ["ATTENDANCES_SUMMARY_QUERY"],
3777
+ data
3778
+ );
3779
+ }
3780
+ });
3781
+ };
3782
+ const useAttendancesById = () => {
3783
+ const queryClient2 = useQueryClient();
3784
+ return useMutation(
3785
+ (data) => {
3786
+ return putWithParameters(`/ATIM/Attendances/${data.Id}?`, {
3787
+ pDate: data.Date
3788
+ });
3789
+ },
3790
+ {
3791
+ onSuccess: (data) => {
3792
+ queryClient2.setQueryData(["INTEGRATION_DATA_QUERY"], data);
3793
+ }
3794
+ }
3795
+ );
3796
+ };
3797
+ const useScheduleMutateQuery = () => {
3798
+ const queryClient2 = useQueryClient();
3799
+ return useMutation(
3800
+ (data) => {
3801
+ return data.Id ? putAuth0(`/ATIM/Schedules/${data.Id}`, void 0, data) : postAuth0(`/ATIM/Schedules`, void 0, data);
3802
+ },
3803
+ {
3804
+ onSuccess: (data, { Date: Date2 }) => {
3805
+ queryClient2.setQueryData(
3806
+ ["SCHEDULES_QUERY", getDateFromUnix(Date2)?.valueOf(), data.StoreId],
3807
+ data
3808
+ );
3809
+ }
3810
+ }
3811
+ );
3812
+ };
3813
+ const getFlowExecutionQuery = ({ page, records, sortBy, sortDirection, terms, query, ...options }) => {
3814
+ return useQuery(
3815
+ ["FLOW_EXECUTION_QUERY", page, records, sortBy, sortDirection, terms, query, options],
3816
+ () => getAuth0(`/AEXP/Execution`, {
3817
+ pPage: page || 1,
3818
+ pRecords: records || 50,
3819
+ pSortBy: sortBy || "Name",
3820
+ pSortDirection: sortDirection || "asc",
3821
+ pTerms: terms || "",
3822
+ pQuery: query || ""
3823
+ }),
3824
+ options
3825
+ );
3826
+ };
3827
+ const getFlowListQuery = ({ page, records, sortBy, sortDirection, terms, query, roleList, ...options }) => {
3828
+ return useQuery(
3829
+ ["FLOW_LIST_QUERY", page, records, sortBy, sortDirection, terms, query, roleList, options],
3830
+ () => getAuth0(`/AEXP/FlowConfiguration`, {
3831
+ pPage: page || 1,
3832
+ pRecords: records || 50,
3833
+ pSortBy: sortBy || "Name",
3834
+ pSortDirection: sortDirection || "asc",
3835
+ pTerms: terms || "",
3836
+ pQuery: query || "",
3837
+ pTagsList: roleList || ""
3838
+ }),
3839
+ options
3840
+ );
3841
+ };
3842
+ const getFlowListById = (flowId, { ...options }) => {
3843
+ return useQuery(
3844
+ ["FLOW_QUERY", options],
3845
+ () => getAuth0(`/AEXP/FlowConfiguration/GetById`, {
3846
+ pId: flowId
3847
+ }),
3848
+ options
3849
+ );
3850
+ };
3851
+ const getFlowExecutionById = (executionId, { ...options }) => {
3852
+ return useQuery(
3853
+ ["FLOW_EXECUTION_QUERY", options],
3854
+ () => getAuth0(`/AEXP/Execution/GetById`, {
3855
+ pExecutionId: executionId
3856
+ }),
3857
+ options
3858
+ );
3859
+ };
3860
+ const deleteFlowConfigurationQuery = () => {
3861
+ const queryClient2 = useQueryClient();
3862
+ return useMutation((data) => {
3863
+ return putAuth0(`/AEXP/FlowConfiguration/Deleted?`, {
3864
+ pId: data.Id
3865
+ }, data);
3866
+ }, {
3867
+ onSuccess: (data) => {
3868
+ queryClient2.setQueryData(
3869
+ ["FLOW_DELETE_QUERY"],
3870
+ data
3871
+ );
3872
+ }
3873
+ });
3874
+ };
3875
+ const runFlowExecutionQuery = () => {
3876
+ const queryClient2 = useQueryClient();
3877
+ return useMutation((data) => {
3878
+ return postAuth0("/AEXP/Execution/RunExecution?", {
3879
+ pExecutionId: data.Id,
3880
+ pUserId: data.UserId,
3881
+ pUserEmail: data.UserEmail,
3882
+ pLastExecutionId: data.LastExecutionId
3883
+ }, data);
3884
+ }, {
3885
+ onSuccess: (data) => {
3886
+ queryClient2.setQueryData(
3887
+ ["RUN_FLOW_EXECUTION_QUERY"],
3888
+ data
3889
+ );
3890
+ }
3891
+ });
3892
+ };
3893
+ const useFlowConfigurationQuery = (bodyType) => {
3894
+ const queryClient2 = useQueryClient();
3895
+ return useMutation((data) => {
3896
+ return data.Id ? putAuth0(`/AEXP/FlowConfiguration`, void 0, data, bodyType) : postAuth0("/AEXP/FlowConfiguration", void 0, data, bodyType);
3897
+ }, {
3898
+ onSuccess: (data) => {
3899
+ queryClient2.setQueryData(
3900
+ ["FLOW_CONFIGURATION_QUERY"],
3901
+ data
3902
+ );
3903
+ }
3904
+ });
3905
+ };
3906
+ const useFlowExecutionQuery = () => {
3907
+ const queryClient2 = useQueryClient();
3908
+ return useMutation((data) => {
3909
+ return data.Id ? putAuth0(`/AEXP/Execution`, void 0, data) : postAuth0("/AEXP/Execution?", {
3910
+ pUserId: data.UserId,
3911
+ pUserName: data.UserName,
3912
+ pFlowId: data.FlowId
3913
+ }, data);
3914
+ }, {
3915
+ onSuccess: (data) => {
3916
+ queryClient2.setQueryData(
3917
+ ["FLOW_EXECUTION_QUERY"],
3918
+ data
3919
+ );
3920
+ }
3921
+ });
3922
+ };
3923
+ const validateExecutionFileQuery = (bodyType) => {
3924
+ const queryClient2 = useQueryClient();
3925
+ return useMutation((data) => {
3926
+ return postAuth0("/AEXP/Execution/FileValidation", void 0, data, bodyType);
3927
+ }, {
3928
+ onSuccess: (data) => {
3929
+ queryClient2.setQueryData(
3930
+ ["VALIDATE_EXECUTION_FILE_QUERY"],
3931
+ data
3932
+ );
3933
+ }
3934
+ });
3935
+ };
3936
+ const inactivateFlowConfigurationQuery = () => {
3937
+ const queryClient2 = useQueryClient();
3938
+ return useMutation((data) => {
3939
+ return putAuth0(`/AEXP/FlowConfiguration/Inactivate?`, {
3940
+ pId: data.Id,
3941
+ pIsActive: data.IsActive
3942
+ }, data);
3943
+ }, {
3944
+ onSuccess: (data) => {
3945
+ queryClient2.setQueryData(
3946
+ ["FLOW_INACTIVATE_QUERY"],
3947
+ data
3948
+ );
3949
+ }
3950
+ });
3951
+ };
3952
+ const getTagsFlow = ({ ...options }) => {
3953
+ return useQuery(
3954
+ ["TAGS_FLOW", options],
3955
+ () => getAuth0(`/AEXP/Tags`),
3956
+ options
3957
+ );
3958
+ };
3959
+ const getCustomerHistoryQueryHook = (customerId, { page, records, sortBy, sortDirection, ...options }) => {
3960
+ return useQuery(
3961
+ ["CUSTOMER_HISTORY_QUERY", customerId, page, records, sortBy, sortDirection, options],
3962
+ () => getAuth0(`/GNG/Salesforce/CustomerHistories/${customerId}`, {
3963
+ pPage: page,
3964
+ pRecords: records,
3965
+ pSortBy: sortBy,
3966
+ pSortDirection: sortDirection
3967
+ }),
3968
+ options
3969
+ );
3970
+ };
3971
+ const getCustomerVouchersQueryHook = (customerId, { page, records, sortBy, sortDirection, ...options }) => {
3972
+ return useQuery(
3973
+ ["CUSTOMER_VOUCHERS_QUERY", page, records, sortBy, sortDirection, customerId, options],
3974
+ () => getAuth0(`/GNG/Salesforce/CustomerVouchers/${customerId}`, {
3975
+ pPage: page,
3976
+ pRecords: records,
3977
+ pSortBy: sortBy,
3978
+ pSortDirection: sortDirection
3979
+ }),
3980
+ options
3981
+ );
3982
+ };
3983
+ const getASAECustomerQueryHook = ({ page, records, sortBy, sortDirection, terms, query, ...options }) => {
3984
+ return useQuery(
3985
+ ["CUSTOMER_QUERY", page, records, sortBy, sortDirection, terms, query, options],
3986
+ () => getAuth0(`/GNG/Salesforce/Customers`, {
3987
+ pPage: page,
3988
+ pRecords: records,
3989
+ pSortBy: sortBy,
3990
+ pSortDirection: sortDirection,
3991
+ pTerms: terms || "",
3992
+ pQuery: query || ""
3993
+ }),
3994
+ options
3995
+ );
3996
+ };
3997
+ const getNotificationsTypeQuery = ({ page, records, sortBy, sortDirection, terms, query, ...options }) => {
3998
+ return useQuery(
3999
+ ["NOTIFICATIONS_TYPE_QUERY", page, records, sortBy, sortDirection, terms, query, options],
4000
+ () => getAuth0(`/ANOT/NotificationTypes`, {
4001
+ pPage: page || 1,
4002
+ pRecords: records || 50,
4003
+ pSortBy: sortBy || "Name",
4004
+ pSortDirection: sortDirection || "asc",
4005
+ pTerms: terms || "",
4006
+ pQuery: query || ""
4007
+ }),
4008
+ options
4009
+ );
4010
+ };
4011
+ const createNotificationTypeQuery = () => {
4012
+ const queryClient2 = useQueryClient();
4013
+ return useMutation((data) => {
4014
+ return data.Id ? putAuth0(`/ANOT/NotificationTypes/${data.Id}`, void 0, data) : postAuth0("/ANOT/NotificationTypes", void 0, data);
4015
+ }, {
4016
+ onSuccess: (data) => {
4017
+ queryClient2.setQueryData(
4018
+ ["USE_NOTIFICATION_TYPE_QUERY"],
4019
+ data
4020
+ );
4021
+ }
4022
+ });
4023
+ };
4024
+ const getNotificationTypeById = (id, { ...options }) => {
4025
+ return useQuery(
4026
+ ["NOTIFICATION_TYPE_BY_ID_QUERY", id, options],
4027
+ () => getAuth0(`/ANOT/NotificationTypes/${id}`),
4028
+ options
4029
+ );
4030
+ };
4031
+ const getNotificationApplications = ({ ...options }) => {
4032
+ return useQuery(
4033
+ ["NOTIFICATION_APPLICATIONS", options],
4034
+ () => getAuth0(`/AACP/Applications`),
4035
+ options
4036
+ );
4037
+ };
4038
+ const getNotificationLanguages = ({ ...options }) => {
4039
+ return useQuery(
4040
+ ["NOTIFICATION_LANGUAGES", options],
4041
+ () => getAuth0(`/ANOT/Configurations/SupportedLanguages`),
4042
+ options
4043
+ );
4044
+ };
4045
+ const getNotificationCriticalities = ({ ...options }) => {
4046
+ return useQuery(
4047
+ ["NOTIFICATION_CRITICALITIES", options],
4048
+ () => getAuth0(`/ANOT/Criticalities`),
4049
+ options
4050
+ );
4051
+ };
4052
+ const getNotificationHeadersQuery = ({ page, records, sortBy, sortDirection, terms, query, ...options }) => {
4053
+ return useQuery(
4054
+ ["NOTIFICATION_HEADERS", page, records, sortBy, sortDirection, terms, query, options],
4055
+ () => getAuth0(`/ANOT/Notifications/Headers`, {
4056
+ pPage: page || 1,
4057
+ pRecords: records || 50,
4058
+ pSortBy: sortBy || "Application",
4059
+ pSortDirection: sortDirection || "asc",
4060
+ pTerms: terms || "",
4061
+ pQuery: query || ""
4062
+ }),
4063
+ options
4064
+ );
4065
+ };
4066
+ const getNotificationsQuery = ({ page, records, sortBy, sortDirection, terms, query, language, ...options }) => {
4067
+ return useQuery(
4068
+ ["NOTIFICATIONS_QUERY", page, records, sortBy, sortDirection, terms, query, language, options],
4069
+ () => getAuth0(`/ANOT/Notifications`, {
4070
+ pPage: page || 1,
4071
+ pRecords: records || 50,
4072
+ pSortBy: sortBy || "Name",
4073
+ pSortDirection: sortDirection || "asc",
4074
+ pTerms: terms || "",
4075
+ pQuery: query || "",
4076
+ pLanguage: language || "PT"
4077
+ }),
4078
+ options
4079
+ );
4080
+ };
4081
+ const useJobTitlesQuery = ({ records, sortBy, sortDirection, ...options }) => {
4082
+ return useQuery(
4083
+ ["JOBTITLES_QUERY", records, sortBy, sortDirection],
4084
+ () => getAuth0(`/AACP/JobTitles`, { pPage: 1, pRecords: records || 195, pSortBy: sortBy || "Rank", pSortDirection: sortDirection || "asc" }),
4085
+ options
4086
+ );
4087
+ };
4088
+ const useContractStatesQuery = ({ records, ...options }) => {
4089
+ return useQuery(
4090
+ ["CONTRACTSTATES_QUERY", records],
4091
+ () => getAuth0(`/AACP/ContractStates`, { pPage: 1, pRecords: records || 195 }),
4092
+ options
4093
+ );
4094
+ };
4095
+ const useApplicationDataQueryHook = () => {
4096
+ return useQuery(
4097
+ ["APPLICATIONS_QUERY"],
4098
+ () => getAuth0("/AACP/Applications/groupByCategory")
4099
+ );
4100
+ };
4101
+ const useTermNotificationQueryHook = () => {
4102
+ return useQuery(
4103
+ ["TERM_NOTIFICATION_QUERY"],
4104
+ () => getAuth0(`/APE/TermNotification`)
4105
+ );
4106
+ };
4107
+ const useCustomersQueryHook = ({ page, records, email, code, ...options }) => {
4108
+ return useQuery(["Customers", page, records, email, code], () => get("/CRMCustomers", {
4109
+ pPage: page || 1,
4110
+ pRecords: records,
4111
+ pEmail: email,
4112
+ pCode: code,
4113
+ pSource: "Custom"
4114
+ }), options);
4115
+ };
4116
+ const useCustomersInfiniteQueryHook = ({ email, code } = {}) => {
4117
+ const infiniteQuery = useInfiniteQuery(["Customers_Infinite", email, code], ({ pageParam = 1 }) => get("/CRMCustomers", {
4118
+ pPage: pageParam,
4119
+ pRecords: 50,
4120
+ pEmail: email,
4121
+ pCode: code,
4122
+ pSource: "Custom"
4123
+ }));
4124
+ const pagesMulti = infiniteQuery.data?.pages?.map((page) => page.Customers || []) || [];
4125
+ const allDataGrouped = [].concat(...pagesMulti);
4126
+ return {
4127
+ ...infiniteQuery,
4128
+ count: infiniteQuery.data?.pages?.[0].Count || 0,
4129
+ data: allDataGrouped
4130
+ };
4131
+ };
4132
+ const useCountriesQuery = ({ records, ...options }) => {
4133
+ return useQuery(
4134
+ ["COUNTRIES_QUERY", records],
4135
+ () => get(`/Franchise/Countries`, { pPage: 1, pRecords: records || 195 }),
4136
+ options
4137
+ );
4138
+ };
4139
+ const useCreateNotificationHook = ({ evaluationCycleId, userId }) => {
4140
+ const queryClient2 = useQueryClient();
4141
+ return useMutation((data) => {
4142
+ return postAuth0(
4143
+ `/APE/Notification/CreateNotification?`,
4144
+ {
4145
+ pEvaluationCycleId: evaluationCycleId,
4146
+ pUserId: userId
4147
+ },
4148
+ data
4149
+ );
4150
+ }, {
4151
+ onSuccess: (data) => {
4152
+ queryClient2.setQueryData(["CREATE_NOTIFICATION_QUERY"], data);
4153
+ }
4154
+ });
4155
+ };
4156
+ const postCheckoutsMutateQueryHook = () => {
4157
+ const queryClient2 = useQueryClient();
4158
+ return useMutation((data) => {
4159
+ return post("/APRE/Checkouts", data);
4160
+ }, {
4161
+ onSuccess: (data) => {
4162
+ queryClient2.setQueryData(
4163
+ ["CHECKOUT"],
4164
+ data
4165
+ );
4166
+ }
4167
+ });
4168
+ };
4169
+ const postVerifyImageQueryHook = (bodyType) => {
4170
+ const queryClient2 = useQueryClient();
4171
+ return useMutation((data) => {
4172
+ return postAuth0("/AACP/FaceAuthentication/verify", void 0, data, bodyType);
4173
+ }, {
4174
+ onSuccess: (data) => {
4175
+ queryClient2.setQueryData(
4176
+ ["VERIFY_IMAGE"],
4177
+ data
4178
+ );
4179
+ }
4180
+ });
4181
+ };
4182
+ const getWeeklyWorkloadQueryHook = ({ page, records, sortBy, sortDirection, ...options }) => {
4183
+ return useQuery(
4184
+ ["WORKLOAD_QUERY", page, records, sortBy, sortDirection],
4185
+ () => getAuth0("/AACP/WeeklyWorkHours", {
4186
+ pPage: page || 1,
4187
+ pRecords: records || 195,
4188
+ pSortBy: "WorkHours",
4189
+ pSortDirection: sortDirection || "asc"
4190
+ }),
4191
+ options
4192
+ );
4193
+ };
4194
+ const getNotificationTitleQueryHook = ({ page, records, ...options }) => {
4195
+ return useQuery(
4196
+ ["NOTIFICATION_TITLE_QUERY", page, records],
4197
+ () => getAuth0("/APE/NotificationType", {
4198
+ pPage: page || 1,
4199
+ pRecords: records || 999999
4200
+ }),
4201
+ options
4202
+ );
4203
+ };
4204
+ const getUserEmailStatusQuery = ({ page, records, tags, ...options }) => {
4205
+ return useQuery(
4206
+ ["USER_EMAIL_STATUS", page, records, tags],
4207
+ () => getAuth0("/APE/Validation", {
4208
+ pPage: page || 1,
4209
+ pRecords: records || 50,
4210
+ pTerms: tags
4211
+ }),
4212
+ options
4213
+ );
4214
+ };
4215
+ const getRegulationQueryHook = ({ ...options }) => {
4216
+ return useQuery(
4217
+ ["REGULATION_QUERY"],
4218
+ () => getAuth0(`/AACP/Users/termsAndConditions`),
4219
+ options
4220
+ );
4221
+ };
4222
+ const useRegulationQueryHook = ({ userId }) => {
4223
+ const queryClient2 = useQueryClient();
4224
+ return useMutation(() => {
4225
+ return putAuth0(`/AACP/Users/termsAndConditions?`, {
4226
+ pUserId: userId
4227
+ });
4228
+ }, {
4229
+ onSuccess: (data) => {
4230
+ queryClient2.setQueryData(["PUT_REGULATION_QUERY"], data);
4231
+ }
4232
+ });
4233
+ };
4234
+ const postUserAuthenticationHook = ({ storeCode }) => {
4235
+ const queryClient2 = useQueryClient();
4236
+ return useMutation(() => {
4237
+ return postWithParameters(`/AACP/Authentication/User/Login?`, {
4238
+ pStoreId: storeCode
4239
+ });
4240
+ }, {
4241
+ onSuccess: (data) => {
4242
+ queryClient2.setQueryData(["POST_USER_AUTHENTICATION_QUERY"], data);
4243
+ }
4244
+ });
4245
+ };
4246
+ const editFieldsByBulkQueryHook = () => {
4247
+ const queryClient2 = useQueryClient();
4248
+ return useMutation((data) => {
4249
+ return putAuth0(`/AACP/Users/BulkUpdate?`, void 0, data);
4250
+ }, {
4251
+ onSuccess: (data) => {
4252
+ queryClient2.setQueryData(
4253
+ ["BULK_QUERY"],
4254
+ data
4255
+ );
4256
+ }
4257
+ });
4258
+ };
4259
+ const getBellNotificationQueryHook = ({ page, records, sortBy, sortDirection, query, language, userId, ...options }) => {
4260
+ return useQuery(
4261
+ ["BELL_NOTIFICATION_QUERY", page, records, sortBy, sortDirection, query, language, userId, options],
4262
+ () => getAuth0(`/ANOT/Notifications/${userId}`, {
4263
+ pPage: page || 1,
4264
+ pRecords: records || 50,
4265
+ pSortBy: sortBy || "Name",
4266
+ pSortDirection: sortDirection || "asc",
4267
+ pQuery: query || "",
4268
+ pLanguage: language || "PT"
4269
+ }),
4270
+ options
4271
+ );
4272
+ };
4273
+ const editBellNotificationStatusQueryHook = ({ userId, notificationId }) => {
4274
+ const queryClient2 = useQueryClient();
4275
+ return useMutation((data) => {
4276
+ return putAuth0(`/ANOT/Notifications/${notificationId}?`, {
4277
+ pUserId: userId
4278
+ }, data);
4279
+ }, {
4280
+ onSuccess: (data) => {
4281
+ queryClient2.setQueryData(
4282
+ ["BELL_NOTIFICATION_QUERY"],
4283
+ data
4284
+ );
4285
+ }
4286
+ });
4287
+ };
4288
+ const editAllBellNotificationStatusQueryHook = ({ userId }) => {
4289
+ const queryClient2 = useQueryClient();
4290
+ return useMutation((data) => {
4291
+ return putAuth0(`/ANOT/Notifications/${userId}/ReadAll`, void 0, data);
4292
+ }, {
4293
+ onSuccess: (data) => {
4294
+ queryClient2.setQueryData(
4295
+ ["BELL_NOTIFICATION_QUERY"],
4296
+ data
4297
+ );
4298
+ }
4299
+ });
4300
+ };
4301
+ const getVacationPlanQueryHook = ({ page, records, userId, ...options }) => {
4302
+ return useQuery(
4303
+ ["VACATION_PLAN_QUERY", page, records, userId, options],
4304
+ () => getAuth0(`/AACP/UserVacationPlans/${userId}`, {
4305
+ pPage: page || 1,
4306
+ pRecords: records || 50
4307
+ }),
4308
+ options
4309
+ );
4310
+ };
4311
+ const approveVacationPlanQueryHook = ({ vacationPlan, userId }) => {
4312
+ const queryClient2 = useQueryClient();
4313
+ return useMutation((data) => {
4314
+ return putAuth0(`/AACP/UserVacationPlans/${vacationPlan}/Approve?`, {
4315
+ pUserId: userId
4316
+ }, data);
4317
+ }, {
4318
+ onSuccess: (data) => {
4319
+ queryClient2.setQueryData(
4320
+ ["APROVE_VACATION_PLAN_QUERY"],
4321
+ data
4322
+ );
4323
+ }
4324
+ });
4325
+ };
4326
+ const postVacationPlanQueryHook = ({ userId, bodyType }) => {
4327
+ const queryClient2 = useQueryClient();
4328
+ return useMutation((data) => {
4329
+ return postAuth0(`/AACP/UserVacationPlans/${userId}`, void 0, data, bodyType);
4330
+ }, {
4331
+ onSuccess: (data) => {
4332
+ queryClient2.setQueryData(
4333
+ ["POST_VACATION_PLAN_QUERY"],
4334
+ data
4335
+ );
4336
+ }
4337
+ });
4338
+ };
4339
+ const rejectVacationPlanQueryHook = ({ vacationPlan, userId, notes }) => {
4340
+ const queryClient2 = useQueryClient();
4341
+ return useMutation((data) => {
4342
+ return putAuth0(`/AACP/UserVacationPlans/${vacationPlan}/Reject?`, {
4343
+ pUserId: userId,
4344
+ pNotes: notes
4345
+ }, data);
4346
+ }, {
4347
+ onSuccess: (data) => {
4348
+ queryClient2.setQueryData(
4349
+ ["REJECT_VACATION_PLAN_QUERY"],
4350
+ data
4351
+ );
4352
+ }
4353
+ });
4354
+ };
4355
+ const getVacationTemplateQueryHook = ({ ...options }) => {
4356
+ return useQuery(
4357
+ ["VACATION_TEMPLATE_QUERY", options],
4358
+ () => getAuth0(`/AACP/UserVacationPlans/Template`),
4359
+ options
4360
+ );
4361
+ };
4362
+ const changePasswordQueryHook = ({ userId, password }) => {
4363
+ const queryClient2 = useQueryClient();
4364
+ return useMutation(() => {
4365
+ return putAuth0(`/AACP/Users/${userId}/changePassword?`, {
4366
+ pPassword: password
4367
+ });
4368
+ }, {
4369
+ onSuccess: (data) => {
4370
+ queryClient2.setQueryData(
4371
+ ["CHANGE_PASSWORD_QUERY"],
4372
+ data
4373
+ );
4374
+ }
4375
+ });
4376
+ };
4377
+ const unblockUserQueryHook = (userId) => {
4378
+ const queryClient2 = useQueryClient();
4379
+ return useMutation(() => {
4380
+ return postAuth0(`/AACP/Users/${userId}/unblock`, void 0);
4381
+ }, {
4382
+ onSuccess: (data) => {
4383
+ queryClient2.setQueryData(
4384
+ ["UNBLOCK_USER_QUERY"],
4385
+ data
4386
+ );
4387
+ }
4388
+ });
4389
+ };
4390
+ const oneSignalUserQuery = () => {
4391
+ const queryClient2 = useQueryClient();
4392
+ return useMutation((data) => {
4393
+ return postAuth0("/ANOT/Users/Register", void 0, data);
4394
+ }, {
4395
+ onSuccess: (data) => {
4396
+ queryClient2.setQueryData(
4397
+ ["ONESIGNAL_USER_QUERY"],
4398
+ data
4399
+ );
4400
+ }
4401
+ });
4402
+ };
4403
+ var AttendanceType = /* @__PURE__ */ ((AttendanceType2) => {
4404
+ AttendanceType2[AttendanceType2["ENTER"] = 0] = "ENTER";
4405
+ AttendanceType2[AttendanceType2["EXIT"] = 1] = "EXIT";
4406
+ return AttendanceType2;
4407
+ })(AttendanceType || {});
4408
+ var EmployeeOrder = /* @__PURE__ */ ((EmployeeOrder2) => {
4409
+ EmployeeOrder2[EmployeeOrder2["NAME_A_Z"] = 0] = "NAME_A_Z";
4410
+ EmployeeOrder2[EmployeeOrder2["NAME_Z_A"] = 1] = "NAME_Z_A";
4411
+ EmployeeOrder2[EmployeeOrder2["ID_ASC"] = 2] = "ID_ASC";
4412
+ EmployeeOrder2[EmployeeOrder2["ID_DESC"] = 3] = "ID_DESC";
4413
+ return EmployeeOrder2;
4414
+ })(EmployeeOrder || {});
4415
+ function getItem(label, key, icon, children, type) {
4416
+ return {
4417
+ key,
4418
+ icon,
4419
+ children,
4420
+ label,
4421
+ type
4422
+ };
4423
+ }
4424
+ const getFormattedDate = (seconds, defaultValue = "") => {
4425
+ if (!seconds) return defaultValue;
4426
+ const date = dayjs.unix(seconds);
4427
+ return date.format("HH:mm");
4428
+ };
4429
+ const getChildrenByType = (children, fn) => {
4430
+ return React.Children.toArray(children).find((child) => child.type === fn);
4431
+ };
4432
+ export {
4433
+ AttendanceType,
4434
+ EmployeeOrder,
4435
+ SharedContextProvider,
4436
+ activateEvaluationCycleQueryHook,
4437
+ activateOsuaVoucher,
4438
+ activateQuestionnaireQueryHook,
4439
+ appConfig,
4440
+ approveVacationPlanQueryHook,
4441
+ archiveActionQueryHook,
4442
+ archiveInspectionQueryHook,
4443
+ archiveTemplateQueryHook,
4444
+ autoSaveASGTQueryHook,
4445
+ autoSaveASTTQueryHook,
4446
+ cancelEvaluationCycleQueryHook,
4447
+ cancelQuestionnaireQueryHook,
4448
+ changePasswordQueryHook,
4449
+ createNotificationTypeQuery,
4450
+ createPackageASGTMutateQuery,
4451
+ createPackageASTTMutateQuery,
4452
+ createTransferASGTMutateQuery,
4453
+ createTransferASTTMutateQuery,
4454
+ deleteActionMutateHook,
4455
+ deleteAnswerTypeHook,
4456
+ deleteEvaluationCycleMutateHook,
4457
+ deleteFlowConfigurationQuery,
4458
+ deleteInspectionMutateHook,
4459
+ deleteManualPackageQueryHook,
4460
+ deletePermissionMutateHook,
4461
+ deleteProductASTTQuery,
4462
+ deleteQuestionnaireMutateHook,
4463
+ deleteTemplateMutateHook,
4464
+ duplicateQuestionnaireMutateHook,
4465
+ duplicateTemplateQueryHook,
4466
+ editAllBellNotificationStatusQueryHook,
4467
+ editBellNotificationStatusQueryHook,
4468
+ editFieldsByBulkQueryHook,
4469
+ exportInspectionMutateHook,
4470
+ extractActionQueryHook,
4471
+ extractInspectionQueryHook,
4472
+ extractTemplateQueryHook,
4473
+ finishActionQueryHook,
4474
+ finishAnswerTypeQueryHook,
4475
+ finishAstaAnswersQueryHook,
4476
+ finishEvaluationCycleQueryHook,
4477
+ finishGNGAstaAnswersQueryHook,
4478
+ finishInspectionQueryHook,
4479
+ finishPackageASTTQuery,
4480
+ finishQuestionnaireQueryHook,
4481
+ finishTemplateQueryHook,
4482
+ get,
4483
+ getASAECustomerQueryHook,
4484
+ getActionByIdQueryHook,
4485
+ getActionPriorityQueryHook,
4486
+ getActionQueryHook,
4487
+ getActionStageQueryHook,
4488
+ getAdidasAllProductsQuery,
4489
+ getAllAnswerTypeQueryHook,
4490
+ getAnswerByIdQueryHook,
4491
+ getAnswerColorsQueryHook,
4492
+ getAnswerTypeByIdQueryHook,
4493
+ getAnswerTypeQueryHook,
4494
+ getArchivedAnalyticsQueryHook,
4495
+ getAssProductsByRef,
4496
+ getAssProductsByStore,
4497
+ getAssProductsStockDetailsQueryHook,
4498
+ getAstaAnswersQueryHook,
4499
+ getAttendanceIssuesByIdQueryHook,
4500
+ getAttendanceIssuesQueryHook,
4501
+ getAuth0,
4502
+ getAuth0ConfigQueryHook,
4503
+ getBarcodesListingByPackageQueryHook,
4504
+ getBarcodesListingQueryHook,
4505
+ getBarcodesPrintQuery,
4506
+ getBasic,
4507
+ getBellNotificationQueryHook,
4508
+ getBwgAllEmployeesQuery,
4509
+ getBwgBackOfficeQuery,
4510
+ getChildrenByType,
4511
+ getClientBalance,
4512
+ getCloseSession,
4513
+ getCriticalitiesQuery,
4514
+ getCustomerHistoryQueryHook,
4515
+ getCustomerVouchersQueryHook,
4516
+ getCustomersLoyaltyQueryHook,
4517
+ getDateFromUnix,
4518
+ getDateStringToUnix,
4519
+ getDateToUnix,
4520
+ getDocumentsFindByIdQueryHook,
4521
+ getEmployeesWithTimekeeping,
4522
+ getFaqsQuery,
4523
+ getFlowExecutionById,
4524
+ getFlowExecutionQuery,
4525
+ getFlowListById,
4526
+ getFlowListQuery,
4527
+ getFormattedDate,
4528
+ getGNGVoucher,
4529
+ getGngDocumentos,
4530
+ getIdProductsPickedASGT,
4531
+ getIdProductsPickedASTT,
4532
+ getInspectionQueryHook,
4533
+ getInstanceByIdQueryHook,
4534
+ getInstancesQueryHook,
4535
+ getIntegrationByName,
4536
+ getIntegrationProductHistory,
4537
+ getItem,
4538
+ getLocationsByUserQuery,
4539
+ getMacrosInstancesQueryHook,
4540
+ getMacrosQueryHook,
4541
+ getMacrosUserQueryHook,
4542
+ getManualPackagesListQueryHook,
4543
+ getMonitoringComponentQueryHook,
4544
+ getMonthsListQueryHook,
4545
+ getNotificationApplications,
4546
+ getNotificationCriticalities,
4547
+ getNotificationHeadersQuery,
4548
+ getNotificationLanguages,
4549
+ getNotificationTitleQueryHook,
4550
+ getNotificationTypeById,
4551
+ getNotificationsQuery,
4552
+ getNotificationsTypeQuery,
4553
+ getOrderDocuments,
4554
+ getOsuaVoucher,
4555
+ getPriceChangePinQueryHook,
4556
+ getProductInfoQueryHook,
4557
+ getProductWarningASGTQueryHook,
4558
+ getProductWarningASTTQueryHook,
4559
+ getProductsByRef,
4560
+ getProductsByStore,
4561
+ getProductsListingASGTQueryHook,
4562
+ getProductsListingASTTQueryHook,
4563
+ getProductsListingQueryHook,
4564
+ getProductsMovementsASGTQueryHook,
4565
+ getProductsMovementsASTTQueryHook,
4566
+ getProductsPickedASGT,
4567
+ getProductsPickedASTT,
4568
+ getProductsStockDetailsQueryHook,
4569
+ getQueues,
4570
+ getQueuesMessages,
4571
+ getReasonCodesQuery,
4572
+ getReconciliationDocumentsQueryHook,
4573
+ getRegulationQueryHook,
4574
+ getReportsBuilderASGTQueryHook,
4575
+ getReportsBuilderASTTQueryHook,
4576
+ getReportsBuilderQueryHook,
4577
+ getReprocessNeededASTTQueryHook,
4578
+ getRfidQueryHook,
4579
+ getSalesNumberOsua,
4580
+ getScheduleQueryHook,
4581
+ getSitooDocumentos,
4582
+ getSitooErrorEvents,
4583
+ getSitooVouchers,
4584
+ getStockQueryHook,
4585
+ getTagsFlow,
4586
+ getTemplateByIdQueryHook,
4587
+ getTemplateHeadersQueryHook,
4588
+ getTemplateQueryHook,
4589
+ getTransfeStatesQueryHook,
4590
+ getTransferAllProductsASGTQueryHook,
4591
+ getTransferAllProductsASTTQueryHook,
4592
+ getTransferAllProductsQueryHook,
4593
+ getTransferDocumentsASGTQueryHook,
4594
+ getTransferDocumentsASTTQueryHook,
4595
+ getTransferDocumentsByIdASGTQueryHook,
4596
+ getTransferDocumentsByIdASTTQueryHook,
4597
+ getTransferDocumentsByIdQueryHook,
4598
+ getTransferDocumentsByPackageASGTQueryHook,
4599
+ getTransferDocumentsByPackageASTTQueryHook,
4600
+ getTransferDocumentsByPackageQueryHook,
4601
+ getTransferDocumentsPackagesASGTQueryHook,
4602
+ getTransferDocumentsPackagesASTTQueryHook,
4603
+ getTransferDocumentsPackagesQueryHook,
4604
+ getTransferDocumentsQueryHook,
4605
+ getTransferReportDiffASGTQueryHook,
4606
+ getTransferReportDiffASTTQueryHook,
4607
+ getTransferReportDiffQueryHook,
4608
+ getUnixFromDateString,
4609
+ getUserAndSupervisorQueryHook,
4610
+ getUserEmailStatusQuery,
4611
+ getUsersReadmissionQueryHook,
4612
+ getVacationPlanQueryHook,
4613
+ getVacationTemplateQueryHook,
4614
+ getVoucherIntegrationRequestStatus,
4615
+ getVoucherLoyaltyQueryHook,
4616
+ getVoucherSitooQueryHook,
4617
+ getVoucherTemplatesQueryHook,
4618
+ getWeeklyWorkloadQueryHook,
4619
+ importABWGQuery,
4620
+ importRegulationHook,
4621
+ inactivateFlowConfigurationQuery,
4622
+ initService,
4623
+ mutateCloseSession,
4624
+ mutateNotificationRequest,
4625
+ notifyMissingProductsQuery,
4626
+ oneSignalUserQuery,
4627
+ openAnswerQueryHook,
4628
+ patch,
4629
+ patchAuth0,
4630
+ post,
4631
+ postAnswersExportQueryHook,
4632
+ postAsttActionsQueryHook,
4633
+ postAttendanceRange,
4634
+ postAudioFileHook,
4635
+ postAuth0,
4636
+ postCheckoutsMutateQueryHook,
4637
+ postClientBalance,
4638
+ postCreateIntegrationRequest,
4639
+ postCreateVoucherTemplates,
4640
+ postDagsAdjustStock,
4641
+ postEventsRep,
4642
+ postIntegrationDag,
4643
+ postManualPackageQueryHook,
4644
+ postManualTransferQueryHook,
4645
+ postMatchingPackageQueryHook,
4646
+ postMissingProductsQuery,
4647
+ postPriceChangePinQueryHook,
4648
+ postQueesMessages,
4649
+ postReprocessQuery,
4650
+ postRfidInventoryMutateQueryHook,
4651
+ postSaldoVoucherQueryHook,
4652
+ postSalesAssociationQueryHook,
4653
+ postTransferDocumentsASGTMutateQueryHook,
4654
+ postTransferDocumentsASTTMutateQueryHook,
4655
+ postTransferDocumentsMutateQueryHook,
4656
+ postUserAuthenticationHook,
4657
+ postVacationPlanQueryHook,
4658
+ postVendusIntegration,
4659
+ postVerificationEmailSitooQueryHook,
4660
+ postVerificationUserSitooQueryHook,
4661
+ postVerifyImageQueryHook,
4662
+ postVerifyUserQueryHook,
4663
+ postVoucherOsua,
4664
+ postVoucherSitooQueryHook,
4665
+ postWithParameters,
4666
+ publishMonthsEmployeeHook,
4667
+ publishMonthsManagerHook,
4668
+ put,
4669
+ putAnswerImageMutateHook,
4670
+ putAuth0,
4671
+ putBalanceVouchers,
4672
+ putTransferDocumentsFinishedQuery,
4673
+ putTransferDocumentsPartiallyQuery,
4674
+ putTransferDocumentsStateASGTMutateQueryHook,
4675
+ putTransferDocumentsStateASTTMutateQueryHook,
4676
+ putTransferDocumentsStateMutateQueryHook,
4677
+ putVendusIntegration,
4678
+ putWithParameters,
4679
+ queryClient,
4680
+ reactivateVoucher,
4681
+ rejectVacationPlanQueryHook,
4682
+ removeProductASGTQuery,
4683
+ removeProductASTTQuery,
4684
+ reprocessingInstanceQueryHook,
4685
+ restartProductASTTQuery,
4686
+ runFlowExecutionQuery,
4687
+ runMacrosQueryHook,
4688
+ selectActionStatusQueryHook,
4689
+ selectAnswerNameQueryHook,
4690
+ sendEmailWithPinQueryHook,
4691
+ sendInspectionEmailMutateHook,
4692
+ sendInspectionEmailStoreMutateHook,
4693
+ showAnswerQueryHook,
4694
+ startActionQueryHook,
4695
+ stopInstanceQuery,
4696
+ toDelete,
4697
+ toDeleteAuth0,
4698
+ unblockUserQueryHook,
4699
+ updateDocumentIdQueryHook,
4700
+ updateErrorHistory,
4701
+ updateMacroStatusQueryHook,
4702
+ updatePackageIdQuery,
4703
+ useAbsenceTypes,
4704
+ useActionMutateHook,
4705
+ useAllRolesQuery,
4706
+ useAllStoreQuery,
4707
+ useAnalyticsEvaluationCyclesQueryHook,
4708
+ useAnalyticsQuestionsQueryHook,
4709
+ useAnalyticsSideBarQueryHook,
4710
+ useAnalyticsUserIdQueryHook,
4711
+ useAnalyticsUserQueryHook,
4712
+ useAnswerIdQueryHook,
4713
+ useAnswerMutateHook,
4714
+ useAnswerTypeMutateHook,
4715
+ useAnswersUserSupervisorQuery,
4716
+ useApplicationDataQueryHook,
4717
+ useApplicationQuery,
4718
+ useAstaAnswersMutateHook,
4719
+ useAttendanceIssuesQueryHook,
4720
+ useAttendancesById,
4721
+ useAttendancesSummary,
4722
+ useAttendancesSummarySearch,
4723
+ useContractStatesQuery,
4724
+ useCountriesQuery,
4725
+ useCreateNotificationHook,
4726
+ useCustomersInfiniteQueryHook,
4727
+ useCustomersQueryHook,
4728
+ useDisableVoucherTemplate,
4729
+ useEmployeeQueryHook,
4730
+ useEmployeeWorklogDetails,
4731
+ useEmployeesQuery,
4732
+ useErrorHistory,
4733
+ useEvaluationCycleIdQueryHook,
4734
+ useEvaluationCycleMutateHook,
4735
+ useEvaluationCycleQueryHook,
4736
+ useExpUsersAnswersQueryHook,
4737
+ useFlowConfigurationQuery,
4738
+ useFlowExecutionQuery,
4739
+ useInspectionMutateHook,
4740
+ useIntegrationDataQuery,
4741
+ useJobTitlesQuery,
4742
+ useKpisQueryHook,
4743
+ usePermissionIdQueryHook,
4744
+ usePermissionsIdMutateQuery,
4745
+ usePermissionsQuery,
4746
+ usePostAttendance,
4747
+ useProductInfiniteQueryHook,
4748
+ useProductRecommendationsHook,
4749
+ useProductsByRefQueryHook,
4750
+ useProductsHierarchiesQueryHook,
4751
+ useProductsQueryHook,
4752
+ useQuestionnaireIdQueryHook,
4753
+ useQuestionnaireMutateHook,
4754
+ useQuestionnaireQueryHook,
4755
+ useRegulationQueryHook,
4756
+ useScheduleMutateQuery,
4757
+ useScheduleQueryHook,
4758
+ useScheduleTimePeriodTypesQueryHook,
4759
+ useScheduleTimePeriodsQueryHook,
4760
+ useSetIntegrationToFinished,
4761
+ useSingleUserIdMutateQuery,
4762
+ useSingleUserIdQueryHook,
4763
+ useSingleUserResetPasswordHook,
4764
+ useStoreByCodeQuery,
4765
+ useStoreQuery,
4766
+ useStoresQueryHook,
4767
+ useTemplateMutateHook,
4768
+ useTermNotificationQueryHook,
4769
+ useUpdateAttendancesSummary,
4770
+ useUpdateSupervisorMutateQueryHook,
4771
+ useUserBlockQueryHook,
4772
+ useUserEmailVerifQueryHook,
4773
+ useUserIdQueryHook,
4774
+ useUserListQueryHook,
4775
+ useUserQueryHook,
4776
+ useUserResetPassByEmailHook,
4777
+ useWorkMonths,
4778
+ useWorkWeekScheduleQueryHook,
4779
+ validateExecutionFileQuery
4780
+ };