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