@ozdao/martyrs 0.2.601 → 0.2.603

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 (717) hide show
  1. package/dist/{abac-BPl9Bmf9.js → abac-Blt8bUTL.js} +3 -3
  2. package/dist/{addUserStatusFields-Cc-JpmPo.js → addUserStatusFields-CjV_sbh7.js} +2 -2
  3. package/dist/auth.server.js +57 -2
  4. package/dist/builder.js +148 -85
  5. package/dist/community.server.js +11 -11
  6. package/dist/core.server.js +2 -2
  7. package/dist/{core.verifier-gPPX_jhf.js → core.verifier-DVB2a21y.js} +6 -3
  8. package/dist/{crud-DpOXTZep.js → crud-BT5FIvQC.js} +2 -3
  9. package/dist/engagement.schema-B-Cc_NsG.js +6 -0
  10. package/dist/events.server.js +3 -3
  11. package/dist/gallery.server.js +1 -1
  12. package/dist/governance.server.js +1632 -0
  13. package/dist/icons.server.js +267 -0
  14. package/dist/inventory.server.js +6 -6
  15. package/dist/martyrs/dist/martyrs.es3.js +116 -0
  16. package/dist/martyrs/dist/martyrs.es3.js.map +1 -0
  17. package/dist/martyrs/dist/martyrs.es39.js +124 -0
  18. package/dist/martyrs/dist/martyrs.es39.js.map +1 -0
  19. package/dist/martyrs/dist/martyrs.es43.js +30 -0
  20. package/dist/martyrs/dist/martyrs.es43.js.map +1 -0
  21. package/dist/martyrs/dist/martyrs.es44.js +28 -0
  22. package/dist/martyrs/dist/martyrs.es44.js.map +1 -0
  23. package/dist/martyrs/dist/martyrs.es46.js +10 -0
  24. package/dist/martyrs/dist/martyrs.es46.js.map +1 -0
  25. package/dist/martyrs/src/components/Address/{Address.vue.js → Address.vue2.js} +2 -2
  26. package/dist/martyrs/src/components/Address/Address.vue2.js.map +1 -0
  27. package/dist/martyrs/src/components/Block/Block.vue.js +1 -1
  28. package/dist/martyrs/src/components/Block/Block.vue.js.map +1 -1
  29. package/dist/martyrs/src/components/Button/{Button.vue.js → Button.vue2.js} +8 -5
  30. package/dist/martyrs/src/components/Button/Button.vue2.js.map +1 -0
  31. package/dist/martyrs/src/components/EditImages/{EditImages.vue2.js → EditImages.vue.js} +2 -2
  32. package/dist/martyrs/src/components/EditImages/EditImages.vue.js.map +1 -0
  33. package/dist/martyrs/src/components/Feed/Feed.vue.js +1 -1
  34. package/dist/martyrs/src/components/FieldBig/FieldBig.vue.js +4 -4
  35. package/dist/martyrs/src/components/LocationMarker/{LocationMarker.vue.js → LocationMarker.vue2.js} +2 -2
  36. package/dist/martyrs/src/components/LocationMarker/LocationMarker.vue2.js.map +1 -0
  37. package/dist/martyrs/src/components/Menu/{Menu.vue2.js → Menu.vue.js} +2 -2
  38. package/dist/martyrs/src/components/Menu/Menu.vue.js.map +1 -0
  39. package/dist/martyrs/src/components/Select/{Select.vue2.js → Select.vue.js} +2 -2
  40. package/dist/martyrs/src/components/Select/Select.vue.js.map +1 -0
  41. package/dist/martyrs/src/components/Tab/{Tab.vue2.js → Tab.vue.js} +2 -2
  42. package/dist/martyrs/src/components/Tab/Tab.vue.js.map +1 -0
  43. package/dist/martyrs/src/components/Table/StatusBadge.vue.js +19 -10
  44. package/dist/martyrs/src/components/Table/StatusBadge.vue.js.map +1 -1
  45. package/dist/martyrs/src/components/Text/Text.vue.js +1 -1
  46. package/dist/martyrs/src/components/Text/Text.vue.js.map +1 -1
  47. package/dist/martyrs/src/modules/auth/views/components/blocks/OtpDialog.vue.js +2 -2
  48. package/dist/martyrs/src/modules/auth/views/components/blocks/PopupAuth.vue.js +3 -3
  49. package/dist/martyrs/src/modules/auth/views/components/blocks/PopupAuth.vue.js.map +1 -1
  50. package/dist/martyrs/src/modules/auth/views/components/pages/Invite.vue.js +3 -3
  51. package/dist/martyrs/src/modules/auth/views/components/pages/Profile.vue.js +2 -2
  52. package/dist/martyrs/src/modules/auth/views/components/pages/ProfileBlogposts.vue.js +17 -21
  53. package/dist/martyrs/src/modules/auth/views/components/pages/ProfileBlogposts.vue.js.map +1 -1
  54. package/dist/martyrs/src/modules/auth/views/components/pages/ProfileEditAccount.vue.js +13 -13
  55. package/dist/martyrs/src/modules/auth/views/components/pages/ProfileEditProfile.vue.js +2 -2
  56. package/dist/martyrs/src/modules/auth/views/components/pages/ResetPassword.vue.js +3 -3
  57. package/dist/martyrs/src/modules/auth/views/components/pages/SignIn.vue.js +42 -4
  58. package/dist/martyrs/src/modules/auth/views/components/pages/SignIn.vue.js.map +1 -1
  59. package/dist/martyrs/src/modules/auth/views/components/pages/SignUp.vue.js +3 -3
  60. package/dist/martyrs/src/modules/auth/views/components/pages/UserDashboard.vue.js +34 -66
  61. package/dist/martyrs/src/modules/auth/views/components/pages/UserDashboard.vue.js.map +1 -1
  62. package/dist/martyrs/src/modules/auth/views/router/users.router.js +0 -53
  63. package/dist/martyrs/src/modules/auth/views/router/users.router.js.map +1 -1
  64. package/dist/martyrs/src/modules/backoffice/components/pages/Dashboard.vue.js +515 -103
  65. package/dist/martyrs/src/modules/backoffice/components/pages/Dashboard.vue.js.map +1 -1
  66. package/dist/martyrs/src/modules/backoffice/configs/navigation.backoffice.config.js +1 -3
  67. package/dist/martyrs/src/modules/backoffice/configs/navigation.backoffice.config.js.map +1 -1
  68. package/dist/martyrs/src/modules/backoffice/router/backoffice.router.js +1 -32
  69. package/dist/martyrs/src/modules/backoffice/router/backoffice.router.js.map +1 -1
  70. package/dist/martyrs/src/modules/community/community.client.js +49 -8
  71. package/dist/martyrs/src/modules/community/community.client.js.map +1 -1
  72. package/dist/martyrs/src/modules/community/components/blocks/CardBlogpost.vue.js +10 -4
  73. package/dist/martyrs/src/modules/community/components/blocks/CardBlogpost.vue.js.map +1 -1
  74. package/dist/martyrs/src/modules/community/components/layouts/Community.vue.js +4 -4
  75. package/dist/martyrs/src/modules/community/components/layouts/Community.vue.js.map +1 -1
  76. package/dist/martyrs/src/modules/community/components/pages/BlogPost.vue.js +2 -2
  77. package/dist/martyrs/src/modules/community/components/pages/BlogPost.vue.js.map +1 -1
  78. package/dist/martyrs/src/modules/community/components/pages/CreateBlogPost.vue.js +28 -17
  79. package/dist/martyrs/src/modules/community/components/pages/CreateBlogPost.vue.js.map +1 -1
  80. package/dist/martyrs/src/modules/community/components/pages/Posts.vue.js +36 -28
  81. package/dist/martyrs/src/modules/community/components/pages/Posts.vue.js.map +1 -1
  82. package/dist/martyrs/src/modules/community/components/sections/Comment.vue.js +2 -2
  83. package/dist/martyrs/src/modules/community/components/sections/Comment.vue.js.map +1 -1
  84. package/dist/martyrs/src/modules/community/router/community.backoffice.router.js +21 -0
  85. package/dist/martyrs/src/modules/community/router/community.backoffice.router.js.map +1 -0
  86. package/dist/martyrs/src/modules/community/router/community.organization.router.js +70 -0
  87. package/dist/martyrs/src/modules/community/router/community.organization.router.js.map +1 -0
  88. package/dist/martyrs/src/modules/community/router/community.router.js +73 -0
  89. package/dist/martyrs/src/modules/community/router/community.router.js.map +1 -0
  90. package/dist/martyrs/src/modules/community/router/community.user.router.js +20 -0
  91. package/dist/martyrs/src/modules/community/router/community.user.router.js.map +1 -0
  92. package/dist/martyrs/src/modules/constructor/components/elements/Textarea.vue2.js +1 -1
  93. package/dist/martyrs/src/modules/constructor/components/elements/Textarea.vue2.js.map +1 -1
  94. package/dist/martyrs/src/modules/constructor/components/sections/Constructor.vue.js.map +1 -1
  95. package/dist/martyrs/src/modules/core/views/classes/core.app.js +5 -3
  96. package/dist/martyrs/src/modules/core/views/classes/core.app.js.map +1 -1
  97. package/dist/martyrs/src/modules/core/views/classes/i18n.manager.js +7 -2
  98. package/dist/martyrs/src/modules/core/views/classes/i18n.manager.js.map +1 -1
  99. package/dist/martyrs/src/modules/core/views/classes/ws.manager.js +11 -5
  100. package/dist/martyrs/src/modules/core/views/classes/ws.manager.js.map +1 -1
  101. package/dist/martyrs/src/modules/core/views/components/blocks/Card.vue.js +53 -18
  102. package/dist/martyrs/src/modules/core/views/components/blocks/Card.vue.js.map +1 -1
  103. package/dist/martyrs/src/modules/core/views/components/blocks/CardHeader.vue.js +1 -1
  104. package/dist/martyrs/src/modules/core/views/components/blocks/CardStat.vue.js +44 -0
  105. package/dist/martyrs/src/modules/core/views/components/blocks/CardStat.vue.js.map +1 -0
  106. package/dist/martyrs/src/modules/core/views/components/blocks/PopupDateSelector.vue.js +5 -5
  107. package/dist/martyrs/src/modules/core/views/components/layouts/App.vue.js +1 -1
  108. package/dist/martyrs/src/modules/core/views/components/layouts/Client.vue.js +9 -6
  109. package/dist/martyrs/src/modules/core/views/components/layouts/Client.vue.js.map +1 -1
  110. package/dist/martyrs/src/modules/core/views/components/partials/BottomNavigationBar.vue.js +5 -5
  111. package/dist/martyrs/src/modules/core/views/components/partials/BottomNavigationBar.vue.js.map +1 -1
  112. package/dist/martyrs/src/modules/core/views/components/partials/Header.vue.js +15 -15
  113. package/dist/martyrs/src/modules/core/views/components/partials/Header.vue.js.map +1 -1
  114. package/dist/martyrs/src/modules/core/views/components/partials/LocationSelection.vue.js +2 -2
  115. package/dist/martyrs/src/modules/core/views/components/partials/Navigation.vue.js +27 -28
  116. package/dist/martyrs/src/modules/core/views/components/partials/Navigation.vue.js.map +1 -1
  117. package/dist/martyrs/src/modules/core/views/components/partials/NavigationBar.vue.js +6 -6
  118. package/dist/martyrs/src/modules/core/views/components/partials/Sidebar.vue.js +5 -7
  119. package/dist/martyrs/src/modules/core/views/components/partials/Sidebar.vue.js.map +1 -1
  120. package/dist/martyrs/src/modules/core/views/components/sections/{Filters.vue2.js → Filters.vue.js} +2 -2
  121. package/dist/martyrs/src/modules/core/views/components/sections/Filters.vue.js.map +1 -0
  122. package/dist/martyrs/src/modules/core/views/components/sections/SectionPageTitle.vue.js +28 -18
  123. package/dist/martyrs/src/modules/core/views/components/sections/SectionPageTitle.vue.js.map +1 -1
  124. package/dist/martyrs/src/modules/core/views/mixins/mixins.js +3 -3
  125. package/dist/martyrs/src/modules/core/views/mixins/mixins.js.map +1 -1
  126. package/dist/martyrs/src/modules/core/views/router/addRoutes.js +2 -3
  127. package/dist/martyrs/src/modules/core/views/router/addRoutes.js.map +1 -1
  128. package/dist/martyrs/src/modules/core/views/utils/vue-app-renderer.js +10 -0
  129. package/dist/martyrs/src/modules/core/views/utils/vue-app-renderer.js.map +1 -1
  130. package/dist/martyrs/src/modules/events/components/elements/ButtonCheck.vue.js +4 -4
  131. package/dist/martyrs/src/modules/events/components/elements/ButtonJoin.vue.js +2 -2
  132. package/dist/martyrs/src/modules/events/components/pages/EditEvent.vue.js +3 -3
  133. package/dist/martyrs/src/modules/events/components/pages/EditEventTickets.vue.js +9 -9
  134. package/dist/martyrs/src/modules/events/components/pages/EditEventTickets.vue.js.map +1 -1
  135. package/dist/martyrs/src/modules/events/components/pages/Event.vue.js +1 -1
  136. package/dist/martyrs/src/modules/events/components/pages/Events.vue.js +1 -0
  137. package/dist/martyrs/src/modules/events/components/pages/Events.vue.js.map +1 -1
  138. package/dist/martyrs/src/modules/events/components/pages/EventsBackoffice.vue.js +23 -33
  139. package/dist/martyrs/src/modules/events/components/pages/EventsBackoffice.vue.js.map +1 -1
  140. package/dist/martyrs/src/modules/events/components/sections/EditTickets.vue.js +13 -13
  141. package/dist/martyrs/src/modules/events/components/sections/List.vue.js +2 -2
  142. package/dist/martyrs/src/modules/events/components/sections/List.vue.js.map +1 -1
  143. package/dist/martyrs/src/modules/events/events.client.js +37 -15
  144. package/dist/martyrs/src/modules/events/events.client.js.map +1 -1
  145. package/dist/martyrs/src/modules/events/router/events.backoffice.router.js +95 -0
  146. package/dist/martyrs/src/modules/events/router/events.backoffice.router.js.map +1 -0
  147. package/dist/martyrs/src/modules/events/router/events.organization.router.js +95 -0
  148. package/dist/martyrs/src/modules/events/router/events.organization.router.js.map +1 -0
  149. package/dist/martyrs/src/modules/events/router/events.router.js +73 -364
  150. package/dist/martyrs/src/modules/events/router/events.router.js.map +1 -1
  151. package/dist/martyrs/src/modules/events/router/events.user.router.js +65 -0
  152. package/dist/martyrs/src/modules/events/router/events.user.router.js.map +1 -0
  153. package/dist/martyrs/src/modules/gallery/components/sections/BackofficeGallery.vue.js +5 -5
  154. package/dist/martyrs/src/modules/governance/configs/navigation.initiative.config.js +33 -0
  155. package/dist/martyrs/src/modules/governance/configs/navigation.initiative.config.js.map +1 -0
  156. package/dist/martyrs/src/modules/governance/governance.client.js +31 -0
  157. package/dist/martyrs/src/modules/governance/governance.client.js.map +1 -0
  158. package/dist/martyrs/src/modules/governance/views/components/blocks/CardInitiativeItem.vue.js +110 -0
  159. package/dist/martyrs/src/modules/governance/views/components/blocks/CardInitiativeItem.vue.js.map +1 -0
  160. package/dist/martyrs/src/modules/governance/views/components/blocks/CardSprintItem.vue.js +105 -0
  161. package/dist/martyrs/src/modules/governance/views/components/blocks/CardSprintItem.vue.js.map +1 -0
  162. package/dist/martyrs/src/modules/governance/views/components/blocks/CardTaskItem.vue.js +110 -0
  163. package/dist/martyrs/src/modules/governance/views/components/blocks/CardTaskItem.vue.js.map +1 -0
  164. package/dist/martyrs/src/modules/governance/views/components/blocks/CardVotingItem.vue.js +106 -0
  165. package/dist/martyrs/src/modules/governance/views/components/blocks/CardVotingItem.vue.js.map +1 -0
  166. package/dist/martyrs/src/modules/governance/views/components/pages/Governance.vue.js +52 -0
  167. package/dist/martyrs/src/modules/governance/views/components/pages/Governance.vue.js.map +1 -0
  168. package/dist/martyrs/src/modules/governance/views/components/pages/Initiative.vue.js +684 -0
  169. package/dist/martyrs/src/modules/governance/views/components/pages/Initiative.vue.js.map +1 -0
  170. package/dist/martyrs/src/modules/governance/views/components/pages/InitiativeCreate.vue.js +78 -0
  171. package/dist/martyrs/src/modules/governance/views/components/pages/InitiativeCreate.vue.js.map +1 -0
  172. package/dist/martyrs/src/modules/governance/views/components/pages/InitiativeSprints.vue.js +328 -0
  173. package/dist/martyrs/src/modules/governance/views/components/pages/InitiativeSprints.vue.js.map +1 -0
  174. package/dist/martyrs/src/modules/governance/views/components/pages/Initiatives.vue.js +145 -0
  175. package/dist/martyrs/src/modules/governance/views/components/pages/Initiatives.vue.js.map +1 -0
  176. package/dist/martyrs/src/modules/governance/views/components/pages/Sprint.vue.js +258 -0
  177. package/dist/martyrs/src/modules/governance/views/components/pages/Sprint.vue.js.map +1 -0
  178. package/dist/martyrs/src/modules/governance/views/components/pages/SprintCreate.vue.js +72 -0
  179. package/dist/martyrs/src/modules/governance/views/components/pages/SprintCreate.vue.js.map +1 -0
  180. package/dist/martyrs/src/modules/governance/views/components/pages/Task.vue.js +769 -0
  181. package/dist/martyrs/src/modules/governance/views/components/pages/Task.vue.js.map +1 -0
  182. package/dist/martyrs/src/modules/governance/views/components/pages/TaskCreate.vue.js +88 -0
  183. package/dist/martyrs/src/modules/governance/views/components/pages/TaskCreate.vue.js.map +1 -0
  184. package/dist/martyrs/src/modules/governance/views/components/pages/Tasks.vue.js +291 -0
  185. package/dist/martyrs/src/modules/governance/views/components/pages/Tasks.vue.js.map +1 -0
  186. package/dist/martyrs/src/modules/governance/views/components/pages/Voting.vue.js +267 -0
  187. package/dist/martyrs/src/modules/governance/views/components/pages/Voting.vue.js.map +1 -0
  188. package/dist/martyrs/src/modules/governance/views/components/pages/VotingCreate.vue.js +90 -0
  189. package/dist/martyrs/src/modules/governance/views/components/pages/VotingCreate.vue.js.map +1 -0
  190. package/dist/martyrs/src/modules/governance/views/components/pages/Votings.vue.js +68 -0
  191. package/dist/martyrs/src/modules/governance/views/components/pages/Votings.vue.js.map +1 -0
  192. package/dist/martyrs/src/modules/governance/views/components/partials/EmptyState.vue.js +47 -0
  193. package/dist/martyrs/src/modules/governance/views/components/partials/EmptyState.vue.js.map +1 -0
  194. package/dist/martyrs/src/modules/governance/views/components/partials/LinkedEntityCard.vue.js +164 -0
  195. package/dist/martyrs/src/modules/governance/views/components/partials/LinkedEntityCard.vue.js.map +1 -0
  196. package/dist/martyrs/src/modules/governance/views/components/partials/TaskStatusBadge.vue.js +39 -0
  197. package/dist/martyrs/src/modules/governance/views/components/partials/TaskStatusBadge.vue.js.map +1 -0
  198. package/dist/martyrs/src/modules/governance/views/components/partials/VoteForm.vue.js +112 -0
  199. package/dist/martyrs/src/modules/governance/views/components/partials/VoteForm.vue.js.map +1 -0
  200. package/dist/martyrs/src/modules/governance/views/components/partials/VotingResults.vue.js +187 -0
  201. package/dist/martyrs/src/modules/governance/views/components/partials/VotingResults.vue.js.map +1 -0
  202. package/dist/martyrs/src/modules/governance/views/components/sections/FormInitiativeDetails.vue.js +555 -0
  203. package/dist/martyrs/src/modules/governance/views/components/sections/FormInitiativeDetails.vue.js.map +1 -0
  204. package/dist/martyrs/src/modules/governance/views/components/sections/FormSprintDetails.vue.js +187 -0
  205. package/dist/martyrs/src/modules/governance/views/components/sections/FormSprintDetails.vue.js.map +1 -0
  206. package/dist/martyrs/src/modules/governance/views/components/sections/FormTaskDetails.vue.js +171 -0
  207. package/dist/martyrs/src/modules/governance/views/components/sections/FormTaskDetails.vue.js.map +1 -0
  208. package/dist/martyrs/src/modules/governance/views/components/sections/FormVotingDetails.vue.js +179 -0
  209. package/dist/martyrs/src/modules/governance/views/components/sections/FormVotingDetails.vue.js.map +1 -0
  210. package/dist/martyrs/src/modules/governance/views/router/governance.router.js +502 -0
  211. package/dist/martyrs/src/modules/governance/views/router/governance.router.js.map +1 -0
  212. package/dist/martyrs/src/modules/governance/views/store/initiatives.js +119 -0
  213. package/dist/martyrs/src/modules/governance/views/store/initiatives.js.map +1 -0
  214. package/dist/martyrs/src/modules/governance/views/store/sprints.js +99 -0
  215. package/dist/martyrs/src/modules/governance/views/store/sprints.js.map +1 -0
  216. package/dist/martyrs/src/modules/governance/views/store/tasks.js +115 -0
  217. package/dist/martyrs/src/modules/governance/views/store/tasks.js.map +1 -0
  218. package/dist/martyrs/src/modules/governance/views/store/votings.js +155 -0
  219. package/dist/martyrs/src/modules/governance/views/store/votings.js.map +1 -0
  220. package/dist/martyrs/src/modules/icons/entities/IconCash.vue.js +70 -0
  221. package/dist/martyrs/src/modules/icons/entities/IconCash.vue.js.map +1 -0
  222. package/dist/martyrs/src/modules/icons/icons.client.js +1 -1
  223. package/dist/martyrs/src/modules/icons/icons.client.js.map +1 -1
  224. package/dist/martyrs/src/modules/icons/{icons.router.js → router/icons.router.js} +1 -1
  225. package/dist/martyrs/src/modules/icons/router/icons.router.js.map +1 -0
  226. package/dist/martyrs/src/modules/inventory/components/forms/AdjustmentForm.vue.js +4 -4
  227. package/dist/martyrs/src/modules/inventory/components/forms/ColumnSettingsMenu.vue.js +3 -3
  228. package/dist/martyrs/src/modules/inventory/components/forms/HistoryView.vue.js +2 -2
  229. package/dist/martyrs/src/modules/inventory/components/forms/StockAlertsForm.vue.js +4 -4
  230. package/dist/martyrs/src/modules/inventory/components/pages/InventoryEdit.vue.js +6 -6
  231. package/dist/martyrs/src/modules/inventory/components/pages/InventoryEdit.vue.js.map +1 -1
  232. package/dist/martyrs/src/modules/marketplace/views/components/pages/Marketplace.vue.js +1 -1
  233. package/dist/martyrs/src/modules/music/components/blocks/ActionButtons.vue.js +9 -9
  234. package/dist/martyrs/src/modules/music/components/cards/AlbumCard.vue.js +4 -4
  235. package/dist/martyrs/src/modules/music/components/cards/ArtistCardSmall.vue.js +2 -2
  236. package/dist/martyrs/src/modules/music/components/cards/PlaylistCard.vue.js +4 -4
  237. package/dist/martyrs/src/modules/music/components/cards/TrackListCard.vue.js +7 -7
  238. package/dist/martyrs/src/modules/music/components/forms/AlbumForm.vue.js +4 -4
  239. package/dist/martyrs/src/modules/music/components/forms/ArtistForm.vue.js +4 -4
  240. package/dist/martyrs/src/modules/music/components/forms/PlaylistForm.vue.js +3 -3
  241. package/dist/martyrs/src/modules/music/components/forms/SearchForm.vue.js +4 -4
  242. package/dist/martyrs/src/modules/music/components/forms/TrackForm.vue.js +4 -4
  243. package/dist/martyrs/src/modules/music/components/pages/Album.vue.js +1 -1
  244. package/dist/martyrs/src/modules/music/components/pages/Artist.vue.js +9 -9
  245. package/dist/martyrs/src/modules/music/components/pages/MusicLibrary.vue.js +13 -13
  246. package/dist/martyrs/src/modules/music/components/pages/Playlist.vue.js +9 -9
  247. package/dist/martyrs/src/modules/music/components/pages/SearchResults.vue.js +9 -9
  248. package/dist/martyrs/src/modules/music/components/pages/Track.vue.js +16 -16
  249. package/dist/martyrs/src/modules/music/components/pages/TrackCreate.vue.js +1 -1
  250. package/dist/martyrs/src/modules/music/components/player/FullscreenPlayer.vue.js +2 -2
  251. package/dist/martyrs/src/modules/music/components/player/MusicPlayer.vue.js +4 -4
  252. package/dist/martyrs/src/modules/music/components/player/PlayerControls.vue.js +10 -10
  253. package/dist/martyrs/src/modules/music/components/player/VolumeControl.vue.js +6 -6
  254. package/dist/martyrs/src/modules/music/components/sections/PopularTracks.vue.js +63 -0
  255. package/dist/martyrs/src/modules/music/components/sections/PopularTracks.vue.js.map +1 -0
  256. package/dist/martyrs/src/modules/music/music.client.js +29 -25
  257. package/dist/martyrs/src/modules/music/music.client.js.map +1 -1
  258. package/dist/martyrs/src/modules/music/{music.router.js → router/music.router.js} +16 -16
  259. package/dist/martyrs/src/modules/music/router/music.router.js.map +1 -0
  260. package/dist/martyrs/src/modules/notifications/components/elements/NotificationBadge.vue.js +26 -27
  261. package/dist/martyrs/src/modules/notifications/components/elements/NotificationBadge.vue.js.map +1 -1
  262. package/dist/martyrs/src/modules/notifications/components/sections/NotificationPreferences.vue.js +118 -59
  263. package/dist/martyrs/src/modules/notifications/components/sections/NotificationPreferences.vue.js.map +1 -1
  264. package/dist/martyrs/src/modules/notifications/notifications.client.js +74 -54
  265. package/dist/martyrs/src/modules/notifications/notifications.client.js.map +1 -1
  266. package/dist/martyrs/src/modules/notifications/{notifications.router.js → router/notifications.router.js} +3 -3
  267. package/dist/martyrs/src/modules/notifications/router/notifications.router.js.map +1 -0
  268. package/dist/martyrs/src/modules/orders/components/blocks/CardApplication.vue.js +34 -44
  269. package/dist/martyrs/src/modules/orders/components/blocks/CardApplication.vue.js.map +1 -1
  270. package/dist/martyrs/src/modules/orders/components/blocks/CardCustomer.vue.js +47 -57
  271. package/dist/martyrs/src/modules/orders/components/blocks/CardCustomer.vue.js.map +1 -1
  272. package/dist/martyrs/src/modules/orders/components/blocks/CardOrderItem.vue.js +2 -2
  273. package/dist/martyrs/src/modules/orders/components/blocks/CardOrderItem.vue.js.map +1 -1
  274. package/dist/martyrs/src/modules/orders/components/blocks/CardOrderUser.vue.js +2 -2
  275. package/dist/martyrs/src/modules/orders/components/blocks/CardOrderUser.vue.js.map +1 -1
  276. package/dist/martyrs/src/modules/orders/components/forms/FormApplicationDetails.vue.js +4 -4
  277. package/dist/martyrs/src/modules/orders/components/forms/FormCustomerDetails.vue.js +6 -6
  278. package/dist/martyrs/src/modules/orders/components/forms/FormCustomerDetails.vue.js.map +1 -1
  279. package/dist/martyrs/src/modules/orders/components/forms/FormSelectCustomer.vue.js +7 -7
  280. package/dist/martyrs/src/modules/orders/components/pages/Applications.vue.js +61 -54
  281. package/dist/martyrs/src/modules/orders/components/pages/Applications.vue.js.map +1 -1
  282. package/dist/martyrs/src/modules/orders/components/pages/Customers.vue.js +43 -31
  283. package/dist/martyrs/src/modules/orders/components/pages/Customers.vue.js.map +1 -1
  284. package/dist/martyrs/src/modules/orders/components/pages/OrderBackoffice.vue.js +14 -14
  285. package/dist/martyrs/src/modules/orders/components/pages/OrderCreate.vue.js +3 -3
  286. package/dist/martyrs/src/modules/orders/components/pages/OrderCreate.vue.js.map +1 -1
  287. package/dist/martyrs/src/modules/orders/components/pages/OrderCreateBackoffice.vue.js +19 -19
  288. package/dist/martyrs/src/modules/orders/components/pages/Orders.vue.js +1 -1
  289. package/dist/martyrs/src/modules/orders/components/sections/ApplicationDetails.vue.js +7 -10
  290. package/dist/martyrs/src/modules/orders/components/sections/ApplicationDetails.vue.js.map +1 -1
  291. package/dist/martyrs/src/modules/orders/components/sections/CustomerDetails.vue.js +7 -10
  292. package/dist/martyrs/src/modules/orders/components/sections/CustomerDetails.vue.js.map +1 -1
  293. package/dist/martyrs/src/modules/orders/components/sections/FormDelivery.vue.js +3 -3
  294. package/dist/martyrs/src/modules/orders/components/sections/FormPayment.vue.js +1 -1
  295. package/dist/martyrs/src/modules/orders/orders.client.js +16 -16
  296. package/dist/martyrs/src/modules/orders/orders.client.js.map +1 -1
  297. package/dist/martyrs/src/modules/organizations/components/blocks/CardOrganization.vue.js +11 -4
  298. package/dist/martyrs/src/modules/organizations/components/blocks/CardOrganization.vue.js.map +1 -1
  299. package/dist/martyrs/src/modules/organizations/components/elements/ButtonToggleMembership.vue.js +2 -2
  300. package/dist/martyrs/src/modules/organizations/components/forms/AddExistingMembersForm.vue.js +2 -2
  301. package/dist/martyrs/src/modules/organizations/components/forms/DepartmentForm.vue.js +22 -15
  302. package/dist/martyrs/src/modules/organizations/components/forms/DepartmentForm.vue.js.map +1 -1
  303. package/dist/martyrs/src/modules/organizations/components/forms/InviteForm.vue.js +2 -2
  304. package/dist/martyrs/src/modules/organizations/components/pages/Members.vue.js +63 -1
  305. package/dist/martyrs/src/modules/organizations/components/pages/Members.vue.js.map +1 -1
  306. package/dist/martyrs/src/modules/organizations/components/pages/Organization.vue.js +9 -3
  307. package/dist/martyrs/src/modules/organizations/components/pages/Organization.vue.js.map +1 -1
  308. package/dist/martyrs/src/modules/organizations/components/pages/OrganizationEdit.vue.js +14 -8
  309. package/dist/martyrs/src/modules/organizations/components/pages/OrganizationEdit.vue.js.map +1 -1
  310. package/dist/martyrs/src/modules/organizations/components/pages/Organizations.vue.js +24 -30
  311. package/dist/martyrs/src/modules/organizations/components/pages/Organizations.vue.js.map +1 -1
  312. package/dist/martyrs/src/modules/organizations/components/sections/Documents.vue.js +2 -2
  313. package/dist/martyrs/src/modules/organizations/components/sections/MembersAdd.vue.js +3 -3
  314. package/dist/martyrs/src/modules/organizations/components/sections/Organizations.vue.js +2 -2
  315. package/dist/martyrs/src/modules/organizations/organizations.client.js +42 -6
  316. package/dist/martyrs/src/modules/organizations/organizations.client.js.map +1 -1
  317. package/dist/martyrs/src/modules/organizations/router/organizations.backoffice.router.js +20 -0
  318. package/dist/martyrs/src/modules/organizations/router/organizations.backoffice.router.js.map +1 -0
  319. package/dist/martyrs/src/modules/organizations/router/organizations.router.js +102 -0
  320. package/dist/martyrs/src/modules/organizations/router/organizations.router.js.map +1 -0
  321. package/dist/martyrs/src/modules/organizations/router/organizations.user.router.js +20 -0
  322. package/dist/martyrs/src/modules/organizations/router/organizations.user.router.js.map +1 -0
  323. package/dist/martyrs/src/modules/pages/pages.client.js +1 -1
  324. package/dist/martyrs/src/modules/pages/pages.client.js.map +1 -1
  325. package/dist/martyrs/src/modules/pages/views/components/blocks/CardPage.vue.js +1 -1
  326. package/dist/martyrs/src/modules/pages/views/components/pages/PageEdit.vue.js +3 -3
  327. package/dist/martyrs/src/modules/pages/views/components/partials/SidebarPages.vue.js +2 -2
  328. package/dist/martyrs/src/modules/pages/{pages.router.js → views/router/pages.router.js} +8 -8
  329. package/dist/martyrs/src/modules/pages/views/router/pages.router.js.map +1 -0
  330. package/dist/martyrs/src/modules/products/components/blocks/CardPosition.vue.js +1 -1
  331. package/dist/martyrs/src/modules/products/components/blocks/CardPosition.vue.js.map +1 -1
  332. package/dist/martyrs/src/modules/products/components/pages/Categories.vue.js +1 -1
  333. package/dist/martyrs/src/modules/products/components/pages/CategoryEdit.vue.js +7 -7
  334. package/dist/martyrs/src/modules/products/components/pages/Product.vue.js +2 -2
  335. package/dist/martyrs/src/modules/products/components/pages/ProductEdit.vue.js +22 -22
  336. package/dist/martyrs/src/modules/products/components/pages/Products.vue.js +5 -5
  337. package/dist/martyrs/src/modules/products/components/pages/Products.vue.js.map +1 -1
  338. package/dist/martyrs/src/modules/products/components/sections/EditAttributes.vue.js +3 -3
  339. package/dist/martyrs/src/modules/products/components/sections/EditDiscounts.vue.js +4 -4
  340. package/dist/martyrs/src/modules/products/components/sections/EditVariants.vue.js +21 -21
  341. package/dist/martyrs/src/modules/products/components/sections/ProductConfigurator.vue.js +4 -4
  342. package/dist/martyrs/src/modules/products/components/sections/ProductsRecommended.vue.js +4 -4
  343. package/dist/martyrs/src/modules/products/components/sections/SectionProduct.vue.js +4 -4
  344. package/dist/martyrs/src/modules/rents/rents.client.js +1 -1
  345. package/dist/martyrs/src/modules/rents/rents.client.js.map +1 -1
  346. package/dist/martyrs/src/modules/rents/views/components/pages/Gant/GanttToolbar.vue.js +7 -7
  347. package/dist/martyrs/src/modules/rents/views/components/pages/Rents.vue.js +1 -1
  348. package/dist/martyrs/src/modules/rents/views/components/pages/RentsEdit.vue.js +4 -4
  349. package/dist/martyrs/src/modules/rents/{rents.router.js → views/router/rents.router.js} +4 -4
  350. package/dist/martyrs/src/modules/rents/views/router/rents.router.js.map +1 -0
  351. package/dist/martyrs/src/modules/reports/components/sections/FormReport.vue.js +3 -3
  352. package/dist/martyrs/src/modules/reports/reports.client.js +1 -1
  353. package/dist/martyrs/src/modules/reports/reports.client.js.map +1 -1
  354. package/dist/martyrs/src/modules/reports/{reports.router.js → router/reports.router.js} +1 -1
  355. package/dist/martyrs/src/modules/reports/router/reports.router.js.map +1 -0
  356. package/dist/martyrs/src/modules/spots/components/blocks/SpotMemberModify.vue.js +1 -1
  357. package/dist/martyrs/src/modules/spots/components/pages/Map.vue.js +2 -2
  358. package/dist/martyrs/src/modules/spots/components/pages/SpotEdit.vue.js +13 -13
  359. package/dist/martyrs/src/modules/spots/components/sections/WorktimeEdit.vue.js +22 -22
  360. package/dist/martyrs/src/modules/wallet/views/components/pages/Payments.vue.js +68 -0
  361. package/dist/martyrs/src/modules/wallet/views/components/pages/Payments.vue.js.map +1 -0
  362. package/dist/martyrs/src/modules/wallet/views/router/wallet.router.js +48 -0
  363. package/dist/martyrs/src/modules/wallet/views/router/wallet.router.js.map +1 -0
  364. package/dist/martyrs/src/modules/wallet/views/store/payments.store.js +59 -0
  365. package/dist/martyrs/src/modules/wallet/views/store/payments.store.js.map +1 -0
  366. package/dist/martyrs/src/modules/wallet/wallet.client.js +20 -0
  367. package/dist/martyrs/src/modules/wallet/wallet.client.js.map +1 -0
  368. package/dist/martyrs.es.js +84 -41
  369. package/dist/martyrs.es10.js +126 -0
  370. package/dist/martyrs.es100.js +33 -0
  371. package/dist/martyrs.es102.js +39 -0
  372. package/dist/martyrs.es103.js +31 -0
  373. package/dist/martyrs.es105.js +27 -0
  374. package/dist/martyrs.es106.js +8 -0
  375. package/dist/martyrs.es107.js +9 -0
  376. package/dist/martyrs.es108.js +79 -0
  377. package/dist/martyrs.es109.js +7 -0
  378. package/dist/martyrs.es11.js +49 -0
  379. package/dist/{web-n_ivHO3v.js → martyrs.es110.js} +1 -1
  380. package/dist/martyrs.es111.js +327 -0
  381. package/dist/martyrs.es112.js +121 -0
  382. package/dist/martyrs.es115.js +4 -0
  383. package/dist/martyrs.es116.js +25 -0
  384. package/dist/martyrs.es117.js +7 -0
  385. package/dist/martyrs.es118.js +10 -0
  386. package/dist/martyrs.es119.js +169 -0
  387. package/dist/martyrs.es12.js +94 -0
  388. package/dist/martyrs.es120.js +460 -0
  389. package/dist/martyrs.es121.js +42 -0
  390. package/dist/martyrs.es122.js +12 -0
  391. package/dist/martyrs.es123.js +52 -0
  392. package/dist/martyrs.es124.js +14 -0
  393. package/dist/martyrs.es125.js +47 -0
  394. package/dist/martyrs.es126.js +7 -0
  395. package/dist/martyrs.es127.js +131 -0
  396. package/dist/martyrs.es128.js +103 -0
  397. package/dist/martyrs.es129.js +89 -0
  398. package/dist/martyrs.es13.js +48 -0
  399. package/dist/martyrs.es130.js +40 -0
  400. package/dist/martyrs.es131.js +14 -0
  401. package/dist/martyrs.es132.js +42 -0
  402. package/dist/martyrs.es133.js +11 -0
  403. package/dist/martyrs.es134.js +6 -0
  404. package/dist/martyrs.es135.js +119 -0
  405. package/dist/martyrs.es136.js +20 -0
  406. package/dist/martyrs.es137.js +18 -0
  407. package/dist/martyrs.es138.js +35 -0
  408. package/dist/martyrs.es139.js +12 -0
  409. package/dist/martyrs.es14.js +101 -0
  410. package/dist/martyrs.es140.js +23 -0
  411. package/dist/martyrs.es141.js +12 -0
  412. package/dist/martyrs.es142.js +11 -0
  413. package/dist/martyrs.es143.js +47 -0
  414. package/dist/martyrs.es144.js +483 -0
  415. package/dist/martyrs.es145.js +8 -0
  416. package/dist/martyrs.es146.js +4 -0
  417. package/dist/martyrs.es147.js +14 -0
  418. package/dist/martyrs.es148.js +33 -0
  419. package/dist/martyrs.es149.js +19 -0
  420. package/dist/martyrs.es15.js +408 -0
  421. package/dist/martyrs.es150.js +22 -0
  422. package/dist/martyrs.es151.js +31 -0
  423. package/dist/martyrs.es152.js +23 -0
  424. package/dist/martyrs.es16.js +58 -0
  425. package/dist/martyrs.es17.js +44 -0
  426. package/dist/martyrs.es18.js +42 -0
  427. package/dist/martyrs.es19.js +27 -0
  428. package/dist/martyrs.es2.js +88 -0
  429. package/dist/martyrs.es20.js +13 -0
  430. package/dist/martyrs.es21.js +57 -0
  431. package/dist/martyrs.es22.js +104 -0
  432. package/dist/martyrs.es23.js +178 -0
  433. package/dist/martyrs.es24.js +123 -0
  434. package/dist/martyrs.es25.js +139 -0
  435. package/dist/martyrs.es26.js +21 -0
  436. package/dist/martyrs.es27.js +60 -0
  437. package/dist/martyrs.es28.js +75 -0
  438. package/dist/martyrs.es29.js +36 -0
  439. package/dist/martyrs.es3.js +116 -0
  440. package/dist/martyrs.es30.js +348 -0
  441. package/dist/martyrs.es31.js +83 -0
  442. package/dist/martyrs.es32.js +148 -0
  443. package/dist/martyrs.es33.js +175 -0
  444. package/dist/martyrs.es34.js +66 -0
  445. package/dist/martyrs.es35.js +57 -0
  446. package/dist/martyrs.es36.js +76 -0
  447. package/dist/martyrs.es37.js +101 -0
  448. package/dist/martyrs.es38.js +39 -0
  449. package/dist/martyrs.es39.js +124 -0
  450. package/dist/martyrs.es4.js +85 -0
  451. package/dist/martyrs.es40.js +120 -0
  452. package/dist/martyrs.es41.js +229 -0
  453. package/dist/martyrs.es43.js +29 -0
  454. package/dist/martyrs.es44.js +27 -0
  455. package/dist/martyrs.es46.js +9 -0
  456. package/dist/martyrs.es48.js +18 -0
  457. package/dist/martyrs.es5.js +395 -0
  458. package/dist/martyrs.es50.js +42 -0
  459. package/dist/martyrs.es52.js +255 -0
  460. package/dist/martyrs.es54.js +8 -0
  461. package/dist/martyrs.es6.js +70 -0
  462. package/dist/martyrs.es61.js +139 -0
  463. package/dist/martyrs.es65.js +28 -0
  464. package/dist/martyrs.es68.js +33 -0
  465. package/dist/martyrs.es69.js +37 -0
  466. package/dist/martyrs.es7.js +17 -0
  467. package/dist/martyrs.es71.js +114 -0
  468. package/dist/martyrs.es73.js +83 -0
  469. package/dist/martyrs.es74.js +52 -0
  470. package/dist/martyrs.es75.js +75 -0
  471. package/dist/martyrs.es76.js +176 -0
  472. package/dist/martyrs.es77.js +31 -0
  473. package/dist/martyrs.es78.js +38 -0
  474. package/dist/martyrs.es8.js +127 -0
  475. package/dist/martyrs.es81.js +32 -0
  476. package/dist/martyrs.es86.js +37 -0
  477. package/dist/martyrs.es89.js +37 -0
  478. package/dist/martyrs.es9.js +396 -0
  479. package/dist/martyrs.es91.js +63 -0
  480. package/dist/martyrs.es92.js +7 -0
  481. package/dist/martyrs.es93.js +35 -0
  482. package/dist/martyrs.es95.js +41 -0
  483. package/dist/martyrs.es96.js +59 -0
  484. package/dist/martyrs.es97.js +123 -0
  485. package/dist/martyrs.es98.js +43 -0
  486. package/dist/martyrs.es99.js +86 -0
  487. package/dist/music.server.js +11 -11
  488. package/dist/notifications.server.js +16 -6
  489. package/dist/orders.server.js +264 -145
  490. package/dist/organizations.server.js +22 -6
  491. package/dist/products.server.js +7 -7
  492. package/dist/rents.server.js +4 -3
  493. package/dist/style.css +970 -986
  494. package/package.json +13 -6
  495. package/src/builder/modes/ssr.rspack.dev.js +32 -20
  496. package/src/builder/rspack/rspack.config.api.js +3 -0
  497. package/src/builder/rspack/rspack.config.base.js +9 -1
  498. package/src/builder/rspack/rspack.config.ssr.client.js +27 -10
  499. package/src/components/Block/Block.vue +1 -1
  500. package/src/components/Button/Button.vue +4 -4
  501. package/src/components/Table/StatusBadge.vue +24 -18
  502. package/src/components/Text/Text.vue +1 -1
  503. package/src/jit/core.js +72 -35
  504. package/src/jit/plugin.js +4 -3
  505. package/src/jit/rules.js +15 -15
  506. package/src/modules/TASKS.MD +30 -0
  507. package/src/modules/TASK_ACTIVITY.md +60 -0
  508. package/src/modules/TASK_MODULE_ARCH.md +391 -0
  509. package/src/modules/auth/controllers/routes/users.routes.js +8 -0
  510. package/src/modules/auth/controllers/services/users.service.js +51 -1
  511. package/src/modules/auth/views/components/blocks/PopupAuth.vue +1 -1
  512. package/src/modules/auth/views/components/pages/ProfileBlogposts.vue +25 -24
  513. package/src/modules/auth/views/components/pages/SignIn.vue +10 -1
  514. package/src/modules/auth/views/components/pages/UserDashboard.vue +35 -62
  515. package/src/modules/auth/views/router/users.router.js +0 -44
  516. package/src/modules/backoffice/components/pages/Dashboard.vue +423 -120
  517. package/src/modules/backoffice/configs/navigation.backoffice.config.js +0 -2
  518. package/src/modules/backoffice/router/backoffice.router.js +0 -25
  519. package/src/modules/community/community.client.js +54 -9
  520. package/src/modules/community/components/blocks/CardBlogpost.vue +10 -3
  521. package/src/modules/community/components/layouts/Community.vue +3 -3
  522. package/src/modules/community/components/pages/BlogPost.vue +1 -1
  523. package/src/modules/community/components/pages/CreateBlogPost.vue +19 -20
  524. package/src/modules/community/components/pages/Posts.vue +43 -28
  525. package/src/modules/community/components/sections/Comment.vue +1 -1
  526. package/src/modules/community/controllers/blog.controller.js +4 -5
  527. package/src/modules/community/models/reaction.model.js +1 -0
  528. package/src/modules/community/router/community.backoffice.router.js +16 -0
  529. package/src/modules/community/router/community.organization.router.js +56 -0
  530. package/src/modules/community/router/community.router.js +58 -106
  531. package/src/modules/community/router/community.user.router.js +15 -0
  532. package/src/modules/constructor/components/elements/Textarea.vue +1 -1
  533. package/src/modules/constructor/components/sections/Constructor.vue +1 -1
  534. package/src/modules/core/controllers/classes/core.validator.js +7 -1
  535. package/src/modules/core/controllers/classes/core.verifier.js +0 -2
  536. package/src/modules/core/controllers/classes/crud/crud.controller.js +0 -4
  537. package/src/modules/core/controllers/classes/crud/crud.service.js +1 -0
  538. package/src/modules/core/models/schemas/engagement.schema.js +19 -22
  539. package/src/modules/core/views/classes/core.app.js +6 -4
  540. package/src/modules/core/views/classes/i18n.manager.js +9 -2
  541. package/src/modules/core/views/classes/ws.manager.js +17 -7
  542. package/src/modules/core/views/components/blocks/Card.vue +47 -24
  543. package/src/modules/core/views/components/blocks/CardStat.vue +27 -0
  544. package/src/modules/core/views/components/blocks/PopupAuth.vue +1 -1
  545. package/src/modules/core/views/components/layouts/Client.vue +5 -4
  546. package/src/modules/core/views/components/partials/BottomNavigationBar.vue +5 -5
  547. package/src/modules/core/views/components/partials/Header.vue +2 -2
  548. package/src/modules/core/views/components/partials/Navigation.vue +13 -14
  549. package/src/modules/core/views/components/partials/Sidebar.vue +4 -6
  550. package/src/modules/core/views/components/sections/SectionPageTitle.vue +23 -15
  551. package/src/modules/core/views/mixins/mixins.js +4 -3
  552. package/src/modules/core/views/router/addRoutes.js +1 -2
  553. package/src/modules/core/views/utils/vue-app-renderer.js +12 -0
  554. package/src/modules/events/components/pages/EditEventTickets.vue +1 -1
  555. package/src/modules/events/components/pages/Events.vue +1 -0
  556. package/src/modules/events/components/pages/EventsBackoffice.vue +23 -48
  557. package/src/modules/events/components/sections/List.vue +2 -2
  558. package/src/modules/events/events.client.js +44 -17
  559. package/src/modules/events/router/events.backoffice.router.js +80 -0
  560. package/src/modules/events/router/events.organization.router.js +80 -0
  561. package/src/modules/events/router/events.router.js +55 -325
  562. package/src/modules/events/router/events.user.router.js +49 -0
  563. package/src/modules/governance/TASK-TRACKER.MD +534 -39
  564. package/src/modules/governance/configs/navigation.initiative.config.js +30 -0
  565. package/src/modules/governance/controllers/routes/initiatives.routes.js +55 -8
  566. package/src/modules/governance/controllers/routes/{milestones.routes.js → sprints.routes.js} +22 -22
  567. package/src/modules/governance/controllers/routes/tasks.routes.js +2 -2
  568. package/src/modules/governance/governance.client.js +1 -4
  569. package/src/modules/governance/governance.server.js +6 -6
  570. package/src/modules/governance/middlewares/initiatives.verifier.js +60 -0
  571. package/src/modules/governance/middlewares/{milestones.verifier.js → sprints.verifier.js} +10 -10
  572. package/src/modules/governance/middlewares/tasks.verifier.js +4 -4
  573. package/src/modules/governance/middlewares/votings.verifier.js +25 -7
  574. package/src/modules/governance/models/{milestone.model.js → sprint.model.js} +11 -11
  575. package/src/modules/governance/models/task.model.js +4 -4
  576. package/src/modules/governance/models/voting.model.js +10 -5
  577. package/src/modules/governance/views/components/blocks/CardInitiativeItem.vue +8 -13
  578. package/src/modules/governance/views/components/blocks/{CardMilestoneItem.vue → CardSprintItem.vue} +16 -17
  579. package/src/modules/governance/views/components/blocks/CardTaskItem.vue +7 -9
  580. package/src/modules/governance/views/components/blocks/CardVotingItem.vue +7 -9
  581. package/src/modules/governance/views/components/pages/Governance.vue +13 -34
  582. package/src/modules/governance/views/components/pages/Initiative.vue +73 -154
  583. package/src/modules/governance/views/components/pages/InitiativeCreate.vue +44 -7
  584. package/src/modules/governance/views/components/pages/{Roadmap.vue → InitiativeSprints.vue} +70 -69
  585. package/src/modules/governance/views/components/pages/Initiatives.vue +23 -108
  586. package/src/modules/governance/views/components/pages/{Milestone.vue → Sprint.vue} +43 -41
  587. package/src/modules/governance/views/components/pages/SprintCreate.vue +55 -0
  588. package/src/modules/governance/views/components/pages/Task.vue +95 -88
  589. package/src/modules/governance/views/components/pages/TaskCreate.vue +47 -9
  590. package/src/modules/governance/views/components/pages/Tasks.vue +25 -21
  591. package/src/modules/governance/views/components/pages/Voting.vue +84 -68
  592. package/src/modules/governance/views/components/pages/VotingCreate.vue +48 -8
  593. package/src/modules/governance/views/components/pages/Votings.vue +12 -57
  594. package/src/modules/governance/views/components/partials/EmptyState.vue +1 -1
  595. package/src/modules/governance/views/components/partials/LinkedEntityCard.vue +23 -11
  596. package/src/modules/governance/views/components/partials/TaskStatusBadge.vue +1 -1
  597. package/src/modules/governance/views/components/partials/VoteForm.vue +3 -3
  598. package/src/modules/governance/views/components/partials/VotingResults.vue +13 -19
  599. package/src/modules/governance/views/components/sections/FormInitiativeDetails.vue +413 -15
  600. package/src/modules/governance/views/components/sections/FormSprintDetails.vue +156 -0
  601. package/src/modules/governance/views/components/sections/FormTaskDetails.vue +125 -21
  602. package/src/modules/governance/views/components/sections/FormVotingDetails.vue +136 -17
  603. package/src/modules/governance/views/components/sections/VoteForm.vue +2 -2
  604. package/src/modules/governance/views/router/governance.router.js +255 -151
  605. package/src/modules/governance/views/store/initiatives.js +23 -2
  606. package/src/modules/governance/views/store/sprints.js +102 -0
  607. package/src/modules/governance/views/store/tasks.js +25 -9
  608. package/src/modules/governance/views/store/votings.js +106 -27
  609. package/src/modules/icons/icons.client.js +1 -1
  610. package/src/modules/inventory/components/pages/InventoryEdit.vue +1 -1
  611. package/src/modules/music/components/sections/PopularTracks.vue +52 -0
  612. package/src/modules/music/music.client.js +8 -1
  613. package/src/modules/music/router/music.router.js +13 -1
  614. package/src/modules/notifications/components/elements/NotificationBadge.vue +8 -33
  615. package/src/modules/notifications/components/sections/NotificationPreferences.vue +110 -48
  616. package/src/modules/notifications/notifications.client.js +78 -57
  617. package/src/modules/notifications/router/notifications.router.js +32 -15
  618. package/src/modules/notifications/services/notification.service.js +15 -6
  619. package/src/modules/notifications/services/web-push.service.js +2 -0
  620. package/src/modules/orders/components/blocks/CardApplication.vue +20 -40
  621. package/src/modules/orders/components/blocks/CardCustomer.vue +35 -55
  622. package/src/modules/orders/components/blocks/CardOrderItem.vue +2 -2
  623. package/src/modules/orders/components/blocks/CardOrderUser.vue +2 -2
  624. package/src/modules/orders/components/forms/FormCustomerDetails.vue +2 -2
  625. package/src/modules/orders/components/pages/Applications.vue +59 -57
  626. package/src/modules/orders/components/pages/Customers.vue +40 -27
  627. package/src/modules/orders/components/pages/OrderCreate.vue +1 -1
  628. package/src/modules/orders/components/sections/ApplicationDetails.vue +1 -4
  629. package/src/modules/orders/components/sections/CustomerDetails.vue +1 -4
  630. package/src/modules/orders/controllers/orders.controller.js +113 -0
  631. package/src/modules/orders/middlewares/applications.verifier.js +13 -37
  632. package/src/modules/orders/middlewares/customers.verifier.js +44 -121
  633. package/src/modules/orders/models/customer.model.js +0 -1
  634. package/src/modules/orders/routes/applications.routes.js +108 -50
  635. package/src/modules/orders/routes/orders.routes.js +9 -1
  636. package/src/modules/organizations/components/blocks/CardOrganization.vue +12 -4
  637. package/src/modules/organizations/components/forms/DepartmentForm.vue +9 -4
  638. package/src/modules/organizations/components/pages/Members.vue +62 -1
  639. package/src/modules/organizations/components/pages/Organization.new.vue +17 -17
  640. package/src/modules/organizations/components/pages/Organization.vue +8 -1
  641. package/src/modules/organizations/components/pages/OrganizationBackoffice.vue +1 -1
  642. package/src/modules/organizations/components/pages/OrganizationEdit.vue +11 -4
  643. package/src/modules/organizations/components/pages/Organizations.vue +33 -46
  644. package/src/modules/organizations/controllers/invites.controller.js +19 -0
  645. package/src/modules/organizations/controllers/memberships.controller.js +1 -0
  646. package/src/modules/organizations/organizations.client.js +48 -7
  647. package/src/modules/organizations/router/organizations.backoffice.router.js +15 -0
  648. package/src/modules/organizations/router/organizations.router.js +72 -112
  649. package/src/modules/organizations/router/organizations.user.router.js +15 -0
  650. package/src/modules/pages/pages.client.js +1 -1
  651. package/src/modules/pages/views/router/pages.router.js +95 -15
  652. package/src/modules/products/components/blocks/CardPosition.vue +1 -1
  653. package/src/modules/products/components/pages/Products.vue +3 -3
  654. package/src/modules/rents/controllers/services/rents.services.js +1 -0
  655. package/src/modules/rents/rents.client.js +1 -1
  656. package/src/modules/rents/views/router/rents.router.js +93 -33
  657. package/src/modules/reports/reports.client.js +1 -1
  658. package/src/modules/wallet/wallet.client.js +1 -1
  659. package/src/styles/theme.scss +5 -3
  660. package/dist/engagement.schema-fh6W1fb_.js +0 -24
  661. package/dist/main-DQm5pwFO.js +0 -8213
  662. package/dist/martyrs/dist/main-DQm5pwFO.js +0 -1080
  663. package/dist/martyrs/dist/main-DQm5pwFO.js.map +0 -1
  664. package/dist/martyrs/dist/web-n_ivHO3v.js +0 -55
  665. package/dist/martyrs/dist/web-n_ivHO3v.js.map +0 -1
  666. package/dist/martyrs/src/components/Address/Address.vue.js.map +0 -1
  667. package/dist/martyrs/src/components/Button/Button.vue.js.map +0 -1
  668. package/dist/martyrs/src/components/EditImages/EditImages.vue2.js.map +0 -1
  669. package/dist/martyrs/src/components/LocationMarker/LocationMarker.vue.js.map +0 -1
  670. package/dist/martyrs/src/components/Menu/Menu.vue2.js.map +0 -1
  671. package/dist/martyrs/src/components/Select/Select.vue2.js.map +0 -1
  672. package/dist/martyrs/src/components/Tab/Tab.vue2.js.map +0 -1
  673. package/dist/martyrs/src/modules/community/community.router.js +0 -124
  674. package/dist/martyrs/src/modules/community/community.router.js.map +0 -1
  675. package/dist/martyrs/src/modules/core/views/components/sections/Filters.vue2.js.map +0 -1
  676. package/dist/martyrs/src/modules/icons/icons.router.js.map +0 -1
  677. package/dist/martyrs/src/modules/music/music.router.js.map +0 -1
  678. package/dist/martyrs/src/modules/notifications/notifications.router.js.map +0 -1
  679. package/dist/martyrs/src/modules/organizations/components/pages/OrganizationBackoffice.vue.js +0 -200
  680. package/dist/martyrs/src/modules/organizations/components/pages/OrganizationBackoffice.vue.js.map +0 -1
  681. package/dist/martyrs/src/modules/organizations/organizations.router.js +0 -145
  682. package/dist/martyrs/src/modules/organizations/organizations.router.js.map +0 -1
  683. package/dist/martyrs/src/modules/pages/pages.router.js.map +0 -1
  684. package/dist/martyrs/src/modules/rents/rents.router.js.map +0 -1
  685. package/dist/martyrs/src/modules/reports/reports.router.js.map +0 -1
  686. package/dist/martyrs.css +0 -1
  687. package/dist/node_modules/.pnpm/@capacitor_device@7.0.1_@capacitor_core@7.4.4/node_modules/@capacitor/device/dist/esm/index.js +0 -8
  688. package/dist/node_modules/.pnpm/@capacitor_device@7.0.1_@capacitor_core@7.4.4/node_modules/@capacitor/device/dist/esm/index.js.map +0 -1
  689. package/dist/node_modules/.pnpm/@capacitor_device@7.0.1_@capacitor_core@7.4.4/node_modules/@capacitor/device/dist/esm/web.js +0 -146
  690. package/dist/node_modules/.pnpm/@capacitor_device@7.0.1_@capacitor_core@7.4.4/node_modules/@capacitor/device/dist/esm/web.js.map +0 -1
  691. package/dist/node_modules/.pnpm/@capacitor_keyboard@7.0.1_@capacitor_core@7.4.4/node_modules/@capacitor/keyboard/dist/esm/definitions.js +0 -18
  692. package/dist/node_modules/.pnpm/@capacitor_keyboard@7.0.1_@capacitor_core@7.4.4/node_modules/@capacitor/keyboard/dist/esm/definitions.js.map +0 -1
  693. package/dist/node_modules/.pnpm/@capacitor_keyboard@7.0.1_@capacitor_core@7.4.4/node_modules/@capacitor/keyboard/dist/esm/index.js +0 -9
  694. package/dist/node_modules/.pnpm/@capacitor_keyboard@7.0.1_@capacitor_core@7.4.4/node_modules/@capacitor/keyboard/dist/esm/index.js.map +0 -1
  695. package/dist/node_modules/.pnpm/@capacitor_push-notifications@7.0.3_@capacitor_core@7.4.4/node_modules/@capacitor/push-notifications/dist/esm/index.js +0 -6
  696. package/dist/node_modules/.pnpm/@capacitor_push-notifications@7.0.3_@capacitor_core@7.4.4/node_modules/@capacitor/push-notifications/dist/esm/index.js.map +0 -1
  697. package/src/jit/.claude/settings.local.json +0 -10
  698. package/src/modules/community/community.router.js +0 -107
  699. package/src/modules/governance/governance.router.js +0 -350
  700. package/src/modules/governance/seed-governance.js +0 -348
  701. package/src/modules/governance/views/components/pages/InitiativeMilestones.vue +0 -159
  702. package/src/modules/governance/views/router/goverance.router.js +0 -290
  703. package/src/modules/governance/views/store/votes.js +0 -113
  704. package/src/modules/icons/icons.router.js +0 -29
  705. package/src/modules/marketplace/marketplace.router.js +0 -66
  706. package/src/modules/music/.claude/settings.local.json +0 -8
  707. package/src/modules/music/music.router.js +0 -188
  708. package/src/modules/notifications/notifications.router.js +0 -47
  709. package/src/modules/orders/orders.router.js +0 -255
  710. package/src/modules/organizations/organizations.router.js +0 -123
  711. package/src/modules/organizations/router/backoffice.router.js +0 -27
  712. package/src/modules/organizations/router/departments.router.js +0 -15
  713. package/src/modules/organizations/router/members.router.js +0 -20
  714. package/src/modules/pages/pages.router.js +0 -107
  715. package/src/modules/rents/rents.router.js +0 -115
  716. package/src/modules/reports/reports.router.js +0 -33
  717. package/src/modules/wallet/wallet.router.js +0 -45
