@ozdao/martyrs 0.2.604 → 0.2.605

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 (833) hide show
  1. package/README.md +2 -2
  2. package/dist/_virtual/dayjs.min.js +1 -1
  3. package/dist/_virtual/weekOfYear.js +1 -1
  4. package/dist/{abac-Blt8bUTL.js → abac-kz5xI99l.js} +1 -0
  5. package/dist/auth.server.js +52 -12
  6. package/dist/builder.js +67 -2
  7. package/dist/chats.server.js +2 -2
  8. package/dist/community.server.js +3 -3
  9. package/dist/core.server.js +2 -2
  10. package/dist/{core.websocket-Cl76z2wT.js → core.websocket-B2FA8gGl.js} +0 -2
  11. package/dist/{crud-BT5FIvQC.js → crud-Cwn0frBP.js} +8 -2
  12. package/dist/events.server.js +4 -4
  13. package/dist/files.server.js +1 -1
  14. package/dist/gallery.server.js +2 -2
  15. package/dist/governance.server.js +10 -10
  16. package/dist/{index-kvBwwb0w.js → index-CPACC651.js} +1 -1
  17. package/dist/inventory.server.js +4 -4
  18. package/dist/{mailing-DT7nbNjZ.js → mailing-BBCidXGr.js} +38 -2
  19. package/dist/marketplace.server.js +2 -2
  20. package/dist/martyrs/dist/martyrs.es3.js +1 -1
  21. package/dist/martyrs/dist/martyrs.es3.js.map +1 -1
  22. package/dist/{node_modules/.pnpm/dayjs@1.11.13 → martyrs/node_modules/.pnpm/dayjs@1.11.19}/node_modules/dayjs/dayjs.min.js +1 -1
  23. package/dist/{node_modules/.pnpm/dayjs@1.11.13 → martyrs/node_modules/.pnpm/dayjs@1.11.19}/node_modules/dayjs/dayjs.min.js.map +1 -1
  24. package/dist/{node_modules/.pnpm/dayjs@1.11.13 → martyrs/node_modules/.pnpm/dayjs@1.11.19}/node_modules/dayjs/plugin/weekOfYear.js +1 -1
  25. package/dist/{node_modules/.pnpm/dayjs@1.11.13 → martyrs/node_modules/.pnpm/dayjs@1.11.19}/node_modules/dayjs/plugin/weekOfYear.js.map +1 -1
  26. package/dist/{node_modules/.pnpm/vue-draggable-next@2.2.1_sortablejs@1.15.6_vue@3.5.13_typescript@5.8.3_ → martyrs/node_modules/.pnpm/vue-draggable-next@2.3.0_sortablejs@1.15.7_vue@3.5.13}/node_modules/vue-draggable-next/dist/vue-draggable-next.esm-bundler.js +305 -268
  27. package/dist/martyrs/node_modules/.pnpm/vue-draggable-next@2.3.0_sortablejs@1.15.7_vue@3.5.13/node_modules/vue-draggable-next/dist/vue-draggable-next.esm-bundler.js.map +1 -0
  28. package/dist/martyrs/src/components/Address/Address.vue2.js +13 -13
  29. package/dist/martyrs/src/components/Address/Address.vue2.js.map +1 -1
  30. package/dist/martyrs/src/components/Block/Block.vue.js +1 -1
  31. package/dist/martyrs/src/components/Button/Button.vue2.js +1 -1
  32. package/dist/martyrs/src/components/Button/Button.vue2.js.map +1 -1
  33. package/dist/martyrs/src/components/Calendar/Calendar.vue2.js +150 -143
  34. package/dist/martyrs/src/components/Calendar/Calendar.vue2.js.map +1 -1
  35. package/dist/martyrs/src/components/Chart/Chart.vue.js +296 -0
  36. package/dist/martyrs/src/components/Chart/Chart.vue.js.map +1 -0
  37. package/dist/martyrs/src/components/Checkbox/Checkbox.vue.js +1 -1
  38. package/dist/martyrs/src/components/Checkbox/Checkbox.vue.js.map +1 -1
  39. package/dist/martyrs/src/components/Chips/Chips.vue.js +5 -6
  40. package/dist/martyrs/src/components/Chips/Chips.vue.js.map +1 -1
  41. package/dist/martyrs/src/components/Countdown/Countdown.vue.js +5 -5
  42. package/dist/martyrs/src/components/Countdown/Countdown.vue.js.map +1 -1
  43. package/dist/martyrs/src/components/DatePicker/DatePicker.vue.js +2 -2
  44. package/dist/martyrs/src/components/DatePicker/DatePicker.vue.js.map +1 -1
  45. package/dist/martyrs/src/components/EditImages/{EditImages.vue2.js → EditImages.vue.js} +6 -6
  46. package/dist/martyrs/src/components/EditImages/EditImages.vue.js.map +1 -0
  47. package/dist/martyrs/src/components/EmptyState/EmptyState.vue.js +1 -1
  48. package/dist/martyrs/src/components/Feed/Feed.vue.js.map +1 -1
  49. package/dist/martyrs/src/components/Field/Field.vue.js +4 -4
  50. package/dist/martyrs/src/components/Field/Field.vue.js.map +1 -1
  51. package/dist/martyrs/src/components/FieldDate/FieldDate.vue.js +3 -3
  52. package/dist/martyrs/src/components/FieldDate/FieldDate.vue.js.map +1 -1
  53. package/dist/martyrs/src/components/LocationMarker/LocationMarker.vue2.js +27 -21
  54. package/dist/martyrs/src/components/LocationMarker/LocationMarker.vue2.js.map +1 -1
  55. package/dist/martyrs/src/components/Map/Map.vue.js +20 -16
  56. package/dist/martyrs/src/components/Map/Map.vue.js.map +1 -1
  57. package/dist/martyrs/src/components/Popup/Popup.vue.js +3 -4
  58. package/dist/martyrs/src/components/Popup/Popup.vue.js.map +1 -1
  59. package/dist/martyrs/src/components/Radio/Radio.vue.js +12 -10
  60. package/dist/martyrs/src/components/Radio/Radio.vue.js.map +1 -1
  61. package/dist/martyrs/src/components/Select/Select.vue.js +2 -2
  62. package/dist/martyrs/src/components/Select/Select.vue.js.map +1 -1
  63. package/dist/martyrs/src/components/Status/Snack.vue.js +1 -1
  64. package/dist/martyrs/src/components/Status/Snack.vue.js.map +1 -1
  65. package/dist/martyrs/src/components/Status/Status.vue.js +1 -1
  66. package/dist/martyrs/src/components/Status/Status.vue.js.map +1 -1
  67. package/dist/martyrs/src/components/Table/Table.vue.js +21 -4
  68. package/dist/martyrs/src/components/Table/Table.vue.js.map +1 -1
  69. package/dist/martyrs/src/components/Tooltip/{Tooltip.vue2.js → Tooltip.vue.js} +2 -2
  70. package/dist/martyrs/src/components/Tooltip/Tooltip.vue.js.map +1 -0
  71. package/dist/martyrs/src/components/Tree/Tree.vue.js +1 -1
  72. package/dist/martyrs/src/components/Upload/Upload.vue2.js +2 -2
  73. package/dist/martyrs/src/components/Upload/Upload.vue2.js.map +1 -1
  74. package/dist/martyrs/src/components/UploadImage/UploadImage.vue.js +2 -2
  75. package/dist/martyrs/src/components/UploadImage/UploadImage.vue.js.map +1 -1
  76. package/dist/martyrs/src/components/UploadImageMultiple/UploadImageMultiple.vue.js +1 -1
  77. package/dist/martyrs/src/components/UploadImageMultiple/UploadImageMultiple.vue.js.map +1 -1
  78. package/dist/martyrs/src/modules/auth/auth.client.js +14 -2
  79. package/dist/martyrs/src/modules/auth/auth.client.js.map +1 -1
  80. package/dist/martyrs/src/modules/auth/views/components/blocks/OtpDialog.vue.js +4 -4
  81. package/dist/martyrs/src/modules/auth/views/components/blocks/OtpDialog.vue.js.map +1 -1
  82. package/dist/martyrs/src/modules/auth/views/components/blocks/PopupAuth.vue.js +1 -1
  83. package/dist/martyrs/src/modules/auth/views/components/blocks/PopupAuth.vue.js.map +1 -1
  84. package/dist/martyrs/src/modules/auth/views/components/blocks/SidebarUserCard.vue.js +96 -0
  85. package/dist/martyrs/src/modules/auth/views/components/blocks/SidebarUserCard.vue.js.map +1 -0
  86. package/dist/martyrs/src/modules/auth/views/components/pages/BackofficeUsers.vue.js +337 -0
  87. package/dist/martyrs/src/modules/auth/views/components/pages/BackofficeUsers.vue.js.map +1 -0
  88. package/dist/martyrs/src/modules/auth/views/components/pages/Invite.vue.js +1 -1
  89. package/dist/martyrs/src/modules/auth/views/components/pages/Invite.vue.js.map +1 -1
  90. package/dist/martyrs/src/modules/auth/views/components/pages/Profile.vue.js +1 -1
  91. package/dist/martyrs/src/modules/auth/views/components/pages/Profile.vue.js.map +1 -1
  92. package/dist/martyrs/src/modules/auth/views/components/pages/ProfileEdit.vue.js +32 -18
  93. package/dist/martyrs/src/modules/auth/views/components/pages/ProfileEdit.vue.js.map +1 -1
  94. package/dist/martyrs/src/modules/auth/views/components/pages/ProfileEditAccount.vue.js +76 -40
  95. package/dist/martyrs/src/modules/auth/views/components/pages/ProfileEditAccount.vue.js.map +1 -1
  96. package/dist/martyrs/src/modules/auth/views/components/pages/ProfileEditSidebar.vue.js +6 -5
  97. package/dist/martyrs/src/modules/auth/views/components/pages/ProfileEditSidebar.vue.js.map +1 -1
  98. package/dist/martyrs/src/modules/auth/views/components/pages/ResetPassword.vue.js +4 -4
  99. package/dist/martyrs/src/modules/auth/views/components/pages/ResetPassword.vue.js.map +1 -1
  100. package/dist/martyrs/src/modules/auth/views/components/pages/SignIn.vue.js +3 -1
  101. package/dist/martyrs/src/modules/auth/views/components/pages/SignIn.vue.js.map +1 -1
  102. package/dist/martyrs/src/modules/auth/views/components/pages/SignUp.vue.js +3 -3
  103. package/dist/martyrs/src/modules/auth/views/components/pages/SignUp.vue.js.map +1 -1
  104. package/dist/martyrs/src/modules/auth/views/components/pages/UserDashboard.vue.js +28 -16
  105. package/dist/martyrs/src/modules/auth/views/components/pages/UserDashboard.vue.js.map +1 -1
  106. package/dist/martyrs/src/modules/auth/views/components/sections/FeaturedUsers.vue.js +1 -1
  107. package/dist/martyrs/src/modules/auth/views/components/sections/FeaturedUsers.vue.js.map +1 -1
  108. package/dist/martyrs/src/modules/auth/views/components/sections/SliderFeatures.vue.js +1 -1
  109. package/dist/martyrs/src/modules/auth/views/components/sections/SliderFeatures.vue.js.map +1 -1
  110. package/dist/martyrs/src/modules/auth/views/middlewares/auth.validation.js +6 -2
  111. package/dist/martyrs/src/modules/auth/views/middlewares/auth.validation.js.map +1 -1
  112. package/dist/martyrs/src/modules/auth/views/router/users.backoffice.router.js +53 -0
  113. package/dist/martyrs/src/modules/auth/views/router/users.backoffice.router.js.map +1 -0
  114. package/dist/martyrs/src/modules/auth/views/store/auth.js +2 -2
  115. package/dist/martyrs/src/modules/auth/views/store/auth.js.map +1 -1
  116. package/dist/martyrs/src/modules/backoffice/components/pages/Dashboard.vue.js +179 -253
  117. package/dist/martyrs/src/modules/backoffice/components/pages/Dashboard.vue.js.map +1 -1
  118. package/dist/martyrs/src/modules/backoffice/configs/navigation.backoffice.config.js +105 -44
  119. package/dist/martyrs/src/modules/backoffice/configs/navigation.backoffice.config.js.map +1 -1
  120. package/dist/martyrs/src/modules/backoffice/router/backoffice.router.js +11 -5
  121. package/dist/martyrs/src/modules/backoffice/router/backoffice.router.js.map +1 -1
  122. package/dist/martyrs/src/modules/chats/components/blocks/ChatMessage.vue.js +1 -1
  123. package/dist/martyrs/src/modules/chats/components/blocks/ChatMessage.vue.js.map +1 -1
  124. package/dist/martyrs/src/modules/chats/components/sections/ChatWindow.vue.js.map +1 -1
  125. package/dist/martyrs/src/modules/community/community.client.js +4 -4
  126. package/dist/martyrs/src/modules/community/community.client.js.map +1 -1
  127. package/dist/martyrs/src/modules/community/components/blocks/CardBlogpost.vue.js +1 -1
  128. package/dist/martyrs/src/modules/community/components/blocks/CardBlogpost.vue.js.map +1 -1
  129. package/dist/martyrs/src/modules/community/components/layouts/Community.vue.js +4 -4
  130. package/dist/martyrs/src/modules/community/components/layouts/Community.vue.js.map +1 -1
  131. package/dist/martyrs/src/modules/community/components/sections/Comment.vue.js +2 -2
  132. package/dist/martyrs/src/modules/community/components/sections/Comment.vue.js.map +1 -1
  133. package/dist/martyrs/src/modules/constructor/components/elements/ImageUpload.vue.js +1 -1
  134. package/dist/martyrs/src/modules/constructor/components/elements/ImageUpload.vue.js.map +1 -1
  135. package/dist/martyrs/src/modules/core/core.client.js +18 -16
  136. package/dist/martyrs/src/modules/core/core.client.js.map +1 -1
  137. package/dist/martyrs/src/modules/core/views/classes/core.app.js +25 -6
  138. package/dist/martyrs/src/modules/core/views/classes/core.app.js.map +1 -1
  139. package/dist/martyrs/src/modules/core/views/classes/module.manager.js +4 -2
  140. package/dist/martyrs/src/modules/core/views/classes/module.manager.js.map +1 -1
  141. package/dist/martyrs/src/modules/core/views/components/blocks/AlertDialog.vue.js +1 -1
  142. package/dist/martyrs/src/modules/core/views/components/blocks/AlertDialog.vue.js.map +1 -1
  143. package/dist/martyrs/src/modules/core/views/components/blocks/BlockSearch.vue.js +1 -1
  144. package/dist/martyrs/src/modules/core/views/components/blocks/BlockSearch.vue.js.map +1 -1
  145. package/dist/martyrs/src/modules/core/views/components/blocks/BlockSlider.vue.js +132 -0
  146. package/dist/martyrs/src/modules/core/views/components/blocks/BlockSlider.vue.js.map +1 -0
  147. package/dist/martyrs/src/modules/core/views/components/blocks/CardHeader.vue.js +3 -3
  148. package/dist/martyrs/src/modules/core/views/components/blocks/CardHeader.vue.js.map +1 -1
  149. package/dist/martyrs/src/modules/core/views/components/blocks/CardStat.vue.js +6 -28
  150. package/dist/martyrs/src/modules/core/views/components/blocks/CardStat.vue.js.map +1 -1
  151. package/dist/martyrs/src/modules/{auth → core}/views/components/blocks/CardUser.vue.js +29 -11
  152. package/dist/martyrs/src/modules/{auth → core}/views/components/blocks/CardUser.vue.js.map +1 -1
  153. package/dist/martyrs/src/modules/core/views/components/blocks/HelpCard.vue.js +2 -2
  154. package/dist/martyrs/src/modules/core/views/components/blocks/HelpCard.vue.js.map +1 -1
  155. package/dist/martyrs/src/modules/core/views/components/blocks/PopupDateSelector.vue.js +41 -26
  156. package/dist/martyrs/src/modules/core/views/components/blocks/PopupDateSelector.vue.js.map +1 -1
  157. package/dist/martyrs/src/modules/core/views/components/elements/OnlineIndicator.vue.js +1 -1
  158. package/dist/martyrs/src/modules/core/views/components/layouts/Client.vue.js +2 -1
  159. package/dist/martyrs/src/modules/core/views/components/layouts/Client.vue.js.map +1 -1
  160. package/dist/martyrs/src/modules/core/views/components/pages/404.vue.js +2 -2
  161. package/dist/martyrs/src/modules/core/views/components/pages/404.vue.js.map +1 -1
  162. package/dist/martyrs/src/modules/core/views/components/partials/BottomNavigationBar.vue.js +5 -5
  163. package/dist/martyrs/src/modules/core/views/components/partials/BottomNavigationBar.vue.js.map +1 -1
  164. package/dist/martyrs/src/modules/core/views/components/partials/CitySelection.vue.js +2 -2
  165. package/dist/martyrs/src/modules/core/views/components/partials/CitySelection.vue.js.map +1 -1
  166. package/dist/martyrs/src/modules/core/views/components/partials/Footer.vue.js +2 -2
  167. package/dist/martyrs/src/modules/core/views/components/partials/Footer.vue.js.map +1 -1
  168. package/dist/martyrs/src/modules/core/views/components/partials/Header.vue.js +4 -4
  169. package/dist/martyrs/src/modules/core/views/components/partials/Header.vue.js.map +1 -1
  170. package/dist/martyrs/src/modules/core/views/components/partials/LocationSelection.vue.js +1 -1
  171. package/dist/martyrs/src/modules/core/views/components/partials/LocationSelection.vue.js.map +1 -1
  172. package/dist/martyrs/src/modules/core/views/components/partials/Navigation.vue.js +2 -2
  173. package/dist/martyrs/src/modules/core/views/components/partials/Navigation.vue.js.map +1 -1
  174. package/dist/martyrs/src/modules/core/views/components/sections/Filters.vue2.js +3 -3
  175. package/dist/martyrs/src/modules/core/views/components/sections/Filters.vue2.js.map +1 -1
  176. package/dist/martyrs/src/modules/core/views/components/sections/SectionPageTitle.vue.js +2 -2
  177. package/dist/martyrs/src/modules/core/views/components/sections/SectionPageTitle.vue.js.map +1 -1
  178. package/dist/martyrs/src/modules/core/views/components/sections/Walkthrough.vue.js +6 -6
  179. package/dist/martyrs/src/modules/core/views/components/sections/Walkthrough.vue.js.map +1 -1
  180. package/dist/martyrs/src/modules/core/views/mixins/mixins.js +14 -1
  181. package/dist/martyrs/src/modules/core/views/mixins/mixins.js.map +1 -1
  182. package/dist/martyrs/src/modules/core/views/plugins/date-picker.plugin.js +8 -5
  183. package/dist/martyrs/src/modules/core/views/plugins/date-picker.plugin.js.map +1 -1
  184. package/dist/martyrs/src/modules/core/views/store/core.store.js +4 -0
  185. package/dist/martyrs/src/modules/core/views/store/core.store.js.map +1 -1
  186. package/dist/martyrs/src/modules/core/views/utils/vue-app-renderer.js +3 -0
  187. package/dist/martyrs/src/modules/core/views/utils/vue-app-renderer.js.map +1 -1
  188. package/dist/martyrs/src/modules/events/components/pages/EditEvent.vue.js +1 -1
  189. package/dist/martyrs/src/modules/events/components/pages/EditEventTickets.vue.js +9 -9
  190. package/dist/martyrs/src/modules/events/components/pages/EditEventTickets.vue.js.map +1 -1
  191. package/dist/martyrs/src/modules/events/components/pages/Event.vue.js +1 -1
  192. package/dist/martyrs/src/modules/events/components/pages/Event.vue.js.map +1 -1
  193. package/dist/martyrs/src/modules/events/components/sections/EditTickets.vue.js +1 -1
  194. package/dist/martyrs/src/modules/events/components/sections/EditTickets.vue.js.map +1 -1
  195. package/dist/martyrs/src/modules/events/components/sections/SelectDate.vue.js +1 -1
  196. package/dist/martyrs/src/modules/events/components/sections/SelectDate.vue.js.map +1 -1
  197. package/dist/martyrs/src/modules/events/events.client.js +4 -4
  198. package/dist/martyrs/src/modules/events/events.client.js.map +1 -1
  199. package/dist/martyrs/src/modules/gallery/components/sections/BackofficeGallery.vue.js +2 -2
  200. package/dist/martyrs/src/modules/gallery/components/sections/BackofficeGallery.vue.js.map +1 -1
  201. package/dist/martyrs/src/modules/gallery/router/gallery.router.js +3 -3
  202. package/dist/martyrs/src/modules/gallery/router/gallery.router.js.map +1 -1
  203. package/dist/martyrs/src/modules/governance/views/components/blocks/CardInitiativeItem.vue.js +3 -3
  204. package/dist/martyrs/src/modules/governance/views/components/blocks/CardInitiativeItem.vue.js.map +1 -1
  205. package/dist/martyrs/src/modules/governance/views/components/blocks/CardSprintItem.vue.js +4 -4
  206. package/dist/martyrs/src/modules/governance/views/components/blocks/CardSprintItem.vue.js.map +1 -1
  207. package/dist/martyrs/src/modules/governance/views/components/blocks/CardTaskItem.vue.js +2 -2
  208. package/dist/martyrs/src/modules/governance/views/components/blocks/CardTaskItem.vue.js.map +1 -1
  209. package/dist/martyrs/src/modules/governance/views/components/blocks/CardVotingItem.vue.js +3 -3
  210. package/dist/martyrs/src/modules/governance/views/components/blocks/CardVotingItem.vue.js.map +1 -1
  211. package/dist/martyrs/src/modules/governance/views/components/pages/Initiatives.vue.js +3 -3
  212. package/dist/martyrs/src/modules/governance/views/components/pages/Initiatives.vue.js.map +1 -1
  213. package/dist/martyrs/src/modules/governance/views/components/partials/TaskStatusBadge.vue.js +1 -1
  214. package/dist/martyrs/src/modules/governance/views/components/partials/TaskStatusBadge.vue.js.map +1 -1
  215. package/dist/martyrs/src/modules/governance/views/components/sections/FormSprintDetails.vue.js +1 -1
  216. package/dist/martyrs/src/modules/governance/views/components/sections/FormSprintDetails.vue.js.map +1 -1
  217. package/dist/martyrs/src/modules/governance/views/components/sections/FormTaskDetails.vue.js +1 -1
  218. package/dist/martyrs/src/modules/governance/views/components/sections/FormTaskDetails.vue.js.map +1 -1
  219. package/dist/martyrs/src/modules/governance/views/router/governance.router.js +3 -3
  220. package/dist/martyrs/src/modules/governance/views/router/governance.router.js.map +1 -1
  221. package/dist/martyrs/src/modules/icons/components/IconSearchPopup.vue.js +2 -2
  222. package/dist/martyrs/src/modules/icons/components/IconSearchPopup.vue.js.map +1 -1
  223. package/dist/martyrs/src/modules/icons/entities/IconApplications.vue.js +32 -0
  224. package/dist/martyrs/src/modules/icons/entities/IconApplications.vue.js.map +1 -0
  225. package/dist/martyrs/src/modules/icons/entities/IconCustomers.vue.js +32 -0
  226. package/dist/martyrs/src/modules/icons/entities/IconCustomers.vue.js.map +1 -0
  227. package/dist/martyrs/src/modules/icons/entities/IconUsers.vue.js +32 -0
  228. package/dist/martyrs/src/modules/icons/entities/IconUsers.vue.js.map +1 -0
  229. package/dist/martyrs/src/modules/inventory/components/forms/AdjustmentForm.vue.js +2 -2
  230. package/dist/martyrs/src/modules/inventory/components/forms/AdjustmentForm.vue.js.map +1 -1
  231. package/dist/martyrs/src/modules/inventory/components/forms/ColumnSettingsMenu.vue.js +2 -2
  232. package/dist/martyrs/src/modules/inventory/components/forms/ColumnSettingsMenu.vue.js.map +1 -1
  233. package/dist/martyrs/src/modules/inventory/components/forms/HistoryView.vue.js +1 -1
  234. package/dist/martyrs/src/modules/inventory/components/forms/HistoryView.vue.js.map +1 -1
  235. package/dist/martyrs/src/modules/inventory/components/forms/StockAlertsForm.vue.js +3 -3
  236. package/dist/martyrs/src/modules/inventory/components/forms/StockAlertsForm.vue.js.map +1 -1
  237. package/dist/martyrs/src/modules/inventory/components/pages/Inventory.vue.js +290 -173
  238. package/dist/martyrs/src/modules/inventory/components/pages/Inventory.vue.js.map +1 -1
  239. package/dist/martyrs/src/modules/inventory/components/pages/InventoryEdit.vue.js +1 -1
  240. package/dist/martyrs/src/modules/inventory/components/pages/InventoryEdit.vue.js.map +1 -1
  241. package/dist/martyrs/src/modules/inventory/inventory.client.js +4 -4
  242. package/dist/martyrs/src/modules/inventory/inventory.client.js.map +1 -1
  243. package/dist/martyrs/src/modules/inventory/router/inventory.router.js +15 -0
  244. package/dist/martyrs/src/modules/inventory/router/inventory.router.js.map +1 -1
  245. package/dist/martyrs/src/modules/landing/components/sections/SectionEarn.vue.js +4 -4
  246. package/dist/martyrs/src/modules/landing/components/sections/SectionEarn.vue.js.map +1 -1
  247. package/dist/martyrs/src/modules/landing/components/sections/SectionFeatures.vue.js +1 -1
  248. package/dist/martyrs/src/modules/landing/components/sections/SectionFeatures.vue.js.map +1 -1
  249. package/dist/martyrs/src/modules/landing/components/sections/SectionFeaturesImages.vue.js +3 -3
  250. package/dist/martyrs/src/modules/landing/components/sections/SectionFeaturesImages.vue.js.map +1 -1
  251. package/dist/martyrs/src/modules/landing/components/sections/SectionGuide.vue.js +2 -2
  252. package/dist/martyrs/src/modules/landing/components/sections/SectionGuide.vue.js.map +1 -1
  253. package/dist/martyrs/src/modules/landing/components/sections/SectionHeroToken.vue.js +1 -1
  254. package/dist/martyrs/src/modules/landing/components/sections/SectionHeroToken.vue.js.map +1 -1
  255. package/dist/martyrs/src/modules/landing/components/sections/SectionMobileApp.vue.js +2 -2
  256. package/dist/martyrs/src/modules/landing/components/sections/SectionMobileApp.vue.js.map +1 -1
  257. package/dist/martyrs/src/modules/landing/components/sections/SectionOverview.vue.js +1 -1
  258. package/dist/martyrs/src/modules/landing/components/sections/SectionOverview.vue.js.map +1 -1
  259. package/dist/martyrs/src/modules/landing/components/sections/SectionRoadmap.vue.js +2 -2
  260. package/dist/martyrs/src/modules/landing/components/sections/SectionRoadmap.vue.js.map +1 -1
  261. package/dist/martyrs/src/modules/landing/components/sections/SubscribeNewsletter.vue.js +1 -1
  262. package/dist/martyrs/src/modules/landing/components/sections/SubscribeNewsletter.vue.js.map +1 -1
  263. package/dist/martyrs/src/modules/marketplace/views/components/sections/SectionMenu.vue.js +3 -3
  264. package/dist/martyrs/src/modules/marketplace/views/components/sections/SectionMenu.vue.js.map +1 -1
  265. package/dist/martyrs/src/modules/music/components/cards/AlbumCard.vue.js +2 -2
  266. package/dist/martyrs/src/modules/music/components/cards/AlbumCard.vue.js.map +1 -1
  267. package/dist/martyrs/src/modules/music/components/cards/ArtistCard.vue.js +2 -2
  268. package/dist/martyrs/src/modules/music/components/cards/ArtistCard.vue.js.map +1 -1
  269. package/dist/martyrs/src/modules/music/components/cards/ArtistCardSmall.vue.js +2 -2
  270. package/dist/martyrs/src/modules/music/components/cards/ArtistCardSmall.vue.js.map +1 -1
  271. package/dist/martyrs/src/modules/music/components/cards/PlaylistCard.vue.js +2 -2
  272. package/dist/martyrs/src/modules/music/components/cards/PlaylistCard.vue.js.map +1 -1
  273. package/dist/martyrs/src/modules/music/components/cards/TrackListCard.vue.js +6 -6
  274. package/dist/martyrs/src/modules/music/components/cards/TrackListCard.vue.js.map +1 -1
  275. package/dist/martyrs/src/modules/music/components/forms/AlbumForm.vue.js +2 -2
  276. package/dist/martyrs/src/modules/music/components/forms/AlbumForm.vue.js.map +1 -1
  277. package/dist/martyrs/src/modules/music/components/forms/ArtistForm.vue.js +1 -1
  278. package/dist/martyrs/src/modules/music/components/forms/ArtistForm.vue.js.map +1 -1
  279. package/dist/martyrs/src/modules/music/components/forms/PlaylistForm.vue.js +5 -5
  280. package/dist/martyrs/src/modules/music/components/forms/PlaylistForm.vue.js.map +1 -1
  281. package/dist/martyrs/src/modules/music/components/forms/TrackForm.vue.js +3 -3
  282. package/dist/martyrs/src/modules/music/components/forms/TrackForm.vue.js.map +1 -1
  283. package/dist/martyrs/src/modules/music/components/pages/Album.vue.js +8 -8
  284. package/dist/martyrs/src/modules/music/components/pages/Album.vue.js.map +1 -1
  285. package/dist/martyrs/src/modules/music/components/pages/Artist.vue.js +5 -5
  286. package/dist/martyrs/src/modules/music/components/pages/Artist.vue.js.map +1 -1
  287. package/dist/martyrs/src/modules/music/components/pages/Playlist.vue.js +11 -11
  288. package/dist/martyrs/src/modules/music/components/pages/Playlist.vue.js.map +1 -1
  289. package/dist/martyrs/src/modules/music/components/pages/SearchResults.vue.js +3 -3
  290. package/dist/martyrs/src/modules/music/components/pages/SearchResults.vue.js.map +1 -1
  291. package/dist/martyrs/src/modules/music/components/pages/Track.vue.js +11 -11
  292. package/dist/martyrs/src/modules/music/components/pages/Track.vue.js.map +1 -1
  293. package/dist/martyrs/src/modules/music/components/player/FullscreenPlayer.vue.js +4 -4
  294. package/dist/martyrs/src/modules/music/components/player/FullscreenPlayer.vue.js.map +1 -1
  295. package/dist/martyrs/src/modules/music/components/player/TrackProgress.vue.js +2 -2
  296. package/dist/martyrs/src/modules/music/components/player/TrackProgress.vue.js.map +1 -1
  297. package/dist/martyrs/src/modules/notifications/components/sections/NotificationPreferences.vue.js +162 -68
  298. package/dist/martyrs/src/modules/notifications/components/sections/NotificationPreferences.vue.js.map +1 -1
  299. package/dist/martyrs/src/modules/notifications/notifications.client.js +181 -17
  300. package/dist/martyrs/src/modules/notifications/notifications.client.js.map +1 -1
  301. package/dist/martyrs/src/modules/notifications/router/notifications.backoffice.router.js +21 -0
  302. package/dist/martyrs/src/modules/notifications/router/notifications.backoffice.router.js.map +1 -0
  303. package/dist/martyrs/src/modules/notifications/router/notifications.router.js +13 -42
  304. package/dist/martyrs/src/modules/notifications/router/notifications.router.js.map +1 -1
  305. package/dist/martyrs/src/modules/notifications/store/notifications.store.js +66 -1
  306. package/dist/martyrs/src/modules/notifications/store/notifications.store.js.map +1 -1
  307. package/dist/martyrs/src/modules/orders/components/blocks/CardApplication.vue.js +9 -7
  308. package/dist/martyrs/src/modules/orders/components/blocks/CardApplication.vue.js.map +1 -1
  309. package/dist/martyrs/src/modules/orders/components/blocks/CardCustomer.vue.js +11 -9
  310. package/dist/martyrs/src/modules/orders/components/blocks/CardCustomer.vue.js.map +1 -1
  311. package/dist/martyrs/src/modules/orders/components/blocks/CardOrder.vue.js +9 -9
  312. package/dist/martyrs/src/modules/orders/components/blocks/CardOrder.vue.js.map +1 -1
  313. package/dist/martyrs/src/modules/orders/components/blocks/CardOrderBackoffice.vue.js +66 -19
  314. package/dist/martyrs/src/modules/orders/components/blocks/CardOrderBackoffice.vue.js.map +1 -1
  315. package/dist/martyrs/src/modules/orders/components/blocks/CardOrderItem.vue.js +29 -27
  316. package/dist/martyrs/src/modules/orders/components/blocks/CardOrderItem.vue.js.map +1 -1
  317. package/dist/martyrs/src/modules/orders/components/blocks/CardOrderUser.vue.js +7 -12
  318. package/dist/martyrs/src/modules/orders/components/blocks/CardOrderUser.vue.js.map +1 -1
  319. package/dist/martyrs/src/modules/orders/components/elements/FieldSubscribeNewsletter.vue.js +1 -1
  320. package/dist/martyrs/src/modules/orders/components/elements/FieldSubscribeNewsletter.vue.js.map +1 -1
  321. package/dist/martyrs/src/modules/orders/components/elements/PriceTotal.vue.js +4 -4
  322. package/dist/martyrs/src/modules/orders/components/elements/PriceTotal.vue.js.map +1 -1
  323. package/dist/martyrs/src/modules/orders/components/forms/FormApplicationDetails.vue.js +1 -1
  324. package/dist/martyrs/src/modules/orders/components/forms/FormApplicationDetails.vue.js.map +1 -1
  325. package/dist/martyrs/src/modules/orders/components/forms/FormSelectCustomer.vue.js +46 -25
  326. package/dist/martyrs/src/modules/orders/components/forms/FormSelectCustomer.vue.js.map +1 -1
  327. package/dist/martyrs/src/modules/orders/components/pages/Applications.vue.js +2 -2
  328. package/dist/martyrs/src/modules/orders/components/pages/Applications.vue.js.map +1 -1
  329. package/dist/martyrs/src/modules/orders/components/pages/Customers.vue.js +54 -38
  330. package/dist/martyrs/src/modules/orders/components/pages/Customers.vue.js.map +1 -1
  331. package/dist/martyrs/src/modules/orders/components/pages/OrderBackoffice.vue.js +454 -139
  332. package/dist/martyrs/src/modules/orders/components/pages/OrderBackoffice.vue.js.map +1 -1
  333. package/dist/martyrs/src/modules/orders/components/pages/OrderCreate.vue.js +2 -1
  334. package/dist/martyrs/src/modules/orders/components/pages/OrderCreate.vue.js.map +1 -1
  335. package/dist/martyrs/src/modules/orders/components/pages/OrderCreateBackoffice.vue.js +141 -68
  336. package/dist/martyrs/src/modules/orders/components/pages/OrderCreateBackoffice.vue.js.map +1 -1
  337. package/dist/martyrs/src/modules/orders/components/pages/Orders.vue.js +38 -32
  338. package/dist/martyrs/src/modules/orders/components/pages/Orders.vue.js.map +1 -1
  339. package/dist/martyrs/src/modules/orders/components/partials/ShopCart.vue.js +1 -1
  340. package/dist/martyrs/src/modules/orders/components/partials/ShopCart.vue.js.map +1 -1
  341. package/dist/martyrs/src/modules/orders/components/sections/ApplicationDetails.vue.js +4 -4
  342. package/dist/martyrs/src/modules/orders/components/sections/ApplicationDetails.vue.js.map +1 -1
  343. package/dist/martyrs/src/modules/orders/components/sections/AskToLogin.vue.js +1 -1
  344. package/dist/martyrs/src/modules/orders/components/sections/AskToLogin.vue.js.map +1 -1
  345. package/dist/martyrs/src/modules/orders/components/sections/CustomerDetails.vue.js +167 -95
  346. package/dist/martyrs/src/modules/orders/components/sections/CustomerDetails.vue.js.map +1 -1
  347. package/dist/martyrs/src/modules/orders/orders.client.js +22 -20
  348. package/dist/martyrs/src/modules/orders/orders.client.js.map +1 -1
  349. package/dist/martyrs/src/modules/orders/store/orders.js +3 -5
  350. package/dist/martyrs/src/modules/orders/store/orders.js.map +1 -1
  351. package/dist/martyrs/src/modules/orders/store/shopcart.js +5 -5
  352. package/dist/martyrs/src/modules/orders/store/shopcart.js.map +1 -1
  353. package/dist/martyrs/src/modules/orders/utils/rent-price.js +60 -0
  354. package/dist/martyrs/src/modules/orders/utils/rent-price.js.map +1 -0
  355. package/dist/martyrs/src/modules/organizations/components/blocks/CardDepartment.vue.js +2 -2
  356. package/dist/martyrs/src/modules/organizations/components/blocks/CardOrganization.vue.js +45 -55
  357. package/dist/martyrs/src/modules/organizations/components/blocks/CardOrganization.vue.js.map +1 -1
  358. package/dist/martyrs/src/modules/organizations/components/blocks/EmptyState.vue.js +1 -1
  359. package/dist/martyrs/src/modules/organizations/components/blocks/Rating.vue.js +1 -1
  360. package/dist/martyrs/src/modules/organizations/components/blocks/Socials.vue.js +2 -2
  361. package/dist/martyrs/src/modules/organizations/components/blocks/Socials.vue.js.map +1 -1
  362. package/dist/martyrs/src/modules/organizations/components/elements/ButtonToggleMembership.vue.js +1 -1
  363. package/dist/martyrs/src/modules/organizations/components/elements/ButtonToggleMembership.vue.js.map +1 -1
  364. package/dist/martyrs/src/modules/organizations/components/forms/AddExistingMembersForm.vue.js +3 -3
  365. package/dist/martyrs/src/modules/organizations/components/forms/AddExistingMembersForm.vue.js.map +1 -1
  366. package/dist/martyrs/src/modules/organizations/components/forms/DepartmentForm.vue.js +1 -1
  367. package/dist/martyrs/src/modules/organizations/components/forms/DepartmentForm.vue.js.map +1 -1
  368. package/dist/martyrs/src/modules/organizations/components/forms/InviteForm.vue.js +1 -1
  369. package/dist/martyrs/src/modules/organizations/components/forms/InviteForm.vue.js.map +1 -1
  370. package/dist/martyrs/src/modules/organizations/components/pages/Department.vue.js +2 -2
  371. package/dist/martyrs/src/modules/organizations/components/pages/Department.vue.js.map +1 -1
  372. package/dist/martyrs/src/modules/organizations/components/pages/Members.vue.js +8 -8
  373. package/dist/martyrs/src/modules/organizations/components/pages/Members.vue.js.map +1 -1
  374. package/dist/martyrs/src/modules/organizations/components/pages/Organization.vue.js +216 -83
  375. package/dist/martyrs/src/modules/organizations/components/pages/Organization.vue.js.map +1 -1
  376. package/dist/martyrs/src/modules/organizations/components/pages/OrganizationEdit.vue.js +35 -25
  377. package/dist/martyrs/src/modules/organizations/components/pages/OrganizationEdit.vue.js.map +1 -1
  378. package/dist/martyrs/src/modules/organizations/components/pages/Organizations.vue.js +3 -2
  379. package/dist/martyrs/src/modules/organizations/components/pages/Organizations.vue.js.map +1 -1
  380. package/dist/martyrs/src/modules/organizations/components/sections/Documents.vue.js +2 -2
  381. package/dist/martyrs/src/modules/organizations/components/sections/Documents.vue.js.map +1 -1
  382. package/dist/martyrs/src/modules/organizations/components/sections/MembersAdd.vue.js +2 -2
  383. package/dist/martyrs/src/modules/organizations/components/sections/MembersAdd.vue.js.map +1 -1
  384. package/dist/martyrs/src/modules/organizations/configs/navigation.organization.config.js +20 -18
  385. package/dist/martyrs/src/modules/organizations/configs/navigation.organization.config.js.map +1 -1
  386. package/dist/martyrs/src/modules/organizations/organizations.client.js +39 -33
  387. package/dist/martyrs/src/modules/organizations/organizations.client.js.map +1 -1
  388. package/dist/martyrs/src/modules/organizations/router/organizations.backoffice.router.js +81 -0
  389. package/dist/martyrs/src/modules/organizations/router/organizations.backoffice.router.js.map +1 -1
  390. package/dist/martyrs/src/modules/pages/views/components/pages/PageEdit.vue.js +1 -1
  391. package/dist/martyrs/src/modules/pages/views/components/pages/Pages.vue.js +1 -1
  392. package/dist/martyrs/src/modules/pages/views/components/pages/Pages.vue.js.map +1 -1
  393. package/dist/martyrs/src/modules/pages/views/router/pages.router.js +2 -2
  394. package/dist/martyrs/src/modules/pages/views/router/pages.router.js.map +1 -1
  395. package/dist/martyrs/src/modules/products/components/blocks/CardPosition.vue.js +1 -1
  396. package/dist/martyrs/src/modules/products/components/blocks/CardPosition.vue.js.map +1 -1
  397. package/dist/martyrs/src/modules/products/components/blocks/CardProduct.vue.js +2 -2
  398. package/dist/martyrs/src/modules/products/components/blocks/CardProduct.vue.js.map +1 -1
  399. package/dist/martyrs/src/modules/products/components/blocks/ProductDiscounts.vue.js +3 -3
  400. package/dist/martyrs/src/modules/products/components/blocks/ProductDiscounts.vue.js.map +1 -1
  401. package/dist/martyrs/src/modules/products/components/blocks/ProductImages.vue.js +2 -2
  402. package/dist/martyrs/src/modules/products/components/blocks/ProductImages.vue.js.map +1 -1
  403. package/dist/martyrs/src/modules/products/components/blocks/ProductVariants.vue.js +3 -3
  404. package/dist/martyrs/src/modules/products/components/blocks/ProductVariants.vue.js.map +1 -1
  405. package/dist/martyrs/src/modules/products/components/elements/Price.vue.js +2 -2
  406. package/dist/martyrs/src/modules/products/components/elements/Price.vue.js.map +1 -1
  407. package/dist/martyrs/src/modules/products/components/pages/Categories.vue.js +9 -25
  408. package/dist/martyrs/src/modules/products/components/pages/Categories.vue.js.map +1 -1
  409. package/dist/martyrs/src/modules/products/components/pages/ProductEdit.vue.js +34 -17
  410. package/dist/martyrs/src/modules/products/components/pages/ProductEdit.vue.js.map +1 -1
  411. package/dist/martyrs/src/modules/products/components/pages/Products.vue.js +96 -96
  412. package/dist/martyrs/src/modules/products/components/pages/Products.vue.js.map +1 -1
  413. package/dist/martyrs/src/modules/products/components/sections/EditAttributes.vue.js +1 -1
  414. package/dist/martyrs/src/modules/products/components/sections/EditAttributes.vue.js.map +1 -1
  415. package/dist/martyrs/src/modules/products/components/sections/EditDiscounts.vue.js +2 -2
  416. package/dist/martyrs/src/modules/products/components/sections/EditDiscounts.vue.js.map +1 -1
  417. package/dist/martyrs/src/modules/products/components/sections/EditVariants.vue.js +22 -9
  418. package/dist/martyrs/src/modules/products/components/sections/EditVariants.vue.js.map +1 -1
  419. package/dist/martyrs/src/modules/products/components/sections/FilterProducts.vue.js +1 -1
  420. package/dist/martyrs/src/modules/products/components/sections/FilterProducts.vue.js.map +1 -1
  421. package/dist/martyrs/src/modules/products/components/sections/ProductConfigurator.vue.js +1 -1
  422. package/dist/martyrs/src/modules/products/components/sections/ProductConfigurator.vue.js.map +1 -1
  423. package/dist/martyrs/src/modules/products/components/sections/SectionProduct.vue.js +3 -3
  424. package/dist/martyrs/src/modules/products/components/sections/SectionProduct.vue.js.map +1 -1
  425. package/dist/martyrs/src/modules/products/router/categories.router.js +2 -2
  426. package/dist/martyrs/src/modules/products/router/categories.router.js.map +1 -1
  427. package/dist/martyrs/src/modules/products/router/products.router.js +17 -3
  428. package/dist/martyrs/src/modules/products/router/products.router.js.map +1 -1
  429. package/dist/martyrs/src/modules/rents/views/components/pages/Gant/GanttBar.vue.js +11 -10
  430. package/dist/martyrs/src/modules/rents/views/components/pages/Gant/GanttBar.vue.js.map +1 -1
  431. package/dist/martyrs/src/modules/rents/views/components/pages/Gant/GanttChart.vue.js +197 -81
  432. package/dist/martyrs/src/modules/rents/views/components/pages/Gant/GanttChart.vue.js.map +1 -1
  433. package/dist/martyrs/src/modules/rents/views/components/pages/Gant/GanttHeaderCell.vue.js +2 -2
  434. package/dist/martyrs/src/modules/rents/views/components/pages/Gant/GanttHeaderCell.vue.js.map +1 -1
  435. package/dist/martyrs/src/modules/rents/views/components/pages/Gant/GanttToolbar.vue.js +2 -2
  436. package/dist/martyrs/src/modules/rents/views/components/pages/Gant/GanttToolbar.vue.js.map +1 -1
  437. package/dist/martyrs/src/modules/rents/views/components/pages/Rents.vue.js +685 -80
  438. package/dist/martyrs/src/modules/rents/views/components/pages/Rents.vue.js.map +1 -1
  439. package/dist/martyrs/src/modules/rents/views/components/pages/RentsEdit.vue.js +68 -18
  440. package/dist/martyrs/src/modules/rents/views/components/pages/RentsEdit.vue.js.map +1 -1
  441. package/dist/martyrs/src/modules/rents/views/router/rents.router.js +3 -3
  442. package/dist/martyrs/src/modules/rents/views/router/rents.router.js.map +1 -1
  443. package/dist/martyrs/src/modules/rents/views/store/rents.store.js +1 -1
  444. package/dist/martyrs/src/modules/rents/views/store/rents.store.js.map +1 -1
  445. package/dist/martyrs/src/modules/reports/components/pages/BackofficeReports.vue.js +3 -3
  446. package/dist/martyrs/src/modules/reports/components/pages/BackofficeReports.vue.js.map +1 -1
  447. package/dist/martyrs/src/modules/reports/router/reports.router.js +1 -1
  448. package/dist/martyrs/src/modules/reports/router/reports.router.js.map +1 -1
  449. package/dist/martyrs/src/modules/spots/components/blocks/CardSpot.vue.js +5 -5
  450. package/dist/martyrs/src/modules/spots/components/blocks/CardSpot.vue.js.map +1 -1
  451. package/dist/martyrs/src/modules/spots/components/pages/Map.vue.js +1 -1
  452. package/dist/martyrs/src/modules/spots/components/pages/Spot.vue.js +3 -3
  453. package/dist/martyrs/src/modules/spots/components/pages/Spot.vue.js.map +1 -1
  454. package/dist/martyrs/src/modules/spots/components/pages/SpotEdit.vue.js +9 -7
  455. package/dist/martyrs/src/modules/spots/components/pages/SpotEdit.vue.js.map +1 -1
  456. package/dist/martyrs/src/modules/spots/components/pages/Spots.vue.js +29 -37
  457. package/dist/martyrs/src/modules/spots/components/pages/Spots.vue.js.map +1 -1
  458. package/dist/martyrs/src/modules/spots/components/sections/WorktimeEdit.vue.js +8 -8
  459. package/dist/martyrs/src/modules/spots/components/sections/WorktimeEdit.vue.js.map +1 -1
  460. package/dist/martyrs/src/modules/spots/router/spots.router.js +3 -3
  461. package/dist/martyrs/src/modules/spots/router/spots.router.js.map +1 -1
  462. package/dist/martyrs/src/modules/wallet/views/components/elements/ConnectMetamask.vue.js +3 -3
  463. package/dist/martyrs/src/modules/wallet/views/components/elements/ConnectMetamask.vue.js.map +1 -1
  464. package/dist/martyrs/src/modules/wallet/views/components/pages/Payments.vue.js +1 -1
  465. package/dist/martyrs/src/modules/wallet/views/components/pages/Payments.vue.js.map +1 -1
  466. package/dist/martyrs/src/modules/wallet/views/router/wallet.router.js +1 -1
  467. package/dist/martyrs/src/modules/wallet/views/router/wallet.router.js.map +1 -1
  468. package/dist/martyrs.es10.js +59 -57
  469. package/dist/martyrs.es106.js +2 -2
  470. package/dist/martyrs.es11.js +31 -30
  471. package/dist/martyrs.es113.js +22 -166
  472. package/dist/martyrs.es114.js +4 -457
  473. package/dist/martyrs.es115.js +8 -40
  474. package/dist/martyrs.es116.js +166 -9
  475. package/dist/martyrs.es117.js +451 -43
  476. package/dist/martyrs.es118.js +38 -10
  477. package/dist/martyrs.es119.js +9 -44
  478. package/dist/martyrs.es12.js +8 -9
  479. package/dist/martyrs.es120.js +49 -4
  480. package/dist/martyrs.es121.js +10 -127
  481. package/dist/martyrs.es122.js +42 -98
  482. package/dist/martyrs.es123.js +4 -86
  483. package/dist/martyrs.es124.js +120 -29
  484. package/dist/martyrs.es125.js +99 -10
  485. package/dist/martyrs.es126.js +71 -24
  486. package/dist/martyrs.es127.js +37 -8
  487. package/dist/martyrs.es128.js +11 -22
  488. package/dist/martyrs.es129.js +39 -4
  489. package/dist/martyrs.es13.js +22 -19
  490. package/dist/martyrs.es130.js +9 -8
  491. package/dist/martyrs.es131.js +7 -7
  492. package/dist/martyrs.es132.js +2 -2
  493. package/dist/martyrs.es133.js +1 -1
  494. package/dist/martyrs.es135.js +1 -1
  495. package/dist/martyrs.es137.js +1 -1
  496. package/dist/martyrs.es138.js +7 -8
  497. package/dist/martyrs.es139.js +8 -7
  498. package/dist/martyrs.es14.js +2 -2
  499. package/dist/martyrs.es140.js +2 -2
  500. package/dist/martyrs.es144.js +10 -29
  501. package/dist/martyrs.es145.js +29 -10
  502. package/dist/martyrs.es146.js +2 -2
  503. package/dist/martyrs.es147.js +2 -2
  504. package/dist/martyrs.es149.js +1 -1
  505. package/dist/martyrs.es2.js +31 -30
  506. package/dist/martyrs.es22.js +16 -16
  507. package/dist/martyrs.es23.js +8 -8
  508. package/dist/martyrs.es24.js +9 -9
  509. package/dist/martyrs.es26.js +9 -11
  510. package/dist/martyrs.es27.js +9 -9
  511. package/dist/martyrs.es28.js +1 -1
  512. package/dist/martyrs.es29.js +5 -5
  513. package/dist/martyrs.es3.js +1 -1
  514. package/dist/martyrs.es38.js +1 -1
  515. package/dist/martyrs.es4.js +12 -12
  516. package/dist/martyrs.es41.js +34 -224
  517. package/dist/martyrs.es5.js +251 -238
  518. package/dist/martyrs.es61.js +33 -26
  519. package/dist/martyrs.es74.js +7 -7
  520. package/dist/martyrs.es76.js +12 -12
  521. package/dist/martyrs.es8.js +31 -31
  522. package/dist/music.server.js +3 -3
  523. package/dist/node_modules/.pnpm/@googlemaps_js-api-loader@2.0.2/node_modules/@googlemaps/js-api-loader/dist/index.js +90 -0
  524. package/dist/node_modules/.pnpm/@googlemaps_js-api-loader@2.0.2/node_modules/@googlemaps/js-api-loader/dist/index.js.map +1 -0
  525. package/dist/notifications.server.js +255 -23
  526. package/dist/orders.server.js +674 -136
  527. package/dist/organizations.server.js +11 -6
  528. package/dist/products.server.js +68 -7
  529. package/dist/{queryProcessor-C_5Iipam.js → queryProcessor-B2FCngFP.js} +3 -2
  530. package/dist/rents.server.js +183 -7
  531. package/dist/{socials.schema-DxnnaBgO.js → socials.schema-C3RjkqJv.js} +4 -0
  532. package/dist/spots.server.js +1 -1
  533. package/dist/style.css +292 -204
  534. package/dist/{tickets.controller-DdF85W-i.js → tickets.controller-Dpzf4kQx.js} +1 -1
  535. package/dist/wallet.server.js +2 -2
  536. package/package.json +5 -3
  537. package/src/builder/modes/ssr.rspack.dev.js +2 -0
  538. package/src/builder/rspack/rspack.config.ssr.client.js +58 -1
  539. package/src/builder/ssr/asset-resolver.js +1 -1
  540. package/src/builder/templates/page.js +2 -0
  541. package/src/components/Address/Address.vue +16 -16
  542. package/src/components/Button/Button.vue +0 -1
  543. package/src/components/ButtonSegmented/ButtonSegmented.vue +1 -1
  544. package/src/components/Calendar/Calendar.vue +141 -118
  545. package/src/components/Chart/Chart.vue +216 -0
  546. package/src/components/Checkbox/Checkbox.vue +1 -1
  547. package/src/components/Chips/Chips.vue +4 -5
  548. package/src/components/Countdown/Countdown.vue +5 -5
  549. package/src/components/DatePicker/DatePicker.vue +2 -2
  550. package/src/components/EditImages/EditImages.vue +3 -3
  551. package/src/components/EmptyState/EmptyState.vue +1 -1
  552. package/src/components/Feed/Feed.vue +5 -0
  553. package/src/components/Field/Field.vue +3 -3
  554. package/src/components/FieldDate/FieldDate.vue +2 -2
  555. package/src/components/LocationMarker/LocationMarker.vue +28 -21
  556. package/src/components/Map/Map.vue +20 -15
  557. package/src/components/Popup/Popup.vue +3 -3
  558. package/src/components/Radio/Radio.vue +2 -2
  559. package/src/components/Select/Select.vue +1 -1
  560. package/src/components/Status/Snack.vue +1 -1
  561. package/src/components/Status/Status.vue +1 -1
  562. package/src/components/Table/Table.vue +16 -1
  563. package/src/components/Upload/Upload.vue +1 -1
  564. package/src/components/UploadImage/UploadImage.vue +1 -1
  565. package/src/components/UploadImageMultiple/UploadImageMultiple.vue +1 -1
  566. package/src/jit/rules.js +4 -0
  567. package/src/modules/TASKS.MD +16 -3
  568. package/src/modules/auth/auth.client.js +18 -3
  569. package/src/modules/auth/controllers/routes/users.routes.js +18 -0
  570. package/src/modules/auth/controllers/services/auth.service.js +3 -3
  571. package/src/modules/auth/controllers/services/users.service.js +34 -5
  572. package/src/modules/auth/views/components/blocks/OtpDialog.vue +4 -4
  573. package/src/modules/auth/views/components/blocks/PopupAuth.vue +1 -1
  574. package/src/modules/auth/views/components/blocks/SidebarUserCard.vue +95 -0
  575. package/src/modules/auth/views/components/pages/BackofficeUsers.vue +337 -0
  576. package/src/modules/auth/views/components/pages/Invite.vue +1 -1
  577. package/src/modules/auth/views/components/pages/Profile.vue +1 -1
  578. package/src/modules/auth/views/components/pages/ProfileEdit.vue +23 -14
  579. package/src/modules/auth/views/components/pages/ProfileEditAccount.vue +45 -26
  580. package/src/modules/auth/views/components/pages/ProfileEditSidebar.vue +8 -7
  581. package/src/modules/auth/views/components/pages/ResetPassword.vue +4 -4
  582. package/src/modules/auth/views/components/pages/SignUp.vue +3 -3
  583. package/src/modules/auth/views/components/pages/UserDashboard.vue +8 -5
  584. package/src/modules/auth/views/components/sections/FeaturedUsers.vue +1 -1
  585. package/src/modules/auth/views/components/sections/SliderFeatures.vue +1 -1
  586. package/src/modules/auth/views/middlewares/auth.validation.js +7 -2
  587. package/src/modules/auth/views/router/users.backoffice.router.js +39 -0
  588. package/src/modules/auth/views/store/auth.js +2 -2
  589. package/src/modules/backoffice/components/admin/Backcalls.vue +2 -2
  590. package/src/modules/backoffice/components/admin/Dashboard.sublime-workspace +1 -1
  591. package/src/modules/backoffice/components/admin/FastOrders.vue +3 -3
  592. package/src/modules/backoffice/components/admin/UserEdit.vue +1 -1
  593. package/src/modules/backoffice/components/pages/Dashboard.vue +102 -139
  594. package/src/modules/backoffice/configs/navigation.backoffice.config.js +91 -29
  595. package/src/modules/backoffice/router/backoffice.router.js +7 -1
  596. package/src/modules/chats/components/blocks/ChatMessage.vue +1 -1
  597. package/src/modules/chats/components/sections/ChatWindow.vue +1 -1
  598. package/src/modules/community/community.client.js +4 -4
  599. package/src/modules/community/components/blocks/CardBlogpost.vue +1 -1
  600. package/src/modules/community/components/layouts/Community.vue +4 -4
  601. package/src/modules/community/components/sections/Comment.vue +1 -1
  602. package/src/modules/constructor/components/elements/ImageUpload.vue +1 -1
  603. package/src/modules/core/TASK.MD +2 -2
  604. package/src/modules/core/controllers/classes/abac/abac.core.js +1 -0
  605. package/src/modules/core/controllers/classes/core.websocket.js +0 -2
  606. package/src/modules/core/controllers/classes/crud/crud.core.js +6 -0
  607. package/src/modules/core/controllers/classes/crud/crud.service.js +6 -0
  608. package/src/modules/core/controllers/utils/mailing.js +35 -26
  609. package/src/modules/core/controllers/utils/queryProcessor.js +4 -2
  610. package/src/modules/core/core.client.js +1 -0
  611. package/src/modules/core/models/schemas/embedding.schema.js +8 -0
  612. package/src/modules/core/models/schemas/socials.schema.js +4 -0
  613. package/src/modules/core/sw.js +448 -0
  614. package/src/modules/core/views/classes/core.app.js +37 -13
  615. package/src/modules/core/views/classes/module.manager.js +3 -1
  616. package/src/modules/core/views/components/blocks/AlertDialog.vue +1 -1
  617. package/src/modules/core/views/components/blocks/BlockSearch.vue +1 -1
  618. package/src/modules/core/views/components/blocks/BlockSlider.vue +96 -0
  619. package/src/modules/core/views/components/blocks/CardHeader.vue +2 -2
  620. package/src/modules/core/views/components/blocks/CardStat.vue +4 -18
  621. package/src/modules/{auth → core}/views/components/blocks/CardUser.vue +45 -20
  622. package/src/modules/core/views/components/blocks/HelpCard.vue +1 -1
  623. package/src/modules/core/views/components/blocks/PopupAuth.vue +1 -1
  624. package/src/modules/core/views/components/blocks/PopupDateSelector.vue +41 -24
  625. package/src/modules/core/views/components/layouts/Client.vue +1 -1
  626. package/src/modules/core/views/components/pages/404.vue +5 -5
  627. package/src/modules/core/views/components/partials/BottomNavigationBar.vue +5 -5
  628. package/src/modules/core/views/components/partials/CitySelection.vue +2 -2
  629. package/src/modules/core/views/components/partials/Footer.centered.vue +2 -2
  630. package/src/modules/core/views/components/partials/Footer.vue +2 -2
  631. package/src/modules/core/views/components/partials/Header.vue +3 -3
  632. package/src/modules/core/views/components/partials/LocationSelection.vue +1 -1
  633. package/src/modules/core/views/components/partials/Navigation.vue +1 -1
  634. package/src/modules/core/views/components/sections/Filters.vue +2 -2
  635. package/src/modules/core/views/components/sections/SectionPageTitle.vue +2 -2
  636. package/src/modules/core/views/components/sections/Walkthrough.vue +6 -6
  637. package/src/modules/core/views/mixins/mixins.js +17 -0
  638. package/src/modules/core/views/plugins/date-picker.plugin.js +8 -5
  639. package/src/modules/core/views/store/core.store.js +5 -0
  640. package/src/modules/core/views/utils/vue-app-renderer.js +5 -0
  641. package/src/modules/events/components/pages/EditEventTickets.vue +9 -9
  642. package/src/modules/events/components/pages/Event.vue +2 -2
  643. package/src/modules/events/components/sections/EditTickets.vue +1 -1
  644. package/src/modules/events/components/sections/SelectDate.vue +1 -1
  645. package/src/modules/events/events.client.js +4 -4
  646. package/src/modules/gallery/components/sections/BackofficeGallery.vue +1 -1
  647. package/src/modules/gallery/router/gallery.router.js +3 -3
  648. package/src/modules/governance/middlewares/sprints.verifier.js +3 -3
  649. package/src/modules/governance/middlewares/tasks.verifier.js +3 -3
  650. package/src/modules/governance/models/sprint.model.js +1 -1
  651. package/src/modules/governance/models/task.model.js +1 -1
  652. package/src/modules/governance/reactcode/src/components/TaskStatusBadge.tsx +1 -1
  653. package/src/modules/governance/views/components/blocks/CardInitiativeItem.vue +3 -3
  654. package/src/modules/governance/views/components/blocks/CardSprintItem.vue +4 -4
  655. package/src/modules/governance/views/components/blocks/CardTaskItem.vue +2 -2
  656. package/src/modules/governance/views/components/blocks/CardVotingItem.vue +3 -3
  657. package/src/modules/governance/views/components/pages/Initiatives.vue +3 -3
  658. package/src/modules/governance/views/components/partials/TaskStatusBadge.vue +1 -1
  659. package/src/modules/governance/views/components/sections/FormSprintDetails.vue +1 -1
  660. package/src/modules/governance/views/components/sections/FormTaskDetails.vue +1 -1
  661. package/src/modules/governance/views/router/governance.router.js +3 -3
  662. package/src/modules/icons/components/IconSearchPopup.vue +1 -1
  663. package/src/modules/icons/entities/IconApplications.vue +14 -0
  664. package/src/modules/icons/entities/IconCustomers.vue +14 -0
  665. package/src/modules/icons/entities/IconUsers.vue +14 -0
  666. package/src/modules/inventory/components/forms/AdjustmentForm.vue +2 -2
  667. package/src/modules/inventory/components/forms/ColumnSettingsMenu.vue +2 -2
  668. package/src/modules/inventory/components/forms/HistoryView.vue +1 -1
  669. package/src/modules/inventory/components/forms/StockAlertsForm.vue +3 -3
  670. package/src/modules/inventory/components/pages/Inventory.vue +278 -159
  671. package/src/modules/inventory/components/pages/InventoryEdit.vue +2 -2
  672. package/src/modules/inventory/inventory.client.js +4 -4
  673. package/src/modules/inventory/models/stock.audit.model.js +1 -1
  674. package/src/modules/inventory/router/inventory.router.js +12 -0
  675. package/src/modules/landing/components/sections/SectionEarn.vue +3 -3
  676. package/src/modules/landing/components/sections/SectionFeature.vue +1 -1
  677. package/src/modules/landing/components/sections/SectionFeatures.vue +1 -1
  678. package/src/modules/landing/components/sections/SectionFeaturesImages.vue +2 -2
  679. package/src/modules/landing/components/sections/SectionGuide.vue +2 -2
  680. package/src/modules/landing/components/sections/SectionHeroToken.vue +1 -1
  681. package/src/modules/landing/components/sections/SectionHeroVideo.vue +1 -1
  682. package/src/modules/landing/components/sections/SectionMobileApp.vue +2 -2
  683. package/src/modules/landing/components/sections/SectionOverview.vue +1 -1
  684. package/src/modules/landing/components/sections/SectionRoadmap.vue +1 -1
  685. package/src/modules/landing/components/sections/SubscribeNewsletter.vue +1 -1
  686. package/src/modules/marketplace/views/components/sections/SectionMenu.vue +2 -2
  687. package/src/modules/music/components/SidebarMusic.vue +1 -1
  688. package/src/modules/music/components/cards/AlbumCard.vue +1 -1
  689. package/src/modules/music/components/cards/ArtistCard.vue +1 -1
  690. package/src/modules/music/components/cards/ArtistCardSmall.vue +1 -1
  691. package/src/modules/music/components/cards/PlaylistCard.vue +1 -1
  692. package/src/modules/music/components/cards/TrackListCard.vue +6 -6
  693. package/src/modules/music/components/forms/AlbumForm.vue +2 -2
  694. package/src/modules/music/components/forms/ArtistForm.vue +1 -1
  695. package/src/modules/music/components/forms/PlaylistForm.vue +5 -5
  696. package/src/modules/music/components/forms/TrackForm.vue +3 -3
  697. package/src/modules/music/components/pages/Album.vue +8 -8
  698. package/src/modules/music/components/pages/Artist.vue +5 -5
  699. package/src/modules/music/components/pages/Playlist.vue +11 -11
  700. package/src/modules/music/components/pages/SearchResults.vue +2 -2
  701. package/src/modules/music/components/pages/Track.vue +11 -11
  702. package/src/modules/music/components/player/FullscreenPlayer.vue +3 -3
  703. package/src/modules/music/components/player/TrackProgress.vue +1 -1
  704. package/src/modules/notifications/components/sections/NotificationPreferences.vue +182 -52
  705. package/src/modules/notifications/controllers/notifications.controller.js +242 -17
  706. package/src/modules/notifications/models/notification-preference.model.js +4 -0
  707. package/src/modules/notifications/notifications.client.js +213 -20
  708. package/src/modules/notifications/router/notifications.backoffice.router.js +16 -0
  709. package/src/modules/notifications/router/notifications.router.js +13 -45
  710. package/src/modules/notifications/routes/notifications.routes.js +9 -0
  711. package/src/modules/notifications/services/notification.service.js +33 -9
  712. package/src/modules/notifications/services/telegram.service.js +2 -2
  713. package/src/modules/notifications/services/web-push.service.js +6 -2
  714. package/src/modules/notifications/store/notifications.store.js +69 -0
  715. package/src/modules/orders/components/blocks/CardApplication.vue +9 -6
  716. package/src/modules/orders/components/blocks/CardCustomer.vue +10 -7
  717. package/src/modules/orders/components/blocks/CardOrder.vue +8 -8
  718. package/src/modules/orders/components/blocks/CardOrderBackoffice.vue +58 -12
  719. package/src/modules/orders/components/blocks/CardOrderItem.vue +31 -28
  720. package/src/modules/orders/components/blocks/CardOrderUser.vue +7 -12
  721. package/src/modules/orders/components/blocks/CardOrderVar1.vue +3 -3
  722. package/src/modules/orders/components/elements/FieldSubscribeNewsletter.vue +1 -1
  723. package/src/modules/orders/components/elements/PriceTotal.vue +4 -4
  724. package/src/modules/orders/components/forms/FormApplicationDetails.vue +1 -1
  725. package/src/modules/orders/components/forms/FormSelectCustomer.vue +48 -25
  726. package/src/modules/orders/components/pages/Applications.vue +2 -2
  727. package/src/modules/orders/components/pages/Customers.vue +35 -23
  728. package/src/modules/orders/components/pages/OrderBackoffice.vue +780 -393
  729. package/src/modules/orders/components/pages/OrderCreate.vue +5 -4
  730. package/src/modules/orders/components/pages/OrderCreateBackoffice.vue +112 -42
  731. package/src/modules/orders/components/pages/Orders.vue +20 -19
  732. package/src/modules/orders/components/pages/Orders_refact.vue +3 -3
  733. package/src/modules/orders/components/partials/ShopCart.vue +1 -1
  734. package/src/modules/orders/components/sections/ApplicationDetails.vue +2 -2
  735. package/src/modules/orders/components/sections/AskToLogin.vue +1 -1
  736. package/src/modules/orders/components/sections/CustomerDetails.vue +130 -64
  737. package/src/modules/orders/controllers/orders.controller.js +463 -134
  738. package/src/modules/orders/middlewares/applications.verifier.js +3 -3
  739. package/src/modules/orders/middlewares/customers.verifier.js +4 -0
  740. package/src/modules/orders/middlewares/orders.verifier.js +187 -0
  741. package/src/modules/orders/models/customer.model.js +2 -0
  742. package/src/modules/orders/models/order.model.js +20 -2
  743. package/src/modules/orders/orders.client.js +21 -19
  744. package/src/modules/orders/routes/applications.routes.js +13 -3
  745. package/src/modules/orders/routes/customers.routes.js +2 -0
  746. package/src/modules/orders/routes/orders.routes.js +46 -4
  747. package/src/modules/orders/store/orders.js +4 -7
  748. package/src/modules/orders/store/shopcart.js +6 -7
  749. package/src/modules/orders/utils/rent-price.js +90 -0
  750. package/src/modules/organizations/components/blocks/CardDepartment.vue +1 -1
  751. package/src/modules/organizations/components/blocks/CardOrganization.vue +30 -33
  752. package/src/modules/organizations/components/blocks/EmptyState.vue +1 -1
  753. package/src/modules/organizations/components/blocks/Rating.vue +1 -1
  754. package/src/modules/organizations/components/blocks/Socials.vue +2 -2
  755. package/src/modules/organizations/components/elements/ButtonToggleMembership.vue +1 -1
  756. package/src/modules/organizations/components/forms/AddExistingMembersForm.vue +3 -3
  757. package/src/modules/organizations/components/forms/DepartmentForm.vue +1 -1
  758. package/src/modules/organizations/components/forms/InviteForm.vue +1 -1
  759. package/src/modules/organizations/components/pages/Department.vue +2 -2
  760. package/src/modules/organizations/components/pages/DepartmentEdit.vue +1 -1
  761. package/src/modules/organizations/components/pages/Members.vue +8 -8
  762. package/src/modules/organizations/components/pages/Organization.vue +232 -124
  763. package/src/modules/organizations/components/pages/OrganizationCreate.vue +3 -3
  764. package/src/modules/organizations/components/pages/OrganizationDocuments.vue +1 -1
  765. package/src/modules/organizations/components/pages/OrganizationEdit.vue +15 -6
  766. package/src/modules/organizations/components/pages/Organizations.vue +3 -2
  767. package/src/modules/organizations/components/sections/Documents.vue +1 -1
  768. package/src/modules/organizations/components/sections/MembersAdd.vue +2 -2
  769. package/src/modules/organizations/configs/navigation.organization.config.js +34 -26
  770. package/src/modules/organizations/controllers/organizations.controller.js +8 -3
  771. package/src/modules/organizations/models/organization.model.js +1 -0
  772. package/src/modules/organizations/organizations.client.js +39 -33
  773. package/src/modules/organizations/router/organizations.backoffice.router.js +67 -0
  774. package/src/modules/pages/views/components/pages/Pages.vue +1 -1
  775. package/src/modules/pages/views/router/pages.router.js +2 -2
  776. package/src/modules/products/components/blocks/CardPosition.vue +2 -2
  777. package/src/modules/products/components/blocks/CardProduct.vue +2 -2
  778. package/src/modules/products/components/blocks/ProductDiscounts.vue +1 -1
  779. package/src/modules/products/components/blocks/ProductImages.vue +1 -1
  780. package/src/modules/products/components/blocks/ProductVariants.vue +3 -3
  781. package/src/modules/products/components/elements/Price.vue +2 -2
  782. package/src/modules/products/components/forms/ColumnSettingsMenu.vue +2 -2
  783. package/src/modules/products/components/forms/ReorderSettingsForm.vue +3 -3
  784. package/src/modules/products/components/forms/StockAuditForm.vue +2 -2
  785. package/src/modules/products/components/forms/StockHistoryView.vue +1 -1
  786. package/src/modules/products/components/pages/Categories.vue +9 -20
  787. package/src/modules/products/components/pages/ProductEdit.vue +19 -3
  788. package/src/modules/products/components/pages/Products.vue +20 -19
  789. package/src/modules/products/components/sections/EditAttributes.vue +1 -1
  790. package/src/modules/products/components/sections/EditCategories.vue +1 -1
  791. package/src/modules/products/components/sections/EditDiscounts.vue +2 -2
  792. package/src/modules/products/components/sections/EditVariants.vue +14 -2
  793. package/src/modules/products/components/sections/FilterProducts.vue +1 -1
  794. package/src/modules/products/components/sections/ProductConfigurator.vue +1 -1
  795. package/src/modules/products/components/sections/SectionProduct.vue +3 -3
  796. package/src/modules/products/controllers/products.controller.js +50 -5
  797. package/src/modules/products/experiments/product-recommendation/components/HeroRecommendation.vue +2 -2
  798. package/src/modules/products/models/product.model.js +7 -0
  799. package/src/modules/products/models/variant.model.js +4 -0
  800. package/src/modules/products/router/categories.router.js +2 -2
  801. package/src/modules/products/router/products.router.js +14 -3
  802. package/src/modules/rents/controllers/routes/rents.routes.js +11 -0
  803. package/src/modules/rents/controllers/services/rents.services.js +193 -2
  804. package/src/modules/rents/models/rent.model.js +9 -0
  805. package/src/modules/rents/views/components/pages/Gant/GanttBar.vue +28 -11
  806. package/src/modules/rents/views/components/pages/Gant/GanttChart.vue +200 -40
  807. package/src/modules/rents/views/components/pages/Gant/GanttHeaderCell.vue +2 -2
  808. package/src/modules/rents/views/components/pages/Gant/GanttToolbar.vue +2 -2
  809. package/src/modules/rents/views/components/pages/Rents.vue +641 -142
  810. package/src/modules/rents/views/components/pages/RentsEdit.vue +44 -4
  811. package/src/modules/rents/views/router/rents.router.js +3 -3
  812. package/src/modules/rents/views/store/rents.store.js +1 -1
  813. package/src/modules/reports/components/pages/BackofficeReports.vue +3 -3
  814. package/src/modules/reports/router/reports.router.js +1 -1
  815. package/src/modules/spots/components/blocks/CardSpot.vue +6 -6
  816. package/src/modules/spots/components/pages/Spot.vue +2 -2
  817. package/src/modules/spots/components/pages/SpotEdit.vue +8 -6
  818. package/src/modules/spots/components/pages/Spots.vue +18 -24
  819. package/src/modules/spots/components/sections/WorktimeEdit.vue +7 -7
  820. package/src/modules/spots/router/spots.router.js +3 -3
  821. package/src/modules/wallet/views/components/blocks/CashDeposit.vue +1 -1
  822. package/src/modules/wallet/views/components/elements/ConnectMetamask.vue +3 -3
  823. package/src/modules/wallet/views/components/pages/Payments.vue +1 -1
  824. package/src/modules/wallet/views/components/pages/Wallet.vue +4 -4
  825. package/src/modules/wallet/views/router/wallet.router.js +1 -1
  826. package/src/styles/layout.scss +1 -1
  827. package/dist/martyrs/src/components/EditImages/EditImages.vue2.js.map +0 -1
  828. package/dist/martyrs/src/components/Tooltip/Tooltip.vue2.js.map +0 -1
  829. package/dist/martyrs/src/modules/icons/entities/IconCash.vue.js +0 -70
  830. package/dist/martyrs/src/modules/icons/entities/IconCash.vue.js.map +0 -1
  831. package/dist/node_modules/.pnpm/@googlemaps_js-api-loader@1.16.8/node_modules/@googlemaps/js-api-loader/dist/index.js +0 -336
  832. package/dist/node_modules/.pnpm/@googlemaps_js-api-loader@1.16.8/node_modules/@googlemaps/js-api-loader/dist/index.js.map +0 -1
  833. package/dist/node_modules/.pnpm/vue-draggable-next@2.2.1_sortablejs@1.15.6_vue@3.5.13_typescript@5.8.3_/node_modules/vue-draggable-next/dist/vue-draggable-next.esm-bundler.js.map +0 -1
