npm-pkg-hook 1.12.7 → 1.12.8

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 (348) hide show
  1. package/.babelrc +0 -0
  2. package/.env +5 -0
  3. package/.github/pull_request_template.md +18 -0
  4. package/.github/workflows/pepeline.yaml +30 -0
  5. package/dist/index.js +47755 -10080
  6. package/dist/index.js.map +1 -0
  7. package/dist/index.mjs +47071 -9610
  8. package/dist/index.mjs.map +1 -0
  9. package/eslint.config.mts +153 -0
  10. package/expire.json +1 -0
  11. package/jsconfig.json +28 -0
  12. package/package.json +24 -61
  13. package/script.txt +7 -0
  14. package/src/config/client/errors.ts +39 -0
  15. package/src/config/client/index.ts +1 -0
  16. package/src/config/content/en.json +5 -0
  17. package/src/config/content/es.json +5 -0
  18. package/src/config/content/index.ts +16 -0
  19. package/src/cookies/index.ts +3 -0
  20. package/src/hooks/addTenMinutes/index.ts +14 -0
  21. package/src/hooks/calculateLogLatHaversine/index.ts +41 -0
  22. package/src/hooks/completeSchedules/index.ts +22 -0
  23. package/src/hooks/convertToMilitaryTime/index.ts +18 -0
  24. package/src/hooks/generateStoreURL/index.ts +41 -0
  25. package/src/hooks/generateTemplate/index.ts +66 -0
  26. package/src/hooks/getCardType/index.ts +24 -0
  27. package/src/hooks/getCategoriesWithProduct/helpers/index.ts +7 -0
  28. package/src/hooks/getCategoriesWithProduct/index.ts +62 -0
  29. package/src/hooks/getGlobalSession/index.ts +69 -0
  30. package/src/hooks/getSession/index.ts +72 -0
  31. package/src/hooks/getTodayTimestamps/index.ts +70 -0
  32. package/src/hooks/getTotalHours/index.ts +76 -0
  33. package/src/hooks/handleLogin/index.ts +14 -0
  34. package/src/hooks/index.ts +153 -0
  35. package/src/hooks/isTokenExpired/index.ts +17 -0
  36. package/src/hooks/newMessageSubscription/index.ts +28 -0
  37. package/src/hooks/newStoreOrderSubscription/index.ts +26 -0
  38. package/src/hooks/statusOpenStores/helpers/index.ts +124 -0
  39. package/src/hooks/statusOpenStores/index.ts +221 -0
  40. package/src/hooks/updateExtProductFoodsOptional/index.ts +49 -0
  41. package/src/hooks/useAcumulateDate/index.ts +18 -0
  42. package/src/hooks/useAllStoresPendingToRegister/index.ts +37 -0
  43. package/src/hooks/useAmountInput/index.ts +127 -0
  44. package/src/hooks/useAnimationFrame/index.ts +45 -0
  45. package/src/hooks/useAnimationText/index.ts +31 -0
  46. package/src/hooks/useAsideCart/helpers/index.ts +22 -0
  47. package/src/hooks/useAsideCart/index.ts +217 -0
  48. package/src/hooks/useAsideCart/queries.ts +10 -0
  49. package/src/hooks/useBanner/index.ts +20 -0
  50. package/src/hooks/useCart/index.ts +2 -0
  51. package/src/hooks/useCart/queries.ts +174 -0
  52. package/src/hooks/useCart/useCart/helpers/index.ts +79 -0
  53. package/src/hooks/useCart/useCart/index.ts +424 -0
  54. package/src/hooks/useCart/useGetCart/index.ts +34 -0
  55. package/src/hooks/useCatWithProduct/index.ts +54 -0
  56. package/src/hooks/useCatWithProduct/queries.ts +200 -0
  57. package/src/hooks/useCatWithProduct/types/index.ts +104 -0
  58. package/src/hooks/useCatWithProductClient/index.ts +57 -0
  59. package/src/hooks/useCatWithProductClient/queries.ts +56 -0
  60. package/src/hooks/useCategoriesProduct/index.ts +14 -0
  61. package/src/hooks/useCategoriesProduct/queries.ts +16 -0
  62. package/src/hooks/useCategoryInStore/index.ts +167 -0
  63. package/src/hooks/useCategoryInStore/queries.ts +78 -0
  64. package/src/hooks/useCategoryStore/index.ts +8 -0
  65. package/src/hooks/useCategoryStore/queries.ts +16 -0
  66. package/src/hooks/useChartData/index.ts +171 -0
  67. package/src/hooks/useChartData/useChartData/index.ts +200 -0
  68. package/src/hooks/useChartData/useChartDataAllOrders/index.ts +94 -0
  69. package/src/hooks/useChatRoomSubscription/index.ts +28 -0
  70. package/src/hooks/useCheckbox/index.ts +115 -0
  71. package/src/hooks/useCities/index.ts +14 -0
  72. package/src/hooks/useCities/queries.ts +12 -0
  73. package/src/hooks/useClients/index.ts +97 -0
  74. package/src/hooks/useClients/queries.ts +215 -0
  75. package/src/hooks/useColorByLetters/helpers/alea.ts +73 -0
  76. package/src/hooks/useColorByLetters/helpers/colors.ts +45 -0
  77. package/src/hooks/useColorByLetters/helpers/index.ts +22 -0
  78. package/src/hooks/useColorByLetters/helpers/mersenne_twister.ts +118 -0
  79. package/src/hooks/useColorByLetters/index.ts +24 -0
  80. package/src/hooks/useConnection/index.ts +24 -0
  81. package/src/hooks/useCountries/index.ts +20 -0
  82. package/src/hooks/useCountries/queries.ts +12 -0
  83. package/src/hooks/useCreateDeliveryTime/index.ts +51 -0
  84. package/src/hooks/useCreateOrderStatusType/index.ts +134 -0
  85. package/src/hooks/useCreateProduct/helpers/index.ts +23 -0
  86. package/src/hooks/useCreateProduct/helpers/manageCacheDataCatProduct/index.ts +52 -0
  87. package/src/hooks/useCreateProduct/helpers/useEditImageProduct/index.ts +182 -0
  88. package/src/hooks/useCreateProduct/index.ts +337 -0
  89. package/src/hooks/useCreateStorePendingToRegister/index.ts +17 -0
  90. package/src/hooks/useCreateStorePendingToRegister/queries.ts +10 -0
  91. package/src/hooks/useDashboardComponents/index.ts +50 -0
  92. package/src/hooks/useDeleteExtraProductFoods/index.ts +13 -0
  93. package/src/hooks/useDeleteSubProductOptional/index.ts +32 -0
  94. package/src/hooks/useDeleteSubProductOptional/queries.ts +10 -0
  95. package/src/hooks/useDeliveryTime/index.ts +29 -0
  96. package/src/hooks/useDepartments/index.ts +14 -0
  97. package/src/hooks/useDepartments/queries.ts +13 -0
  98. package/src/hooks/useDessert/helpers/index.ts +51 -0
  99. package/src/hooks/useDessert/index.ts +529 -0
  100. package/src/hooks/useDessertWithPrice/helpers/index.ts +76 -0
  101. package/src/hooks/useDessertWithPrice/index.ts +381 -0
  102. package/src/hooks/useDessertWithPrice/queries.ts +18 -0
  103. package/src/hooks/useDevWS/index.ts +53 -0
  104. package/src/hooks/useDevices/index.ts +2 -0
  105. package/src/hooks/useDevices/queries.ts +28 -0
  106. package/src/hooks/useDevices/useGetDevices.ts +28 -0
  107. package/src/hooks/useDevices/useRegisterDevices.ts +75 -0
  108. package/src/hooks/useDownloadReports/helpers/downloadFileFromResponse.ts +21 -0
  109. package/src/hooks/useDownloadReports/index.ts +2 -0
  110. package/src/hooks/useDownloadReports/useDownloadReportByDay/index.ts +105 -0
  111. package/src/hooks/useDownloadReports/useGetReportByDateRange/index.ts +116 -0
  112. package/src/hooks/useDrag/index.ts +79 -0
  113. package/src/hooks/useDropzone/index.ts +94 -0
  114. package/src/hooks/useDynamicAuth/index.ts +14 -0
  115. package/src/hooks/useDynamicAuth/queries.ts +24 -0
  116. package/src/hooks/useEditCategory/index.ts +41 -0
  117. package/src/hooks/useEditOneExtProductFoodOptional/index.ts +28 -0
  118. package/src/hooks/useEditOneExtProductFoodOptional/queries.ts +16 -0
  119. package/src/hooks/useEditSubProductOptional/index.ts +12 -0
  120. package/src/hooks/useEditSubProductOptional/queries.ts +10 -0
  121. package/src/hooks/useEmployee/index.ts +18 -0
  122. package/src/hooks/useEmployee/queries.ts +85 -0
  123. package/src/hooks/useEmployee/useCreateEmployee.ts +90 -0
  124. package/src/hooks/useEvent/index.ts +34 -0
  125. package/src/hooks/useFavoriteStores/index.ts +31 -0
  126. package/src/hooks/useFavoriteStores/queries.ts +54 -0
  127. package/src/hooks/useFetchJson/index.ts +25 -0
  128. package/src/hooks/useFetchMoreInteractions/index.jsx +39 -0
  129. package/src/hooks/useFilterConfigs/index.ts +173 -0
  130. package/src/hooks/useFingerprintjs/index.ts +197 -0
  131. package/src/hooks/useFormTools/index.ts +143 -0
  132. package/src/hooks/useFormatDate/index.ts +91 -0
  133. package/src/hooks/useFormatNumberPhone/index.ts +23 -0
  134. package/src/hooks/useFullScreenMode/index.ts +61 -0
  135. package/src/hooks/useGenerateNumberArray/index.ts +17 -0
  136. package/src/hooks/useGetAllLocationUser/index.ts +13 -0
  137. package/src/hooks/useGetAllLocationUser/queries.ts +44 -0
  138. package/src/hooks/useGetAllSales/index.ts +26 -0
  139. package/src/hooks/useGetCookies/index.ts +43 -0
  140. package/src/hooks/useGetExtProductFoodsSubOptionalAll/index.ts +15 -0
  141. package/src/hooks/useGetFoodRecomended/index.ts +33 -0
  142. package/src/hooks/useGetFoodRecomended/queries.ts +47 -0
  143. package/src/hooks/useGetMessagesToRoom/index.ts +23 -0
  144. package/src/hooks/useGetMinPrice/index.ts +13 -0
  145. package/src/hooks/useGetMinPrice/queries.ts +7 -0
  146. package/src/hooks/useGetOneStoreRating/index.ts +41 -0
  147. package/src/hooks/useGetOneStoreRating/queries.ts +18 -0
  148. package/src/hooks/useGetSalesAmountToday/index.ts +31 -0
  149. package/src/hooks/useGetStoreCookie/index.ts +21 -0
  150. package/src/hooks/useGoogleLogin/index.ts +169 -0
  151. package/src/hooks/useGoogleLogin/loadScript.ts +15 -0
  152. package/src/hooks/useGoogleLogin/removeScript.ts +7 -0
  153. package/src/hooks/useHover/index.ts +32 -0
  154. package/src/hooks/useImageOptimization/index.ts +32 -0
  155. package/src/hooks/useImageUploaderProduct/helper/canvasUtils.ts +146 -0
  156. package/src/hooks/useImageUploaderProduct/helper/getOrientation.ts +54 -0
  157. package/src/hooks/useImageUploaderProduct/helper/index.ts +5 -0
  158. package/src/hooks/useImageUploaderProduct/index.ts +295 -0
  159. package/src/hooks/useImageWeight/index.ts +55 -0
  160. package/src/hooks/useImagesStore/index.ts +227 -0
  161. package/src/hooks/useImagesStore/queries.ts +193 -0
  162. package/src/hooks/useImagesStore/utils/index.ts +4 -0
  163. package/src/hooks/useIncomingOrders/index.ts +11 -0
  164. package/src/hooks/useIncomingOrders/queries.ts +87 -0
  165. package/src/hooks/useInnerHtml/index.ts +39 -0
  166. package/src/hooks/useIntersection/index.ts +84 -0
  167. package/src/hooks/useInventory/index.ts +2 -0
  168. package/src/hooks/useInventory/queries.ts +58 -0
  169. package/src/hooks/useInventory/useGetProductsInStock.ts +16 -0
  170. package/src/hooks/useInventory/useUpdateManageStock.ts +41 -0
  171. package/src/hooks/useKeypress/index.ts +28 -0
  172. package/src/hooks/useLazyScript/index.ts +74 -0
  173. package/src/hooks/useLocalBackendIp/index.ts +34 -0
  174. package/src/hooks/useLocalSorage/index.ts +36 -0
  175. package/src/hooks/useLocationManager/index.ts +63 -0
  176. package/src/hooks/useLocationNavigate/index.ts +54 -0
  177. package/src/hooks/useLoginEmployeeInStore/index.ts +38 -0
  178. package/src/hooks/useLogout/helpers/BroadcastChannel.ts +74 -0
  179. package/src/hooks/useLogout/helpers/apiBaseUrl.ts +12 -0
  180. package/src/hooks/useLogout/helpers/fetchData.ts +37 -0
  181. package/src/hooks/useLogout/helpers/getCsrfToken.ts +37 -0
  182. package/src/hooks/useLogout/helpers/index.ts +65 -0
  183. package/src/hooks/useLogout/helpers/logger.ts +88 -0
  184. package/src/hooks/useLogout/helpers/parseUrl.ts +39 -0
  185. package/src/hooks/useLogout/index.ts +105 -0
  186. package/src/hooks/useManageNewOrder/helpers/index.ts +45 -0
  187. package/src/hooks/useManageNewOrder/helpers/mock.ts +0 -0
  188. package/src/hooks/useManageNewOrder/index.ts +104 -0
  189. package/src/hooks/useManageQueryParams/index.ts +120 -0
  190. package/src/hooks/useMobile/index.ts +65 -0
  191. package/src/hooks/useModules/helpers/index.ts +1 -0
  192. package/src/hooks/useModules/helpers/validateModules.ts +29 -0
  193. package/src/hooks/useModules/index.ts +124 -0
  194. package/src/hooks/useMouse/index.ts +55 -0
  195. package/src/hooks/useMutateHeight/index.ts +36 -0
  196. package/src/hooks/useOrderClient/index.ts +5 -0
  197. package/src/hooks/useOrderStatusTypes/index.ts +2 -0
  198. package/src/hooks/useOrderStatusTypes/useOrderStatusTypes/index.ts +133 -0
  199. package/src/hooks/useOrderStatusTypes/useUpdateOrderStatusPriorities/index.ts +99 -0
  200. package/src/hooks/useOrders/index.ts +3 -0
  201. package/src/hooks/useOrders/queries.ts +99 -0
  202. package/src/hooks/useOrders/useChangeOrderState/index.ts +128 -0
  203. package/src/hooks/useOrders/useOrdersFromStore/index.ts +78 -0
  204. package/src/hooks/usePWAInstall/index.ts +38 -0
  205. package/src/hooks/usePaymentMethod/index.ts +3 -0
  206. package/src/hooks/usePaymentMethod/paymentMethod.gql.ts +62 -0
  207. package/src/hooks/usePaymentMethod/paymentMethod.types.ts +28 -0
  208. package/src/hooks/usePaymentMethod/useCreatePaymentMethod/index.ts +25 -0
  209. package/src/hooks/usePaymentMethod/useGetAllPaymentMethods/index.ts +19 -0
  210. package/src/hooks/usePaymentMethod/useGetPaymentMethod/index.ts +26 -0
  211. package/src/hooks/usePortFetcher/index.ts +33 -0
  212. package/src/hooks/usePrintSaleTicket/index.ts +68 -0
  213. package/src/hooks/useProductsFood/index.ts +341 -0
  214. package/src/hooks/useProductsFood/queriesStore.ts +964 -0
  215. package/src/hooks/useProductsFood/types/index.ts +0 -0
  216. package/src/hooks/useProductsFood/useEditProduct.ts +49 -0
  217. package/src/hooks/useProductsFood/usetagsProducts.ts +101 -0
  218. package/src/hooks/useProviders/index.ts +3 -0
  219. package/src/hooks/useProviders/queries.ts +31 -0
  220. package/src/hooks/useProviders/useProvidersCreateStore/index.ts +13 -0
  221. package/src/hooks/useProviders/useProvidersDataStore/index.ts +25 -0
  222. package/src/hooks/useProvidersStore/index.ts +25 -0
  223. package/src/hooks/useProvidersStore/queries.ts +31 -0
  224. package/src/hooks/usePushNotificationOrder/index.ts +52 -0
  225. package/src/hooks/usePushNotifications/helpers/index.ts +123 -0
  226. package/src/hooks/usePushNotifications/index.ts +150 -0
  227. package/src/hooks/useQueryLocationsMap/index.ts +20 -0
  228. package/src/hooks/useQueryLocationsMap/queries.ts +40 -0
  229. package/src/hooks/useRatingArrayData/index.ts +54 -0
  230. package/src/hooks/useRatingArrayData/queries.ts +19 -0
  231. package/src/hooks/useReactToPrint/index.txt +1223 -0
  232. package/src/hooks/useRemoveExtraProductFoodsOptional/index.ts +24 -0
  233. package/src/hooks/useRemoveExtraProductFoodsOptional/queries.ts +48 -0
  234. package/src/hooks/useReport/index.ts +48 -0
  235. package/src/hooks/useReport/queries.ts +72 -0
  236. package/src/hooks/useRestaurant/helpers/index.ts +28 -0
  237. package/src/hooks/useRestaurant/helpers/manageStatusOpen.ts +26 -0
  238. package/src/hooks/useRestaurant/index.ts +71 -0
  239. package/src/hooks/useRestaurant/queries.ts +81 -0
  240. package/src/hooks/useRoads/index.ts +20 -0
  241. package/src/hooks/useRoads/queries.ts +13 -0
  242. package/src/hooks/useRoles/index.ts +4 -0
  243. package/src/hooks/useRoles/queries.ts +70 -0
  244. package/src/hooks/useRoles/useCreateRole.ts +40 -0
  245. package/src/hooks/useRoles/useGetRoles.ts +37 -0
  246. package/src/hooks/useRoles/useRemoveRoles.ts +40 -0
  247. package/src/hooks/useRoles/useUpdateRolesPriority.ts +44 -0
  248. package/src/hooks/useSales/helpers/add-product.utils.ts +120 -0
  249. package/src/hooks/useSales/helpers/apply-discount-to-cart.utils.ts +292 -0
  250. package/src/hooks/useSales/helpers/comment-product.utils.ts +41 -0
  251. package/src/hooks/useSales/helpers/constants/index.ts +38 -0
  252. package/src/hooks/useSales/helpers/extras.utils.ts +42 -0
  253. package/src/hooks/useSales/helpers/filterProductsByCarProId.utils.ts +17 -0
  254. package/src/hooks/useSales/helpers/increment-product-quantity.utils.ts +76 -0
  255. package/src/hooks/useSales/helpers/index.ts +3 -0
  256. package/src/hooks/useSales/helpers/initializer.utils.ts +22 -0
  257. package/src/hooks/useSales/helpers/isStockInsufficient.ts +3 -0
  258. package/src/hooks/useSales/helpers/remove-product.utils.test.ts +49 -0
  259. package/src/hooks/useSales/helpers/remove-product.utils.ts +34 -0
  260. package/src/hooks/useSales/helpers/resolveProduct.ts +29 -0
  261. package/src/hooks/useSales/helpers/useAddToCart.ts +64 -0
  262. package/src/hooks/useSales/index.ts +1418 -0
  263. package/src/hooks/useSales/queries.ts +532 -0
  264. package/src/hooks/useSales/types/index.ts +206 -0
  265. package/src/hooks/useSales/types/use-sales.types.ts +8 -0
  266. package/src/hooks/useSales/useGetSale.ts +21 -0
  267. package/src/hooks/useSales/useTotalSales.ts +24 -0
  268. package/src/hooks/useSaveAvailableProduct/helpers/index.ts +38 -0
  269. package/src/hooks/useSaveAvailableProduct/index.ts +32 -0
  270. package/src/hooks/useSaveAvailableProduct/queries.ts +10 -0
  271. package/src/hooks/useSaveLocation/index.ts +17 -0
  272. package/src/hooks/useSaveLocation/queries.ts +19 -0
  273. package/src/hooks/useSchedule/index.ts +35 -0
  274. package/src/hooks/useSchedule/queries.ts +43 -0
  275. package/src/hooks/useSchedule/schedule.ts +79 -0
  276. package/src/hooks/useScheduleData/index.ts +135 -0
  277. package/src/hooks/useScroll/index.ts +56 -0
  278. package/src/hooks/useScrollRotate/index.ts +16 -0
  279. package/src/hooks/useSetImageProducts/index.ts +59 -0
  280. package/src/hooks/useSetImageProducts/queries.ts +18 -0
  281. package/src/hooks/useSetSession/index.ts +44 -0
  282. package/src/hooks/useSetState/index.ts +24 -0
  283. package/src/hooks/useSetupSchedule/helpers/index.ts +85 -0
  284. package/src/hooks/useSetupSchedule/index.ts +284 -0
  285. package/src/hooks/useStatusOpenStore/helpers/index.ts +124 -0
  286. package/src/hooks/useStatusOpenStore/index.ts +195 -0
  287. package/src/hooks/useStatusOrdersClient/helpers/index.ts +14 -0
  288. package/src/hooks/useStatusOrdersClient/index.ts +18 -0
  289. package/src/hooks/useStatusOrdersClient/queries.ts +80 -0
  290. package/src/hooks/useStock/index.ts +1 -0
  291. package/src/hooks/useStock/useStockUpdatedAllSubscription.ts +40 -0
  292. package/src/hooks/useStockMovements/helpers/index.ts +16 -0
  293. package/src/hooks/useStockMovements/index.ts +39 -0
  294. package/src/hooks/useStore/index.ts +83 -0
  295. package/src/hooks/useStore/queries.ts +163 -0
  296. package/src/hooks/useStoreCalendar/index.ts +5 -0
  297. package/src/hooks/useStoreContacts/index.ts +53 -0
  298. package/src/hooks/useStoreContacts/queries.ts +48 -0
  299. package/src/hooks/useStoreTable/index.ts +2 -0
  300. package/src/hooks/useStoreTable/queries.ts +47 -0
  301. package/src/hooks/useStoreTable/useStoreTableCreate.ts +77 -0
  302. package/src/hooks/useStoreTable/useStoreTables.ts +15 -0
  303. package/src/hooks/useSubscriptionValidation/index.ts +112 -0
  304. package/src/hooks/useTagProducts/index.ts +3 -0
  305. package/src/hooks/useTagProducts/useDeleteOneTag.ts +106 -0
  306. package/src/hooks/useTagProducts/useGetAllTags.ts +68 -0
  307. package/src/hooks/useTagProducts/useRegisterMultipleTags.ts +157 -0
  308. package/src/hooks/useTheme/index.ts +65 -0
  309. package/src/hooks/useTimeAgo/useTimeAgo.ts +39 -0
  310. package/src/hooks/useTokenCards/index.ts +45 -0
  311. package/src/hooks/useTopProductsMovements/index.ts +27 -0
  312. package/src/hooks/useTotalAllSales/index.ts +25 -0
  313. package/src/hooks/useTotalProductsInStock/index.ts +23 -0
  314. package/src/hooks/useTotalProductsSold/index.ts +23 -0
  315. package/src/hooks/useTotalProductsSolded/index.ts +20 -0
  316. package/src/hooks/useUpdateCart/index.ts +131 -0
  317. package/src/hooks/useUpdateCartCookie/index.ts +60 -0
  318. package/src/hooks/useUpdateDashboardComponent/index.ts +91 -0
  319. package/src/hooks/useUpdateExistingOrders/index.ts +85 -0
  320. package/src/hooks/useUpdateExtProductFoodsSubOptional/index.ts +61 -0
  321. package/src/hooks/useUpdateModuleOrder/index.ts +37 -0
  322. package/src/hooks/useUpdateMultipleExtProduct/index.ts +34 -0
  323. package/src/hooks/useUpdateMultipleExtProduct/queries.ts +33 -0
  324. package/src/hooks/useUpdateMultipleProducts/index.ts +117 -0
  325. package/src/hooks/useUpdateMultipleProducts/queries.ts +51 -0
  326. package/src/hooks/useUploadProducts/helpers/index.ts +1 -0
  327. package/src/hooks/useUploadProducts/helpers/parseNumber.ts +37 -0
  328. package/src/hooks/useUploadProducts/helpers/validateProductDataExcel.ts +73 -0
  329. package/src/hooks/useUploadProducts/index.ts +442 -0
  330. package/src/hooks/useUpsertGoal/index.ts +68 -0
  331. package/src/hooks/useUser/index.ts +24 -0
  332. package/src/hooks/useUser/queries.ts +131 -0
  333. package/src/hooks/useWeeklyStockMovement/helpers/index.ts +32 -0
  334. package/src/hooks/useWeeklyStockMovement/index.ts +52 -0
  335. package/src/hooks/useWindowSize/index.ts +45 -0
  336. package/src/index.ts +13 -0
  337. package/src/mock/dessert/index.ts +16 -0
  338. package/src/mock/index.ts +1 -0
  339. package/src/security/index.ts +1 -0
  340. package/src/services/index.ts +1 -0
  341. package/src/utils/UtilDateRange.ts +56 -0
  342. package/src/utils/generateCode.ts +222 -0
  343. package/src/utils/index.ts +2 -0
  344. package/src/utils/utils.ts +344 -0
  345. package/tsconfig.eslint.json +16 -0
  346. package/tsconfig.json +21 -0
  347. package/tsup.config.ts +24 -0
  348. package/dist/index.cjs +0 -20089