@@ -0,0 +1,1632 @@
1
+ import { C as CRUD } from "./crud-BT5FIvQC.js";
2
+ import { A as ABAC } from "./abac-Blt8bUTL.js";
3
+ import { V as Verifier, a as Validator } from "./core.verifier-DVB2a21y.js";
4
+ function initiativesVerifierFactory(db) {
5
+ const createVerifier = new Verifier({
6
+ name: {
7
+ rule: "required",
8
+ validator: Validator.schema().string().required("Initiative name is required").min(1, "Name cannot be empty").max(200, "Name must not exceed 200 characters")
9
+ },
10
+ title: {
11
+ rule: "optional",
12
+ validator: Validator.schema().string().max(200, "Title must not exceed 200 characters")
13
+ },
14
+ description: {
15
+ rule: "optional",
16
+ validator: Validator.schema().string().max(2e3, "Description must not exceed 2000 characters")
17
+ },
18
+ status: {
19
+ rule: "optional",
20
+ default: "draft",
21
+ validator: Validator.schema().string().oneOf(["draft", "active", "completed", "archived"], "Invalid status")
22
+ },
23
+ client: {
24
+ rule: "optional",
25
+ validator: Validator.schema().string().max(100, "Client name must not exceed 100 characters")
26
+ },
27
+ url: {
28
+ rule: "optional",
29
+ validator: Validator.schema().string().max(200, "URL must not exceed 200 characters")
30
+ },
31
+ createdBy: {
32
+ rule: "optional",
33
+ validator: Validator.schema().string().pattern(/^[0-9a-fA-F]{24}$/, "Invalid user ID format")
34
+ },
35
+ cover: {
36
+ rule: "optional"
37
+ },
38
+ published: {
39
+ rule: "optional"
40
+ },
41
+ structure: {
42
+ rule: "optional"
43
+ },
44
+ team: {
45
+ rule: "optional"
46
+ },
47
+ services: {
48
+ rule: "optional"
49
+ },
50
+ date: {
51
+ rule: "optional"
52
+ },
53
+ fullDescription: {
54
+ rule: "optional"
55
+ },
56
+ valueProposition: {
57
+ rule: "optional"
58
+ },
59
+ targetAudience: {
60
+ rule: "optional"
61
+ },
62
+ successCriteria: {
63
+ rule: "optional"
64
+ },
65
+ repositories: {
66
+ rule: "optional"
67
+ },
68
+ links: {
69
+ rule: "optional"
70
+ },
71
+ environments: {
72
+ rule: "optional"
73
+ },
74
+ releases: {
75
+ rule: "optional"
76
+ },
77
+ metrics: {
78
+ rule: "optional"
79
+ },
80
+ sprints: {
81
+ rule: "optional"
82
+ }
83
+ });
84
+ const readVerifier = new Verifier({
85
+ _id: {
86
+ rule: "optional",
87
+ validator: Validator.schema().string().pattern(/^[0-9a-fA-F]{24}$/, "Invalid initiative ID format")
88
+ },
89
+ status: {
90
+ rule: "optional",
91
+ validator: Validator.schema().string().oneOf(["draft", "active", "completed", "archived"], "Invalid status")
92
+ },
93
+ createdBy: {
94
+ rule: "optional",
95
+ validator: Validator.schema().string().pattern(/^[0-9a-fA-F]{24}$/, "Invalid user ID format")
96
+ },
97
+ limit: {
98
+ rule: "optional",
99
+ validator: Validator.schema().integer().min(1, "Limit must be at least 1").max(100, "Limit cannot exceed 100")
100
+ },
101
+ skip: {
102
+ rule: "optional",
103
+ validator: Validator.schema().integer().min(0, "Skip cannot be negative")
104
+ },
105
+ sort: {
106
+ rule: "optional"
107
+ },
108
+ populate: {
109
+ rule: "optional"
110
+ }
111
+ });
112
+ const updateVerifier = new Verifier({
113
+ _id: {
114
+ rule: "required",
115
+ validator: Validator.schema().string().required("Initiative ID is required").pattern(/^[0-9a-fA-F]{24}$/, "Invalid initiative ID format")
116
+ },
117
+ name: {
118
+ rule: "optional",
119
+ validator: Validator.schema().string().min(1, "Name cannot be empty").max(200, "Name must not exceed 200 characters")
120
+ },
121
+ title: {
122
+ rule: "optional",
123
+ validator: Validator.schema().string().max(200, "Title must not exceed 200 characters")
124
+ },
125
+ description: {
126
+ rule: "optional",
127
+ validator: Validator.schema().string().max(2e3, "Description must not exceed 2000 characters")
128
+ },
129
+ status: {
130
+ rule: "optional",
131
+ validator: Validator.schema().string().oneOf(["draft", "active", "completed", "archived"], "Invalid status")
132
+ },
133
+ client: {
134
+ rule: "optional",
135
+ validator: Validator.schema().string().max(100, "Client name must not exceed 100 characters")
136
+ },
137
+ url: {
138
+ rule: "optional",
139
+ validator: Validator.schema().string().max(200, "URL must not exceed 200 characters")
140
+ },
141
+ cover: {
142
+ rule: "optional"
143
+ },
144
+ published: {
145
+ rule: "optional"
146
+ },
147
+ structure: {
148
+ rule: "optional"
149
+ },
150
+ team: {
151
+ rule: "optional"
152
+ },
153
+ services: {
154
+ rule: "optional"
155
+ },
156
+ date: {
157
+ rule: "optional"
158
+ },
159
+ fullDescription: {
160
+ rule: "optional"
161
+ },
162
+ valueProposition: {
163
+ rule: "optional"
164
+ },
165
+ targetAudience: {
166
+ rule: "optional"
167
+ },
168
+ successCriteria: {
169
+ rule: "optional"
170
+ },
171
+ repositories: {
172
+ rule: "optional"
173
+ },
174
+ links: {
175
+ rule: "optional"
176
+ },
177
+ environments: {
178
+ rule: "optional"
179
+ },
180
+ releases: {
181
+ rule: "optional"
182
+ },
183
+ metrics: {
184
+ rule: "optional"
185
+ },
186
+ sprints: {
187
+ rule: "optional"
188
+ }
189
+ });
190
+ const deleteVerifier = new Verifier({
191
+ _id: {
192
+ rule: "required",
193
+ validator: Validator.schema().string().required("Initiative ID is required").pattern(/^[0-9a-fA-F]{24}$/, "Invalid initiative ID format")
194
+ }
195
+ });
196
+ return {
197
+ createVerifier,
198
+ readVerifier,
199
+ updateVerifier,
200
+ deleteVerifier
201
+ };
202
+ }
203
+ const { getInstance: getInstance$4 } = ABAC;
204
+ function RoutesInitiative(app, db) {
205
+ const abac = getInstance$4(db);
206
+ const verifier = initiativesVerifierFactory();
207
+ const initiativesCRUD = new CRUD({
208
+ app,
209
+ db,
210
+ model: db.initiative,
211
+ modelName: "initiative",
212
+ basePath: "/api/initiatives",
213
+ auth: { read: false },
214
+ verifiers: {
215
+ create: verifier.createVerifier,
216
+ read: verifier.readVerifier,
217
+ update: verifier.updateVerifier,
218
+ delete: verifier.deleteVerifier
219
+ },
220
+ abac,
221
+ policies: {
222
+ read: { enabled: false }
223
+ },
224
+ cache: {
225
+ enabled: true,
226
+ ttl: 300,
227
+ tags: ["initiatives", "governance"]
228
+ },
229
+ events: {
230
+ enabled: true,
231
+ logReads: false
232
+ }
233
+ });
234
+ initiativesCRUD.addAction("sprints", {
235
+ method: "get",
236
+ path: "/:id/sprints",
237
+ auth: false,
238
+ abac: { enabled: false },
239
+ handler: async (req, res) => {
240
+ try {
241
+ const sprints = await db.sprint.find({
242
+ initiative: req.params.id
243
+ }).populate("owner contributors");
244
+ res.json(sprints);
245
+ } catch (error) {
246
+ console.error(error);
247
+ res.status(500).json({ error: error.message });
248
+ }
249
+ }
250
+ });
251
+ initiativesCRUD.addAction("propose-task", {
252
+ method: "post",
253
+ path: "/:id/propose-task",
254
+ auth: true,
255
+ handler: async (req, res) => {
256
+ try {
257
+ const { title, description, sprint, dueDate } = req.body;
258
+ const voting = await db.voting.create({
259
+ type: "create_task",
260
+ targetModel: "Task",
261
+ title: `Create task: ${title}`,
262
+ description: `Proposal to create task: ${description}`,
263
+ initiative: req.params.id,
264
+ sprint,
265
+ threshold: 51,
266
+ participants: [],
267
+ metadata: {
268
+ taskData: {
269
+ title,
270
+ description,
271
+ sprint,
272
+ dueDate,
273
+ initiative: req.params.id
274
+ }
275
+ }
276
+ });
277
+ res.status(201).json(voting);
278
+ } catch (error) {
279
+ console.error(error);
280
+ res.status(500).json({ error: error.message });
281
+ }
282
+ }
283
+ });
284
+ initiativesCRUD.addAction("metrics", {
285
+ method: "get",
286
+ path: "/:id/metrics",
287
+ auth: false,
288
+ abac: { enabled: false },
289
+ handler: async (req, res) => {
290
+ try {
291
+ const initiativeId = req.params.id;
292
+ const [tasks, sprints, initiative] = await Promise.all([
293
+ db.task.find({ initiative: initiativeId }),
294
+ db.sprint.find({ initiative: initiativeId }),
295
+ db.initiative.findById(initiativeId)
296
+ ]);
297
+ const totalTasks = tasks.length;
298
+ const completedTasks = tasks.filter((t) => t.status === "completed").length;
299
+ const taskProgress = totalTasks > 0 ? Math.round(completedTasks / totalTasks * 100) : 0;
300
+ const totalSprints = sprints.length;
301
+ const completedSprints = sprints.filter((m) => m.status === "completed").length;
302
+ const sprintProgress = totalSprints > 0 ? Math.round(completedSprints / totalSprints * 100) : 0;
303
+ const now = /* @__PURE__ */ new Date();
304
+ const incompleteTasks = tasks.filter((t) => t.status !== "completed");
305
+ const overdueTasks = incompleteTasks.filter((t) => t.dueDate && new Date(t.dueDate) < now);
306
+ const overdueRatio = incompleteTasks.length > 0 ? overdueTasks.length / incompleteTasks.length : 0;
307
+ const riskIndex = overdueRatio > 0.3 ? "high" : overdueRatio > 0.1 ? "medium" : "low";
308
+ const envs = initiative?.environments || [];
309
+ const healthyEnvs = envs.filter((e) => e.status === "healthy").length;
310
+ const availabilityIndex = envs.length > 0 ? Math.round(healthyEnvs / envs.length * 100) : 100;
311
+ const team = initiative?.team || {};
312
+ const activeUsers = (team.owners?.length || 0) + (team.coreTeam?.length || 0) + (team.contributors?.length || 0);
313
+ const performance = totalSprints > 0 ? Math.round(completedSprints / totalSprints * 100) : 0;
314
+ res.json({ taskProgress, sprintProgress, riskIndex, availabilityIndex, activeUsers, performance });
315
+ } catch (error) {
316
+ console.error(error);
317
+ res.status(500).json({ error: error.message });
318
+ }
319
+ }
320
+ });
321
+ return initiativesCRUD;
322
+ }
323
+ function sprintsVerifierFactory(db) {
324
+ const createVerifier = new Verifier({
325
+ name: {
326
+ rule: "required",
327
+ validator: Validator.schema().string().required("Sprint name is required").min(1, "Name cannot be empty").max(200, "Name must not exceed 200 characters")
328
+ },
329
+ description: {
330
+ rule: "optional",
331
+ validator: Validator.schema().string().max(1e3, "Description must not exceed 1000 characters")
332
+ },
333
+ status: {
334
+ rule: "optional",
335
+ default: "not_started",
336
+ validator: Validator.schema().string().oneOf(["not_started", "in_progress", "completed", "blocked", "cancelled"], "Invalid status")
337
+ },
338
+ startDate: {
339
+ rule: "required",
340
+ validator: Validator.schema().date().required("Start date is required")
341
+ },
342
+ dueDate: {
343
+ rule: "required",
344
+ validator: Validator.schema().date().required("Due date is required")
345
+ },
346
+ completedDate: {
347
+ rule: "optional",
348
+ validator: Validator.schema().date()
349
+ },
350
+ progress: {
351
+ rule: "optional",
352
+ default: 0,
353
+ validator: Validator.schema().number().min(0, "Progress cannot be negative").max(100, "Progress cannot exceed 100")
354
+ },
355
+ owner: {
356
+ rule: "required",
357
+ validator: Validator.schema().string().required("Owner is required").pattern(/^[0-9a-fA-F]{24}$/, "Invalid owner ID format")
358
+ },
359
+ contributors: {
360
+ rule: "optional",
361
+ validator: Validator.schema().array().items(
362
+ Validator.schema().string().pattern(/^[0-9a-fA-F]{24}$/, "Invalid contributor ID format")
363
+ )
364
+ },
365
+ initiative: {
366
+ rule: "required",
367
+ validator: Validator.schema().string().required("Initiative is required").pattern(/^[0-9a-fA-F]{24}$/, "Invalid initiative ID format")
368
+ },
369
+ priority: {
370
+ rule: "optional",
371
+ default: "medium",
372
+ validator: Validator.schema().string().oneOf(["low", "medium", "high", "urgent"], "Invalid priority")
373
+ },
374
+ tags: {
375
+ rule: "optional",
376
+ validator: Validator.schema().array().items(Validator.schema().string())
377
+ },
378
+ dependencies: {
379
+ rule: "optional"
380
+ },
381
+ metadata: {
382
+ rule: "optional"
383
+ }
384
+ });
385
+ const readVerifier = new Verifier({
386
+ _id: {
387
+ rule: "optional",
388
+ validator: Validator.schema().string().pattern(/^[0-9a-fA-F]{24}$/, "Invalid sprint ID format")
389
+ },
390
+ initiative: {
391
+ rule: "optional",
392
+ validator: Validator.schema().string().pattern(/^[0-9a-fA-F]{24}$/, "Invalid initiative ID format")
393
+ },
394
+ status: {
395
+ rule: "optional",
396
+ validator: Validator.schema().string().oneOf(["not_started", "in_progress", "completed", "blocked", "cancelled"], "Invalid status")
397
+ },
398
+ owner: {
399
+ rule: "optional",
400
+ validator: Validator.schema().string().pattern(/^[0-9a-fA-F]{24}$/, "Invalid owner ID format")
401
+ },
402
+ limit: {
403
+ rule: "optional",
404
+ validator: Validator.schema().integer().min(1, "Limit must be at least 1").max(100, "Limit cannot exceed 100")
405
+ },
406
+ skip: {
407
+ rule: "optional",
408
+ validator: Validator.schema().integer().min(0, "Skip cannot be negative")
409
+ },
410
+ sort: {
411
+ rule: "optional"
412
+ },
413
+ populate: {
414
+ rule: "optional"
415
+ }
416
+ });
417
+ const updateVerifier = new Verifier({
418
+ _id: {
419
+ rule: "required",
420
+ validator: Validator.schema().string().required("Sprint ID is required").pattern(/^[0-9a-fA-F]{24}$/, "Invalid sprint ID format")
421
+ },
422
+ name: {
423
+ rule: "optional",
424
+ validator: Validator.schema().string().min(1, "Name cannot be empty").max(200, "Name must not exceed 200 characters")
425
+ },
426
+ description: {
427
+ rule: "optional",
428
+ validator: Validator.schema().string().max(1e3, "Description must not exceed 1000 characters")
429
+ },
430
+ status: {
431
+ rule: "optional",
432
+ validator: Validator.schema().string().oneOf(["not_started", "in_progress", "completed", "blocked", "cancelled"], "Invalid status")
433
+ },
434
+ startDate: {
435
+ rule: "optional",
436
+ validator: Validator.schema().date()
437
+ },
438
+ dueDate: {
439
+ rule: "optional",
440
+ validator: Validator.schema().date()
441
+ },
442
+ completedDate: {
443
+ rule: "optional",
444
+ validator: Validator.schema().date()
445
+ },
446
+ progress: {
447
+ rule: "optional",
448
+ validator: Validator.schema().number().min(0, "Progress cannot be negative").max(100, "Progress cannot exceed 100")
449
+ },
450
+ contributors: {
451
+ rule: "optional",
452
+ validator: Validator.schema().array().items(
453
+ Validator.schema().string().pattern(/^[0-9a-fA-F]{24}$/, "Invalid contributor ID format")
454
+ )
455
+ },
456
+ priority: {
457
+ rule: "optional",
458
+ validator: Validator.schema().string().oneOf(["low", "medium", "high", "urgent"], "Invalid priority")
459
+ },
460
+ tags: {
461
+ rule: "optional",
462
+ validator: Validator.schema().array().items(Validator.schema().string())
463
+ },
464
+ dependencies: {
465
+ rule: "optional"
466
+ },
467
+ metadata: {
468
+ rule: "optional"
469
+ }
470
+ });
471
+ const deleteVerifier = new Verifier({
472
+ _id: {
473
+ rule: "required",
474
+ validator: Validator.schema().string().required("Sprint ID is required").pattern(/^[0-9a-fA-F]{24}$/, "Invalid sprint ID format")
475
+ }
476
+ });
477
+ return {
478
+ createVerifier,
479
+ readVerifier,
480
+ updateVerifier,
481
+ deleteVerifier
482
+ };
483
+ }
484
+ const { getInstance: getInstance$3 } = ABAC;
485
+ function RoutesSprint(app, db) {
486
+ const abac = getInstance$3(db);
487
+ const verifier = sprintsVerifierFactory();
488
+ const sprintsCRUD = new CRUD({
489
+ app,
490
+ db,
491
+ model: db.sprint,
492
+ modelName: "sprint",
493
+ basePath: "/api/sprints",
494
+ auth: { read: false },
495
+ verifiers: {
496
+ create: verifier.createVerifier,
497
+ read: verifier.readVerifier,
498
+ update: verifier.updateVerifier,
499
+ delete: verifier.deleteVerifier
500
+ },
501
+ abac,
502
+ policies: {
503
+ read: { enabled: false }
504
+ },
505
+ cache: {
506
+ enabled: true,
507
+ ttl: 300,
508
+ tags: ["sprints", "governance"]
509
+ },
510
+ events: {
511
+ enabled: true,
512
+ logReads: false
513
+ }
514
+ });
515
+ sprintsCRUD.addAction("tasks", {
516
+ method: "get",
517
+ path: "/:id/tasks",
518
+ auth: false,
519
+ abac: { enabled: false },
520
+ handler: async (req, res) => {
521
+ try {
522
+ const tasks = await db.task.find({
523
+ sprint: req.params.id
524
+ }).populate("assignedTo");
525
+ res.json(tasks);
526
+ } catch (error) {
527
+ console.error(error);
528
+ res.status(500).json({ error: error.message });
529
+ }
530
+ }
531
+ });
532
+ sprintsCRUD.addAction("propose-task", {
533
+ method: "post",
534
+ path: "/:id/propose-task",
535
+ auth: true,
536
+ handler: async (req, res) => {
537
+ try {
538
+ const sprint = await db.sprint.findById(req.params.id);
539
+ if (!sprint) {
540
+ return res.status(404).json({ error: "Sprint not found" });
541
+ }
542
+ const { title, description, dueDate } = req.body;
543
+ const voting = await db.voting.create({
544
+ type: "create_task",
545
+ targetModel: "Task",
546
+ title: `Create task: ${title}`,
547
+ description: `Proposal to create task in sprint "${sprint.name}": ${description}`,
548
+ initiative: sprint.initiative,
549
+ sprint: req.params.id,
550
+ threshold: 51,
551
+ participants: [],
552
+ metadata: {
553
+ taskData: {
554
+ title,
555
+ description,
556
+ sprint: req.params.id,
557
+ initiative: sprint.initiative,
558
+ dueDate
559
+ }
560
+ }
561
+ });
562
+ res.status(201).json(voting);
563
+ } catch (error) {
564
+ console.error(error);
565
+ res.status(500).json({ error: error.message });
566
+ }
567
+ }
568
+ });
569
+ return sprintsCRUD;
570
+ }
571
+ function tasksVerifierFactory(db) {
572
+ const createVerifier = new Verifier({
573
+ title: {
574
+ rule: "required",
575
+ validator: Validator.schema().string().required("Task title is required").min(1, "Title cannot be empty").max(200, "Title must not exceed 200 characters")
576
+ },
577
+ description: {
578
+ rule: "optional",
579
+ validator: Validator.schema().string().max(2e3, "Description must not exceed 2000 characters")
580
+ },
581
+ status: {
582
+ rule: "optional",
583
+ default: "not_started",
584
+ validator: Validator.schema().string().oneOf(["proposed", "voting", "not_started", "in_progress", "review", "completed", "blocked", "cancelled"], "Invalid status")
585
+ },
586
+ assignedTo: {
587
+ rule: "optional",
588
+ validator: Validator.schema().string().pattern(/^[0-9a-fA-F]{24}$/, "Invalid user ID format")
589
+ },
590
+ dueDate: {
591
+ rule: "optional",
592
+ validator: Validator.schema().date()
593
+ },
594
+ sprint: {
595
+ rule: "optional",
596
+ validator: Validator.schema().string().pattern(/^[0-9a-fA-F]{24}$/, "Invalid sprint ID format")
597
+ },
598
+ initiative: {
599
+ rule: "optional",
600
+ validator: Validator.schema().string().pattern(/^[0-9a-fA-F]{24}$/, "Invalid initiative ID format")
601
+ },
602
+ priority: {
603
+ rule: "optional",
604
+ default: "medium",
605
+ validator: Validator.schema().string().oneOf(["low", "medium", "high", "urgent"], "Invalid priority")
606
+ },
607
+ tags: {
608
+ rule: "optional",
609
+ validator: Validator.schema().array().items(Validator.schema().string())
610
+ },
611
+ proposedByVoting: {
612
+ rule: "optional",
613
+ validator: Validator.schema().string().pattern(/^[0-9a-fA-F]{24}$/, "Invalid voting ID format")
614
+ },
615
+ completionVoting: {
616
+ rule: "optional",
617
+ validator: Validator.schema().string().pattern(/^[0-9a-fA-F]{24}$/, "Invalid voting ID format")
618
+ },
619
+ completedDate: {
620
+ rule: "optional",
621
+ validator: Validator.schema().date()
622
+ }
623
+ });
624
+ const readVerifier = new Verifier({
625
+ _id: {
626
+ rule: "optional",
627
+ validator: Validator.schema().string().pattern(/^[0-9a-fA-F]{24}$/, "Invalid task ID format")
628
+ },
629
+ sprint: {
630
+ rule: "optional",
631
+ validator: Validator.schema().string().pattern(/^[0-9a-fA-F]{24}$/, "Invalid sprint ID format")
632
+ },
633
+ initiative: {
634
+ rule: "optional",
635
+ validator: Validator.schema().string().pattern(/^[0-9a-fA-F]{24}$/, "Invalid initiative ID format")
636
+ },
637
+ assignedTo: {
638
+ rule: "optional",
639
+ validator: Validator.schema().string().pattern(/^[0-9a-fA-F]{24}$/, "Invalid user ID format")
640
+ },
641
+ status: {
642
+ rule: "optional",
643
+ validator: Validator.schema().string().oneOf(["proposed", "voting", "not_started", "in_progress", "review", "completed", "blocked", "cancelled"], "Invalid status")
644
+ },
645
+ priority: {
646
+ rule: "optional",
647
+ validator: Validator.schema().string().oneOf(["low", "medium", "high", "urgent"], "Invalid priority")
648
+ },
649
+ limit: {
650
+ rule: "optional",
651
+ validator: Validator.schema().integer().min(1, "Limit must be at least 1").max(100, "Limit cannot exceed 100")
652
+ },
653
+ skip: {
654
+ rule: "optional",
655
+ validator: Validator.schema().integer().min(0, "Skip cannot be negative")
656
+ },
657
+ sort: {
658
+ rule: "optional"
659
+ },
660
+ populate: {
661
+ rule: "optional"
662
+ }
663
+ });
664
+ const updateVerifier = new Verifier({
665
+ _id: {
666
+ rule: "required",
667
+ validator: Validator.schema().string().required("Task ID is required").pattern(/^[0-9a-fA-F]{24}$/, "Invalid task ID format")
668
+ },
669
+ title: {
670
+ rule: "optional",
671
+ validator: Validator.schema().string().min(1, "Title cannot be empty").max(200, "Title must not exceed 200 characters")
672
+ },
673
+ description: {
674
+ rule: "optional",
675
+ validator: Validator.schema().string().max(2e3, "Description must not exceed 2000 characters")
676
+ },
677
+ status: {
678
+ rule: "optional",
679
+ validator: Validator.schema().string().oneOf(["proposed", "voting", "not_started", "in_progress", "review", "completed", "blocked", "cancelled"], "Invalid status")
680
+ },
681
+ assignedTo: {
682
+ rule: "optional",
683
+ validator: Validator.schema().string().pattern(/^[0-9a-fA-F]{24}$/, "Invalid user ID format")
684
+ },
685
+ dueDate: {
686
+ rule: "optional",
687
+ validator: Validator.schema().date()
688
+ },
689
+ priority: {
690
+ rule: "optional",
691
+ validator: Validator.schema().string().oneOf(["low", "medium", "high", "urgent"], "Invalid priority")
692
+ },
693
+ tags: {
694
+ rule: "optional",
695
+ validator: Validator.schema().array().items(Validator.schema().string())
696
+ },
697
+ completionVoting: {
698
+ rule: "optional",
699
+ validator: Validator.schema().string().pattern(/^[0-9a-fA-F]{24}$/, "Invalid voting ID format")
700
+ },
701
+ completedDate: {
702
+ rule: "optional",
703
+ validator: Validator.schema().date()
704
+ }
705
+ });
706
+ const deleteVerifier = new Verifier({
707
+ _id: {
708
+ rule: "required",
709
+ validator: Validator.schema().string().required("Task ID is required").pattern(/^[0-9a-fA-F]{24}$/, "Invalid task ID format")
710
+ }
711
+ });
712
+ return {
713
+ createVerifier,
714
+ readVerifier,
715
+ updateVerifier,
716
+ deleteVerifier
717
+ };
718
+ }
719
+ const { getInstance: getInstance$2 } = ABAC;
720
+ function RoutesTask(app, db) {
721
+ const abac = getInstance$2(db);
722
+ const verifier = tasksVerifierFactory();
723
+ const tasksCRUD = new CRUD({
724
+ app,
725
+ db,
726
+ model: db.task,
727
+ modelName: "task",
728
+ basePath: "/api/tasks",
729
+ auth: { read: false },
730
+ verifiers: {
731
+ create: verifier.createVerifier,
732
+ read: verifier.readVerifier,
733
+ update: verifier.updateVerifier,
734
+ delete: verifier.deleteVerifier
735
+ },
736
+ abac,
737
+ policies: {
738
+ read: { enabled: false }
739
+ },
740
+ cache: {
741
+ enabled: true,
742
+ ttl: 300,
743
+ tags: ["tasks", "governance"]
744
+ },
745
+ events: {
746
+ enabled: true,
747
+ logReads: false
748
+ }
749
+ });
750
+ tasksCRUD.addAction("assign", {
751
+ method: "post",
752
+ path: "/:id/assign",
753
+ auth: true,
754
+ handler: async (req, res) => {
755
+ try {
756
+ const task = await db.task.findById(req.params.id);
757
+ if (!task) {
758
+ return res.status(404).json({ error: "Task not found" });
759
+ }
760
+ const { userId } = req.body;
761
+ const user = await db.user.findById(userId);
762
+ if (!user) {
763
+ return res.status(404).json({ error: "User not found" });
764
+ }
765
+ task.assignedTo = userId;
766
+ task.status = "in_progress";
767
+ await task.save();
768
+ res.json({ message: "Task assigned successfully", task });
769
+ } catch (error) {
770
+ console.error(error);
771
+ res.status(500).json({ error: error.message });
772
+ }
773
+ }
774
+ });
775
+ tasksCRUD.addAction("submit-for-review", {
776
+ method: "post",
777
+ path: "/:id/submit-for-review",
778
+ auth: true,
779
+ handler: async (req, res) => {
780
+ try {
781
+ const task = await db.task.findById(req.params.id).populate("assignedTo").populate("sprint");
782
+ if (!task) {
783
+ return res.status(404).json({ error: "Task not found" });
784
+ }
785
+ if (task.status !== "in_progress") {
786
+ return res.status(400).json({ error: "Task must be in progress to submit for review" });
787
+ }
788
+ const voting = await db.voting.create({
789
+ type: "approve_task",
790
+ targetModel: "Task",
791
+ targetId: task._id,
792
+ title: `Approve completion of task: ${task.title}`,
793
+ description: `Review and approve the completion of task "${task.title}"`,
794
+ initiative: task.initiative,
795
+ sprint: task.sprint,
796
+ threshold: 51,
797
+ participants: [],
798
+ metadata: {
799
+ taskId: task._id,
800
+ completedBy: task.assignedTo
801
+ }
802
+ });
803
+ task.status = "review";
804
+ task.completionVoting = voting._id;
805
+ await task.save();
806
+ res.json({ message: "Task submitted for review", task, voting });
807
+ } catch (error) {
808
+ console.error(error);
809
+ res.status(500).json({ error: error.message });
810
+ }
811
+ }
812
+ });
813
+ tasksCRUD.addAction("complete", {
814
+ method: "post",
815
+ path: "/:id/complete",
816
+ auth: true,
817
+ handler: async (req, res) => {
818
+ try {
819
+ const task = await db.task.findById(req.params.id);
820
+ if (!task) {
821
+ return res.status(404).json({ error: "Task not found" });
822
+ }
823
+ if (task.status !== "review") {
824
+ return res.status(400).json({ error: "Task must be in review to complete" });
825
+ }
826
+ if (task.completionVoting) {
827
+ const voting = await db.voting.findById(task.completionVoting);
828
+ if (voting && voting.result !== "approved") {
829
+ return res.status(400).json({ error: "Task completion not approved by voting" });
830
+ }
831
+ }
832
+ task.status = "completed";
833
+ task.completedDate = /* @__PURE__ */ new Date();
834
+ await task.save();
835
+ res.json({ message: "Task completed successfully", task });
836
+ } catch (error) {
837
+ console.error(error);
838
+ res.status(500).json({ error: error.message });
839
+ }
840
+ }
841
+ });
842
+ return tasksCRUD;
843
+ }
844
+ function votesVerifierFactory(db) {
845
+ const createVerifier = new Verifier({
846
+ voting: {
847
+ rule: "required",
848
+ validator: Validator.schema().string().required("Voting ID is required").pattern(/^[0-9a-fA-F]{24}$/, "Invalid voting ID format")
849
+ },
850
+ value: {
851
+ rule: "required",
852
+ validator: Validator.schema().number().required("Vote value is required")
853
+ },
854
+ voter: {
855
+ rule: "optional",
856
+ validator: Validator.schema().string().pattern(/^[0-9a-fA-F]{24}$/, "Invalid voter ID format")
857
+ },
858
+ comment: {
859
+ rule: "optional",
860
+ validator: Validator.schema().string().max(500, "Comment must not exceed 500 characters")
861
+ }
862
+ });
863
+ const readVerifier = new Verifier({
864
+ _id: {
865
+ rule: "optional",
866
+ validator: Validator.schema().string().pattern(/^[0-9a-fA-F]{24}$/, "Invalid vote ID format")
867
+ },
868
+ voting: {
869
+ rule: "optional",
870
+ validator: Validator.schema().string().pattern(/^[0-9a-fA-F]{24}$/, "Invalid voting ID format")
871
+ },
872
+ voter: {
873
+ rule: "optional",
874
+ validator: Validator.schema().string().pattern(/^[0-9a-fA-F]{24}$/, "Invalid voter ID format")
875
+ },
876
+ limit: {
877
+ rule: "optional",
878
+ validator: Validator.schema().integer().min(1, "Limit must be at least 1").max(100, "Limit cannot exceed 100")
879
+ },
880
+ skip: {
881
+ rule: "optional",
882
+ validator: Validator.schema().integer().min(0, "Skip cannot be negative")
883
+ },
884
+ sort: {
885
+ rule: "optional"
886
+ },
887
+ populate: {
888
+ rule: "optional"
889
+ }
890
+ });
891
+ const updateVerifier = new Verifier({
892
+ _id: {
893
+ rule: "required",
894
+ validator: Validator.schema().string().required("Vote ID is required").pattern(/^[0-9a-fA-F]{24}$/, "Invalid vote ID format")
895
+ },
896
+ value: {
897
+ rule: "optional",
898
+ validator: Validator.schema().number()
899
+ },
900
+ comment: {
901
+ rule: "optional",
902
+ validator: Validator.schema().string().max(500, "Comment must not exceed 500 characters")
903
+ }
904
+ });
905
+ const deleteVerifier = new Verifier({
906
+ _id: {
907
+ rule: "required",
908
+ validator: Validator.schema().string().required("Vote ID is required").pattern(/^[0-9a-fA-F]{24}$/, "Invalid vote ID format")
909
+ }
910
+ });
911
+ return {
912
+ createVerifier,
913
+ readVerifier,
914
+ updateVerifier,
915
+ deleteVerifier
916
+ };
917
+ }
918
+ const { getInstance: getInstance$1 } = ABAC;
919
+ function RoutesVote(app, db) {
920
+ const abac = getInstance$1(db);
921
+ const verifier = votesVerifierFactory();
922
+ const votesCRUD = new CRUD({
923
+ app,
924
+ db,
925
+ model: db.vote,
926
+ modelName: "vote",
927
+ basePath: "/api/votes",
928
+ auth: {
929
+ read: false,
930
+ create: true
931
+ // Votes are typically created via /api/votings/:id/vote
932
+ },
933
+ verifiers: {
934
+ create: verifier.createVerifier,
935
+ read: verifier.readVerifier,
936
+ update: verifier.updateVerifier,
937
+ delete: verifier.deleteVerifier
938
+ },
939
+ abac,
940
+ policies: {
941
+ read: { enabled: false }
942
+ },
943
+ cache: {
944
+ enabled: true,
945
+ ttl: 60,
946
+ tags: ["votes", "governance"]
947
+ },
948
+ events: {
949
+ enabled: true,
950
+ logReads: false
951
+ }
952
+ });
953
+ return votesCRUD;
954
+ }
955
+ function votingsVerifierFactory(db) {
956
+ const createVerifier = new Verifier({
957
+ title: {
958
+ rule: "required",
959
+ validator: Validator.schema().string().required("Voting title is required").min(1, "Title cannot be empty").max(200, "Title must not exceed 200 characters")
960
+ },
961
+ description: {
962
+ rule: "optional",
963
+ validator: Validator.schema().string().max(2e3, "Description must not exceed 2000 characters")
964
+ },
965
+ type: {
966
+ rule: "required",
967
+ validator: Validator.schema().string().required("Voting type is required").oneOf(["create_task", "approve_task", "create_initiative", "update_sprint", "general"], "Invalid voting type")
968
+ },
969
+ targetModel: {
970
+ rule: "optional",
971
+ validator: Validator.schema().string().oneOf(["Task", "Initiative", "Sprint"], "Invalid target model")
972
+ },
973
+ targetId: {
974
+ rule: "optional",
975
+ validator: Validator.schema().string().pattern(/^[0-9a-fA-F]{24}$/, "Invalid target ID format")
976
+ },
977
+ threshold: {
978
+ rule: "optional",
979
+ default: 51,
980
+ validator: Validator.schema().number().min(1, "Threshold must be at least 1").max(100, "Threshold cannot exceed 100")
981
+ },
982
+ participants: {
983
+ rule: "optional",
984
+ validator: Validator.schema().array().items(
985
+ Validator.schema().string().pattern(/^[0-9a-fA-F]{24}$/, "Invalid participant ID format")
986
+ )
987
+ },
988
+ result: {
989
+ rule: "optional",
990
+ default: "pending",
991
+ validator: Validator.schema().string().oneOf(["pending", "approved", "rejected"], "Invalid result")
992
+ },
993
+ initiative: {
994
+ rule: "optional",
995
+ validator: Validator.schema().string().pattern(/^[0-9a-fA-F]{24}$/, "Invalid initiative ID format")
996
+ },
997
+ sprint: {
998
+ rule: "optional",
999
+ validator: Validator.schema().string().pattern(/^[0-9a-fA-F]{24}$/, "Invalid sprint ID format")
1000
+ },
1001
+ task: {
1002
+ rule: "optional",
1003
+ validator: Validator.schema().string().pattern(/^[0-9a-fA-F]{24}$/, "Invalid task ID format")
1004
+ },
1005
+ metadata: {
1006
+ rule: "optional"
1007
+ },
1008
+ startDate: {
1009
+ rule: "optional",
1010
+ validator: Validator.schema().date()
1011
+ },
1012
+ endDate: {
1013
+ rule: "optional",
1014
+ validator: Validator.schema().date()
1015
+ },
1016
+ status: {
1017
+ rule: "optional",
1018
+ default: "pending",
1019
+ validator: Validator.schema().string().oneOf(["pending", "active", "closed"], "Invalid status")
1020
+ }
1021
+ });
1022
+ const readVerifier = new Verifier({
1023
+ _id: {
1024
+ rule: "optional",
1025
+ validator: Validator.schema().string().pattern(/^[0-9a-fA-F]{24}$/, "Invalid voting ID format")
1026
+ },
1027
+ type: {
1028
+ rule: "optional",
1029
+ validator: Validator.schema().string().oneOf(["create_task", "approve_task", "create_initiative", "update_sprint", "general"], "Invalid voting type")
1030
+ },
1031
+ initiative: {
1032
+ rule: "optional",
1033
+ validator: Validator.schema().string().pattern(/^[0-9a-fA-F]{24}$/, "Invalid initiative ID format")
1034
+ },
1035
+ sprint: {
1036
+ rule: "optional",
1037
+ validator: Validator.schema().string().pattern(/^[0-9a-fA-F]{24}$/, "Invalid sprint ID format")
1038
+ },
1039
+ task: {
1040
+ rule: "optional",
1041
+ validator: Validator.schema().string().pattern(/^[0-9a-fA-F]{24}$/, "Invalid task ID format")
1042
+ },
1043
+ result: {
1044
+ rule: "optional",
1045
+ validator: Validator.schema().string().oneOf(["pending", "approved", "rejected"], "Invalid result")
1046
+ },
1047
+ status: {
1048
+ rule: "optional",
1049
+ validator: Validator.schema().string().oneOf(["pending", "active", "closed"], "Invalid status")
1050
+ },
1051
+ limit: {
1052
+ rule: "optional",
1053
+ validator: Validator.schema().integer().min(1, "Limit must be at least 1").max(100, "Limit cannot exceed 100")
1054
+ },
1055
+ skip: {
1056
+ rule: "optional",
1057
+ validator: Validator.schema().integer().min(0, "Skip cannot be negative")
1058
+ },
1059
+ sort: {
1060
+ rule: "optional"
1061
+ },
1062
+ populate: {
1063
+ rule: "optional"
1064
+ }
1065
+ });
1066
+ const updateVerifier = new Verifier({
1067
+ _id: {
1068
+ rule: "required",
1069
+ validator: Validator.schema().string().required("Voting ID is required").pattern(/^[0-9a-fA-F]{24}$/, "Invalid voting ID format")
1070
+ },
1071
+ title: {
1072
+ rule: "optional",
1073
+ validator: Validator.schema().string().min(1, "Title cannot be empty").max(200, "Title must not exceed 200 characters")
1074
+ },
1075
+ description: {
1076
+ rule: "optional",
1077
+ validator: Validator.schema().string().max(2e3, "Description must not exceed 2000 characters")
1078
+ },
1079
+ threshold: {
1080
+ rule: "optional",
1081
+ validator: Validator.schema().number().min(1, "Threshold must be at least 1").max(100, "Threshold cannot exceed 100")
1082
+ },
1083
+ participants: {
1084
+ rule: "optional",
1085
+ validator: Validator.schema().array().items(
1086
+ Validator.schema().string().pattern(/^[0-9a-fA-F]{24}$/, "Invalid participant ID format")
1087
+ )
1088
+ },
1089
+ result: {
1090
+ rule: "optional",
1091
+ validator: Validator.schema().string().oneOf(["pending", "approved", "rejected"], "Invalid result")
1092
+ },
1093
+ task: {
1094
+ rule: "optional",
1095
+ validator: Validator.schema().string().pattern(/^[0-9a-fA-F]{24}$/, "Invalid task ID format")
1096
+ },
1097
+ metadata: {
1098
+ rule: "optional"
1099
+ },
1100
+ endDate: {
1101
+ rule: "optional",
1102
+ validator: Validator.schema().date()
1103
+ },
1104
+ status: {
1105
+ rule: "optional",
1106
+ validator: Validator.schema().string().oneOf(["pending", "active", "closed"], "Invalid status")
1107
+ }
1108
+ });
1109
+ const deleteVerifier = new Verifier({
1110
+ _id: {
1111
+ rule: "required",
1112
+ validator: Validator.schema().string().required("Voting ID is required").pattern(/^[0-9a-fA-F]{24}$/, "Invalid voting ID format")
1113
+ }
1114
+ });
1115
+ return {
1116
+ createVerifier,
1117
+ readVerifier,
1118
+ updateVerifier,
1119
+ deleteVerifier
1120
+ };
1121
+ }
1122
+ const { getInstance } = ABAC;
1123
+ function RoutesVoting(app, db) {
1124
+ const abac = getInstance(db);
1125
+ const verifier = votingsVerifierFactory();
1126
+ const votingsCRUD = new CRUD({
1127
+ app,
1128
+ db,
1129
+ model: db.voting,
1130
+ modelName: "voting",
1131
+ basePath: "/api/votings",
1132
+ auth: { read: false },
1133
+ verifiers: {
1134
+ create: verifier.createVerifier,
1135
+ read: verifier.readVerifier,
1136
+ update: verifier.updateVerifier,
1137
+ delete: verifier.deleteVerifier
1138
+ },
1139
+ abac,
1140
+ policies: {
1141
+ read: { enabled: false }
1142
+ },
1143
+ cache: {
1144
+ enabled: true,
1145
+ ttl: 60,
1146
+ tags: ["votings", "governance"]
1147
+ },
1148
+ events: {
1149
+ enabled: true,
1150
+ logReads: false
1151
+ }
1152
+ });
1153
+ votingsCRUD.addAction("vote", {
1154
+ method: "post",
1155
+ path: "/:id/vote",
1156
+ auth: true,
1157
+ handler: async (req, res) => {
1158
+ try {
1159
+ const voting = await db.voting.findById(req.params.id);
1160
+ if (!voting) {
1161
+ return res.status(404).json({ error: "Voting not found" });
1162
+ }
1163
+ if (voting.result !== "pending") {
1164
+ return res.status(400).json({ error: "Voting is closed" });
1165
+ }
1166
+ const { value, comment } = req.body;
1167
+ const userId = req.user?._id;
1168
+ if (voting.participants?.length > 0 && !voting.participants.includes(userId)) {
1169
+ return res.status(403).json({ error: "Not authorized to vote" });
1170
+ }
1171
+ const existingVote = await db.vote.findOne({
1172
+ voting: voting._id,
1173
+ voter: userId
1174
+ });
1175
+ if (existingVote) {
1176
+ return res.status(400).json({ error: "Already voted" });
1177
+ }
1178
+ const vote = await db.vote.create({
1179
+ voting: voting._id,
1180
+ voter: userId,
1181
+ value,
1182
+ comment
1183
+ });
1184
+ await checkVotingResults(voting, db);
1185
+ res.status(201).json({ message: "Vote cast successfully", vote });
1186
+ } catch (error) {
1187
+ console.error(error);
1188
+ res.status(500).json({ error: error.message });
1189
+ }
1190
+ }
1191
+ });
1192
+ votingsCRUD.addAction("results", {
1193
+ method: "get",
1194
+ path: "/:id/results",
1195
+ auth: false,
1196
+ abac: { enabled: false },
1197
+ handler: async (req, res) => {
1198
+ try {
1199
+ const voting = await db.voting.findById(req.params.id);
1200
+ if (!voting) {
1201
+ return res.status(404).json({ error: "Voting not found" });
1202
+ }
1203
+ const votes = await db.vote.find({ voting: voting._id }).populate("voter", "name email");
1204
+ const totalVotes = votes.length;
1205
+ const yesVotes = votes.filter((v) => v.value === 1 || v.value === true).length;
1206
+ const noVotes = votes.filter((v) => v.value === 0 || v.value === false).length;
1207
+ const abstainVotes = totalVotes - yesVotes - noVotes;
1208
+ const results = {
1209
+ voting,
1210
+ totalVotes,
1211
+ yesVotes,
1212
+ noVotes,
1213
+ abstainVotes,
1214
+ percentageYes: totalVotes > 0 ? (yesVotes / totalVotes * 100).toFixed(2) : 0,
1215
+ percentageNo: totalVotes > 0 ? (noVotes / totalVotes * 100).toFixed(2) : 0,
1216
+ threshold: voting.threshold || 51,
1217
+ result: voting.result,
1218
+ votes
1219
+ };
1220
+ res.json(results);
1221
+ } catch (error) {
1222
+ console.error(error);
1223
+ res.status(500).json({ error: error.message });
1224
+ }
1225
+ }
1226
+ });
1227
+ votingsCRUD.addAction("close", {
1228
+ method: "post",
1229
+ path: "/:id/close",
1230
+ auth: true,
1231
+ handler: async (req, res) => {
1232
+ try {
1233
+ const voting = await db.voting.findById(req.params.id);
1234
+ if (!voting) {
1235
+ return res.status(404).json({ error: "Voting not found" });
1236
+ }
1237
+ if (voting.result !== "pending") {
1238
+ return res.status(400).json({ error: "Voting is already closed" });
1239
+ }
1240
+ const result = await checkVotingResults(voting, db);
1241
+ res.json({ message: "Voting closed", result });
1242
+ } catch (error) {
1243
+ console.error(error);
1244
+ res.status(500).json({ error: error.message });
1245
+ }
1246
+ }
1247
+ });
1248
+ return votingsCRUD;
1249
+ }
1250
+ async function checkVotingResults(voting, db) {
1251
+ const votes = await db.vote.find({ voting: voting._id });
1252
+ const totalVotes = votes.length;
1253
+ const yesVotes = votes.filter((v) => v.value === 1 || v.value === true).length;
1254
+ const percentageYes = totalVotes > 0 ? yesVotes / totalVotes * 100 : 0;
1255
+ if (percentageYes >= (voting.threshold || 51)) {
1256
+ voting.result = "approved";
1257
+ if (voting.type === "create_task" && voting.metadata?.taskData) {
1258
+ const task = await db.task.create({
1259
+ ...voting.metadata.taskData,
1260
+ proposedByVoting: voting._id,
1261
+ status: "not_started"
1262
+ });
1263
+ voting.targetId = task._id;
1264
+ } else if (voting.type === "approve_task" && voting.targetId) {
1265
+ const task = await db.task.findById(voting.targetId);
1266
+ if (task) {
1267
+ task.status = "completed";
1268
+ task.completedDate = /* @__PURE__ */ new Date();
1269
+ await task.save();
1270
+ }
1271
+ }
1272
+ } else if (totalVotes >= (voting.participants?.length || 1)) {
1273
+ voting.result = "rejected";
1274
+ }
1275
+ await voting.save();
1276
+ return voting.result;
1277
+ }
1278
+ const ModelInitiative = (db) => {
1279
+ const InitiativeSchema = new db.mongoose.Schema(
1280
+ {
1281
+ title: { type: String },
1282
+ name: { type: String },
1283
+ description: { type: String },
1284
+ status: { type: String },
1285
+ client: { type: String },
1286
+ date: { type: db.mongoose.Schema.Types.Mixed },
1287
+ url: { type: String },
1288
+ cover: { type: db.mongoose.Schema.Types.Mixed },
1289
+ published: { type: db.mongoose.Schema.Types.Mixed },
1290
+ structure: { type: db.mongoose.Schema.Types.Mixed },
1291
+ team: { type: db.mongoose.Schema.Types.Mixed },
1292
+ services: { type: db.mongoose.Schema.Types.Mixed },
1293
+ createdBy: {
1294
+ type: db.mongoose.Schema.Types.ObjectId,
1295
+ ref: "User"
1296
+ },
1297
+ tasks: [
1298
+ {
1299
+ type: db.mongoose.Schema.Types.ObjectId,
1300
+ ref: "Task"
1301
+ }
1302
+ ]
1303
+ },
1304
+ {
1305
+ timestamps: { currentTime: () => Date.now() },
1306
+ strict: false,
1307
+ collection: "initiatives"
1308
+ }
1309
+ );
1310
+ const Initiative = db.mongoose.model("Initiative", InitiativeSchema);
1311
+ return Initiative;
1312
+ };
1313
+ const ModelSprint = (db) => {
1314
+ const SprintSchema = new db.mongoose.Schema(
1315
+ {
1316
+ name: {
1317
+ type: String,
1318
+ required: true
1319
+ },
1320
+ description: {
1321
+ type: String
1322
+ },
1323
+ status: {
1324
+ type: String,
1325
+ enum: ["not_started", "in_progress", "completed", "blocked", "cancelled"],
1326
+ default: "not_started"
1327
+ },
1328
+ startDate: {
1329
+ type: Date,
1330
+ required: true
1331
+ },
1332
+ dueDate: {
1333
+ type: Date,
1334
+ required: true
1335
+ },
1336
+ completedDate: {
1337
+ type: Date
1338
+ },
1339
+ progress: {
1340
+ type: Number,
1341
+ min: 0,
1342
+ max: 100,
1343
+ default: 0
1344
+ },
1345
+ owner: {
1346
+ type: db.mongoose.Schema.Types.ObjectId,
1347
+ ref: "User",
1348
+ required: true
1349
+ },
1350
+ contributors: [
1351
+ {
1352
+ type: db.mongoose.Schema.Types.ObjectId,
1353
+ ref: "User"
1354
+ }
1355
+ ],
1356
+ initiative: {
1357
+ type: db.mongoose.Schema.Types.ObjectId,
1358
+ ref: "Initiative",
1359
+ required: true
1360
+ },
1361
+ priority: {
1362
+ type: String,
1363
+ enum: ["low", "medium", "high", "urgent"],
1364
+ default: "medium"
1365
+ },
1366
+ tags: [
1367
+ {
1368
+ type: String
1369
+ }
1370
+ ],
1371
+ dependencies: [
1372
+ {
1373
+ sprint: {
1374
+ type: db.mongoose.Schema.Types.ObjectId,
1375
+ ref: "Sprint"
1376
+ },
1377
+ type: {
1378
+ type: String,
1379
+ enum: ["blocks", "blocked_by", "related_to"],
1380
+ required: true
1381
+ }
1382
+ }
1383
+ ],
1384
+ metadata: {
1385
+ estimatedHours: Number,
1386
+ actualHours: Number,
1387
+ budget: Number,
1388
+ actualCost: Number,
1389
+ notes: String
1390
+ }
1391
+ },
1392
+ {
1393
+ timestamps: {
1394
+ currentTime: () => Date.now()
1395
+ },
1396
+ toJSON: { virtuals: true },
1397
+ toObject: { virtuals: true }
1398
+ }
1399
+ );
1400
+ SprintSchema.virtual("isOverdue").get(function() {
1401
+ return this.dueDate && this.dueDate < /* @__PURE__ */ new Date() && this.status !== "completed";
1402
+ });
1403
+ SprintSchema.virtual("duration").get(function() {
1404
+ return this.dueDate ? Math.ceil((this.dueDate - this.startDate) / (1e3 * 60 * 60 * 24)) : null;
1405
+ });
1406
+ SprintSchema.index({ initiative: 1, status: 1 });
1407
+ SprintSchema.index({ owner: 1 });
1408
+ SprintSchema.index({ dueDate: 1 });
1409
+ SprintSchema.index({ "dependencies.sprint": 1 });
1410
+ const Sprint = db.mongoose.model("Sprint", SprintSchema);
1411
+ return Sprint;
1412
+ };
1413
+ const ModelTask = (db) => {
1414
+ const TaskSchema = new db.mongoose.Schema(
1415
+ {
1416
+ title: {
1417
+ type: String,
1418
+ required: true
1419
+ },
1420
+ description: {
1421
+ type: String
1422
+ },
1423
+ status: {
1424
+ type: String,
1425
+ enum: ["proposed", "voting", "not_started", "in_progress", "review", "completed", "blocked", "cancelled"],
1426
+ default: "not_started"
1427
+ },
1428
+ assignedTo: {
1429
+ type: db.mongoose.Schema.Types.ObjectId,
1430
+ ref: "User"
1431
+ },
1432
+ dueDate: {
1433
+ type: Date
1434
+ },
1435
+ // Reference to sprint
1436
+ sprint: {
1437
+ type: db.mongoose.Schema.Types.ObjectId,
1438
+ ref: "Sprint"
1439
+ },
1440
+ initiative: {
1441
+ type: db.mongoose.Schema.Types.ObjectId,
1442
+ ref: "Initiative"
1443
+ },
1444
+ // Added priority
1445
+ priority: {
1446
+ type: String,
1447
+ enum: ["low", "medium", "high", "urgent"],
1448
+ default: "medium"
1449
+ },
1450
+ // Added tags
1451
+ tags: [
1452
+ {
1453
+ type: String
1454
+ }
1455
+ ],
1456
+ // Voting references
1457
+ proposedByVoting: {
1458
+ type: db.mongoose.Schema.Types.ObjectId,
1459
+ ref: "Voting"
1460
+ },
1461
+ completionVoting: {
1462
+ type: db.mongoose.Schema.Types.ObjectId,
1463
+ ref: "Voting"
1464
+ },
1465
+ completedDate: {
1466
+ type: Date
1467
+ }
1468
+ },
1469
+ {
1470
+ timestamps: { currentTime: () => Date.now() }
1471
+ }
1472
+ );
1473
+ TaskSchema.index({ sprint: 1 });
1474
+ TaskSchema.index({ assignedTo: 1 });
1475
+ TaskSchema.index({ status: 1 });
1476
+ TaskSchema.index({ dueDate: 1 });
1477
+ const Task = db.mongoose.model("Task", TaskSchema);
1478
+ return Task;
1479
+ };
1480
+ const ModelVote = (db) => {
1481
+ const VoteSchema = new db.mongoose.Schema(
1482
+ {
1483
+ value: { type: Number, required: true },
1484
+ voter: {
1485
+ type: db.mongoose.Schema.Types.ObjectId,
1486
+ ref: "User",
1487
+ required: true
1488
+ },
1489
+ voting: {
1490
+ type: db.mongoose.Schema.Types.ObjectId,
1491
+ ref: "Voting",
1492
+ required: true
1493
+ }
1494
+ },
1495
+ {
1496
+ timestamps: { currentTime: () => Date.now() }
1497
+ }
1498
+ );
1499
+ const Vote = db.mongoose.model("Vote", VoteSchema);
1500
+ return Vote;
1501
+ };
1502
+ const ModelVoting = (db) => {
1503
+ const VotingSchema = new db.mongoose.Schema(
1504
+ {
1505
+ title: { type: String, required: true },
1506
+ description: { type: String },
1507
+ type: {
1508
+ type: String,
1509
+ enum: ["create_task", "approve_task", "create_initiative", "update_sprint", "general"],
1510
+ default: "general",
1511
+ required: true
1512
+ },
1513
+ targetModel: {
1514
+ type: String,
1515
+ enum: ["Task", "Initiative", "Sprint", null]
1516
+ },
1517
+ targetId: {
1518
+ type: db.mongoose.Schema.Types.ObjectId
1519
+ },
1520
+ threshold: {
1521
+ type: Number,
1522
+ default: 51,
1523
+ // Percentage needed for approval
1524
+ min: 1,
1525
+ max: 100
1526
+ },
1527
+ participants: [
1528
+ {
1529
+ type: db.mongoose.Schema.Types.ObjectId,
1530
+ ref: "User"
1531
+ }
1532
+ ],
1533
+ result: {
1534
+ type: String,
1535
+ enum: ["pending", "approved", "rejected"],
1536
+ default: "pending"
1537
+ },
1538
+ initiative: {
1539
+ type: db.mongoose.Schema.Types.ObjectId,
1540
+ ref: "Initiative"
1541
+ },
1542
+ sprint: {
1543
+ type: db.mongoose.Schema.Types.ObjectId,
1544
+ ref: "Sprint"
1545
+ },
1546
+ task: {
1547
+ type: db.mongoose.Schema.Types.ObjectId,
1548
+ ref: "Task"
1549
+ },
1550
+ metadata: {
1551
+ type: Object
1552
+ // For storing additional data like taskData for create_task voting
1553
+ },
1554
+ startDate: {
1555
+ type: Date,
1556
+ default: Date.now
1557
+ },
1558
+ endDate: {
1559
+ type: Date
1560
+ },
1561
+ status: {
1562
+ type: String,
1563
+ enum: ["pending", "active", "closed"],
1564
+ default: "pending"
1565
+ },
1566
+ votes: [
1567
+ {
1568
+ type: db.mongoose.Schema.Types.ObjectId,
1569
+ ref: "Vote"
1570
+ }
1571
+ ]
1572
+ },
1573
+ {
1574
+ timestamps: { currentTime: () => Date.now() },
1575
+ toJSON: { virtuals: true },
1576
+ toObject: { virtuals: true }
1577
+ }
1578
+ );
1579
+ VotingSchema.virtual("voteCount").get(function() {
1580
+ return this.votes ? this.votes.length : 0;
1581
+ });
1582
+ VotingSchema.virtual("isActive").get(function() {
1583
+ const now = /* @__PURE__ */ new Date();
1584
+ return this.status === "active" || this.status === "pending" && (!this.endDate || this.endDate > now);
1585
+ });
1586
+ VotingSchema.index({ initiative: 1 });
1587
+ VotingSchema.index({ sprint: 1 });
1588
+ VotingSchema.index({ task: 1 });
1589
+ VotingSchema.index({ type: 1, targetId: 1 });
1590
+ VotingSchema.index({ result: 1 });
1591
+ const Voting = db.mongoose.model("Voting", VotingSchema);
1592
+ return Voting;
1593
+ };
1594
+ function initializeGovernance({ app, db, origins, publicPath }) {
1595
+ db.initiative = ModelInitiative(db);
1596
+ db.sprint = ModelSprint(db);
1597
+ db.task = ModelTask(db);
1598
+ db.voting = ModelVoting(db);
1599
+ db.vote = ModelVote(db);
1600
+ if (app) {
1601
+ RoutesInitiative(app, db);
1602
+ RoutesSprint(app, db);
1603
+ RoutesTask(app, db);
1604
+ RoutesVoting(app, db);
1605
+ RoutesVote(app, db);
1606
+ }
1607
+ }
1608
+ const models = {
1609
+ ModelInitiative,
1610
+ ModelSprint,
1611
+ ModelTask,
1612
+ ModelVoting,
1613
+ ModelVote
1614
+ };
1615
+ const routes = {
1616
+ RoutesInitiative,
1617
+ RoutesSprint,
1618
+ RoutesTask,
1619
+ RoutesVoting,
1620
+ RoutesVote
1621
+ };
1622
+ const governance_server = {
1623
+ initialize: initializeGovernance,
1624
+ models,
1625
+ routes
1626
+ };
1627
+ export {
1628
+ governance_server as default,
1629
+ initializeGovernance as initialize,
1630
+ models,
1631
+ routes
1632
+ };