@@ -1,5 +1,6 @@
1
1
  import mailing from '@martyrs/src/modules/core/controllers/utils/mailing.js';
2
2
  import queryProcessorCore from '@martyrs/src/modules/core/controllers/utils/queryProcessor.js';
3
+ import { calcRentTotalPrice } from '@martyrs/src/modules/orders/utils/rent-price.js';
3
4
  const { sendChatMessageTelegram } = mailing;
4
5
  function formatPositions(positions) {
5
6
  return positions.map(pos => `🔹 ${pos.name} - Price: $${pos.price}, Quantity: ${pos.quantity}`).join('\n');
@@ -33,16 +34,19 @@ const controllerFactory = db => {
33
34
  const Order = db.order;
34
35
  const Customer = db.customer;
35
36
  const Department = db.department;
37
+ const Organization = db.organization;
38
+ const Variant = db.variant;
36
39
 
37
40
  // Оптимизированная функция получения пользователей с доступом orders.confirm
41
+ // Если нет участников в отделах с доступом — фоллбэк на owner организации
38
42
  const getUsersWithOrdersConfirmAccess = async (organizationId) => {
39
43
  console.log('=== Getting users with orders.confirm access ===');
40
44
  console.log('Organization ID:', organizationId);
41
-
45
+
42
46
  const pipeline = [
43
- { $match: {
47
+ { $match: {
44
48
  organization: new db.mongoose.Types.ObjectId(organizationId),
45
- 'accesses.orders.confirm': true
49
+ 'accesses.orders.confirm': true
46
50
  }},
47
51
  { $unwind: '$members' },
48
52
  { $group: {
@@ -50,19 +54,115 @@ const controllerFactory = db => {
50
54
  }},
51
55
  { $project: { userId: '$_id' }}
52
56
  ];
53
-
57
+
54
58
  console.log('Pipeline:', JSON.stringify(pipeline, null, 2));
55
-
59
+
56
60
  const result = await Department.aggregate(pipeline);
57
- const userIds = result.map(item => item.userId);
58
-
61
+ let userIds = result.map(item => item.userId);
62
+
59
63
  console.log('Found departments with access:', result.length);
60
64
  console.log('User IDs with access:', userIds);
65
+
66
+ // Фоллбэк: если нет участников в отделах — отправляем всем админам платформы
67
+ if (userIds.length === 0) {
68
+ console.log('No department members with access, falling back to platform admins');
69
+ const Role = db.mongoose.model('Role');
70
+ const User = db.mongoose.model('User');
71
+ const adminRole = await Role.findOne({ name: 'admin' }, { _id: 1 }).lean();
72
+ if (adminRole) {
73
+ const admins = await User.find({ roles: adminRole._id }, { _id: 1 }).lean();
74
+ userIds = admins.map(a => a._id);
75
+ console.log('Fallback to platform admins:', userIds);
76
+ }
77
+ }
78
+
61
79
  console.log('=== End getting users ===');
62
-
80
+
63
81
  return userIds;
64
82
  };
65
83
 
84
+ // Escape HTML entities for Telegram HTML parse_mode (required: <, >, &)
85
+ const escHtml = (str) => String(str).replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;');
86
+
87
+ // Форматирование Telegram-сообщения об ордере (HTML)
88
+ const formatOrderTelegram = async (order, type, extraData = {}) => {
89
+ // Получаем данные клиента
90
+ let customerName = '';
91
+ let customerPhone = '';
92
+ let customerEmail = '';
93
+ let customerTelegram = '';
94
+ try {
95
+ const customer = await db.mongoose.model('Customer').findById(order.customer?.target);
96
+ if (customer) {
97
+ customerName = customer.profile?.name || '';
98
+ customerPhone = customer.phone || '';
99
+ customerEmail = customer.email || '';
100
+ customerTelegram = customer.socials?.telegram || '';
101
+ }
102
+ } catch (e) {
103
+ console.error('[Telegram] Failed to fetch customer:', e.message);
104
+ }
105
+
106
+ const orderId = order._id.toString();
107
+ const baseUrl = process.env.API_URL || `https://${process.env.DOMAIN_URL}`;
108
+ const orderUrl = `${baseUrl}/backoffice/orders/${orderId}`;
109
+ const total = order.totalPrice || 0;
110
+
111
+ const fmtDate = (d) => new Date(d).toLocaleDateString('en-GB', { day: 'numeric', month: 'short', year: 'numeric' });
112
+ const fmtTime = (d) => { const dt = new Date(d); return `${String(dt.getHours()).padStart(2, '0')}:${String(dt.getMinutes()).padStart(2, '0')}`; };
113
+
114
+ // Позиции
115
+ const posLines = (order.positions || []).map(pos => {
116
+ let datePart = '';
117
+ if (pos.listing === 'rent' && pos.date?.start && pos.date?.end) {
118
+ const isShort = ['hour', '4hours', 'flat'].includes(pos.rentPeriod);
119
+ if (isShort) {
120
+ datePart = ` / ${fmtDate(pos.date.start)}, ${fmtTime(pos.date.start)}–${fmtTime(pos.date.end)}`;
121
+ } else {
122
+ datePart = ` / ${fmtDate(pos.date.start)} – ${fmtDate(pos.date.end)}`;
123
+ }
124
+ }
125
+ return `- ${escHtml(pos.name)}${datePart} / ${pos.quantity} x ฿${pos.price}`;
126
+ }).join('\n');
127
+
128
+ if (type === 'order_created') {
129
+ const lines = [];
130
+ lines.push(`🆕 <a href="${orderUrl}">New Order from ${escHtml(customerName) || 'Guest'}</a>`);
131
+ lines.push('');
132
+ if (customerPhone) lines.push(`Phone: ${escHtml(customerPhone)}`);
133
+ if (customerEmail) lines.push(`Email: ${escHtml(customerEmail)}`);
134
+ if (customerTelegram) lines.push(`Telegram: @${escHtml(customerTelegram.replace('@', ''))}`);
135
+ lines.push('');
136
+ if (order.payment?.type) lines.push(`Payment: ${escHtml(order.payment.type)}`);
137
+ lines.push('');
138
+ lines.push('📦 Positions:');
139
+ lines.push(posLines);
140
+ lines.push('');
141
+ lines.push(`In total: ฿${total}`);
142
+ if (order.delivery?.address) lines.push(`\nDelivery: ${escHtml(order.delivery.address)}`);
143
+ if (order.comment) lines.push(`\n💬 Comment: ${escHtml(order.comment)}`);
144
+ return {
145
+ text: lines.join('\n'),
146
+ reply_markup: {
147
+ inline_keyboard: [[
148
+ { text: '✅ Confirm', callback_data: `order_confirm:${orderId}` },
149
+ { text: '❌ Cancel', callback_data: `order_cancel:${orderId}` },
150
+ ]],
151
+ },
152
+ };
153
+ }
154
+
155
+ if (type === 'order_status') {
156
+ const lines = [];
157
+ lines.push(`📋 <a href="${orderUrl}">Order — ${escHtml(customerName) || 'Guest'}</a>`);
158
+ lines.push(`${escHtml(extraData.oldStatus)} → <b>${escHtml(extraData.newStatus)}</b>`);
159
+ lines.push(`In total: ฿${total}`);
160
+ return lines.join('\n');
161
+ }
162
+
163
+ return `📋 <a href="${orderUrl}">Order</a> updated`;
164
+ };
165
+
66
166
  // Отправка уведомлений о заказах - только данные
67
167
  const sendOrderNotifications = async (order, type, userIds, extraData = {}) => {
68
168
  console.log('=== Sending order notifications ===');
@@ -70,12 +170,21 @@ const controllerFactory = db => {
70
170
  console.log('Type:', type);
71
171
  console.log('User IDs:', userIds);
72
172
  console.log('Extra data:', extraData);
73
-
173
+
74
174
  if (!userIds || userIds.length === 0) {
75
175
  console.log('No users to notify, skipping...');
76
176
  return;
77
177
  }
78
178
 
179
+ // Форматируем Telegram-сообщение один раз для всех юзеров
180
+ const telegramResult = await formatOrderTelegram(order, type, extraData);
181
+ // formatOrderTelegram returns either a string or { text, reply_markup }
182
+ const telegramBody = typeof telegramResult === 'string' ? telegramResult : telegramResult.text;
183
+ const telegramOptions = { parse_mode: 'HTML', disable_web_page_preview: true };
184
+ if (typeof telegramResult === 'object' && telegramResult.reply_markup) {
185
+ telegramOptions.reply_markup = telegramResult.reply_markup;
186
+ }
187
+
79
188
  const notifications = userIds.map(userId => ({
80
189
  title: getNotificationTitle(type, order, extraData),
81
190
  body: getNotificationBody(type, order, extraData),
@@ -84,6 +193,12 @@ const controllerFactory = db => {
84
193
  type: type,
85
194
  orderId: order._id,
86
195
  context: 'organization',
196
+ channels: {
197
+ telegram: {
198
+ body: telegramBody,
199
+ options: telegramOptions,
200
+ },
201
+ },
87
202
  ...extraData
88
203
  },
89
204
  userId: userId
@@ -160,6 +275,22 @@ const controllerFactory = db => {
160
275
  if (Object.keys(searchCriteria).length > 0) {
161
276
  customer = await Customer.findOne({ $or: [searchCriteria] });
162
277
  }
278
+ // Update existing customer with new info if provided
279
+ if (customer) {
280
+ const updates = {};
281
+ if (customerInfo.profile?.name && !customer.profile?.name) {
282
+ updates['profile.name'] = customerInfo.profile.name;
283
+ }
284
+ if (customerInfo.socials) {
285
+ for (const [key, val] of Object.entries(customerInfo.socials)) {
286
+ if (val && !customer.socials?.[key]) updates[`socials.${key}`] = val;
287
+ }
288
+ }
289
+ if (Object.keys(updates).length > 0) {
290
+ await Customer.updateOne({ _id: customer._id }, { $set: updates });
291
+ customer = await Customer.findById(customer._id);
292
+ }
293
+ }
163
294
  if (!customer) {
164
295
  // Create visitor for anonymous customer
165
296
  const visitorsService = getVisitorsService();
@@ -217,6 +348,25 @@ const controllerFactory = db => {
217
348
  });
218
349
 
219
350
 
351
+ // Server-side price validation
352
+ if (orderData.positions && orderData.positions.length > 0) {
353
+ const variantIds = orderData.positions.map(pos => pos.variant).filter(Boolean);
354
+ const variants = variantIds.length > 0 ? await Variant.find({ _id: { $in: variantIds } }).lean() : [];
355
+ const variantMap = {};
356
+ for (const v of variants) {
357
+ variantMap[v._id.toString()] = v;
358
+ }
359
+ for (const pos of orderData.positions) {
360
+ if (pos.variant) {
361
+ const variant = variantMap[pos.variant.toString ? pos.variant.toString() : pos.variant];
362
+ if (!variant) {
363
+ return res.status(400).send({ errorCode: 'INVALID_VARIANT', message: `Variant ${pos.variant} not found.` });
364
+ }
365
+ pos.price = variant.price;
366
+ }
367
+ }
368
+ }
369
+
220
370
  // Start a database transaction
221
371
  const session = await db.mongoose.startSession();
222
372
  session.startTransaction();
@@ -243,12 +393,69 @@ const controllerFactory = db => {
243
393
  }
244
394
  }
245
395
  console.log('Order data after customer processing:', orderData);
396
+ // Snapshot prices into positions and calculate totalPrice
397
+ if (orderData.positions && orderData.positions.length > 0) {
398
+ let orderTotal = 0;
399
+ for (const pos of orderData.positions) {
400
+ if (pos.listing === 'rent' && pos.date?.start && pos.date?.end) {
401
+ pos.totalPrice = calcRentTotalPrice(pos.price, pos.quantity, pos.date.start, pos.date.end, pos.rentPeriod || 'day');
402
+ } else {
403
+ pos.totalPrice = (pos.price || 0) * (pos.quantity || 1);
404
+ }
405
+ orderTotal += pos.totalPrice;
406
+ }
407
+ orderData.totalPrice = orderTotal;
408
+ }
246
409
  // Now create the order with proper references
247
410
  const order = await Order.create([orderData], { session });
248
411
  const createdOrder = order[0];
249
- // Don't process positions during order creation - moved to update when status changes to confirmed
412
+
250
413
  // Commit the transaction
251
414
  await session.commitTransaction();
415
+
416
+ // Create rents immediately after order creation (outside transaction — via API)
417
+ // Skip if rents were already created externally (e.g. from Rents page)
418
+ const existingRents = req.body.existingRents || [];
419
+ try {
420
+ const rentPositions = existingRents.length > 0 ? [] : (createdOrder.positions || []).filter(pos => pos.listing === 'rent' && pos.date?.start && pos.date?.end);
421
+ if (rentPositions.length > 0) {
422
+ console.log(`Creating ${rentPositions.length} rents for new order ${createdOrder._id}`);
423
+ const rentPromises = rentPositions.map((position, index) => {
424
+ const rentData = {
425
+ order: createdOrder._id,
426
+ product: position._id,
427
+ variant: position.variant,
428
+ quantity: position.quantity,
429
+ startDate: position.date.start,
430
+ endDate: position.date.end,
431
+ status: 'pending',
432
+ creator: createdOrder.creator,
433
+ owner: createdOrder.owner,
434
+ comment: `Created from order ${createdOrder._id}`,
435
+ };
436
+ return fetch(`${process.env.API_URL || ''}/api/rents`, {
437
+ method: 'POST',
438
+ headers: {
439
+ 'Content-Type': 'application/json',
440
+ 'X-Service-Key': process.env.SERVICE_KEY,
441
+ },
442
+ body: JSON.stringify(rentData),
443
+ }).then(async (response) => {
444
+ if (!response.ok) {
445
+ const errorData = await response.json();
446
+ console.error(`Failed to create rent for position ${index + 1}:`, errorData);
447
+ } else {
448
+ const result = await response.json();
449
+ console.log(`Rent created for position ${index + 1}:`, result._id);
450
+ }
451
+ });
452
+ });
453
+ await Promise.all(rentPromises);
454
+ }
455
+ } catch (rentError) {
456
+ console.error('Error creating rents for new order:', rentError);
457
+ // Don't fail the order creation if rent creation fails
458
+ }
252
459
 
253
460
  // ПОСЛЕ транзакции - отправка уведомлений
254
461
  try {
@@ -271,7 +478,6 @@ const controllerFactory = db => {
271
478
  res.status(500).send({
272
479
  errorCode: 'CREATE_ORDER_FAILED',
273
480
  message: 'Error occurred while creating the order.',
274
- error: err.message,
275
481
  });
276
482
  } finally {
277
483
  // End session
@@ -279,23 +485,10 @@ const controllerFactory = db => {
279
485
  }
280
486
  };
281
487
  const read = async (req, res) => {
282
- console.log(req.query);
283
488
  let stages = [
284
489
  ...queryProcessorCore.getBasicOptions(req.query),
285
490
  ...queryProcessorCore.getFilterDate(req.query.dateStart, req.query.dateEnd),
286
- ...queryProcessorCore.getSearchOptions(req.query.search, {
287
- fields: ['positions.name'],
288
- }),
289
- // For spots
290
- {
291
- $lookup: {
292
- from: 'spots',
293
- localField: 'delivery.spot',
294
- foreignField: '_id',
295
- as: 'delivery.spot',
296
- },
297
- },
298
- // For customer
491
+ // For customer (before search so we can search by customer fields)
299
492
  {
300
493
  $lookup: {
301
494
  from: 'customers',
@@ -309,6 +502,18 @@ const controllerFactory = db => {
309
502
  'customer.target': { $arrayElemAt: ['$customerTarget', 0] },
310
503
  },
311
504
  },
505
+ ...queryProcessorCore.getSearchOptions(req.query.search, {
506
+ fields: ['positions.name', 'customer.target.profile.name', 'customer.target.phone', 'customer.target.email', 'customer.target.socials.telegram'],
507
+ }),
508
+ // For spots
509
+ {
510
+ $lookup: {
511
+ from: 'spots',
512
+ localField: 'delivery.spot',
513
+ foreignField: '_id',
514
+ as: 'delivery.spot',
515
+ },
516
+ },
312
517
  // For creator
313
518
  queryProcessorCore.getCreatorUserLookupStage(),
314
519
  queryProcessorCore.getCreatorOrganizationLookupStage(),
@@ -332,7 +537,6 @@ const controllerFactory = db => {
332
537
  res.status(500).send({
333
538
  errorCode: 'GET_ORDERS_FAILED',
334
539
  message: 'Error occurred while fetching orders.',
335
- error: err,
336
540
  });
337
541
  }
338
542
  };
@@ -364,108 +568,108 @@ const controllerFactory = db => {
364
568
  const oldStatus = order.status;
365
569
  console.log('Status changed:', statusChanged, 'from', oldStatus, 'to', req.body.status);
366
570
 
367
- // Process positions FIRST when status changes to confirmed
571
+ // Process positions when status changes to confirmed (stock adjustments for sales only — rents are created at order creation)
368
572
  if (req.body.status === 'confirmed' && oldStatus !== 'confirmed') {
369
- console.log('Processing confirmed status change - creating rents/adjustments');
573
+ console.log('Processing confirmed status change - creating stock adjustments');
370
574
  // Update positions if they were changed
371
575
  if (req.body.positions) {
372
576
  console.log('Updating order positions');
373
577
  order.positions = req.body.positions;
374
578
  }
375
-
376
- console.log('Total positions to process:', order.positions.length);
377
-
378
- // Create promises for parallel execution
579
+
580
+ // Server-side price validation for positions
581
+ const variantIds = order.positions.map(pos => pos.variant).filter(Boolean);
582
+ if (variantIds.length > 0) {
583
+ const variants = await Variant.find({ _id: { $in: variantIds } }).lean();
584
+ const variantMap = {};
585
+ for (const v of variants) {
586
+ variantMap[v._id.toString()] = v;
587
+ }
588
+ for (const pos of order.positions) {
589
+ if (pos.variant) {
590
+ const variant = variantMap[pos.variant.toString ? pos.variant.toString() : pos.variant];
591
+ if (variant) {
592
+ pos.price = variant.price;
593
+ }
594
+ }
595
+ }
596
+ }
597
+
598
+ // Create stock adjustments for sale positions
379
599
  const apiCalls = [];
380
-
600
+
381
601
  for (const [index, position] of order.positions.entries()) {
382
- console.log(`Processing position ${index + 1}/${order.positions.length}:`, position.name, 'listing:', position.listing);
383
-
384
- switch (position.listing) {
385
- case 'rent':
386
- console.log(`Creating rent for position ${index + 1}`);
387
- const rentData = {
388
- order: order._id,
389
- product: position._id,
390
- variant: position.variant,
391
- quantity: position.quantity,
392
- startDate: position.date.start,
393
- endDate: position.date.end,
394
- status: 'pending',
395
- creator: order.creator,
396
- owner: order.owner,
397
- comment: `Created from order ${order._id}`,
398
- };
399
-
400
- const rentPromise = fetch(`${process.env.API_URL || ''}/api/rents`, {
401
- method: 'POST',
402
- headers: {
403
- 'Content-Type': 'application/json',
404
- 'X-Service-Key': process.env.SERVICE_KEY,
405
- },
406
- body: JSON.stringify(rentData),
407
- }).then(async (response) => {
408
- console.log(`Rent API response for position ${index + 1}:`, response.status);
409
- if (!response.ok) {
410
- const errorData = await response.json();
411
- throw new Error(`Failed to create rent for position ${index + 1}: ${JSON.stringify(errorData)}`);
412
- }
413
- const result = await response.json();
414
- console.log(`Rent created successfully for position ${index + 1}:`, result._id);
415
- return result;
416
- });
417
-
418
- apiCalls.push(rentPromise);
419
- break;
420
-
421
- case 'sale':
422
- console.log(`Creating stock adjustment for position ${index + 1}`);
423
- const adjustmentData = {
424
- product: position._id,
425
- variant: position.variant,
426
- storage: order.delivery?.spot,
427
- source: { type: 'Order', target: order._id },
428
- reason: 'sale',
429
- quantity: -position.quantity, // Negative for stock-out
430
- comment: `Stock-out for order ${order._id}`,
431
- owner: order.owner,
432
- creator: { type: 'User', target: req.userId }
433
- };
434
-
435
-
436
- const adjustmentPromise = fetch(`${process.env.API_URL || ''}/api/inventory/adjustments/create`, {
437
- method: 'POST',
602
+ if (position.listing === 'sale') {
603
+ console.log(`Creating stock adjustment for position ${index + 1}`);
604
+ const adjustmentData = {
605
+ product: position._id,
606
+ variant: position.variant,
607
+ storage: order.delivery?.spot,
608
+ source: { type: 'Order', target: order._id },
609
+ reason: 'sale',
610
+ quantity: -position.quantity, // Negative for stock-out
611
+ comment: `Stock-out for order ${order._id}`,
612
+ owner: order.owner,
613
+ creator: { type: 'User', target: req.userId }
614
+ };
615
+
616
+ const adjustmentPromise = fetch(`${process.env.API_URL || ''}/api/inventory/adjustments/create`, {
617
+ method: 'POST',
618
+ headers: {
619
+ 'Content-Type': 'application/json',
620
+ 'X-Service-Key': process.env.SERVICE_KEY,
621
+ },
622
+ body: JSON.stringify(adjustmentData),
623
+ }).then(async (response) => {
624
+ console.log(`Adjustment API response for position ${index + 1}:`, response.status);
625
+ if (!response.ok) {
626
+ const errorData = await response.json();
627
+ throw new Error(`Failed to create stock adjustment for position ${index + 1}: ${JSON.stringify(errorData)}`);
628
+ }
629
+ const result = await response.json();
630
+ console.log(`Stock adjustment created successfully for position ${index + 1}:`, result._id);
631
+ return result;
632
+ });
633
+
634
+ apiCalls.push(adjustmentPromise);
635
+ }
636
+ }
637
+
638
+ // Execute all API calls in parallel
639
+ if (apiCalls.length > 0) {
640
+ console.log(`Executing ${apiCalls.length} stock adjustment API calls in parallel...`);
641
+ await Promise.all(apiCalls);
642
+ console.log('All stock adjustment API calls completed successfully');
643
+ }
644
+ }
645
+
646
+ // When order is cancelled — delete associated rents
647
+ if (req.body.status === 'canceled' && oldStatus !== 'canceled') {
648
+ console.log('Order canceled - deleting associated rents');
649
+ try {
650
+ const Rent = db.mongoose.model('Rent');
651
+ const rents = await Rent.find({ order: order._id }).lean();
652
+ if (rents.length > 0) {
653
+ console.log(`Deleting ${rents.length} rents for canceled order ${order._id}`);
654
+ const deletePromises = rents.map(rent =>
655
+ fetch(`${process.env.API_URL || ''}/api/rents/${rent._id}`, {
656
+ method: 'DELETE',
438
657
  headers: {
439
658
  'Content-Type': 'application/json',
440
659
  'X-Service-Key': process.env.SERVICE_KEY,
441
660
  },
442
- body: JSON.stringify(adjustmentData),
443
661
  }).then(async (response) => {
444
- console.log(`Adjustment API response for position ${index + 1}:`, response.status);
445
662
  if (!response.ok) {
446
- const errorData = await response.json();
447
- throw new Error(`Failed to create stock adjustment for position ${index + 1}: ${JSON.stringify(errorData)}`);
663
+ console.error(`Failed to delete rent ${rent._id}:`, response.status);
664
+ } else {
665
+ console.log(`Rent ${rent._id} deleted`);
448
666
  }
449
- const result = await response.json();
450
- console.log(`Stock adjustment created successfully for position ${index + 1}:`, result._id);
451
- return result;
452
- });
453
-
454
- apiCalls.push(adjustmentPromise);
455
- break;
456
-
457
- default:
458
- console.warn(`Unknown listing type: ${position.listing} for position ${position._id}`);
667
+ })
668
+ );
669
+ await Promise.all(deletePromises);
459
670
  }
460
- }
461
-
462
- // Execute all API calls in parallel
463
- if (apiCalls.length > 0) {
464
- console.log(`Executing ${apiCalls.length} API calls in parallel...`);
465
- await Promise.all(apiCalls);
466
- console.log('All API calls completed successfully');
467
- } else {
468
- console.log('No API calls to execute');
671
+ } catch (rentDeleteError) {
672
+ console.error('Error deleting rents for canceled order:', rentDeleteError);
469
673
  }
470
674
  }
471
675
 
@@ -539,7 +743,6 @@ const controllerFactory = db => {
539
743
  res.status(500).send({
540
744
  errorCode: 'UPDATE_ORDER_FAILED',
541
745
  message: 'Error occurred while updating the order.',
542
- error: err.message,
543
746
  });
544
747
  console.log('Error response sent to client');
545
748
  } finally {
@@ -556,7 +759,7 @@ const controllerFactory = db => {
556
759
  // Изменение статуса оплаты
557
760
  const changePaymentStatus = async (req, res) => {
558
761
  try {
559
- const order = await Order.findOneAndUpdate({ _id: req.params._id }, { status: 'closed', payment: { type: 'Cash', status: 'paid' } }, { new: true }).exec();
762
+ const order = await Order.findOneAndUpdate({ _id: req.params._id }, { status: 'finished', payment: { type: 'Cash', status: 'paid' } }, { new: true }).exec();
560
763
  if (!order) {
561
764
  return res.status(404).send({
562
765
  errorCode: 'PAYMENT_STATUS_CHANGE_FAILED',
@@ -568,14 +771,13 @@ const controllerFactory = db => {
568
771
  res.status(500).send({
569
772
  errorCode: 'CHANGE_PAYMENT_STATUS_FAILED',
570
773
  message: 'Error occurred while changing the payment status.',
571
- error: err,
572
774
  });
573
775
  }
574
776
  };
575
777
  // Удаление заказа
576
778
  const deleteOrder = async (req, res) => {
577
779
  try {
578
- const order = await Order.findOneAndDelete({ _id: req.params._id }).exec();
780
+ const order = await Order.findOneAndDelete({ _id: req.body._id }).exec();
579
781
  if (!order) {
580
782
  return res.status(404).send({ errorCode: 'ORDER_DELETE_FAILED', message: 'Failed to delete the order.' });
581
783
  }
@@ -584,7 +786,6 @@ const controllerFactory = db => {
584
786
  res.status(500).send({
585
787
  errorCode: 'DELETE_ORDER_FAILED',
586
788
  message: 'Error occurred while deleting the order.',
587
- error: err,
588
789
  });
589
790
  }
590
791
  };
@@ -611,11 +812,7 @@ const controllerFactory = db => {
611
812
  { $match: matchStage },
612
813
  { $group: {
613
814
  _id: null,
614
- totalRevenue: { $sum: { $reduce: {
615
- input: '$positions',
616
- initialValue: 0,
617
- in: { $add: ['$$value', { $multiply: [{ $ifNull: ['$$this.price', 0] }, { $ifNull: ['$$this.quantity', 1] }] }] }
618
- }}},
815
+ totalRevenue: { $sum: '$totalPrice' },
619
816
  orderCount: { $sum: 1 }
620
817
  }}
621
818
  ]),
@@ -625,11 +822,7 @@ const controllerFactory = db => {
625
822
  { $match: (startDate && endDate) ? matchStage : { ...matchStage, createdAt: { $gte: startOfMonth } } },
626
823
  { $group: {
627
824
  _id: null,
628
- totalRevenue: { $sum: { $reduce: {
629
- input: '$positions',
630
- initialValue: 0,
631
- in: { $add: ['$$value', { $multiply: [{ $ifNull: ['$$this.price', 0] }, { $ifNull: ['$$this.quantity', 1] }] }] }
632
- }}},
825
+ totalRevenue: { $sum: '$totalPrice' },
633
826
  orderCount: { $sum: 1 }
634
827
  }}
635
828
  ]),
@@ -639,11 +832,7 @@ const controllerFactory = db => {
639
832
  { $match: matchStage },
640
833
  { $group: {
641
834
  _id: { $dateToString: { format: '%Y-%m-%d', date: '$createdAt' } },
642
- revenue: { $sum: { $reduce: {
643
- input: '$positions',
644
- initialValue: 0,
645
- in: { $add: ['$$value', { $multiply: [{ $ifNull: ['$$this.price', 0] }, { $ifNull: ['$$this.quantity', 1] }] }] }
646
- }}},
835
+ revenue: { $sum: '$totalPrice' },
647
836
  count: { $sum: 1 }
648
837
  }},
649
838
  { $sort: { _id: 1 } }
@@ -664,7 +853,7 @@ const controllerFactory = db => {
664
853
  name: { $first: '$positions.name' },
665
854
  image: { $first: { $arrayElemAt: ['$positions.images', 0] } },
666
855
  totalQuantity: { $sum: { $ifNull: ['$positions.quantity', 1] } },
667
- totalRevenue: { $sum: { $multiply: [{ $ifNull: ['$positions.price', 0] }, { $ifNull: ['$positions.quantity', 1] }] } }
856
+ totalRevenue: { $sum: '$positions.totalPrice' }
668
857
  }},
669
858
  { $sort: { totalQuantity: -1 } },
670
859
  { $limit: 10 }
@@ -694,18 +883,158 @@ const controllerFactory = db => {
694
883
  res.status(500).send({
695
884
  errorCode: 'GET_ORDER_STATS_FAILED',
696
885
  message: 'Error occurred while fetching order stats.',
697
- error: err.message,
698
886
  });
699
887
  }
700
888
  };
701
889
 
890
+ // Чтение своих заказов (по userId или visitorId)
891
+ const readMy = async (req, res) => {
892
+ try {
893
+ let customerQuery;
894
+ if (req.userId) {
895
+ customerQuery = { 'identity.type': 'User', 'identity.target': new db.mongoose.Types.ObjectId(req.userId) };
896
+ } else if (req.visitorId) {
897
+ customerQuery = { 'identity.type': 'Visitor', 'identity.target': new db.mongoose.Types.ObjectId(req.visitorId) };
898
+ } else {
899
+ return res.status(401).send({ errorCode: 'UNAUTHORIZED', message: 'Authentication required.' });
900
+ }
901
+
902
+ const customers = await Customer.find(customerQuery, { _id: 1 }).lean();
903
+ if (!customers.length) {
904
+ return res.status(200).send([]);
905
+ }
906
+
907
+ const customerIds = customers.map(c => c._id);
908
+ const orders = await Order.aggregate([
909
+ { $match: { 'customer.target': { $in: customerIds } } },
910
+ { $sort: { createdAt: -1 } },
911
+ {
912
+ $lookup: {
913
+ from: 'customers',
914
+ localField: 'customer.target',
915
+ foreignField: '_id',
916
+ as: 'customerTarget',
917
+ },
918
+ },
919
+ {
920
+ $addFields: {
921
+ 'customer.target': { $arrayElemAt: ['$customerTarget', 0] },
922
+ },
923
+ },
924
+ {
925
+ $lookup: {
926
+ from: 'spots',
927
+ localField: 'delivery.spot',
928
+ foreignField: '_id',
929
+ as: 'delivery.spot',
930
+ },
931
+ },
932
+ { $project: { customerTarget: 0 } },
933
+ ]);
934
+
935
+ res.status(200).send(orders);
936
+ } catch (err) {
937
+ console.error(err);
938
+ res.status(500).send({
939
+ errorCode: 'GET_MY_ORDERS_FAILED',
940
+ message: 'Error occurred while fetching your orders.',
941
+ });
942
+ }
943
+ };
944
+
945
+ // Handle Telegram inline button actions (confirm/cancel order)
946
+ const handleTelegramAction = async (action, orderId) => {
947
+ const order = await Order.findById(orderId);
948
+ if (!order) {
949
+ return { success: false, message: 'Order not found' };
950
+ }
951
+
952
+ if (order.status !== 'created') {
953
+ return { success: false, message: `Order already ${order.status}` };
954
+ }
955
+
956
+ const newStatus = action === 'confirm' ? 'confirmed' : 'canceled';
957
+
958
+ // For confirmed orders — create stock adjustments for sale positions
959
+ if (newStatus === 'confirmed') {
960
+ const salePositions = order.positions.filter(pos => pos.listing === 'sale');
961
+ for (const position of salePositions) {
962
+ try {
963
+ await fetch(`${process.env.API_URL || ''}/api/inventory/adjustments/create`, {
964
+ method: 'POST',
965
+ headers: {
966
+ 'Content-Type': 'application/json',
967
+ 'X-Service-Key': process.env.SERVICE_KEY,
968
+ },
969
+ body: JSON.stringify({
970
+ product: position._id,
971
+ variant: position.variant,
972
+ storage: order.delivery?.spot,
973
+ source: { type: 'Order', target: order._id },
974
+ reason: 'sale',
975
+ quantity: -position.quantity,
976
+ comment: `Stock-out for order ${order._id}`,
977
+ owner: order.owner,
978
+ creator: order.creator,
979
+ }),
980
+ });
981
+ } catch (e) {
982
+ console.error('Stock adjustment failed:', e.message);
983
+ }
984
+ }
985
+ }
986
+
987
+ // For canceled orders — delete associated rents
988
+ if (newStatus === 'canceled') {
989
+ try {
990
+ const Rent = db.mongoose.model('Rent');
991
+ const rents = await Rent.find({ order: order._id }).lean();
992
+ for (const rent of rents) {
993
+ await fetch(`${process.env.API_URL || ''}/api/rents/${rent._id}`, {
994
+ method: 'DELETE',
995
+ headers: {
996
+ 'Content-Type': 'application/json',
997
+ 'X-Service-Key': process.env.SERVICE_KEY,
998
+ },
999
+ }).catch(e => console.error('Rent delete failed:', e.message));
1000
+ }
1001
+ } catch (e) {
1002
+ console.error('Error deleting rents:', e.message);
1003
+ }
1004
+ }
1005
+
1006
+ order.status = newStatus;
1007
+ order.status_history.push({
1008
+ status: newStatus,
1009
+ timestamp: new Date(),
1010
+ comment: `${newStatus} via Telegram`,
1011
+ });
1012
+ await order.save();
1013
+
1014
+ // Send status change notification
1015
+ try {
1016
+ const usersWithAccess = await getUsersWithOrdersConfirmAccess(order.owner.target);
1017
+ await sendOrderNotifications(order, 'order_status', usersWithAccess, {
1018
+ oldStatus: 'created',
1019
+ newStatus: newStatus,
1020
+ organization: order.owner.target,
1021
+ });
1022
+ } catch (e) {
1023
+ console.error('Notification error:', e.message);
1024
+ }
1025
+
1026
+ return { success: true, status: newStatus };
1027
+ };
1028
+
702
1029
  return {
703
1030
  create,
704
1031
  read,
1032
+ readMy,
705
1033
  update,
706
1034
  changePaymentStatus,
707
1035
  deleteOrder,
708
1036
  getStats,
1037
+ handleTelegramAction,
709
1038
  };
710
1039
  };
711
1040
  export default controllerFactory;