@@ -0,0 +1,532 @@
1
+ import { gql } from '@apollo/client'
2
+
3
+ export const GET_ALL_SALES = gql`
4
+ query getAllSalesStore {
5
+ getAllSalesStore {
6
+ change
7
+ channel
8
+ status
9
+ createdAt
10
+ pCodeRef
11
+ idStore
12
+ pdpId
13
+ locationUser
14
+ shoppingCartRefCode
15
+ statusOrder {
16
+ idStatus
17
+ name
18
+ description
19
+ color
20
+ backgroundColor
21
+ priority
22
+ state
23
+ createdAt
24
+ updatedAt
25
+ }
26
+ updatedAt
27
+ totalProductsPrice
28
+ unidProducts
29
+ getUser {
30
+ associateStore
31
+ avatar
32
+ createdAt
33
+ id
34
+ email
35
+ }
36
+ }
37
+ }
38
+
39
+ `
40
+
41
+ export const GET_ALL_COUNT_SALES = gql`
42
+ query getTodaySales {
43
+ getTodaySales
44
+ }
45
+ `
46
+ export const GET_ALL_SALES_STATISTICS = gql`
47
+ query getAllSalesStoreStatistic(
48
+ $idStore: ID
49
+ $search: String
50
+ $min: Int
51
+ $max: Int
52
+ $fromDate: DateTime
53
+ $toDate: DateTime
54
+ ) {
55
+ getAllSalesStoreStatistic(
56
+ idStore: $idStore
57
+ search: $search
58
+ min: $min
59
+ max: $max
60
+ toDate: $toDate
61
+ fromDate: $fromDate
62
+ ) {
63
+ pdpId
64
+ idStore
65
+ pCodeRef
66
+ payId
67
+ pPRecoger
68
+ totalProductsPrice
69
+ pSState
70
+ pDatCre
71
+ locationUser
72
+ pDatMod
73
+ getAllPedidoStore {
74
+ pdpId
75
+ pId
76
+ idStore
77
+ ShoppingCard
78
+ pCodeRef
79
+ pPStateP
80
+ payId
81
+ pPRecoger
82
+ pDatCre
83
+ pDatMod
84
+ getAllShoppingCard {
85
+ ShoppingCard
86
+ comments
87
+ cantProducts
88
+ pId
89
+ productFood {
90
+ pId
91
+ carProId
92
+ colorId
93
+ idStore
94
+ pName
95
+ ProPrice
96
+ ProDescuento
97
+ ProDescription
98
+ ValueDelivery
99
+ ProImage
100
+ ProStar
101
+ pState
102
+ pDatCre
103
+ pDatMod
104
+ }
105
+ }
106
+ }
107
+ }
108
+ }
109
+ `
110
+
111
+ export const CREATE_CLIENTS = gql`
112
+ mutation createClients($input: IClients) {
113
+ createClients(input: $input) {
114
+ cliId
115
+ idStore
116
+ idUser
117
+ clState
118
+ ClientAddress
119
+ clientNumber
120
+ ccClient
121
+ gender
122
+ clientLastName
123
+ clientName
124
+ createAt
125
+ updateAt
126
+ }
127
+ }
128
+ `
129
+ export const DELETE_ONE_CLIENTS = gql`
130
+ mutation deleteClient($cliId: ID, $clState: Int!) {
131
+ deleteClient(cliId: $cliId, clState: $clState) {
132
+ success
133
+ message
134
+ }
135
+ }
136
+ `
137
+ export const GET_ALL_CLIENTS = gql`
138
+ query getAllClients(
139
+ $idStore: ID
140
+ $cId: ID
141
+ $dId: ID
142
+ $ctId: ID
143
+ $search: String
144
+ $min: Int
145
+ $max: Int
146
+ $fromDate: DateTime
147
+ $toDate: DateTime
148
+ ) {
149
+ getAllClients(
150
+ idStore: $idStore
151
+ cId: $cId
152
+ dId: $dId
153
+ ctId: $ctId
154
+ search: $search
155
+ min: $min
156
+ max: $max
157
+ fromDate: $fromDate
158
+ toDate: $toDate
159
+ ) {
160
+ cliId
161
+ idStore
162
+ gender
163
+ # idUser
164
+ clState
165
+ clientNumber
166
+ ccClient
167
+ clientLastName
168
+ clientName
169
+ ClientAddress
170
+ createAt
171
+ updateAt
172
+ }
173
+ }
174
+ `
175
+ export const GET_ONE_CLIENT = gql`
176
+ query getOneClients($cliId: ID) {
177
+ getOneClients(cliId: $cliId) {
178
+ cliId
179
+ idStore
180
+ idUser
181
+ clState
182
+ clientNumber
183
+ ClientAddress
184
+ gender
185
+ ccClient
186
+ clientLastName
187
+ clientName
188
+ createAt
189
+ updateAt
190
+ }
191
+ }
192
+ `
193
+
194
+ export const CREATE_SHOPPING_CARD = gql`
195
+ mutation registerShoppingCard(
196
+ $input: IShoppingCard
197
+ $idSubArray: IID_SUB_ITEMS
198
+ ) {
199
+ registerShoppingCard(input: $input, idSubArray: $idSubArray) {
200
+ ShoppingCard
201
+ id
202
+ pId
203
+ subProductsId
204
+ ShoppingCardRefCode
205
+ uuid
206
+ discountCardProduct
207
+ idUser
208
+ cName
209
+ idStore
210
+ cState
211
+ cDatCre
212
+ cDatMod
213
+ csDescription
214
+ cantProducts
215
+ comments
216
+ # idSubArray
217
+ }
218
+ }
219
+ `
220
+ export const GET_ONE_SALE = gql`
221
+ query getOneSalesStore($pCodeRef: String) {
222
+ getOneSalesStore(pCodeRef: $pCodeRef) {
223
+ message
224
+ message
225
+ errors {
226
+ message
227
+ path
228
+ type
229
+ context {
230
+ key
231
+ label
232
+ limit
233
+ value
234
+ __typename
235
+ }
236
+ }
237
+ data {
238
+ statusOrder {
239
+ idStatus
240
+ name
241
+ description
242
+ color
243
+ backgroundColor
244
+ priority
245
+ state
246
+ createdAt
247
+ updatedAt
248
+ }
249
+ paymentMethod {
250
+ payId
251
+ name
252
+ icon
253
+ state
254
+ paymentPriority
255
+ createdAt
256
+ updatedAt
257
+ }
258
+ totals {
259
+ name
260
+ value
261
+ }
262
+ createdAt
263
+ change
264
+ channel
265
+ pCodeRef
266
+ id
267
+ locationUser
268
+ pCodeRef
269
+ pdpId
270
+ ppState
271
+ ppState
272
+ shoppingCartRefCode
273
+ pSState
274
+ totalProductsPrice
275
+ unidProducts
276
+ updatedAt
277
+ createdAt
278
+ store {
279
+ addressStore
280
+ banner
281
+ cId
282
+ createdAt
283
+ dailyGoal
284
+ description
285
+ upLon
286
+ upLat
287
+ deliveryTimeMinutes
288
+ emailStore
289
+ documentIdentifier
290
+ Viaprincipal
291
+ uState
292
+ }
293
+ client {
294
+ cliId
295
+ idStore
296
+ idUser
297
+ clState
298
+ clientNumber
299
+ ClientAddress
300
+ ccClient
301
+ gender
302
+ clientLastName
303
+ clientName
304
+ createAt
305
+ updateAt
306
+ }
307
+ shoppingCarts {
308
+ shoppingCartId
309
+ id
310
+ pId
311
+ shoppingCartRefCode
312
+ priceProduct
313
+ comments
314
+ cantProducts
315
+ refCodePid
316
+ idUser
317
+ idStore
318
+ sState
319
+ createdAt
320
+ updatedAt
321
+ products {
322
+ pId
323
+ carProId
324
+ sizeId
325
+ colorId
326
+ idStore
327
+ cId
328
+ caId
329
+ dId
330
+ ctId
331
+ tpId
332
+ fId
333
+ pName
334
+ pCode
335
+ ProPrice
336
+ free
337
+ ProDescuento
338
+ ProUniDisponibles
339
+ ProDescription
340
+ ValueDelivery
341
+ ProProtegido
342
+ ProAssurance
343
+ ProImage
344
+ ProStar
345
+ ProWidth
346
+ ProHeight
347
+ ProLength
348
+ ProWeight
349
+ ProQuantity
350
+ ProOutstanding
351
+ ProDelivery
352
+ ProVoltaje
353
+ pState
354
+ tgId
355
+ sTateLogistic
356
+ ProBarCode
357
+ stock
358
+ manageStock
359
+ vat
360
+ ExtProductFoodOptional {
361
+ pId
362
+ opExPid
363
+ OptionalProName
364
+ state
365
+ code
366
+ required
367
+ numbersOptionalOnly
368
+ createdAt
369
+ updatedAt
370
+ ExtProductFoodsSubOptionalAll {
371
+ pId
372
+ opExPid
373
+ idStore
374
+ opSubExPid
375
+ OptionalSubProName
376
+ exCodeOptionExtra
377
+ exCode
378
+ state
379
+ }
380
+ }
381
+ ExtProductFoodsAll {
382
+ pId
383
+ exPid
384
+ exState
385
+ extraName
386
+ extraPrice
387
+ quantity
388
+ newExtraPrice
389
+ state
390
+ createdAt
391
+ updatedAt
392
+ }
393
+ createdAt
394
+ updatedAt
395
+ }
396
+ }
397
+ __typename
398
+ }
399
+ }
400
+ }
401
+ `
402
+ export const CREATE_SHOPPING_CARD_TO_USER_STORE = gql`
403
+ mutation registerSalesStore(
404
+ $input: [IShoppingCart]
405
+ $id: ID
406
+ $tableId: ID
407
+ $discount: DiscountInput
408
+ $idStore: ID
409
+ $pCodeRef: String
410
+ $change: Float
411
+ $shoppingCartRefCode: String
412
+ $payId: ID
413
+ $pickUp: Int
414
+ $totalProductsPrice: Float
415
+ $valueDelivery: Float
416
+ $idSubArray: IID_SUB_ITEMS
417
+ ) {
418
+ registerSalesStore(
419
+ input: $input
420
+ id: $id
421
+ tableId: $tableId
422
+ discount: $discount
423
+ shoppingCartRefCode: $shoppingCartRefCode
424
+ idStore: $idStore
425
+ pCodeRef: $pCodeRef
426
+ change: $change
427
+
428
+ payId: $payId
429
+ pickUp: $pickUp
430
+ totalProductsPrice: $totalProductsPrice
431
+ valueDelivery: $valueDelivery
432
+ idSubArray: $idSubArray
433
+ ) {
434
+ success
435
+ message
436
+ errors {
437
+ path
438
+ message
439
+ type
440
+ context {
441
+ limit
442
+ value
443
+ label
444
+ key
445
+ __typename
446
+ }
447
+ }
448
+ data {
449
+ pCodeRef
450
+ idStore
451
+ id
452
+ channel
453
+ payId
454
+ pSState
455
+ createdAt
456
+ updatedAt
457
+ unidProducts
458
+ totalProductsPrice
459
+ getOneStore {
460
+ idStore
461
+ cId
462
+ dId
463
+ catStore
464
+ scheduleOpenAll
465
+ dailyGoal
466
+ deliveryTimeMinutes
467
+ }
468
+ getUser {
469
+ id
470
+ name
471
+ email
472
+ createdAt
473
+ updatedAt
474
+ __typename
475
+ }
476
+ }
477
+ }
478
+ }
479
+ `
480
+
481
+ export const GET_ALL_ORDER = gql`
482
+ query getAllOrderStoreFinal($idStore: ID, $search: String, $min: Int, $max: Int, $statusOrder: Int) {
483
+ getAllOrderStoreFinal(idStore: $idStore, search: $search, min: $min, max: $max, statusOrder: $statusOrder) {
484
+ pdpId
485
+ idStore
486
+ pCodeRef
487
+ payId
488
+ pPRecoger
489
+ totalProductsPrice
490
+ pSState
491
+ pDatCre
492
+ channel
493
+ locationUser
494
+ pDatMod
495
+ getAllPedidoStore{
496
+ pdpId
497
+ pId
498
+ idStore
499
+ ShoppingCard
500
+ pCodeRef
501
+ pPStateP
502
+ payId
503
+ pPRecoger
504
+ pDatCre
505
+ pDatMod
506
+ getAllShoppingCard {
507
+ ShoppingCard
508
+ priceProduct
509
+ comments
510
+ cantProducts
511
+ pId
512
+ productFood{
513
+ pId
514
+ carProId
515
+ colorId
516
+ idStore
517
+ pName
518
+ ProPrice
519
+ ProDescuento
520
+ ProDescription
521
+ ValueDelivery
522
+ ProImage
523
+ ProStar
524
+ pState
525
+ pDatCre
526
+ pDatMod
527
+ }
528
+ }
529
+ }
530
+ }
531
+ }
532
+ `
@@ -0,0 +1,206 @@
1
+ import { TypeDiscount } from '../helpers/apply-discount-to-cart.utils'
2
+ import { SalesActionTypes } from '../helpers/constants'
3
+ /**
4
+ * Basic notification payload used across hook
5
+ */
6
+ export interface NotificationPayload {
7
+ title?: string
8
+ description?: string
9
+ backgroundColor?: 'success' | 'error' | 'warning' | 'info'
10
+ }
11
+
12
+ export interface SalesState {
13
+ PRODUCT: any[];
14
+ totalPrice: number;
15
+ sortBy: string | null;
16
+ itemsInCart: number;
17
+ animateType: string;
18
+ startAnimateUp: string;
19
+ priceRange: number;
20
+ counter: number;
21
+ totalAmount: number;
22
+ payId: string;
23
+ discountType: TypeDiscount;
24
+ discountPercent: number;
25
+ discountAmount: number;
26
+ }
27
+
28
+ /**
29
+ * Basic product model as returned by productsFood (server model).
30
+ * Add fields as your GraphQL schema evolves; keep server -> client mapping explicit.
31
+ */
32
+ export interface ProductFood {
33
+ pId: string
34
+ pName: string
35
+ ProPrice: number
36
+ unitPrice?: number
37
+ stock?: number
38
+ manageStock?: boolean
39
+ ProQuantity?: number
40
+ existsInSale?: boolean
41
+ // allow extra server metadata
42
+ [key: string]: any
43
+ }
44
+
45
+ /**
46
+ * Extra product attached to a product inside cart.
47
+ */
48
+ export interface ExtraItem {
49
+ exPid: string
50
+ extraPrice: number
51
+ quantity: number
52
+ newExtraPrice?: number
53
+ __typename?: string
54
+ [key: string]: any
55
+ }
56
+
57
+ /**
58
+ * Sub option element for optional groups
59
+ */
60
+ export interface SubOptionalItem {
61
+ opSubExPid: string
62
+ name?: string
63
+ check?: boolean
64
+ price?: number
65
+ __typename?: string
66
+ }
67
+
68
+ /**
69
+ * Optional group of sub options
70
+ */
71
+ export interface OptionalGroup {
72
+ opExPid: string
73
+ name?: string
74
+ ExtProductFoodsSubOptionalAll: SubOptionalItem[]
75
+ code?: string
76
+ __typename?: string
77
+ }
78
+
79
+
80
+ /**
81
+ * Item stored inside the sales reducer PRODUCT array.
82
+ */
83
+ export interface SaleProduct {
84
+ pId: string
85
+ pName?: string
86
+ // quantity currently chosen
87
+ ProQuantity: number
88
+ // total price for the quantity (without extras)
89
+ ProPrice: number
90
+ unitPrice?: number
91
+ comment?: string
92
+ dataExtra?: ExtraItem[]
93
+ dataOptional?: OptionalGroup[]
94
+ free?: boolean
95
+ editing?: boolean
96
+ oldQuantity?: number
97
+ // additional UI-only helpers
98
+ refCodePid?: string
99
+ [key: string]: any
100
+ }
101
+
102
+ export type SalesReducerAction =
103
+ | { type: SalesActionTypes.ADD_TO_CART; payload: ProductFood }
104
+ | { type: SalesActionTypes.ADD_PRODUCT; payload: SaleProduct }
105
+ | { type: SalesActionTypes.REMOVE_PRODUCT; payload: { pId: string } }
106
+ | { type: SalesActionTypes.REMOVE_PRODUCT_TO_CART; payload: { pId: string; ProQuantity: number } }
107
+ | { type: SalesActionTypes.ON_CHANGE; payload: { payload: { value: number; index: number; id: string } } }
108
+ | { type: SalesActionTypes.UPDATE_SUCCESS_QUANTITY_EDITING_PRODUCT; payload: { payload: { pId: string } } }
109
+ | { type: SalesActionTypes.CANCEL_UPDATE_QUANTITY_EDITING_PRODUCT; payload: { payload: { pId: string } } }
110
+ | { type: SalesActionTypes.REMOVE_ALL_PRODUCTS }
111
+ | { type: SalesActionTypes.TOGGLE_FREE_PRODUCT; payload: { pId: string } }
112
+ | { type: SalesActionTypes.TOGGLE_EDITING_PRODUCT; payload: { payload: { pId: string } } }
113
+ | { type: SalesActionTypes.INCREMENT; id: string }
114
+ | { type: SalesActionTypes.PUT_COMMENT; payload: string, value: string }
115
+ | { type: SalesActionTypes.PUT_EXTRA_PRODUCTS_AND_OPTIONAL_PRODUCT; payload: string; dataOptional?: OptionalGroup[]; dataExtra?: ExtraItem[] }
116
+ | { type: SalesActionTypes.PRICE_RANGE; payload: number }
117
+ | { type: SalesActionTypes.SORT; payload: string }
118
+ | { type: SalesActionTypes.DECREMENT }
119
+ | { type: SalesActionTypes.PAYMENT_METHOD; payload: string }
120
+ | { type: SalesActionTypes.APPLY_DISCOUNT; payload: any }
121
+
122
+
123
+ /**
124
+ * Values used in forms (change, client id, comments etc)
125
+ */
126
+ export interface ValuesState {
127
+ change: string | number
128
+ cliId: string | null
129
+ comment: string
130
+ tableId: string | null
131
+ valueDelivery: string | number
132
+ }
133
+
134
+ /**
135
+ * Hook return shape — keep in sync with actual returned object.
136
+ * Export a minimal public API so consumers only see typed surface.
137
+ */
138
+ export interface UseSalesReturn {
139
+ loading: boolean
140
+ loadingExtraProduct: boolean
141
+ disabledModalItems: boolean
142
+ loadingRegisterSale: boolean
143
+ errorSale: boolean
144
+ openCurrentSale: boolean | null
145
+ code: string | null
146
+ totalProductPrice: number
147
+ saveDataState: any
148
+ product: { PRODUCT: { pId: string | null } }
149
+ data: SalesState
150
+ openCommentModal: boolean
151
+ inputValue: string
152
+ arrayProduct: any[]
153
+ delivery: boolean
154
+ valuesDates: { fromDate: string; toDate?: string }
155
+ print: boolean
156
+ finalFilter: any[]
157
+ showMore: number
158
+ search: string
159
+ values: ValuesState
160
+ initialStateSales: SalesState
161
+ productsFood: ProductFood[]
162
+ modalItem: boolean
163
+ sumExtraProducts: number
164
+ oneProductToComment: any
165
+ dataProduct: any
166
+ dataOptional: OptionalGroup[]
167
+ dataExtra: ExtraItem[]
168
+ fetchMore: Function
169
+ pagination: any
170
+ discount: number
171
+ datCat: any[]
172
+ currentPage: number
173
+ loadingProduct: boolean
174
+ handleChangeCheck: (caId: string) => void
175
+ errors: Record<string, boolean>
176
+ handleUpdateAllExtra: () => void
177
+ handleAddAllProductsToCart: () => void
178
+ dispatch: React.Dispatch<SalesReducerAction>
179
+ handlePageChange: (pageNumber: number) => void
180
+ handleComment: (product: any) => void
181
+ setModalItem: (v: boolean) => void
182
+ handleChangeFilter: (value: string) => void
183
+ handleProduct: (PRODUCT: any) => Promise<void>
184
+ handleChange: (e: React.ChangeEvent<HTMLInputElement> | { target: { name: string; value: any } }, error: boolean) => void
185
+ setOpenCurrentSale: (v: any) => void
186
+ setErrors: (e: any) => void
187
+ onChangeInput: (e: React.ChangeEvent<HTMLInputElement>) => void
188
+ handleAddProduct: (product: any) => Promise<void>
189
+ handleRemoveValue: ({ name, value, pId }: { name: string; value: any; pId: string }) => void
190
+ setDelivery: (v: boolean) => void
191
+ setValues: (v: ValuesState) => void
192
+ setShowMore: (n: number) => void
193
+ PriceRangeFunc: (products: any[], price: number) => any[]
194
+ handleCleanFilter: () => null
195
+ handleSubmit: () => void
196
+ handleChangeFilterProduct: (e: React.ChangeEvent<HTMLInputElement>) => void
197
+ handleDecrementExtra: ({ Adicionales }: { Adicionales: any }) => void
198
+ setTotalProductPrice: (n: number) => void
199
+ setInputValue: (s: string) => void
200
+ getSortedProduct: (data: any[], sort: string) => any[]
201
+ handleAddOptional: ({ exOptional, codeCategory }: { exOptional?: string | null; codeCategory?: string | null }) => void
202
+ handleIncrementExtra: ({ Adicionales, index }: { Adicionales: any; index?: number }) => void
203
+ setProduct: (p: any) => void
204
+ setPrint: () => void
205
+ PRODUCT: (state: SalesState, action: SalesReducerAction) => SalesState
206
+ }