@ozdao/prometheus-framework 0.2.39 → 0.2.41
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/auth.server.js +1 -2
- package/dist/auth.server.mjs +1 -2
- package/dist/files.server.js +1 -2
- package/dist/files.server.mjs +1 -2
- package/dist/globals.server.js +1 -1
- package/dist/globals.server.mjs +1 -1
- package/dist/mailing-10560277.mjs +78 -0
- package/dist/mailing-902d13d5.js +77 -0
- package/dist/main.css +1 -1
- package/dist/prometheus-framework/src/components/Button/Button.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Button/Button.vue.js +225 -2
- package/dist/prometheus-framework/src/components/Button/Button.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/Button/Button.vue2.js +2 -225
- package/dist/prometheus-framework/src/components/Checkbox/Checkbox.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Checkbox/Checkbox.vue.js +61 -2
- package/dist/prometheus-framework/src/components/Checkbox/Checkbox.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/Checkbox/Checkbox.vue2.js +2 -61
- package/dist/prometheus-framework/src/components/Chips/Chips.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Chips/Chips.vue.js +13 -9
- package/dist/prometheus-framework/src/components/Chips/Chips.vue2.cjs +1 -0
- package/dist/prometheus-framework/src/components/Chips/Chips.vue2.js +4 -0
- package/dist/prometheus-framework/src/components/Dropdown/Dropdown.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Dropdown/Dropdown.vue.js +26 -22
- package/dist/prometheus-framework/src/components/Feed/Feed.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Feed/Feed.vue.js +29 -30
- package/dist/prometheus-framework/src/components/Field/Field.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Field/Field.vue.js +76 -2
- package/dist/prometheus-framework/src/components/Field/Field.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/Field/Field.vue2.js +2 -76
- package/dist/prometheus-framework/src/components/Popup/Popup.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Popup/Popup.vue.js +70 -2
- package/dist/prometheus-framework/src/components/Popup/Popup.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/Popup/Popup.vue2.js +2 -70
- package/dist/prometheus-framework/src/components/Select/Select.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Select/Select.vue.js +95 -2
- package/dist/prometheus-framework/src/components/Select/Select.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/Select/Select.vue2.js +2 -95
- package/dist/prometheus-framework/src/components/Slider/Slider.vue.cjs +1 -0
- package/dist/prometheus-framework/src/components/Slider/Slider.vue.js +69 -0
- package/dist/prometheus-framework/src/components/Tab/Tab.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Tab/Tab.vue.js +44 -2
- package/dist/prometheus-framework/src/components/Tab/Tab.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/Tab/Tab.vue2.js +2 -44
- package/dist/prometheus-framework/src/modules/auth/components/layouts/Auth.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/layouts/Auth.vue.js +3 -3
- package/dist/prometheus-framework/src/modules/auth/components/pages/EnterCode.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/pages/EnterCode.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/pages/EnterPassword.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/pages/EnterPassword.vue.js +3 -3
- package/dist/prometheus-framework/src/modules/auth/components/pages/Invite.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/pages/Invite.vue.js +3 -3
- package/dist/prometheus-framework/src/modules/auth/components/pages/ResetPassword.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/pages/ResetPassword.vue.js +3 -3
- package/dist/prometheus-framework/src/modules/auth/components/pages/SignIn.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/pages/SignIn.vue.js +3 -3
- package/dist/prometheus-framework/src/modules/auth/components/pages/SignUp.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/pages/SignUp.vue.js +3 -3
- package/dist/prometheus-framework/src/modules/auth/store/auth.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/store/auth.js +8 -8
- package/dist/prometheus-framework/src/modules/backoffice/components/pages/Dashboard.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/backoffice/components/pages/Dashboard.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/community/community.client.cjs +1 -1
- package/dist/prometheus-framework/src/modules/community/community.client.js +18 -20
- package/dist/prometheus-framework/src/modules/community/components/blocks/CardBlogpost.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/community/components/blocks/CardBlogpost.vue.js +88 -62
- package/dist/prometheus-framework/src/modules/community/components/layouts/Community.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/community/components/layouts/Community.vue.js +97 -68
- package/dist/prometheus-framework/src/modules/community/components/pages/BlogPost.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/community/components/pages/BlogPost.vue.js +35 -34
- package/dist/prometheus-framework/src/modules/community/components/pages/Community.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/community/components/pages/Community.vue.js +18 -18
- package/dist/prometheus-framework/src/modules/community/components/pages/Community.vue2.js +2 -2
- package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.js +5 -5
- package/dist/prometheus-framework/src/modules/community/components/sections/Feed.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/community/components/sections/Feed.vue.js +4 -4
- package/dist/prometheus-framework/src/modules/community/components/sections/HotPosts.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/community/components/sections/HotPosts.vue.js +65 -19
- package/dist/prometheus-framework/src/modules/community/components/sections/JoinUs.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/community/components/sections/JoinUs.vue.js +9 -9
- package/dist/prometheus-framework/src/modules/constructor/components/elements/Embed.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/constructor/components/elements/Embed.vue.js +8 -7
- package/dist/prometheus-framework/src/modules/constructor/components/elements/Image.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/constructor/components/elements/Image.vue.js +6 -6
- package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue.cjs +5 -1
- package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue.js +65 -2
- package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue2.cjs +1 -5
- package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue2.js +2 -65
- package/dist/prometheus-framework/src/modules/constructor/components/sections/Constructor.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/constructor/components/sections/Constructor.vue.js +64 -70
- package/dist/prometheus-framework/src/modules/events/components/blocks/CardEvent.vue.js +6 -6
- package/dist/prometheus-framework/src/modules/events/components/elements/ButtonJoin.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/events/components/elements/ButtonJoin.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/events/components/layouts/layoutEvents.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/events/components/layouts/layoutEvents.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.js +5 -5
- package/dist/prometheus-framework/src/modules/events/components/pages/Events.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/events/components/pages/Events.vue.js +6 -5
- package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.js +3 -3
- package/dist/prometheus-framework/src/modules/gallery/components/sections/GalleryWithCategories.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/gallery/components/sections/GalleryWithCategories.vue.js +3 -3
- package/dist/prometheus-framework/src/modules/globals/components/blocks/CardHeader.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/globals/components/blocks/CardHeader.vue.js +43 -42
- package/dist/prometheus-framework/src/modules/icons/entities/IconFeatured.vue.cjs +1 -0
- package/dist/prometheus-framework/src/modules/icons/entities/IconFeatured.vue.js +30 -0
- package/dist/prometheus-framework/src/modules/icons/entities/IconFollowing.vue.cjs +1 -0
- package/dist/prometheus-framework/src/modules/icons/entities/IconFollowing.vue.js +47 -0
- package/dist/prometheus-framework/src/modules/icons/entities/IconPopular.vue.cjs +1 -0
- package/dist/prometheus-framework/src/modules/icons/entities/IconPopular.vue.js +28 -0
- package/dist/prometheus-framework/src/modules/icons/entities/IconRecent.vue.cjs +1 -0
- package/dist/prometheus-framework/src/modules/icons/entities/IconRecent.vue.js +45 -0
- package/dist/prometheus-framework/src/modules/icons/navigation/IconArrow.vue.cjs +1 -0
- package/dist/prometheus-framework/src/modules/icons/navigation/IconArrow.vue.js +32 -0
- package/dist/prometheus-framework/src/modules/icons/navigation/IconChevronRight.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/icons/navigation/IconChevronRight.vue.js +3 -3
- package/dist/prometheus-framework/src/modules/icons/navigation/IconEdit.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/icons/navigation/IconEdit.vue.js +25 -14
- package/dist/prometheus-framework/src/modules/icons/navigation/IconEllipsis.vue.cjs +1 -0
- package/dist/prometheus-framework/src/modules/icons/navigation/IconEllipsis.vue.js +44 -0
- package/dist/prometheus-framework/src/modules/landing/components/sections/MobileApp.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/landing/components/sections/MobileApp.vue.js +90 -67
- package/dist/prometheus-framework/src/modules/legal/components/pages/Legal.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/legal/components/pages/Legal.vue.js +3 -3
- package/dist/prometheus-framework/src/modules/mobile/components/Menu/Menu.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/mobile/components/Menu/Menu.vue.js +2 -11
- package/dist/prometheus-framework/src/modules/mobile/components/Menu/Menu.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/modules/mobile/components/Menu/Menu.vue2.js +11 -2
- package/dist/prometheus-framework/src/modules/orders/components/pages/EditOrder.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/pages/EditOrder.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/pages/Orders.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/pages/Orders.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormOrderDetails.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormOrderDetails.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/organizations/components/blocks/CardOrganization.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/blocks/CardOrganization.vue.js +45 -42
- package/dist/prometheus-framework/src/modules/organizations/components/blocks/DepartmentMemberModify.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/blocks/DepartmentMemberModify.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/organizations/components/elements/ButtonToggleMembership.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/elements/ButtonToggleMembership.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.js +6 -6
- package/dist/prometheus-framework/src/modules/organizations/components/pages/Members.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/Members.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/Organization.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/Organization.vue.js +3 -3
- package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.js +5 -5
- package/dist/prometheus-framework/src/modules/organizations/components/pages/Organizations.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/Organizations.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/DetailsTab.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/DetailsTab.vue.js +60 -55
- package/dist/prometheus-framework/src/modules/organizations/components/sections/Documents.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/Documents.vue.js +3 -3
- package/dist/prometheus-framework/src/modules/organizations/components/sections/FeedDepartments.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/FeedDepartments.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.js +3 -3
- package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersList.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersList.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.js +18 -17
- package/dist/prometheus-framework/src/modules/organizations/components/sections/Publics.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/Publics.vue.js +20 -21
- package/dist/prometheus-framework/src/modules/products/components/blocks/CardLeftover.vue.js +7 -7
- package/dist/prometheus-framework/src/modules/products/components/blocks/CardPosition.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/blocks/CardPosition.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/products/components/blocks/ImagesThumbnails.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/blocks/ImagesThumbnails.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/EditLeftover.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/EditLeftover.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/products/components/pages/Leftovers.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/Leftovers.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.js +6 -6
- package/dist/prometheus-framework/src/modules/products/components/pages/ProductsBackoffice.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/ProductsBackoffice.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/products/components/sections/EditProductInfo.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/sections/EditProductInfo.vue.js +3 -3
- package/dist/prometheus-framework/src/modules/products/components/sections/FilterProducts.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/sections/FilterProducts.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/products/components/sections/PopularProducts.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/sections/PopularProducts.vue.js +37 -34
- package/dist/prometheus-framework/src/modules/products/components/sections/SectionProduct.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/sections/SectionProduct.vue.js +23 -23
- package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.js +3 -3
- package/dist/prometheus-framework/src/modules/spots/components/blocks/CardSpot.vue.js +8 -8
- package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.js +7 -7
- package/dist/prometheus-framework/src/modules/users/components/pages/ProfileBlogposts.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/users/components/pages/ProfileBlogposts.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEdit.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEdit.vue.js +3 -3
- package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEvents.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEvents.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/wallet/components/pages/Wallet.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/wallet/components/pages/Wallet.vue.js +31 -30
- package/dist/prometheus-framework.cjs.js +20 -20
- package/dist/prometheus-framework.es.js +1278 -1288
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/src/components/Button/Button.vue +2 -3
- package/src/components/Chips/Chips.vue +9 -3
- package/src/components/Countdown/Countdown.vue +4 -3
- package/src/components/Dropdown/Dropdown.vue +9 -3
- package/src/components/Feed/Feed.vue +7 -11
- package/src/components/Feed/Masonry.vue +177 -0
- package/src/components/FieldBig/FieldBig.vue +3 -3
- package/src/components/Header/Header.vue +2 -0
- package/src/components/Navigation/Navigation.vue +2 -0
- package/src/components/Shader/Shader.vue +161 -116
- package/src/components/Slider/Slider.vue +92 -0
- package/src/modules/applications/applications.client.js +2 -0
- package/src/modules/applications/components/sections/SubscribeNewsletter.vue +114 -0
- package/src/modules/applications/controllers/applications.controller.js +125 -136
- package/src/modules/applications/models/application.model.js +22 -7
- package/src/modules/applications/routes/applications.routes.js +29 -13
- package/src/modules/auth/controllers/auth.controller.js +2 -3
- package/src/modules/auth/store/auth.js +3 -5
- package/src/modules/chats/components/blocks/ChatMessage.vue +3 -2
- package/src/modules/chats/components/pages/ChatPage.vue +6 -6
- package/src/modules/chats/components/sections/ChatWindow.vue +57 -12
- package/src/modules/chats/store/chat.store.js +6 -1
- package/src/modules/community/community.client.js +0 -2
- package/src/modules/community/components/blocks/CardBlogpost.vue +71 -33
- package/src/modules/community/components/layouts/Community.vue +65 -26
- package/src/modules/community/components/pages/Blog.vue +37 -0
- package/src/modules/community/components/pages/BlogPost.vue +5 -6
- package/src/modules/community/components/pages/Community.vue +1 -0
- package/src/modules/community/components/pages/CreateBlogPost.vue +1 -0
- package/src/modules/community/components/sections/Feed.vue +1 -1
- package/src/modules/community/components/sections/HotPosts.vue +64 -24
- package/src/modules/community/components/sections/JoinUs.vue +4 -5
- package/src/modules/community/store/blogposts.js +1 -0
- package/src/modules/constructor/components/elements/Embed.vue +7 -6
- package/src/modules/constructor/components/elements/Image.vue +2 -2
- package/src/modules/constructor/components/elements/Textarea.vue +1 -1
- package/src/modules/constructor/components/sections/Constructor.vue +3 -19
- package/src/modules/events/components/pages/EditEvent.vue +48 -3
- package/src/modules/events/components/pages/Event.vue +16 -8
- package/src/modules/events/components/sections/HeroEvent.vue +32 -28
- package/src/modules/events/components/sections/SectionMainGuest.vue +3 -2
- package/src/modules/events/components/sections/SectionPreviousEvents.vue +22 -15
- package/src/modules/events/models/event.model.js +9 -0
- package/src/modules/files/middlewares/server/middlewareBusboy.js +14 -3
- package/src/modules/files/routes/files.routes.js +9 -1
- package/src/modules/globals/components/blocks/CardHeader.vue +6 -3
- package/src/modules/globals/utils/mailing.js +12 -0
- package/src/modules/icons/entities/IconEarn.vue +20 -0
- package/src/modules/icons/entities/IconFeatured.vue +14 -0
- package/src/modules/icons/entities/IconFollowing.vue +17 -0
- package/src/modules/icons/entities/IconPopular.vue +14 -0
- package/src/modules/icons/entities/IconRecent.vue +17 -0
- package/src/modules/icons/navigation/IconAdd.vue +1 -3
- package/src/modules/icons/navigation/IconArrow.vue +21 -0
- package/src/modules/icons/navigation/IconCheckmark.vue +16 -0
- package/src/modules/icons/navigation/IconChevronRight.vue +2 -2
- package/src/modules/icons/navigation/IconEdit.vue +16 -2
- package/src/modules/icons/navigation/IconEllipsis.vue +16 -0
- package/src/modules/icons/placeholders/PlaceholderChat.vue +9 -0
- package/src/modules/landing/components/sections/MobileApp.vue +38 -21
- package/src/modules/landing/components/sections/SectionEarn.vue +104 -0
- package/src/modules/landing/components/sections/SectionFeatures.vue +7 -8
- package/src/modules/marketplace/components/layouts/Marketplace.vue +3 -3
- package/src/modules/orders/components/blocks/StatusHistory.vue +7 -1
- package/src/modules/orders/components/pages/Order.vue +3 -4
- package/src/modules/orders/store/shopcart.js +21 -5
- package/src/modules/organizations/components/blocks/CardOrganization.vue +6 -6
- package/src/modules/organizations/components/pages/Organization.vue +1 -1
- package/src/modules/organizations/components/sections/DetailsTab.vue +42 -43
- package/src/modules/organizations/components/sections/Publics.vue +3 -4
- package/src/modules/payments/controller/payments.controller.js +54 -200
- package/src/modules/payments/controller/payments.tinkoff.controller.js +242 -0
- package/src/modules/payments/models/payment.model.js +22 -0
- package/src/modules/payments/routes/payments.routes.js +4 -25
- package/src/modules/payments/routes/payments.tinkoff.routes.js +58 -0
- package/src/modules/products/components/pages/Product.vue +3 -1
- package/src/modules/products/components/sections/HeroRecommendation.vue +9 -170
- package/src/modules/products/components/sections/MenuSection.vue +4 -4
- package/src/modules/products/components/sections/PopularProducts.vue +3 -3
- package/src/modules/products/components/sections/SectionProduct.vue +3 -0
- package/src/modules/products/controllers/products.controller.js +188 -109
- package/src/modules/products/models/product.model.js +1 -0
- package/src/modules/spots/components/layouts/Spots.vue +2 -2
- package/src/modules/wallet/components/pages/Wallet.vue +73 -88
- package/src/modules/wallet/controllers/crypto.controller.js +79 -0
- package/src/modules/wallet/models/wallet.model.js +27 -0
- package/src/styles/base/all.scss +4 -0
- package/src/styles/base/backgrounds.scss +2 -2
- package/src/styles/base/shadow_transitions_hover_refactor.scss +11 -1
- package/src/styles/typography.scss +19 -12
- package/src/modules/community/components/sections/SubscribeNewsletter.vue +0 -67
- package/src/modules/constructor/components/elements/Youtube.vue +0 -52
- /package/src/modules/{orders/models/payment.model.js → payments/models/payment.tinkoff.model.js} +0 -0
@@ -167,77 +167,142 @@ const controllerFactory = (db) => {
|
|
167
167
|
|
168
168
|
const getProducts = (req, res) => {
|
169
169
|
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
170
|
+
// {
|
171
|
+
// $lookup: {
|
172
|
+
// from: "modifications",
|
173
|
+
// let: { "productId": "$_id" },
|
174
|
+
// pipeline: [{
|
175
|
+
// $match: {
|
176
|
+
// "$expr": {
|
177
|
+
// "$eq": ["$product", "$$productId"]
|
178
|
+
// }
|
179
|
+
// }
|
180
|
+
// },{
|
181
|
+
// $lookup: {
|
182
|
+
// from: "leftovers",
|
183
|
+
// let: { "productId": "$_id" },
|
184
|
+
// pipeline: [{
|
185
|
+
// $unwind: "$positions"
|
186
|
+
// },{
|
187
|
+
// "$match": { "$expr": { "$eq": ["$positions._id", "$$productId"] }}
|
188
|
+
// },{
|
189
|
+
// "$project": {
|
190
|
+
// _id: "$positions._id",
|
191
|
+
// quantity: "$positions.quantity",
|
192
|
+
// name: "$positions.name",
|
193
|
+
// }
|
194
|
+
// }],
|
195
|
+
// as: "variantsMods"
|
196
|
+
// },
|
197
|
+
// },{
|
198
|
+
// $set: {
|
199
|
+
// quantity:{
|
200
|
+
// $sum:["$quantity",{$sum:"$variantsMods.quantity"}]
|
201
|
+
// }
|
202
|
+
// }
|
203
|
+
// },{
|
204
|
+
// $unset: "variants"
|
205
|
+
// }],
|
206
|
+
// as: "modifications"
|
207
|
+
// },
|
208
|
+
// }
|
209
|
+
|
210
|
+
Product.aggregate([
|
211
|
+
{
|
212
|
+
$facet: {
|
213
|
+
"withIngredients": [
|
214
|
+
{
|
215
|
+
$match: {
|
216
|
+
ingridients: { $exists: true, $not: {$size: 0} } // Продукты с ингредиентами
|
179
217
|
}
|
180
|
-
},
|
218
|
+
},
|
219
|
+
{
|
220
|
+
$lookup: {
|
221
|
+
from: "products",
|
222
|
+
localField: "ingridients",
|
223
|
+
foreignField: "_id",
|
224
|
+
as: "ingredientDetails"
|
225
|
+
}
|
226
|
+
},
|
227
|
+
{ $unwind: "$ingredientDetails" },
|
228
|
+
{
|
229
|
+
$lookup: {
|
230
|
+
from: "leftovers",
|
231
|
+
let: { "ingredientId": "$ingredientDetails._id" },
|
232
|
+
pipeline: [
|
233
|
+
{ $unwind: "$positions" },
|
234
|
+
{
|
235
|
+
$match: {
|
236
|
+
$expr: {
|
237
|
+
$eq: ["$positions._id", "$$ingredientId"]
|
238
|
+
}
|
239
|
+
}
|
240
|
+
},
|
241
|
+
{
|
242
|
+
$project: {
|
243
|
+
quantity: "$positions.quantity"
|
244
|
+
}
|
245
|
+
}
|
246
|
+
],
|
247
|
+
as: "ingredientLeftovers"
|
248
|
+
}
|
249
|
+
},
|
250
|
+
{
|
251
|
+
$group: {
|
252
|
+
_id: "$_id",
|
253
|
+
name: { $first: "$name" },
|
254
|
+
minQuantity: { $min: "$ingredientLeftovers.quantity" }
|
255
|
+
}
|
256
|
+
}
|
257
|
+
],
|
258
|
+
"withoutIngredients": [
|
259
|
+
{
|
260
|
+
$match: {
|
261
|
+
$or: [
|
262
|
+
{ ingridients: { $exists: false } }, // Продукты без ингредиентов
|
263
|
+
{ ingridients: { $size: 0 } }
|
264
|
+
]
|
265
|
+
}
|
266
|
+
},
|
267
|
+
{
|
181
268
|
$lookup: {
|
182
269
|
from: "leftovers",
|
183
270
|
let: { "productId": "$_id" },
|
184
|
-
pipeline: [
|
185
|
-
$unwind: "$positions"
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
271
|
+
pipeline: [
|
272
|
+
{ $unwind: "$positions" },
|
273
|
+
{
|
274
|
+
$match: {
|
275
|
+
$expr: {
|
276
|
+
$eq: ["$positions._id", "$$productId"]
|
277
|
+
}
|
278
|
+
}
|
279
|
+
},
|
280
|
+
{
|
281
|
+
$project: {
|
282
|
+
quantity: "$positions.quantity"
|
283
|
+
}
|
193
284
|
}
|
194
|
-
|
195
|
-
as: "
|
196
|
-
},
|
197
|
-
},{
|
198
|
-
$set: {
|
199
|
-
quantity:{
|
200
|
-
$sum:["$quantity",{$sum:"$variantsMods.quantity"}]
|
201
|
-
}
|
285
|
+
],
|
286
|
+
as: "productLeftovers"
|
202
287
|
}
|
203
|
-
},
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
},
|
208
|
-
},
|
209
|
-
{
|
210
|
-
$lookup: {
|
211
|
-
from: "leftovers",
|
212
|
-
let: { "productId": "$_id" },
|
213
|
-
pipeline: [
|
214
|
-
{
|
215
|
-
$unwind: "$positions"
|
216
|
-
},
|
217
|
-
|
218
|
-
{
|
219
|
-
"$match": { "$expr": { "$eq": ["$positions._id", "$$productId"] }}
|
220
|
-
},
|
221
|
-
{
|
222
|
-
"$project": {
|
223
|
-
_id: "$positions._id",
|
224
|
-
quantity: "$positions.quantity",
|
225
|
-
name: "$positions.name",
|
288
|
+
},
|
289
|
+
{
|
290
|
+
$set: {
|
291
|
+
minQuantity: { $sum: "$productLeftovers.quantity" }
|
226
292
|
}
|
227
293
|
}
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
{
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
])
|
294
|
+
]
|
295
|
+
}
|
296
|
+
},
|
297
|
+
{
|
298
|
+
$project: {
|
299
|
+
products: { $setUnion: ["$withIngredients", "$withoutIngredients"] }
|
300
|
+
}
|
301
|
+
},
|
302
|
+
{ $unwind: "$products" },
|
303
|
+
{ $replaceRoot: { newRoot: "$products" } }
|
304
|
+
])
|
305
|
+
|
241
306
|
.exec((err, products) => {
|
242
307
|
// If error
|
243
308
|
if (err) {return res.status(500).send({ message: err }); }
|
@@ -338,58 +403,72 @@ const controllerFactory = (db) => {
|
|
338
403
|
// Get product
|
339
404
|
const getProduct = async (req, res) => {
|
340
405
|
try {
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
{
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
406
|
+
const product = await Product.aggregate([
|
407
|
+
{
|
408
|
+
$match: { "_id": new ObjectId(req.params._id) }
|
409
|
+
},
|
410
|
+
{
|
411
|
+
$lookup: {
|
412
|
+
from: "leftovers",
|
413
|
+
let: { productId: "$_id", ingredients: { $ifNull: ["$ingredients", []] } },
|
414
|
+
pipeline: [
|
415
|
+
{
|
416
|
+
$unwind: "$positions"
|
417
|
+
},
|
418
|
+
{
|
419
|
+
"$match": { "$expr": { "$eq": ["$positions._id", "$$productId"] }}
|
420
|
+
},
|
421
|
+
{
|
422
|
+
"$addFields": {
|
423
|
+
"positions.quantity": {
|
424
|
+
$cond: {
|
425
|
+
if: { $eq: ["$type", "stock-in"] },
|
426
|
+
then: "$positions.quantity",
|
427
|
+
else: { $multiply: ["$positions.quantity", -1] }
|
428
|
+
}
|
429
|
+
}
|
430
|
+
}
|
431
|
+
},
|
432
|
+
{
|
433
|
+
"$project": {
|
434
|
+
_id: "$positions._id",
|
435
|
+
quantity: "$positions.quantity",
|
436
|
+
name: "$positions.name",
|
437
|
+
}
|
360
438
|
}
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
}
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
439
|
+
],
|
440
|
+
as: "variants"
|
441
|
+
}
|
442
|
+
},
|
443
|
+
{
|
444
|
+
$set: {
|
445
|
+
quantity: {
|
446
|
+
$sum: ["$quantity", {$sum: "$variants.quantity"}]
|
447
|
+
}
|
369
448
|
}
|
370
|
-
}
|
371
|
-
},
|
372
|
-
{ $unset: "variants" }
|
373
|
-
])
|
449
|
+
},
|
374
450
|
|
375
|
-
|
376
|
-
|
377
|
-
}
|
451
|
+
{ $unset: "variants" }
|
452
|
+
]);
|
378
453
|
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
{ new: true }
|
383
|
-
);
|
454
|
+
if (!product || product.length < 1) {
|
455
|
+
return res.status(404).send({ message: "Product not found." });
|
456
|
+
}
|
384
457
|
|
385
|
-
|
458
|
+
const updatedProduct = await Product.findOneAndUpdate(
|
459
|
+
{ _id: req.params._id },
|
460
|
+
{ $inc: { popularity: 1 } },
|
461
|
+
{ new: true }
|
462
|
+
);
|
386
463
|
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
|
391
|
-
|
392
|
-
|
464
|
+
console.log('Popularity updated:', updatedProduct);
|
465
|
+
|
466
|
+
res.status(200).send(product);
|
467
|
+
} catch (err) {
|
468
|
+
console.error('Error:', err);
|
469
|
+
res.status(500).send({ message: err });
|
470
|
+
}
|
471
|
+
};
|
393
472
|
|
394
473
|
return {
|
395
474
|
Create,
|
@@ -4,13 +4,13 @@
|
|
4
4
|
<div class="h-100 w-100 flex-nowrap flex-column flex gap-thin pd-thin">
|
5
5
|
|
6
6
|
<!-- Sorting section -->
|
7
|
-
<div class="pd-medium bg-
|
7
|
+
<div class="pd-medium bg-main radius-big">
|
8
8
|
<div class="flex-nowrap flex flex-v-center">
|
9
9
|
<header class="mn-r-auto flex-v-center t-left flex-nowrap flex">
|
10
10
|
<h2 class="t-left">
|
11
11
|
<span class="">Weed in </span>
|
12
12
|
|
13
|
-
<span @click="a => { globals.state.isOpenLocationPopup = true }" v-if="localPosition.city || localPosition.state || localPosition.country" class="t-semi t-
|
13
|
+
<span @click="a => { globals.state.isOpenLocationPopup = true }" v-if="localPosition.city || localPosition.state || localPosition.country" class="t-semi t-black">
|
14
14
|
<span v-if="localPosition.city">{{localPosition.city}}, </span>
|
15
15
|
<span v-if="localPosition.state">{{localPosition.state}}, </span>
|
16
16
|
<span v-if="localPosition.country">{{localPosition.country}}</span>
|
@@ -1,117 +1,102 @@
|
|
1
1
|
<template>
|
2
|
-
<section class="pd-
|
3
|
-
<h1 class="mn-b-small">Your Wallet</h1>
|
2
|
+
<section class="pd-thin">
|
4
3
|
|
5
|
-
<
|
6
|
-
|
7
|
-
</p>
|
4
|
+
<section class="bg-black t-white mn-b-thin radius-big pd-big">
|
5
|
+
<h1 class="mn-b-medium ">Your Wallet</h1>
|
8
6
|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
class="w-100 pd-medium radius-medium t-center bg-grey"
|
13
|
-
>
|
14
|
-
<h3 class="mn-b-small">Make first order and start earning Weeder Token</h3>
|
15
|
-
<button class="mn-l-auto mn-r-auto bg-main button">Explore marketplace</button>
|
16
|
-
</div>
|
7
|
+
<p class="mn-b-semi t-transp p-big">
|
8
|
+
Earn Weeder Tokens by purchasing our weed or contributing to the community.
|
9
|
+
</p>
|
17
10
|
|
18
|
-
<div
|
11
|
+
<div
|
19
12
|
v-if="state.account"
|
20
|
-
class="
|
13
|
+
class="gap-thin flex-nowrap bg-black radius-extra t-white br-solid br-white-transp-10 br-1px flex-v-center flex pd-medium"
|
21
14
|
>
|
22
|
-
<
|
23
|
-
|
24
|
-
|
25
|
-
</div>
|
26
|
-
|
27
|
-
<div class="w-100 bg-black radius-semi pd-medium t-white">
|
28
|
-
<p class="h4 mn-b-thin">Your Metamask</p>
|
29
|
-
|
30
|
-
<div
|
31
|
-
v-if="state.account"
|
32
|
-
class="mn-b-small pd-small br-solid br-1px br-white-transp-10 radius-small"
|
33
|
-
>
|
34
|
-
{{state.account}}
|
15
|
+
<div class="flex-v-center flex-nowrap flex mn-r-auto">
|
16
|
+
<img src="/logo/wdt.svg" class="mn-r-thin i-big">
|
17
|
+
<h2>{{state.tokenBalance}} WDT</h2>
|
35
18
|
</div>
|
36
19
|
|
37
|
-
<
|
38
|
-
|
39
|
-
class="p-medium t-transp mn-b-small"
|
40
|
-
>
|
41
|
-
Connect Metamask to withdrawal your earnings.
|
42
|
-
</p>
|
43
|
-
|
44
|
-
<button
|
45
|
-
v-if="!state.account"
|
46
|
-
@click="actions.connectWallet"
|
47
|
-
class="w-100 br-solid br-2px br-white t-white button"
|
48
|
-
>
|
49
|
-
Connect Wallet
|
50
|
-
</button>
|
51
|
-
|
52
|
-
<button
|
53
|
-
v-if="state.account"
|
54
|
-
@click="actions.disconnectWallet"
|
55
|
-
class="w-100 bg-red button"
|
56
|
-
>
|
57
|
-
Disconnect Wallet
|
58
|
-
</button>
|
20
|
+
<button class="w-max bg-main t-medium button">Get More</button>
|
21
|
+
<button class="w-max bg-white t-black t-medium button" @click="actions.collectRewards">Withdraw</button>
|
59
22
|
</div>
|
60
|
-
</div>
|
61
23
|
|
62
|
-
|
63
|
-
v-if="state.account"
|
64
|
-
class="w-100 pd-medium radius-medium bg-grey"
|
65
|
-
>
|
66
|
-
<p class="h4 mn-b-thin">You earn:</p>
|
67
|
-
<h3 class="mn-b-small">{{state.tokenBalance}} WDT</h3>
|
68
|
-
<button class="w-100 bg-main button" @click="actions.collectRewards">Withdraw</button>
|
69
|
-
</div>
|
70
|
-
|
71
|
-
|
72
|
-
<h3 class="mn-b-small" v-if="state.rewards.length > 0">Latest Rewards </h3>
|
24
|
+
</section>
|
73
25
|
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
<div class="pd-medium">
|
82
|
-
<span class="w-max mn-b-small d-block pd-t-nano pd-b-nano pd-l-thin pd-r-thin bg-main radius-extra t-semi p-small">{{income.type === 'blogpost' ? 'Community Reward' : income.type}}</span>
|
83
|
-
<h4 class="mn-b-thin">{{income.name}}</h4>
|
84
|
-
<p class="mn-b-small p-small">{{income.content[0].content}}</p>
|
26
|
+
<div v-if="!state.account" class="mn-b-semi cols-2 gap-thin">
|
27
|
+
<div
|
28
|
+
class="w-100 pd-medium radius-medium t-center bg-grey"
|
29
|
+
>
|
30
|
+
<h3 class="mn-b-small">Make first order and start earning Weeder Token</h3>
|
31
|
+
<button class="mn-l-auto mn-r-auto bg-main button">Explore marketplace</button>
|
32
|
+
</div>
|
85
33
|
|
86
|
-
<div
|
87
|
-
|
88
|
-
|
34
|
+
<div
|
35
|
+
class="w-100 pd-medium flex-center flex flex-column radius-medium t-center bg-grey"
|
36
|
+
>
|
37
|
+
<h3
|
38
|
+
v-if="!state.account"
|
39
|
+
class="mn-b-small"
|
40
|
+
>
|
41
|
+
Connect Metamask to withdrawal your earnings.
|
42
|
+
</h3>
|
43
|
+
|
44
|
+
<button
|
45
|
+
v-if="!state.account"
|
46
|
+
@click="actions.connectWallet"
|
47
|
+
class="br-solid br-2px br-black-transp-10 t-black button"
|
48
|
+
>
|
49
|
+
Connect Wallet
|
50
|
+
</button>
|
89
51
|
</div>
|
90
52
|
</div>
|
91
|
-
|
92
|
-
|
93
|
-
<!-- <CardBlogpost
|
94
|
-
:key="income._id"
|
95
|
-
:blogpost="income"
|
96
|
-
class=""
|
97
|
-
/> -->
|
98
53
|
|
99
|
-
|
54
|
+
<div
|
55
|
+
v-if="state.account"
|
56
|
+
class="w-100 mn-b-semi flex-column flex pd-big radius-big bg-main t-black"
|
57
|
+
>
|
58
|
+
<p class="t-transp t-medium mn-b-thin">You own:</p>
|
59
|
+
<p class="h1 mn-b-small">{{state.share}}%</p>
|
60
|
+
<p class="t-white p-big t-medium mn-b-semi">of all shares</p>
|
61
|
+
|
62
|
+
<div
|
63
|
+
class="flex-v-center mn-b-small flex-nowrap flex pd-small bg-black-transp-5 radius-extra"
|
64
|
+
>
|
65
|
+
<img src="@/assets/icons/metamask.svg" class="mn-r-small i-big" >
|
66
|
+
|
67
|
+
<p v-if="state.account" class="t-transp t-medium ">
|
68
|
+
<span class="uppercase p-small t-medium t-transp">Connected Metamask</span><br>
|
69
|
+
<span>{{state.account}}</span>
|
70
|
+
</p>
|
71
|
+
|
72
|
+
<button
|
73
|
+
v-if="state.account"
|
74
|
+
@click="actions.disconnectWallet"
|
75
|
+
class="mn-l-auto bg-red button"
|
76
|
+
>
|
77
|
+
Disconnect Wallet
|
78
|
+
</button>
|
79
|
+
</div>
|
80
|
+
|
81
|
+
|
82
|
+
</div>
|
83
|
+
<h2 class="mn-b-small" v-if="state.rewards.length > 0">Latest Rewards </h2>
|
100
84
|
|
85
|
+
<section class="cols-3 gap-thin">
|
101
86
|
<div
|
102
87
|
class="radius-medium bg-grey"
|
103
88
|
v-for="income in state.rewards"
|
104
89
|
>
|
105
|
-
<div class="flex-nowrap flex pd-medium">
|
106
|
-
|
90
|
+
<div class="flex-nowrap br-b br-black-transp-10 br-solid flex pd-medium">
|
91
|
+
<img src="/logo/wdt-plus.svg" class="mn-r-thin i-semi">
|
107
92
|
<p class="t-semi mn-r-auto">{{income.amount}} WDT</p>
|
108
93
|
|
109
94
|
<span class="pd-t-nano pd-b-nano pd-l-thin pd-r-thin bg-main flex flex-center radius-extra t-semi p-small">{{income.type === 'blogpost' ? 'Community Reward' : income.type}}</span>
|
110
95
|
</div>
|
111
96
|
|
112
97
|
<div class="pd-medium">
|
113
|
-
<h4 class="mn-b-thin">{{income.name}}</h4>
|
114
|
-
<p class="p-small">{{income.content[0].content}}</p>
|
98
|
+
<h4 class="t-regular mn-b-thin">{{income.name}}</h4>
|
99
|
+
<!-- <p class="p-small">{{income.content[0].content}}</p> -->
|
115
100
|
</div>
|
116
101
|
|
117
102
|
</div>
|
@@ -26,6 +26,85 @@ const cryptoControllerFactory = (db, wdmClient) => {
|
|
26
26
|
const Comment = db.comment;
|
27
27
|
const Reward = db.reward;
|
28
28
|
|
29
|
+
// const listRewards = async (req, res) => {
|
30
|
+
// try {
|
31
|
+
// const rewards = await Blogpost.aggregate([
|
32
|
+
// // Шаг 1: Фильтрация блогпостов по создателю
|
33
|
+
// { $match: { "creator.target": req.userId } },
|
34
|
+
// // Шаг 2: Соединение с Reaction для подсчета реакций
|
35
|
+
// {
|
36
|
+
// $lookup: {
|
37
|
+
// from: "reactions",
|
38
|
+
// localField: "_id",
|
39
|
+
// foreignField: "target",
|
40
|
+
// as: "reactions"
|
41
|
+
// }
|
42
|
+
// },
|
43
|
+
// // Шаг 3: Соединение с Comment для подсчета комментариев
|
44
|
+
// {
|
45
|
+
// $lookup: {
|
46
|
+
// from: "comments",
|
47
|
+
// localField: "_id",
|
48
|
+
// foreignField: "target",
|
49
|
+
// as: "comments"
|
50
|
+
// }
|
51
|
+
// },
|
52
|
+
// // Шаг 4: Соединение с Reward для получения предыдущих наград
|
53
|
+
// {
|
54
|
+
// $lookup: {
|
55
|
+
// from: "rewards",
|
56
|
+
// let: { blogId: "$_id", userId: req.userId },
|
57
|
+
// pipeline: [
|
58
|
+
// { $match: {
|
59
|
+
// $expr: {
|
60
|
+
// $and: [
|
61
|
+
// { $eq: ["$user", "$$userId"] },
|
62
|
+
// { $eq: ["$type", "blogpost"] },
|
63
|
+
// { $eq: ["$target", "$$blogId"] }
|
64
|
+
// ]
|
65
|
+
// }
|
66
|
+
// }
|
67
|
+
// },
|
68
|
+
// { $sort: { createdAt: -1 } },
|
69
|
+
// { $limit: 1 }
|
70
|
+
// ],
|
71
|
+
// as: "previousReward"
|
72
|
+
// }
|
73
|
+
// },
|
74
|
+
// // Шаг 5: Проецирование результата и преобразование массивов в счетчики
|
75
|
+
// {
|
76
|
+
// $project: {
|
77
|
+
// user: req.userId,
|
78
|
+
// type: 'blogpost',
|
79
|
+
// name: "$name",
|
80
|
+
// content: "$content",
|
81
|
+
// url: "$url",
|
82
|
+
// views: "$views",
|
83
|
+
// reactionsCount: { $size: "$reactions" },
|
84
|
+
// commentsCount: { $size: "$comments" },
|
85
|
+
// previousRewardSnapshot: { $arrayElemAt: ["$previousReward.snapshot", 0] },
|
86
|
+
// }
|
87
|
+
// }
|
88
|
+
// ]).exec();
|
89
|
+
|
90
|
+
// // Пересчет наград на основе полученных данных
|
91
|
+
// const calculatedRewards = rewards.map(reward => ({
|
92
|
+
// ...reward,
|
93
|
+
// amount: calculateRewardForPost(
|
94
|
+
// reward.previousRewardSnapshot,
|
95
|
+
// reward.views,
|
96
|
+
// reward.reactionsCount,
|
97
|
+
// reward.commentsCount
|
98
|
+
// ).toString(),
|
99
|
+
// }));
|
100
|
+
|
101
|
+
// res.status(200).send(calculatedRewards);
|
102
|
+
// } catch (error) {
|
103
|
+
// console.error("Error listing rewards:", error);
|
104
|
+
// res.status(500).send({ message: "Internal server error" });
|
105
|
+
// }
|
106
|
+
// };
|
107
|
+
|
29
108
|
const listRewards = async (req, res) => {
|
30
109
|
const blogs = await Blogpost.find({ "creator.target": req.userId }).exec();
|
31
110
|
|
@@ -0,0 +1,27 @@
|
|
1
|
+
module.exports = (mongoose) => {
|
2
|
+
const WalletSchema = new mongoose.Schema(
|
3
|
+
{
|
4
|
+
owner: {
|
5
|
+
type: mongoose.Schema.Types.ObjectId,
|
6
|
+
ref: () => {
|
7
|
+
if (this.owner.type === 'user') return 'User';
|
8
|
+
if (this.owner.type === 'organization') return 'Organization';
|
9
|
+
},
|
10
|
+
required: true,
|
11
|
+
},
|
12
|
+
amount: {
|
13
|
+
type: Number,
|
14
|
+
required: true,
|
15
|
+
default: 0
|
16
|
+
},
|
17
|
+
},
|
18
|
+
{
|
19
|
+
timestamps: {
|
20
|
+
currentTime: () => Date.now(),
|
21
|
+
},
|
22
|
+
},
|
23
|
+
{ strict: false },
|
24
|
+
);
|
25
|
+
|
26
|
+
return mongoose.model("Wallet", WalletSchema);
|
27
|
+
};
|