@ozdao/martyrs 0.2.459 → 0.2.461
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/dist/{Media-Df1hO2ZT.mjs → Media-BKlUty0j.mjs} +1 -1
- package/dist/{Media-B9V7fmz-.js → Media-ChTgw58S.js} +1 -1
- package/dist/chats.server.js +11 -18
- package/dist/chats.server.mjs +11 -18
- package/dist/globals.server.js +104 -1
- package/dist/globals.server.mjs +104 -1
- package/dist/{main-DviXUDiB.js → main-DIXWgUWx.js} +2 -2
- package/dist/{main-DbrX42CV.mjs → main-Q8Dr1-HT.mjs} +2 -2
- package/dist/martyrs/src/components/Block/Block.vue.cjs +1 -1
- package/dist/martyrs/src/components/Block/Block.vue.js +1 -1
- package/dist/martyrs/src/components/Button/Button.vue2.cjs +1 -1
- package/dist/martyrs/src/components/Button/Button.vue2.js +1 -1
- package/dist/martyrs/src/components/Chips/{Chips.vue2.cjs → Chips.vue.cjs} +2 -2
- package/dist/martyrs/src/components/Chips/Chips.vue.cjs.map +1 -0
- package/dist/martyrs/src/components/Chips/{Chips.vue2.js → Chips.vue.js} +2 -2
- package/dist/martyrs/src/components/Chips/Chips.vue.js.map +1 -0
- package/dist/martyrs/src/components/Dropdown/{Dropdown.vue.cjs → Dropdown.vue2.cjs} +2 -2
- package/dist/martyrs/src/components/Dropdown/Dropdown.vue2.cjs.map +1 -0
- package/dist/martyrs/src/components/Dropdown/{Dropdown.vue.js → Dropdown.vue2.js} +2 -2
- package/dist/martyrs/src/components/Dropdown/{Dropdown.vue.cjs.map → Dropdown.vue2.js.map} +1 -1
- package/dist/martyrs/src/components/Feed/Feed.vue.cjs +3 -3
- package/dist/martyrs/src/components/Feed/Feed.vue.cjs.map +1 -1
- package/dist/martyrs/src/components/Feed/Feed.vue.js +3 -3
- package/dist/martyrs/src/components/Feed/Feed.vue.js.map +1 -1
- package/dist/martyrs/src/components/Loader/{Loader.vue2.cjs → Loader.vue.cjs} +2 -2
- package/dist/martyrs/src/components/Loader/{Loader.vue2.js.map → Loader.vue.cjs.map} +1 -1
- package/dist/martyrs/src/components/Loader/{Loader.vue2.js → Loader.vue.js} +2 -2
- package/dist/martyrs/src/components/Loader/Loader.vue.js.map +1 -0
- package/dist/martyrs/src/components/LocationMarker/LocationMarker.vue2.cjs +1 -1
- package/dist/martyrs/src/components/LocationMarker/LocationMarker.vue2.js +1 -1
- package/dist/martyrs/src/components/Menu/{Menu.vue.cjs → Menu.vue2.cjs} +2 -2
- package/dist/martyrs/src/components/Menu/Menu.vue2.cjs.map +1 -0
- package/dist/martyrs/src/components/Menu/{Menu.vue.js → Menu.vue2.js} +2 -2
- package/dist/martyrs/src/components/Menu/Menu.vue2.js.map +1 -0
- package/dist/martyrs/src/components/SelectMulti/{SelectMulti.vue2.cjs → SelectMulti.vue.cjs} +2 -2
- package/dist/martyrs/src/components/SelectMulti/{SelectMulti.vue2.js.map → SelectMulti.vue.cjs.map} +1 -1
- package/dist/martyrs/src/components/SelectMulti/{SelectMulti.vue2.js → SelectMulti.vue.js} +2 -2
- package/dist/martyrs/src/components/SelectMulti/SelectMulti.vue.js.map +1 -0
- package/dist/martyrs/src/components/Slider/Slider.native.vue.cjs +1 -1
- package/dist/martyrs/src/components/Slider/Slider.native.vue.js +1 -1
- package/dist/martyrs/src/components/Tab/{Tab.vue2.cjs → Tab.vue.cjs} +2 -2
- package/dist/martyrs/src/components/Tab/{Tab.vue2.js.map → Tab.vue.cjs.map} +1 -1
- package/dist/martyrs/src/components/Tab/{Tab.vue2.js → Tab.vue.js} +2 -2
- package/dist/martyrs/src/components/Tab/Tab.vue.js.map +1 -0
- package/dist/martyrs/src/components/Tooltip/{Tooltip.vue2.cjs → Tooltip.vue.cjs} +2 -2
- package/dist/martyrs/src/components/Tooltip/{Tooltip.vue2.js.map → Tooltip.vue.cjs.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/UploadImageMultiple/UploadImageMultiple.vue.cjs +1 -1
- package/dist/martyrs/src/components/UploadImageMultiple/UploadImageMultiple.vue.js +1 -1
- package/dist/martyrs/src/modules/auth/views/components/layouts/Auth.vue.cjs +2 -2
- package/dist/martyrs/src/modules/auth/views/components/layouts/Auth.vue.js +2 -2
- package/dist/martyrs/src/modules/auth/views/components/pages/EnterPassword.vue.cjs +1 -1
- package/dist/martyrs/src/modules/auth/views/components/pages/EnterPassword.vue.js +1 -1
- package/dist/martyrs/src/modules/auth/views/components/pages/Invite.vue.cjs +1 -1
- package/dist/martyrs/src/modules/auth/views/components/pages/Invite.vue.js +1 -1
- package/dist/martyrs/src/modules/auth/views/components/pages/Profile.vue.cjs +3 -3
- package/dist/martyrs/src/modules/auth/views/components/pages/Profile.vue.js +3 -3
- package/dist/martyrs/src/modules/auth/views/components/pages/ProfileBlogposts.vue.cjs +1 -1
- package/dist/martyrs/src/modules/auth/views/components/pages/ProfileBlogposts.vue.js +1 -1
- package/dist/martyrs/src/modules/auth/views/components/pages/ProfileEdit.vue.cjs +1 -1
- package/dist/martyrs/src/modules/auth/views/components/pages/ProfileEdit.vue.js +1 -1
- package/dist/martyrs/src/modules/auth/views/components/pages/ResetPassword.vue.cjs +1 -1
- package/dist/martyrs/src/modules/auth/views/components/pages/ResetPassword.vue.js +1 -1
- package/dist/martyrs/src/modules/auth/views/components/pages/SignIn.vue.cjs +1 -1
- package/dist/martyrs/src/modules/auth/views/components/pages/SignIn.vue.js +1 -1
- package/dist/martyrs/src/modules/auth/views/components/pages/SignUp.vue.cjs +1 -1
- package/dist/martyrs/src/modules/auth/views/components/pages/SignUp.vue.js +1 -1
- package/dist/martyrs/src/modules/backoffice/components/partials/Sidebar.vue.cjs +1 -1
- package/dist/martyrs/src/modules/backoffice/components/partials/Sidebar.vue.js +1 -1
- package/dist/martyrs/src/modules/chats/components/sections/ChatWindow.vue.cjs +1 -0
- package/dist/martyrs/src/modules/chats/components/sections/ChatWindow.vue.cjs.map +1 -1
- package/dist/martyrs/src/modules/chats/components/sections/ChatWindow.vue.js +1 -0
- package/dist/martyrs/src/modules/chats/components/sections/ChatWindow.vue.js.map +1 -1
- package/dist/martyrs/src/modules/chats/store/chat.store.cjs +1 -1
- package/dist/martyrs/src/modules/chats/store/chat.store.cjs.map +1 -1
- package/dist/martyrs/src/modules/chats/store/chat.store.js +1 -1
- package/dist/martyrs/src/modules/chats/store/chat.store.js.map +1 -1
- package/dist/martyrs/src/modules/community/components/blocks/CardBlogpost.vue.cjs +1 -1
- package/dist/martyrs/src/modules/community/components/blocks/CardBlogpost.vue.js +1 -1
- package/dist/martyrs/src/modules/community/components/pages/BlogPost.vue.cjs +2 -2
- package/dist/martyrs/src/modules/community/components/pages/BlogPost.vue.js +2 -2
- package/dist/martyrs/src/modules/community/components/sections/Comment.vue.cjs +1 -1
- package/dist/martyrs/src/modules/community/components/sections/Comment.vue.cjs.map +1 -1
- package/dist/martyrs/src/modules/community/components/sections/Comment.vue.js +1 -1
- package/dist/martyrs/src/modules/community/components/sections/Comment.vue.js.map +1 -1
- package/dist/martyrs/src/modules/community/components/sections/HotPosts.vue.cjs +2 -2
- package/dist/martyrs/src/modules/community/components/sections/HotPosts.vue.js +2 -2
- package/dist/martyrs/src/modules/events/components/blocks/CardEvent.vue.cjs +1 -1
- package/dist/martyrs/src/modules/events/components/blocks/CardEvent.vue.js +1 -1
- package/dist/martyrs/src/modules/events/components/pages/EditEvent.vue.cjs +2 -2
- package/dist/martyrs/src/modules/events/components/pages/EditEvent.vue.js +2 -2
- package/dist/martyrs/src/modules/events/components/pages/Event.vue.cjs +2 -2
- package/dist/martyrs/src/modules/events/components/pages/Event.vue.js +2 -2
- package/dist/martyrs/src/modules/events/components/pages/EventsBackoffice.vue.cjs +1 -1
- package/dist/martyrs/src/modules/events/components/pages/EventsBackoffice.vue.js +1 -1
- package/dist/martyrs/src/modules/events/components/sections/EventsHot.vue.cjs +2 -2
- package/dist/martyrs/src/modules/events/components/sections/EventsHot.vue.js +2 -2
- package/dist/martyrs/src/modules/events/components/sections/Feed.vue.cjs +1 -1
- package/dist/martyrs/src/modules/events/components/sections/Feed.vue.js +1 -1
- package/dist/martyrs/src/modules/events/components/sections/List.vue.cjs +1 -1
- package/dist/martyrs/src/modules/events/components/sections/List.vue.js +1 -1
- package/dist/martyrs/src/modules/gallery/components/sections/BackofficeGallery.vue.cjs +2 -2
- package/dist/martyrs/src/modules/gallery/components/sections/BackofficeGallery.vue.js +2 -2
- package/dist/martyrs/src/modules/globals/views/components/blocks/CardHeader.vue.cjs +4 -4
- package/dist/martyrs/src/modules/globals/views/components/blocks/CardHeader.vue.cjs.map +1 -1
- package/dist/martyrs/src/modules/globals/views/components/blocks/CardHeader.vue.js +4 -4
- package/dist/martyrs/src/modules/globals/views/components/blocks/CardHeader.vue.js.map +1 -1
- package/dist/martyrs/src/modules/globals/views/components/blocks/PopupDateSelector.vue.cjs +1 -1
- package/dist/martyrs/src/modules/globals/views/components/blocks/PopupDateSelector.vue.js +1 -1
- package/dist/martyrs/src/modules/globals/views/components/layouts/Client.vue.cjs +1 -1
- package/dist/martyrs/src/modules/globals/views/components/layouts/Client.vue.js +1 -1
- package/dist/martyrs/src/modules/globals/views/components/partials/Navigation.vue.cjs +1 -1
- package/dist/martyrs/src/modules/globals/views/components/partials/Navigation.vue.js +1 -1
- package/dist/martyrs/src/modules/globals/views/components/sections/SectionPageTitle.vue.cjs +1 -1
- package/dist/martyrs/src/modules/globals/views/components/sections/SectionPageTitle.vue.js +1 -1
- package/dist/martyrs/src/modules/globals/views/plugins/AlertDialog.vue.cjs +1 -1
- package/dist/martyrs/src/modules/globals/views/plugins/AlertDialog.vue.cjs.map +1 -1
- package/dist/martyrs/src/modules/globals/views/plugins/AlertDialog.vue.js +1 -1
- package/dist/martyrs/src/modules/globals/views/plugins/AlertDialog.vue.js.map +1 -1
- package/dist/martyrs/src/modules/icons/entities/IconTime.vue.cjs +4 -3
- package/dist/martyrs/src/modules/icons/entities/IconTime.vue.cjs.map +1 -1
- package/dist/martyrs/src/modules/icons/entities/IconTime.vue.js +5 -4
- package/dist/martyrs/src/modules/icons/entities/IconTime.vue.js.map +1 -1
- package/dist/martyrs/src/modules/marketplace/views/components/sections/SectionMenu.vue.cjs +1 -1
- package/dist/martyrs/src/modules/marketplace/views/components/sections/SectionMenu.vue.js +1 -1
- package/dist/martyrs/src/modules/notifications/notifications.client.cjs +2 -61
- package/dist/martyrs/src/modules/notifications/notifications.client.cjs.map +1 -1
- package/dist/martyrs/src/modules/notifications/notifications.client.js +2 -61
- package/dist/martyrs/src/modules/notifications/notifications.client.js.map +1 -1
- package/dist/martyrs/src/modules/orders/components/blocks/CardOrderUser.vue.cjs +1 -1
- package/dist/martyrs/src/modules/orders/components/blocks/CardOrderUser.vue.js +1 -1
- package/dist/martyrs/src/modules/orders/components/pages/OrderBackoffice.vue.cjs +1 -1
- package/dist/martyrs/src/modules/orders/components/pages/OrderBackoffice.vue.js +1 -1
- package/dist/martyrs/src/modules/orders/components/pages/OrderCreate.vue.cjs +1 -0
- package/dist/martyrs/src/modules/orders/components/pages/OrderCreate.vue.cjs.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.cjs +2 -2
- package/dist/martyrs/src/modules/orders/components/pages/OrderCreateBackoffice.vue.js +2 -2
- package/dist/martyrs/src/modules/orders/components/pages/Orders.vue.cjs +1 -1
- package/dist/martyrs/src/modules/orders/components/pages/Orders.vue.js +1 -1
- package/dist/martyrs/src/modules/orders/components/partials/ShopCart.vue.cjs +1 -1
- package/dist/martyrs/src/modules/orders/components/partials/ShopCart.vue.cjs.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/AskToLogin.vue.cjs +2 -2
- package/dist/martyrs/src/modules/orders/components/sections/AskToLogin.vue.cjs.map +1 -1
- package/dist/martyrs/src/modules/orders/components/sections/AskToLogin.vue.js +2 -2
- package/dist/martyrs/src/modules/orders/components/sections/AskToLogin.vue.js.map +1 -1
- package/dist/martyrs/src/modules/orders/components/sections/FormDelivery.vue.cjs +2 -2
- package/dist/martyrs/src/modules/orders/components/sections/FormDelivery.vue.js +2 -2
- package/dist/martyrs/src/modules/organizations/components/blocks/CardOrganization.vue.cjs +13 -17
- package/dist/martyrs/src/modules/organizations/components/blocks/CardOrganization.vue.cjs.map +1 -1
- package/dist/martyrs/src/modules/organizations/components/blocks/CardOrganization.vue.js +16 -20
- package/dist/martyrs/src/modules/organizations/components/blocks/CardOrganization.vue.js.map +1 -1
- package/dist/martyrs/src/modules/organizations/components/pages/DepartmentEdit.vue.cjs +2 -2
- package/dist/martyrs/src/modules/organizations/components/pages/DepartmentEdit.vue.js +2 -2
- package/dist/martyrs/src/modules/organizations/components/pages/Members.vue.cjs +3 -3
- package/dist/martyrs/src/modules/organizations/components/pages/Members.vue.js +3 -3
- package/dist/martyrs/src/modules/organizations/components/pages/Organization.vue.cjs +2 -2
- package/dist/martyrs/src/modules/organizations/components/pages/Organization.vue.js +2 -2
- package/dist/martyrs/src/modules/organizations/components/pages/OrganizationBackoffice.vue.cjs +2 -2
- package/dist/martyrs/src/modules/organizations/components/pages/OrganizationBackoffice.vue.js +2 -2
- package/dist/martyrs/src/modules/organizations/components/pages/OrganizationEdit.vue.cjs +2 -2
- package/dist/martyrs/src/modules/organizations/components/pages/OrganizationEdit.vue.js +2 -2
- package/dist/martyrs/src/modules/organizations/components/pages/Organizations.vue.cjs +1 -1
- package/dist/martyrs/src/modules/organizations/components/pages/Organizations.vue.js +1 -1
- package/dist/martyrs/src/modules/organizations/components/sections/DetailsTabSection.vue.cjs +2 -2
- package/dist/martyrs/src/modules/organizations/components/sections/DetailsTabSection.vue.js +2 -2
- package/dist/martyrs/src/modules/organizations/components/sections/Documents.vue.cjs +1 -1
- package/dist/martyrs/src/modules/organizations/components/sections/Documents.vue.js +1 -1
- package/dist/martyrs/src/modules/organizations/components/sections/Organizations.vue.cjs +2 -2
- package/dist/martyrs/src/modules/organizations/components/sections/Organizations.vue.js +2 -2
- package/dist/martyrs/src/modules/pages/views/components/blocks/CardPage.vue.cjs +1 -1
- package/dist/martyrs/src/modules/pages/views/components/blocks/CardPage.vue.js +1 -1
- package/dist/martyrs/src/modules/pages/views/components/pages/PageEdit.vue.cjs +1 -1
- package/dist/martyrs/src/modules/pages/views/components/pages/PageEdit.vue.js +1 -1
- package/dist/martyrs/src/modules/products/components/blocks/CardPosition.vue.cjs +1 -1
- package/dist/martyrs/src/modules/products/components/blocks/CardPosition.vue.js +1 -1
- package/dist/martyrs/src/modules/products/components/blocks/Images360.vue.cjs +1 -1
- package/dist/martyrs/src/modules/products/components/blocks/Images360.vue.js +1 -1
- package/dist/martyrs/src/modules/products/components/pages/Categories.vue.cjs +2 -2
- package/dist/martyrs/src/modules/products/components/pages/Categories.vue.js +2 -2
- package/dist/martyrs/src/modules/products/components/pages/CategoryEdit.vue.cjs +2 -2
- package/dist/martyrs/src/modules/products/components/pages/CategoryEdit.vue.js +2 -2
- package/dist/martyrs/src/modules/products/components/pages/EditLeftover.vue.cjs +1 -1
- package/dist/martyrs/src/modules/products/components/pages/EditLeftover.vue.js +1 -1
- package/dist/martyrs/src/modules/products/components/pages/Leftovers.vue.cjs +1 -1
- package/dist/martyrs/src/modules/products/components/pages/Leftovers.vue.js +1 -1
- package/dist/martyrs/src/modules/products/components/pages/Product.vue.cjs +4 -4
- package/dist/martyrs/src/modules/products/components/pages/Product.vue.cjs.map +1 -1
- package/dist/martyrs/src/modules/products/components/pages/Product.vue.js +4 -4
- package/dist/martyrs/src/modules/products/components/pages/Product.vue.js.map +1 -1
- package/dist/martyrs/src/modules/products/components/pages/ProductEdit.vue.cjs +1 -1
- package/dist/martyrs/src/modules/products/components/pages/ProductEdit.vue.js +1 -1
- package/dist/martyrs/src/modules/products/components/pages/ProductRecommmendation.vue.cjs +1 -1
- package/dist/martyrs/src/modules/products/components/pages/ProductRecommmendation.vue.js +1 -1
- package/dist/martyrs/src/modules/products/components/pages/Products.vue.cjs +1 -1
- package/dist/martyrs/src/modules/products/components/pages/Products.vue.js +1 -1
- package/dist/martyrs/src/modules/products/components/sections/EditProductInfo.vue.cjs +1 -1
- package/dist/martyrs/src/modules/products/components/sections/EditProductInfo.vue.js +1 -1
- package/dist/martyrs/src/modules/products/components/sections/PopularProducts.vue.cjs +1 -1
- package/dist/martyrs/src/modules/products/components/sections/PopularProducts.vue.js +1 -1
- package/dist/martyrs/src/modules/products/components/sections/SectionProduct.vue.cjs +1 -1
- package/dist/martyrs/src/modules/products/components/sections/SectionProduct.vue.js +1 -1
- package/dist/martyrs/src/modules/rents/views/components/pages/GanttChart.vue.cjs +1 -1
- package/dist/martyrs/src/modules/rents/views/components/pages/GanttChart.vue.js +1 -1
- package/dist/martyrs/src/modules/rents/views/components/pages/Rents.vue.cjs +1 -1
- package/dist/martyrs/src/modules/rents/views/components/pages/Rents.vue.js +1 -1
- package/dist/martyrs/src/modules/rents/views/components/pages/RentsEdit.vue.cjs +1 -1
- package/dist/martyrs/src/modules/rents/views/components/pages/RentsEdit.vue.js +1 -1
- package/dist/martyrs/src/modules/spots/components/blocks/CardSpot.vue.cjs +1 -1
- package/dist/martyrs/src/modules/spots/components/blocks/CardSpot.vue.js +1 -1
- package/dist/martyrs/src/modules/spots/components/layouts/Spots.vue.cjs +1 -1
- package/dist/martyrs/src/modules/spots/components/layouts/Spots.vue.js +1 -1
- package/dist/martyrs/src/modules/spots/components/pages/SpotEdit.vue.cjs +1 -1
- package/dist/martyrs/src/modules/spots/components/pages/SpotEdit.vue.js +1 -1
- package/dist/martyrs.cjs.js +1 -1
- package/dist/martyrs.es.js +1 -1
- package/dist/notifications.server.js +1 -85
- package/dist/notifications.server.mjs +1 -85
- package/dist/orders.server.js +124 -109
- package/dist/orders.server.mjs +124 -109
- package/package.json +1 -1
- package/src/components/Feed/Feed.vue +1 -1
- package/src/modules/chats/components/sections/ChatWindow.vue +1 -0
- package/src/modules/chats/routes/chats.routes.js +10 -20
- package/src/modules/chats/store/chat.store.js +1 -1
- package/src/modules/community/components/sections/Comment.vue +1 -1
- package/src/modules/globals/controllers/classes/globals.websocket.js +116 -0
- package/src/modules/globals/globals.server.js +3 -0
- package/src/modules/globals/views/components/blocks/CardHeader.vue +1 -1
- package/src/modules/globals/views/plugins/AlertDialog.vue +1 -1
- package/src/modules/icons/entities/IconTime.vue +1 -1
- package/src/modules/notifications/notifications.client.js +2 -79
- package/src/modules/notifications/services/notification.service.js +2 -2
- package/src/modules/orders/components/pages/OrderCreate.vue +6 -1
- package/src/modules/orders/components/partials/ShopCart.vue +1 -1
- package/src/modules/orders/components/sections/AskToLogin.vue +2 -1
- package/src/modules/orders/controllers/orders.controller.js +49 -35
- package/src/modules/organizations/components/blocks/CardOrganization.vue +10 -9
- package/src/modules/products/components/pages/Product.vue +3 -3
- package/dist/martyrs/src/components/Chips/Chips.vue2.cjs.map +0 -1
- package/dist/martyrs/src/components/Chips/Chips.vue2.js.map +0 -1
- package/dist/martyrs/src/components/Dropdown/Dropdown.vue.js.map +0 -1
- package/dist/martyrs/src/components/Loader/Loader.vue2.cjs.map +0 -1
- package/dist/martyrs/src/components/Menu/Menu.vue.cjs.map +0 -1
- package/dist/martyrs/src/components/Menu/Menu.vue.js.map +0 -1
- package/dist/martyrs/src/components/SelectMulti/SelectMulti.vue2.cjs.map +0 -1
- package/dist/martyrs/src/components/Tab/Tab.vue2.cjs.map +0 -1
- package/dist/martyrs/src/components/Tooltip/Tooltip.vue2.cjs.map +0 -1
- package/src/components/AskToLogin/AskToLogin.vue +0 -22
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
const { WebSocketServer } = require('ws');
|
|
2
|
+
const jwt = require('jsonwebtoken');
|
|
3
|
+
|
|
4
|
+
class WebSocketManager {
|
|
5
|
+
constructor(server) {
|
|
6
|
+
this.wss = new WebSocketServer({
|
|
7
|
+
server,
|
|
8
|
+
verifyClient: this.verifyClient.bind(this)
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
this.modules = new Map(); // moduleName => handler
|
|
12
|
+
this.userConnections = new Map(); // userId => Set(ws)
|
|
13
|
+
|
|
14
|
+
this.wss.on('connection', (ws, req) => {
|
|
15
|
+
ws.moduleName = null;
|
|
16
|
+
ws.userId = req.userId || null;
|
|
17
|
+
|
|
18
|
+
if (ws.userId) {
|
|
19
|
+
this._trackUserConnection(ws.userId, ws);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
ws.on('message', async (rawMessage) => {
|
|
23
|
+
try {
|
|
24
|
+
const msg = JSON.parse(rawMessage);
|
|
25
|
+
console.log(msg)
|
|
26
|
+
const moduleName = ws.moduleName || msg.module;
|
|
27
|
+
|
|
28
|
+
console.log('module name is,', moduleName)
|
|
29
|
+
console.log('modules is,', this.modules)
|
|
30
|
+
|
|
31
|
+
if (moduleName && this.modules.has(moduleName)) {
|
|
32
|
+
ws.moduleName = moduleName;
|
|
33
|
+
const handler = this.modules.get(moduleName);
|
|
34
|
+
await handler(ws, msg);
|
|
35
|
+
}
|
|
36
|
+
} catch (err) {
|
|
37
|
+
console.error('Invalid message or handler error:', err);
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
ws.on('close', () => {
|
|
42
|
+
if (ws.userId && this.userConnections.has(ws.userId)) {
|
|
43
|
+
this.userConnections.get(ws.userId).delete(ws);
|
|
44
|
+
if (this.userConnections.get(ws.userId).size === 0) {
|
|
45
|
+
this.userConnections.delete(ws.userId);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
verifyClient(info, done) {
|
|
53
|
+
try {
|
|
54
|
+
const userCookie = info.req.headers.cookie
|
|
55
|
+
?.split('; ')
|
|
56
|
+
.find((cookie) => cookie.startsWith('user='));
|
|
57
|
+
|
|
58
|
+
if (!userCookie) return done(true);
|
|
59
|
+
|
|
60
|
+
const token = JSON.parse(decodeURIComponent(userCookie.replace('user=', '')));
|
|
61
|
+
const decoded = jwt.verify(token.accessToken, process.env.SECRET_KEY);
|
|
62
|
+
|
|
63
|
+
info.req.userId = decoded._id;
|
|
64
|
+
} catch (err) {
|
|
65
|
+
console.error('Invalid token:', err);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
done(true); // Разрешаем в любом случае
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
_trackUserConnection(userId, ws) {
|
|
72
|
+
if (!this.userConnections.has(userId)) {
|
|
73
|
+
this.userConnections.set(userId, new Set());
|
|
74
|
+
}
|
|
75
|
+
this.userConnections.get(userId).add(ws);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
registerModule(moduleName, handler) {
|
|
79
|
+
this.modules.set(moduleName, handler);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
sendToUserInModule(moduleName, userId, data) {
|
|
83
|
+
const sockets = this.userConnections.get(userId);
|
|
84
|
+
if (!sockets) return;
|
|
85
|
+
|
|
86
|
+
for (const ws of sockets) {
|
|
87
|
+
if (ws.readyState === 1 && ws.moduleName === moduleName) {
|
|
88
|
+
ws.send(JSON.stringify(data));
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
broadcastToModule(moduleName, data) {
|
|
94
|
+
for (const ws of this.wss.clients) {
|
|
95
|
+
if (ws.readyState === 1 && ws.moduleName === moduleName) {
|
|
96
|
+
ws.send(JSON.stringify(data));
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
broadcastToModuleWithFilter(moduleName, filterFn, data) {
|
|
102
|
+
for (const ws of this.wss.clients) {
|
|
103
|
+
if (ws.readyState !== 1) continue;
|
|
104
|
+
if (ws.moduleName !== moduleName) continue;
|
|
105
|
+
if (!filterFn(ws)) continue;
|
|
106
|
+
|
|
107
|
+
ws.send(JSON.stringify(data));
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
getServer() {
|
|
112
|
+
return this.wss;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
module.exports = WebSocketManager;
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
const { getInstance } = require('@martyrs/src/modules/globals/controllers/classes/globals.abac.js')
|
|
3
3
|
const initGlobalsPolicies = require('./controllers/policies/globals.policies.js');
|
|
4
4
|
|
|
5
|
+
const WebSocketManager = require('@martyrs/src/modules/globals/controllers/classes/globals.websocket.js');
|
|
6
|
+
|
|
5
7
|
function initializeGlobals(app, db, origins, publicPath) {
|
|
6
8
|
// Определяем модель Log только здесь
|
|
7
9
|
db.log = db.mongoose.models.Log || db.mongoose.model('Log', new db.mongoose.Schema({
|
|
@@ -16,4 +18,5 @@ function initializeGlobals(app, db, origins, publicPath) {
|
|
|
16
18
|
|
|
17
19
|
module.exports = {
|
|
18
20
|
initialize: initializeGlobals,
|
|
21
|
+
WebSocketManager
|
|
19
22
|
};
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
:title="alertState.title"
|
|
4
4
|
:isPopupOpen="alertState.visible"
|
|
5
5
|
@close-popup="closeAlert"
|
|
6
|
-
class="bg-white w-min-
|
|
6
|
+
class="bg-white w-min-20r w-max-30r w-max-100 radius-medium pd-medium"
|
|
7
7
|
>
|
|
8
8
|
<p class="mn-b-medium">{{ alertState.message }}</p>
|
|
9
9
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<svg width="50" height="49" viewBox="0 0 50 49" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
3
|
-
<path d="M24.7274 45.2266C13.2178 45.2266 3.85356 35.8624 3.85356 24.3528C3.85356 12.8432 13.2178 3.47897 24.7274 3.47897C36.237 3.47897 45.6012 12.8432 45.6012 24.3528C45.6012 35.8624 36.237 45.2266 24.7274 45.2266ZM24.7274 0C11.2777 0 0.374592 10.9031 0.374592 24.3528C0.374592 37.8025 11.2777 48.7056 24.7274 48.7056C38.1771 48.7056 49.0802 37.8025 49.0802 24.3528C49.0802 10.9031 38.1771 0 24.7274 0ZM34.0047 23.773H26.4669V11.5966C26.4669 11.1352 26.2836 10.6928 25.9574 10.3666C25.6312 10.0404 25.1887 9.85709 24.7274 9.85709C24.2661 9.85709 23.8236 10.0404 23.4974 10.3666C23.1712 10.6928 22.9879 11.1352 22.9879 11.5966V25.5125C22.9879 25.9738 23.1712 26.4162 23.4974 26.7425C23.8236 27.0687 24.2661 27.2519 24.7274 27.2519H34.0047C34.2331 27.2519 34.4593 27.207 34.6703 27.1195C34.8814 27.0321 35.0731 26.904 35.2347 26.7425C35.3962 26.5809 35.5243 26.3892 35.6117 26.1781C35.6991 25.9671 35.7441 25.7409 35.7441 25.5125C35.7441 25.284 35.6991 25.0578 35.6117 24.8468C35.5243 24.6357 35.3962 24.444 35.2347 24.2825C35.0731 24.1209 34.8814 23.9928 34.6703 23.9054C34.4593 23.818 34.2331 23.773 34.0047 23.773Z" fill="rgb(var(--black))"/>
|
|
3
|
+
<path d="M24.7274 45.2266C13.2178 45.2266 3.85356 35.8624 3.85356 24.3528C3.85356 12.8432 13.2178 3.47897 24.7274 3.47897C36.237 3.47897 45.6012 12.8432 45.6012 24.3528C45.6012 35.8624 36.237 45.2266 24.7274 45.2266ZM24.7274 0C11.2777 0 0.374592 10.9031 0.374592 24.3528C0.374592 37.8025 11.2777 48.7056 24.7274 48.7056C38.1771 48.7056 49.0802 37.8025 49.0802 24.3528C49.0802 10.9031 38.1771 0 24.7274 0ZM34.0047 23.773H26.4669V11.5966C26.4669 11.1352 26.2836 10.6928 25.9574 10.3666C25.6312 10.0404 25.1887 9.85709 24.7274 9.85709C24.2661 9.85709 23.8236 10.0404 23.4974 10.3666C23.1712 10.6928 22.9879 11.1352 22.9879 11.5966V25.5125C22.9879 25.9738 23.1712 26.4162 23.4974 26.7425C23.8236 27.0687 24.2661 27.2519 24.7274 27.2519H34.0047C34.2331 27.2519 34.4593 27.207 34.6703 27.1195C34.8814 27.0321 35.0731 26.904 35.2347 26.7425C35.3962 26.5809 35.5243 26.3892 35.6117 26.1781C35.6991 25.9671 35.7441 25.7409 35.7441 25.5125C35.7441 25.284 35.6991 25.0578 35.6117 24.8468C35.5243 24.6357 35.3962 24.444 35.2347 24.2825C35.0731 24.1209 34.8814 23.9928 34.6703 23.9054C34.4593 23.818 34.2331 23.773 34.0047 23.773Z" :class="$attrs.class" fill="rgb(var(--black))"/>
|
|
4
4
|
</svg>
|
|
5
5
|
</template>
|
|
@@ -18,82 +18,6 @@ import Notifications from './components/pages/Notifications.vue';
|
|
|
18
18
|
import NotificationBadge from './components/elements/NotificationBadge.vue';
|
|
19
19
|
import NotificationItem from './components/blocks/NotificationItem.vue';
|
|
20
20
|
|
|
21
|
-
/**
|
|
22
|
-
* WebSocket notification handler that uses the global WebSocket connection
|
|
23
|
-
*/
|
|
24
|
-
class WebSocketNotificationHandler {
|
|
25
|
-
constructor(store, options = {}) {
|
|
26
|
-
this.store = store;
|
|
27
|
-
this.options = options;
|
|
28
|
-
this.moduleName = 'notifications';
|
|
29
|
-
this.listeners = [];
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* Connect to notifications channel
|
|
34
|
-
*/
|
|
35
|
-
connect(userId) {
|
|
36
|
-
// Skip if running in SSR
|
|
37
|
-
if (typeof window === 'undefined' || !userId) {
|
|
38
|
-
return Promise.resolve(false);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
// First ensure the global WebSocket is connected
|
|
42
|
-
return globalWebSocket.connect(userId).then(() => {
|
|
43
|
-
// Register event listeners
|
|
44
|
-
this._registerListeners();
|
|
45
|
-
return true;
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
* Disconnect notification listeners
|
|
51
|
-
*/
|
|
52
|
-
disconnect() {
|
|
53
|
-
globalWebSocket.removeModuleListeners(this.moduleName);
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
/**
|
|
57
|
-
* Register notification event listeners
|
|
58
|
-
*/
|
|
59
|
-
_registerListeners() {
|
|
60
|
-
// Listen for notification events
|
|
61
|
-
this.listeners.push(
|
|
62
|
-
globalWebSocket.addEventListener('notification', this._processNotification.bind(this), {
|
|
63
|
-
module: this.moduleName
|
|
64
|
-
})
|
|
65
|
-
);
|
|
66
|
-
|
|
67
|
-
// Listen for notification read status changes
|
|
68
|
-
this.listeners.push(
|
|
69
|
-
globalWebSocket.addEventListener('notification_read', (data) => {
|
|
70
|
-
this.store.notifications.actions.syncNotificationStatus(data.notificationId, 'read');
|
|
71
|
-
}, { module: this.moduleName })
|
|
72
|
-
);
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
/**
|
|
76
|
-
* Process incoming notification
|
|
77
|
-
*/
|
|
78
|
-
_processNotification(data) {
|
|
79
|
-
if (!data || !data.data) return;
|
|
80
|
-
|
|
81
|
-
const notification = data.data;
|
|
82
|
-
|
|
83
|
-
// Add notification to store
|
|
84
|
-
this.store.notifications.actions.addLocalNotification({
|
|
85
|
-
_id: notification._id,
|
|
86
|
-
title: notification.title,
|
|
87
|
-
body: notification.body,
|
|
88
|
-
type: notification.type || 'info',
|
|
89
|
-
metadata: notification.metadata || {},
|
|
90
|
-
status: 'unread',
|
|
91
|
-
createdAt: notification.createdAt || new Date().toISOString(),
|
|
92
|
-
updatedAt: notification.updatedAt || new Date().toISOString()
|
|
93
|
-
});
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
|
|
97
21
|
/**
|
|
98
22
|
* Capacitor Push Notification handler
|
|
99
23
|
*/
|
|
@@ -258,7 +182,6 @@ class NotificationManager {
|
|
|
258
182
|
constructor(store, options = {}) {
|
|
259
183
|
this.store = store;
|
|
260
184
|
this.options = options;
|
|
261
|
-
this.wsHandler = new WebSocketNotificationHandler(store, options);
|
|
262
185
|
this.pushHandler = new CapacitorPushHandler(store);
|
|
263
186
|
this.initialized = false;
|
|
264
187
|
this.isServer = typeof window === 'undefined';
|
|
@@ -278,7 +201,7 @@ class NotificationManager {
|
|
|
278
201
|
}
|
|
279
202
|
|
|
280
203
|
// Initialize WebSocket for realtime notifications
|
|
281
|
-
await
|
|
204
|
+
await globalWebSocket.connect(userId);
|
|
282
205
|
|
|
283
206
|
// Initialize push notifications for mobile if enabled
|
|
284
207
|
if (this.options.enablePush !== false) {
|
|
@@ -297,7 +220,7 @@ class NotificationManager {
|
|
|
297
220
|
disconnect() {
|
|
298
221
|
if (this.isServer) return;
|
|
299
222
|
|
|
300
|
-
|
|
223
|
+
globalWebSocket.removeModuleListeners('notifications');
|
|
301
224
|
this.pushHandler.removeListeners();
|
|
302
225
|
this.initialized = false;
|
|
303
226
|
}
|
|
@@ -108,10 +108,10 @@ const NotificationService = (db, wss) => {
|
|
|
108
108
|
};
|
|
109
109
|
|
|
110
110
|
// Send web notification (for real-time notifications via WebSocket/SSE)
|
|
111
|
-
const webSocketService = require('./websocket.service')(wss);
|
|
111
|
+
// const webSocketService = require('./websocket.service')(wss);
|
|
112
112
|
|
|
113
113
|
const sendWebNotification = async (notification, user) => {
|
|
114
|
-
return
|
|
114
|
+
return wss.sendToUserInModule('notification', user._id, {
|
|
115
115
|
type: 'notification',
|
|
116
116
|
data: notification
|
|
117
117
|
});
|
|
@@ -163,10 +163,14 @@ const orderOrganization = ref({})
|
|
|
163
163
|
if (!globals.state.options.orders.allowUnauthenticatedOrders && !auth.state.user._id) {
|
|
164
164
|
router.push({name: 'Sign In'})
|
|
165
165
|
}
|
|
166
|
-
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
orders.mutations.resetOrder()
|
|
169
|
+
|
|
167
170
|
onMounted(async()=> {
|
|
168
171
|
isLocationLoading.value = true
|
|
169
172
|
|
|
173
|
+
|
|
170
174
|
if (auth.state.user._id) {
|
|
171
175
|
let data = await users.actions.read({ _id:auth.state.user._id, user: auth.state.user._id });
|
|
172
176
|
orders.state.current.customer.profile.name = users.state.current.profile.name
|
|
@@ -283,6 +287,7 @@ async function handleCreate() {
|
|
|
283
287
|
})
|
|
284
288
|
|
|
285
289
|
shopcart.actions.resetShopcart()
|
|
290
|
+
|
|
286
291
|
} else {
|
|
287
292
|
alert('something wrong')
|
|
288
293
|
}
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
<!-- ---------------------------------------------------------------- -->
|
|
14
14
|
<!-- 02. Popup Content -->
|
|
15
15
|
<!-- ---------------------------------------------------------------- -->
|
|
16
|
-
<div class="pd-big mobile:pd-medium h-70 flex flex-column w-100 pos-relative o-x-hidden o-y-scroll gap-small shopcart-content">
|
|
16
|
+
<div class="pd-big pd-t-zero mobile:pd-t-zero mobile:pd-medium h-70 flex flex-column w-100 pos-relative o-x-hidden o-y-scroll gap-small shopcart-content">
|
|
17
17
|
<!-- Empty State -->
|
|
18
18
|
<p v-if="!(shopcart.state.positions.length > 0)" class="mn-t-medium"><i>{{t('emptystate')}}</i></p>
|
|
19
19
|
<!-- Shopcart positions -->
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
flex-v-center
|
|
10
10
|
flex-nowrap
|
|
11
11
|
flex
|
|
12
|
+
mobile:flex-column
|
|
12
13
|
"
|
|
13
14
|
>
|
|
14
15
|
<!-- <img loading="lazy"
|
|
@@ -28,7 +29,7 @@
|
|
|
28
29
|
|
|
29
30
|
<button
|
|
30
31
|
@click="toggleSignInPopup()"
|
|
31
|
-
class="button h-4r bg-main"
|
|
32
|
+
class="button mobile:w-100 mobile:mn-t-small h-4r bg-main"
|
|
32
33
|
>
|
|
33
34
|
Sign In
|
|
34
35
|
</button>
|
|
@@ -24,47 +24,35 @@ function formatOrderMessage(order) {
|
|
|
24
24
|
|
|
25
25
|
async function findOrCreateCustomer(Customer, customerInfo, orderOwner, orderCreator) {
|
|
26
26
|
let searchCriteria = {};
|
|
27
|
-
|
|
28
27
|
if (customerInfo.phone) {
|
|
29
28
|
searchCriteria.phone = customerInfo.phone;
|
|
30
29
|
}
|
|
31
|
-
|
|
32
30
|
if (customerInfo.email) {
|
|
33
31
|
searchCriteria.email = customerInfo.email;
|
|
34
32
|
}
|
|
35
|
-
|
|
33
|
+
|
|
36
34
|
let customer = null;
|
|
37
|
-
|
|
38
35
|
// Проверяем, есть ли критерии для поиска
|
|
39
36
|
if (Object.keys(searchCriteria).length > 0) {
|
|
40
37
|
customer = await Customer.findOne({ $or: [searchCriteria] });
|
|
41
38
|
}
|
|
42
|
-
|
|
39
|
+
|
|
43
40
|
if (!customer) {
|
|
44
41
|
// Handle the case when creator.target is null
|
|
45
42
|
let creatorType = customerInfo.creator?.type || orderCreator.type;
|
|
46
43
|
let creatorTarget = customerInfo.creator?.target || orderCreator.target;
|
|
47
44
|
|
|
48
|
-
// If creator target is still null, use the
|
|
45
|
+
// If creator target is still null, use the organization as creator
|
|
49
46
|
if (!creatorTarget) {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
creatorTarget = new db.mongoose.Types.ObjectId();
|
|
53
|
-
} else if (creatorType === 'Visitor') {
|
|
54
|
-
// If it's a visitor, we could use the fingerprint from the request
|
|
55
|
-
// This assumes you have access to the request object or store fingerprint somewhere
|
|
56
|
-
const fingerprint = generateFingerprint(req); // Ensure this is accessible
|
|
57
|
-
creatorTarget = fingerprint;
|
|
58
|
-
} else {
|
|
59
|
-
// Fallback to using the organization as creator if available
|
|
60
|
-
creatorType = orderOwner.type;
|
|
61
|
-
creatorTarget = orderOwner.target;
|
|
62
|
-
}
|
|
47
|
+
creatorType = orderOwner.type;
|
|
48
|
+
creatorTarget = orderOwner.target;
|
|
63
49
|
}
|
|
64
|
-
|
|
50
|
+
|
|
65
51
|
// Create new customer with proper creator fields
|
|
66
52
|
const newCustomerData = {
|
|
67
53
|
...customerInfo,
|
|
54
|
+
// Ensure we're not passing any null _id that might override MongoDB's auto-generation
|
|
55
|
+
_id: undefined, // Let MongoDB generate this
|
|
68
56
|
owner: orderOwner,
|
|
69
57
|
creator: {
|
|
70
58
|
type: creatorType,
|
|
@@ -76,9 +64,19 @@ async function findOrCreateCustomer(Customer, customerInfo, orderOwner, orderCre
|
|
|
76
64
|
}
|
|
77
65
|
};
|
|
78
66
|
|
|
79
|
-
|
|
67
|
+
try {
|
|
68
|
+
customer = await Customer.create(newCustomerData);
|
|
69
|
+
// Verify the customer was created with an _id
|
|
70
|
+
if (!customer || !customer._id) {
|
|
71
|
+
console.error("Customer creation failed to generate _id:", customer);
|
|
72
|
+
throw new Error("Customer creation did not generate a valid _id");
|
|
73
|
+
}
|
|
74
|
+
} catch (err) {
|
|
75
|
+
console.error("Error creating customer:", err);
|
|
76
|
+
throw err;
|
|
77
|
+
}
|
|
80
78
|
}
|
|
81
|
-
|
|
79
|
+
|
|
82
80
|
return customer;
|
|
83
81
|
}
|
|
84
82
|
|
|
@@ -97,40 +95,56 @@ const controllerFactory = (db) => {
|
|
|
97
95
|
const Leftover = db.leftover;
|
|
98
96
|
|
|
99
97
|
// Создание заказа
|
|
100
|
-
|
|
98
|
+
const create = async (req, res) => {
|
|
101
99
|
const orderData = req.body;
|
|
102
|
-
|
|
103
|
-
|
|
100
|
+
const userId = req.userId || req.body.creator?.target;
|
|
101
|
+
|
|
104
102
|
orderData.status = 'created';
|
|
105
103
|
orderData.status_history = orderData.status_history || [];
|
|
106
104
|
|
|
107
105
|
orderData.status_history.push({
|
|
108
106
|
status: orderData.status,
|
|
109
|
-
// user: new db.mongoose.Types.ObjectId(userId),
|
|
110
107
|
timestamp: new Date(),
|
|
111
108
|
comment: ''
|
|
112
109
|
});
|
|
113
110
|
|
|
111
|
+
console.log('order.data is,', orderData);
|
|
112
|
+
|
|
114
113
|
// Start a database transaction
|
|
115
114
|
const session = await db.mongoose.startSession();
|
|
116
|
-
|
|
117
115
|
session.startTransaction();
|
|
118
116
|
|
|
119
117
|
try {
|
|
120
|
-
|
|
118
|
+
// In your create controller function
|
|
121
119
|
if (!orderData.customer.target) {
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
120
|
+
const customer = await findOrCreateCustomer(Customer, orderData.customer, orderData.owner, orderData.creator);
|
|
121
|
+
|
|
122
|
+
console.log('customer is', customer)
|
|
123
|
+
// Make sure we have a valid customer ID
|
|
124
|
+
if (!customer || !customer._id) {
|
|
125
|
+
throw new Error('Failed to create or find a valid customer');
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
// Set the customer target properly
|
|
129
|
+
orderData.customer = {
|
|
130
|
+
type: 'Customer',
|
|
131
|
+
target: customer._id
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
// If creator target is also missing, use the customer
|
|
135
|
+
if (!orderData.creator || !orderData.creator.target) {
|
|
136
|
+
orderData.creator = {
|
|
137
|
+
type: 'Customer',
|
|
138
|
+
target: customer._id
|
|
139
|
+
};
|
|
126
140
|
}
|
|
127
141
|
}
|
|
128
142
|
|
|
129
|
-
console.log(orderData)
|
|
143
|
+
console.log('Order data after customer processing:', orderData);
|
|
130
144
|
|
|
131
|
-
//
|
|
145
|
+
// Now create the order with proper references
|
|
132
146
|
const order = await Order.create([orderData], { session });
|
|
133
|
-
const createdOrder = order[0];
|
|
147
|
+
const createdOrder = order[0];
|
|
134
148
|
|
|
135
149
|
// Process each position individually
|
|
136
150
|
if (orderData.positions && orderData.positions.length > 0) {
|
|
@@ -69,10 +69,10 @@
|
|
|
69
69
|
|
|
70
70
|
<div
|
|
71
71
|
v-if="showProducts && organization.products"
|
|
72
|
-
class="mn-b-small mn-t-small w-100 flex-nowrap flex flex-v-center pd-small bg-white radius-medium"
|
|
72
|
+
class="mn-b-small t-nowrap mn-t-small w-100 flex-nowrap flex flex-v-center pd-small bg-white radius-medium"
|
|
73
73
|
>
|
|
74
|
-
<IconTime class="i-medium mn-r-micro"/>
|
|
75
|
-
<span class="mn-r-
|
|
74
|
+
<IconTime class="i-medium t-transp mn-r-micro"/>
|
|
75
|
+
<span class="mn-r-micro">
|
|
76
76
|
{{
|
|
77
77
|
organization.distance ?
|
|
78
78
|
organization.distance > 50 ?
|
|
@@ -83,16 +83,17 @@
|
|
|
83
83
|
+ ' MIN' : 'Unavailable'
|
|
84
84
|
}}
|
|
85
85
|
</span>
|
|
86
|
-
|
|
87
|
-
<span v-if="organization.distance && organization.distance < 50" class="mn-r-
|
|
86
|
+
|
|
87
|
+
<span v-if="organization.distance && organization.distance < 50" class="t-transp t-grey mn-r-micro">|</span>
|
|
88
|
+
<span v-if="organization.distance && organization.distance < 50" class="mn-r-thin">{{organization.distance ? organization.distance.toFixed(1) + 'KM' : ''}}</span>
|
|
88
89
|
<!-- <span class="mn-r-thin">{{organization.nearestSpotDistance}}</span> -->
|
|
89
|
-
<IconPrice class="i-medium mn-r-micro"/>
|
|
90
|
-
<span class="mn-r-thin">{{returnCurrency()}}500 </span>
|
|
91
|
-
<IconShopcart class="i-medium mn-r-micro"/>
|
|
90
|
+
<!-- <IconPrice class="i-medium mn-r-micro"/> -->
|
|
91
|
+
<!-- <span class="mn-r-thin">{{returnCurrency()}}500 </span> -->
|
|
92
|
+
<IconShopcart class="i-medium t-transp mn-r-micro"/>
|
|
92
93
|
<span class="mn-r-thin"> {{organization.products.length}} products</span>
|
|
93
94
|
</div>
|
|
94
95
|
|
|
95
|
-
<div v-if="showProducts && organization.products?.length > 0" class="w-100 o-scroll radius-medium">
|
|
96
|
+
<div v-if="showProducts && organization.products?.length > 0" class="w-100 o-scroll scroll-hide radius-medium">
|
|
96
97
|
<div class="w-max flex-nowrap flex gap-thin">
|
|
97
98
|
<CardOrderItem
|
|
98
99
|
@click.stop="$router.push({name: 'Organization_Product', params: {_id: organization._id, product: product._id}})"
|
|
@@ -179,7 +179,7 @@ async function addToCart(product, selectedDates = null) {
|
|
|
179
179
|
// Если организация товара отличается от текущей в корзине
|
|
180
180
|
if (shopcart.state.organization && shopcart.state.organization !== product.owner.target) {
|
|
181
181
|
const result = await proxy.$alert({
|
|
182
|
-
title: '
|
|
182
|
+
title: 'Replace items in your cart?',
|
|
183
183
|
message: `Your cart has items from another vendor. If you continue, we'll clear it so you can order from this one instead.`,
|
|
184
184
|
actions: [
|
|
185
185
|
{ label: 'Cancel', value: false },
|
|
@@ -189,11 +189,11 @@ async function addToCart(product, selectedDates = null) {
|
|
|
189
189
|
|
|
190
190
|
if (!result) throw error
|
|
191
191
|
|
|
192
|
-
shopcart.state.organization = product.owner.target
|
|
192
|
+
shopcart.state.organization = product.owner.target._id
|
|
193
193
|
shopcart.state.positions = []
|
|
194
194
|
}
|
|
195
195
|
|
|
196
|
-
await shopcart.actions.addProductToCart(product, product.owner.target, selectedDates)
|
|
196
|
+
await shopcart.actions.addProductToCart(product, product.owner.target._id, selectedDates)
|
|
197
197
|
return true
|
|
198
198
|
} catch (error) {
|
|
199
199
|
console.error('Error while adding product to cart:', error)
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Chips.vue2.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Chips.vue2.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Dropdown.vue.js","sources":["../../../../../src/components/Dropdown/Dropdown.vue"],"sourcesContent":["<template>\n <div class=\"dropdown pos-relative\" v-click-outside=\"clickedOutside\" @click.stop=\"isOpen = !isOpen\">\n <div v-if=\"isComponentLabel\" class=\"w-100 h-100 flex-center flex\">\n <component :is=\"label.component\" v-bind=\"label.props\" :class=\"label.class\"></component>\n </div>\n <div v-else>\n {{ label }}\n </div>\n <transition name=\"TransitionTranslateY\" mode=\"out-in\">\n <div \n v-show=\"isOpen\" \n :style=\"{ left: align === 'left' ? '0' : 'auto', right: align === 'right' ? '0' : 'auto' }\" \n class=\"dropdown-content radius-big\" \n >\n <slot></slot>\n </div>\n </transition>\n </div>\n</template>\n\n<script setup>\nimport { ref, computed } from 'vue';\nimport clickOutside from '../FieldPhone/click-outside';\n\nlet vClickOutside = clickOutside\n\nconst props = defineProps({\n label: {\n type: [String, Object],\n default: 'Open'\n },\n align: {\n type: String,\n default: 'left'\n }\n})\n\nconst isOpen = ref(false);\nconst isComponentLabel = computed(() => typeof props.label === 'object');\n\nfunction clickedOutside () {\n isOpen.value = false\n}\n</script>\n\n<style >\n.dropdown-content {\n display: block;\n position: absolute;\n box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);\n z-index: 1;\n}\n\n/*.dropdown:hover .dropdown-content {\n display: block;\n}*/\n</style>\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAwBA,QAAI,gBAAgB;AAEpB,UAAM,QAAQ;AAWd,UAAM,SAAS,IAAI,KAAK;AACxB,UAAM,mBAAmB,SAAS,MAAM,OAAO,MAAM,UAAU,QAAQ;AAEvE,aAAS,iBAAkB;AACzB,aAAO,QAAQ;AAAA,IACjB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Loader.vue2.cjs","sources":["../../../../../src/components/Loader/Loader.vue"],"sourcesContent":["<template>\n <div class=\"circular-loader\" :class=\"{ 'circular-loader-centered': centered }\">\n <svg viewBox=\"25 25 50 50\">\n <circle class=\"circular-loader-fill\" cx=\"50\" cy=\"50\" r=\"20\" fill=\"none\" stroke-width=\"4\" stroke-miterlimit=\"10\" />\n <circle class=\"circular-loader-circle\" cx=\"50\" cy=\"50\" r=\"20\" fill=\"none\" stroke-width=\"4\" stroke-miterlimit=\"10\" />\n </svg>\n <div v-if=\"progress\" class=\"progress-text\">{{ progress }}</div>\n <div v-if=\"status\" class=\"uppercase t-semi w-m-10r status-text\">{{ status }}</div>\n </div>\n</template>\n\n<script>\nexport default {\n props: {\n progress: {\n type: Number,\n default: null,\n },\n status: {\n type: String,\n default: null,\n },\n centered: {\n type: Boolean,\n default: true, // По умолчанию лоадер центрирован (для обратной совместимости)\n },\n },\n};\n</script>\n\n<style>\n.circular-loader {\n position: relative;\n z-index: 50;\n height: 2rem;\n width: 2rem;\n}\n\n.circular-loader-centered {\n top: calc(50% - 1rem);\n left: calc(50% - 1rem);\n}\n\n.circular-loader svg {\n animation: rotate 2s linear infinite;\n}\n\n.circular-loader-circle {\n stroke-dasharray: 1, 200;\n stroke-dashoffset: 0;\n stroke-linecap: round;\n stroke: rgb(var(--main));\n animation: dash 1.5s ease-in-out infinite;\n}\n\n.circular-loader-fill {\n stroke-linecap: round;\n stroke: rgba(var(--black),0.2);\n}\n\n.progress-text {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n font-size: 0.8rem;\n color: rgb(var(--main));;\n}\n\n.status-text {\n position: absolute;\n top: 120%;\n left: calc(50% - 5rem);\n font-size: 0.8rem;\n width: 10rem !important;\n text-align: center;\n}\n\n@keyframes rotate {\n 100% {\n transform: rotate(360deg);\n }\n}\n\n@keyframes dash {\n 0% {\n stroke-dasharray: 1, 200;\n stroke-dashoffset: 0;\n }\n 50% {\n stroke-dasharray: 89, 200;\n stroke-dashoffset: -35;\n }\n 100% {\n stroke-dasharray: 1, 200;\n stroke-dashoffset: -124;\n }\n}\n</style>"],"names":["_createElementBlock","_normalizeClass","_createElementVNode","_toDisplayString","_createCommentVNode"],"mappings":";;;;;AAYA,MAAK,YAAU;AAAA,EACb,OAAO;AAAA,IACL,UAAU;AAAA,MACR,MAAM;AAAA,MACN,SAAS;AAAA,IACV;AAAA,IACD,QAAQ;AAAA,MACN,MAAM;AAAA,MACN,SAAS;AAAA,IACV;AAAA,IACD,UAAU;AAAA,MACR,MAAM;AAAA,MACN,SAAS;AAAA;AAAA,IACV;AAAA,EACF;AACH;;EA3BA,KAAA;AAAA,EAMyB,OAAM;;;EAN/B,KAAA;AAAA,EAOuB,OAAM;;;0BAN3BA,IAOM,mBAAA,OAAA;AAAA,IAPD,OADPC,IAAA,eAAA,CACa,mBAAiB,EAAA,4BAAuC,OAAQ,UAAA,CAAA;AAAA;8BACzEC,IAGM,mBAAA,OAAA,EAHD,SAAQ,iBAAa;AAAA,MACxBA,IAAAA,mBAAkH,UAAA;AAAA,QAA1G,OAAM;AAAA,QAAuB,IAAG;AAAA,QAAK,IAAG;AAAA,QAAK,GAAE;AAAA,QAAK,MAAK;AAAA,QAAO,gBAAa;AAAA,QAAI,qBAAkB;AAAA;MAC3GA,IAAAA,mBAAoH,UAAA;AAAA,QAA5G,OAAM;AAAA,QAAyB,IAAG;AAAA,QAAK,IAAG;AAAA,QAAK,GAAE;AAAA,QAAK,MAAK;AAAA,QAAO,gBAAa;AAAA,QAAI,qBAAkB;AAAA;;IAEpG,OAAQ,6BAAnBF,IAA+D,mBAAA,OAA/D,YAA+DG,IAAAA,gBAAjB,OAAQ,QAAA,GAAA,CAAA,KAN1DC,IAAA,mBAAA,IAAA,IAAA;AAAA,IAOe,OAAM,2BAAjBJ,IAAkF,mBAAA,OAAlF,YAAkFG,IAAAA,gBAAf,OAAM,MAAA,GAAA,CAAA,KAP7EC,IAAA,mBAAA,IAAA,IAAA;AAAA;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Menu.vue.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Menu.vue.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;"}
|