@ozdao/prometheus-framework 0.2.29 → 0.2.31
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/addMembersQuantity-3505b6f3.mjs +98 -0
- package/dist/addMembersQuantity-fb552ca0.js +97 -0
- package/dist/auth.server.js +6 -9
- package/dist/auth.server.mjs +6 -9
- package/dist/community.server.js +28 -21
- package/dist/community.server.mjs +28 -21
- package/dist/events.server.js +1 -1
- package/dist/events.server.mjs +1 -1
- package/dist/files.server.js +114 -111
- package/dist/files.server.mjs +114 -111
- package/dist/gallery.server.js +3 -3
- package/dist/gallery.server.mjs +3 -3
- package/dist/globals.server.js +1 -1
- package/dist/globals.server.mjs +1 -1
- package/dist/index-a8dffc0c.js +213 -0
- package/dist/index-d769324d.mjs +214 -0
- package/dist/mailing-37c2ba41.mjs +68 -0
- package/dist/mailing-fe16a26a.js +67 -0
- package/dist/main.css +1 -1
- package/dist/middlewares.server.js +1 -1
- package/dist/middlewares.server.mjs +1 -1
- package/dist/organizations.server.js +125 -25
- package/dist/organizations.server.mjs +125 -25
- package/dist/prometheus-framework/src/components/Dropdown/Dropdown.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Dropdown/Dropdown.vue.js +49 -2
- package/dist/prometheus-framework/src/components/Dropdown/Dropdown.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/Dropdown/Dropdown.vue2.js +2 -49
- package/dist/prometheus-framework/src/components/Select/Select.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Select/Select.vue.js +78 -2
- package/dist/prometheus-framework/src/components/Select/Select.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/Select/Select.vue2.js +2 -78
- 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/components/layouts/Community.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/community/components/layouts/Community.vue.js +1 -1
- 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 +1 -1
- package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue.cjs +4 -1
- package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue.js +62 -2
- package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue2.cjs +1 -4
- package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue2.js +2 -62
- 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 +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 +1 -1
- 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 +2 -2
- 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 +1 -1
- 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 +1 -1
- 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 +1 -1
- 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 +1 -1
- 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 +11 -2
- 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 +2 -11
- 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 +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 +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 +2 -2
- 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 +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 +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 +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 +2 -2
- 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 +1 -1
- 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 +2 -2
- package/dist/prometheus-framework.cjs.js +30 -29
- package/dist/prometheus-framework.es.js +2478 -2282
- package/dist/reports.server.js +1 -1
- package/dist/reports.server.mjs +1 -1
- package/dist/style.css +1 -1
- package/dist/users.server.js +1 -1
- package/dist/users.server.mjs +1 -1
- package/package.json +4 -2
- package/src/assets/images/logo.svg +7 -7
- package/src/components/Block/Block.vue +77 -0
- package/src/components/Breadcrumbs/Breadcrumbs.vue +2 -2
- package/src/components/Button/Button.vue +32 -227
- package/src/components/Checkbox/Checkbox.vue +1 -1
- package/src/components/Chips/Chips.vue +8 -8
- package/src/components/DatePicker/DatePicker.vue +3 -4
- package/src/components/EditImages/EditImages.vue +32 -14
- package/src/{modules/globals/components/sections → components/Feed}/Feed.vue +60 -45
- package/src/components/FieldBig/FieldBig.vue +16 -5
- package/src/components/FieldPhone/FieldPhone.vue +2 -1
- package/src/components/Footer/Footer.vue +36 -27
- package/src/components/Header/Header.vue +161 -166
- package/src/components/Loader/Loader.vue +9 -2
- package/src/components/LocationMarker/LocationMarker.vue +38 -12
- package/src/components/LocationSelection/LocationSelection.vue +67 -75
- package/src/components/Magnifier/Magnifier.vue +3 -3
- package/src/components/Navigation/Navigation.vue +16 -16
- package/src/components/Popup/Popup.vue +8 -6
- package/src/components/Select/Select.vue +35 -6
- package/src/components/SelectMulti/SelectMulti.vue +5 -13
- package/src/components/Shader/Shader.vue +128 -0
- package/src/components/Sidebar/Sidebar.vue +71 -35
- package/src/components/Spoiler/Spoiler.vue +1 -1
- package/src/components/Tab/Tab.vue +1 -1
- package/src/components/Tooltip/Tooltip.vue +1 -1
- package/src/components/UploadImage/UploadImage.vue +4 -4
- package/src/components/UploadImageMultiple/UploadImageMultiple.vue +54 -10
- package/src/modules/applications/controllers/applications.controller.js +0 -1
- package/src/modules/auth/components/pages/EnterCode.vue +1 -1
- package/src/modules/auth/components/pages/EnterPassword.vue +3 -3
- package/src/modules/auth/components/pages/ResetPassword.vue +1 -2
- package/src/modules/auth/components/pages/SignIn.vue +26 -10
- package/src/modules/auth/components/pages/SignUp.vue +1 -2
- package/src/modules/auth/controllers/twofa.controller.js +4 -4
- package/src/modules/auth/localization/EnterCode.json +2 -2
- package/src/modules/auth/localization/EnterPassword.json +2 -2
- package/src/modules/auth/localization/ResetPassword.json +2 -2
- package/src/modules/auth/localization/SignIn.json +3 -3
- package/src/modules/auth/localization/SignUp.json +3 -3
- package/src/modules/auth/utils/server/verifyAppleIdToken.js +0 -1
- package/src/modules/backoffice/components/layouts/Backoffice.vue +1 -1
- package/src/modules/backoffice/components/pages/Dashboard.vue +171 -120
- package/src/modules/backoffice/router/backoffice.js +119 -129
- package/src/modules/chats/components/blocks/ChatMessage.vue +25 -0
- package/src/modules/chats/components/pages/ChatPage.vue +50 -0
- package/src/modules/chats/components/sections/ChatWindow.vue +38 -0
- package/src/modules/chats/controllers/chats.controller.js +32 -0
- package/src/modules/chats/models/chat.model.js +26 -0
- package/src/modules/chats/routes/chats.routes.js +53 -0
- package/src/modules/chats/store/chat.store.js +61 -0
- package/src/modules/community/components/blocks/CardBlogpost.vue +19 -4
- package/src/modules/community/components/layouts/Community.vue +96 -39
- package/src/modules/community/components/pages/Blog.vue +4 -3
- package/src/modules/community/components/pages/BlogPost.vue +10 -1
- package/src/modules/community/components/pages/CreateBlogPost.vue +36 -17
- package/src/modules/community/components/sections/HotPosts.vue +3 -3
- package/src/modules/community/components/sections/JoinUs.vue +19 -13
- package/src/modules/community/controllers/blog.controller.js +3 -4
- package/src/modules/community/controllers/utils/queryProcessor.js +16 -17
- package/src/modules/community/models/blogpost.model.js +6 -3
- package/src/modules/community/store/blogposts.js +1 -0
- package/src/modules/constructor/components/elements/Embed.vue +12 -1
- package/src/modules/constructor/components/elements/ImageUpload.vue +2 -2
- package/src/modules/constructor/components/elements/Textarea.vue +6 -1
- package/src/modules/constructor/components/elements/Video.vue +79 -0
- package/src/modules/constructor/components/elements/VideoPlayer.vue +59 -0
- package/src/modules/constructor/components/elements/Youtube.vue +52 -0
- package/src/modules/constructor/components/sections/Constructor.vue +27 -3
- package/src/modules/events/components/layouts/layoutEvents.vue +7 -28
- package/src/modules/files/controllers/files.controller.js +9 -22
- package/src/modules/files/middlewares/server/index.js +2 -2
- package/src/modules/files/middlewares/server/middlewareBusboy.js +137 -0
- package/src/modules/files/routes/files.routes.js +9 -9
- package/src/modules/globals/localization/vue-i18n.js +8 -1
- package/src/modules/globals/mixins/mixins.js +23 -13
- package/src/modules/globals/router/routerGuards.js +2 -2
- package/src/modules/globals/store/globals.js +86 -9
- package/src/modules/globals/utils/mailing.js +24 -3
- package/src/modules/icons/entities/IconCommunity.vue +4 -4
- package/src/modules/icons/entities/IconEvents.vue +1 -1
- package/src/modules/icons/entities/IconGroups.vue +1 -1
- package/src/modules/icons/entities/IconPrice.vue +5 -0
- package/src/modules/icons/entities/IconProfile.vue +5 -0
- package/src/modules/icons/entities/IconShopcart.vue +5 -0
- package/src/modules/icons/entities/IconTime.vue +5 -0
- package/src/modules/icons/icons.client.js +4 -0
- package/src/modules/icons/labels/LabelAppStore.vue +24 -24
- package/src/modules/icons/labels/LabelGooglePlay.vue +9 -9
- package/src/modules/icons/logos/Logotype.vue +20 -0
- package/src/modules/icons/navigation/IconAdd.vue +17 -0
- package/src/modules/icons/navigation/IconChevronBottom.vue +18 -0
- package/src/modules/icons/navigation/IconChevronRight.vue +3 -3
- package/src/modules/icons/navigation/IconDelete.vue +19 -0
- package/src/modules/icons/navigation/IconMinus.vue +15 -0
- package/src/modules/icons/navigation/IconSearch.vue +17 -0
- package/src/modules/icons/navigation/IconUpload.vue +16 -0
- package/src/modules/icons/placeholders/PlaceholderImage.vue +5 -0
- package/src/modules/icons/placeholders/PlaceholderOrganizationPic.vue +20 -0
- package/src/modules/icons/placeholders/PlaceholderUserpic.vue +4 -18
- package/src/modules/icons/socials/instagram.vue +1 -1
- package/src/modules/icons/socials/line.vue +1 -1
- package/src/modules/icons/socials/reddit.vue +1 -1
- package/src/modules/icons/socials/telegram.vue +1 -1
- package/src/modules/icons/socials/twitter.vue +1 -1
- package/src/modules/icons/socials/youtube.vue +1 -1
- package/src/modules/landing/components/sections/Guide.vue +92 -0
- package/src/modules/landing/components/sections/MobileApp.vue +23 -12
- package/src/modules/marketplace/components/layouts/Marketplace.vue +76 -188
- package/src/modules/marketplace/components/pages/Catalog.vue +65 -119
- package/src/modules/marketplace/components/sections/Filters.vue +195 -0
- package/src/modules/marketplace/store/marketplace.js +2 -2
- package/src/modules/middlewares/client/auth.validation.js +0 -6
- package/src/modules/middlewares/client/states.validation.js +2 -8
- package/src/modules/middlewares/server/authJwt.js +1 -1
- package/src/modules/mobile/components/Menu/MenuItem.vue +3 -6
- package/src/modules/openai/controllers/openai.controller.js +0 -1
- package/src/modules/orders/components/blocks/CardOrder.vue +166 -0
- package/src/modules/orders/components/blocks/CardOrderItem.vue +59 -66
- package/src/modules/orders/components/blocks/Positions.vue +4 -4
- package/src/modules/orders/components/pages/EditOrder.vue +78 -142
- package/src/modules/orders/components/pages/FormOrder.vue +192 -0
- package/src/modules/orders/components/pages/Order.vue +326 -120
- package/src/modules/orders/components/pages/Orders.vue +13 -9
- package/src/modules/orders/components/pages/{ViewOrder.vue → Orders_refact.vue} +13 -10
- package/src/modules/orders/components/partials/ShopCart.vue +22 -13
- package/src/modules/orders/components/sections/EmptyState.vue +1 -1
- package/src/modules/orders/components/sections/{Form.vue → FormOrderDetails.vue} +38 -106
- package/src/modules/orders/controllers/orders.controller.js +37 -28
- package/src/modules/orders/models/order.model.js +39 -9
- package/src/modules/orders/router/orders.router.js +23 -2
- package/src/modules/orders/routes/orders.routes.js +14 -17
- package/src/modules/orders/store/orders.js +24 -9
- package/src/modules/orders/store/shopcart.js +20 -19
- package/src/modules/organizations/components/blocks/CardDepartment.vue +1 -1
- package/src/modules/organizations/components/blocks/CardOrganization.vue +98 -46
- package/src/modules/organizations/components/blocks/Rating.vue +1 -1
- package/src/modules/organizations/components/blocks/Socials.vue +11 -3
- package/src/modules/organizations/components/elements/ButtonToggleMembership.vue +1 -1
- package/src/modules/organizations/components/pages/Department.vue +1 -1
- package/src/modules/organizations/components/pages/DepartmentEdit.vue +4 -4
- package/src/modules/organizations/components/pages/Members.vue +6 -4
- package/src/modules/organizations/components/pages/Organization.vue +120 -49
- package/src/modules/organizations/components/pages/OrganizationEdit.vue +8 -1
- package/src/modules/organizations/components/pages/Organizations.vue +27 -6
- package/src/modules/organizations/components/sections/DetailsTab.vue +11 -9
- package/src/modules/organizations/components/sections/Feed.vue +0 -3
- package/src/modules/organizations/components/sections/FeedDepartments.vue +2 -2
- package/src/modules/organizations/controllers/organizations.controller.js +126 -15
- package/src/modules/organizations/controllers/utils/addMembersQuantity.js +19 -9
- package/src/modules/organizations/models/organization.model.js +5 -2
- package/src/modules/organizations/router/members.router.js +1 -3
- package/src/modules/organizations/router/organizations.js +8 -6
- package/src/modules/organizations/router/products.router.js +36 -2
- package/src/modules/organizations/store/organizations.js +38 -84
- package/src/modules/pages/controllers/pages.controller.js +0 -4
- package/src/modules/payments/controller/payments.controller.js +1 -1
- package/src/modules/products/components/blocks/CardLeftover.vue +17 -22
- package/src/modules/products/components/blocks/CardPosition.vue +96 -49
- package/src/modules/products/components/blocks/CardProduct.vue +24 -53
- package/src/modules/products/components/blocks/Images360.vue +4 -4
- package/src/modules/products/components/blocks/ImagesThumbnails.vue +2 -7
- package/src/modules/products/components/blocks/ListPositions.vue +74 -0
- package/src/modules/products/components/elements/Price.vue +11 -5
- package/src/modules/products/components/elements/THC.vue +6 -6
- package/src/modules/products/components/pages/{LeftoverAdd.vue → EditLeftover.vue} +93 -79
- package/src/modules/products/components/pages/Leftovers.vue +74 -70
- package/src/modules/products/components/pages/Product.vue +4 -7
- package/src/modules/products/components/pages/ProductEdit.vue +230 -88
- package/src/modules/products/components/pages/ProductRecommmendation.vue +1 -1
- package/src/modules/products/components/pages/Products.vue +6 -3
- package/src/modules/products/components/pages/ProductsBackoffice.vue +3 -5
- package/src/modules/products/components/sections/EditModifications.vue +3 -3
- package/src/modules/products/components/sections/EditProductInfo.vue +40 -50
- package/src/modules/products/components/sections/FilterProducts.vue +57 -18
- package/src/modules/products/components/sections/HeroRecommendation.vue +233 -99
- package/src/modules/products/components/sections/MenuSection.vue +127 -0
- package/src/modules/products/components/sections/PopularProducts.vue +81 -37
- package/src/modules/products/components/sections/SectionProduct.vue +21 -23
- package/src/modules/products/controllers/leftovers.controller.js +11 -1
- package/src/modules/products/controllers/products.controller.js +100 -97
- package/src/modules/products/models/leftover.model.js +6 -4
- package/src/modules/products/models/product.model.js +13 -1
- package/src/modules/products/routes/products.routes.js +4 -4
- package/src/modules/products/store/leftovers.js +4 -24
- package/src/modules/products/store/products.js +44 -30
- package/src/modules/spots/components/blocks/CardSpot.vue +43 -72
- package/src/modules/spots/components/layouts/Spots.vue +9 -91
- package/src/modules/spots/components/pages/Map.vue +171 -62
- package/src/modules/spots/components/pages/Spot.vue +1 -1
- package/src/modules/spots/components/pages/SpotEdit.vue +131 -174
- package/src/modules/spots/controllers/spots.controller.js +1 -0
- package/src/modules/spots/models/spot.model.js +6 -3
- package/src/modules/spots/store/spots.js +42 -48
- package/src/modules/users/components/pages/Profile.vue +6 -28
- package/src/modules/users/components/pages/ProfileBlogposts.vue +1 -1
- package/src/modules/users/components/pages/ProfileEdit.vue +1 -1
- package/src/modules/users/components/pages/ProfileEvents.vue +1 -1
- package/src/modules/users/components/pages/ProfileOrganizations.vue +1 -1
- package/src/modules/users/router/users.js +1 -1
- package/src/modules/wallet/components/pages/Wallet.vue +105 -109
- package/src/modules/wallet/controllers/crypto.controller.js +129 -0
- package/src/modules/wallet/models/reward.model.js +53 -0
- package/src/modules/wallet/routes/crypto.routes.js +36 -0
- package/src/modules/wallet/store/wallet.js +52 -49
- package/src/styles/base/all.scss +144 -12
- package/src/styles/base/backgrounds.scss +2 -34
- package/src/styles/base/borders.scss +18 -23
- package/src/styles/base/scrolling.scss +97 -29
- package/src/styles/base/{shadows.scss → shadow_transitions_hover_refactor.scss} +55 -2
- package/src/styles/config.scss +69 -17
- package/src/styles/layout.scss +12 -182
- package/src/styles/reset.scss +20 -21
- package/src/styles/responsive.scss +4 -67
- package/src/styles/theme.scss +3 -4
- package/src/styles/typography.scss +15 -17
- package/src/assets/fonts/AvenirNext-Bold.woff2 +0 -0
- package/src/assets/fonts/AvenirNext-DemiBold.woff2 +0 -0
- package/src/assets/fonts/AvenirNext-Heavy.woff2 +0 -0
- package/src/assets/fonts/AvenirNext-Medium.woff2 +0 -0
- package/src/assets/fonts/AvenirNext-Regular.woff2 +0 -0
- package/src/assets/fonts/AvenirNext-UltraLight.woff2 +0 -0
- package/src/modules/files/middlewares/server/md.js +0 -152
- package/src/modules/files/middlewares/server/middlewareMulter.js +0 -121
- package/src/modules/organizations/controllers/organizations.new.controller.js +0 -372
- package/src/modules/products/components/blocks/EditCategories.vue +0 -68
- package/src/modules/products/components/sections/EditParameters.vue +0 -58
- package/src/modules/products/components/sections/EditProductImages.vue +0 -67
- package/src/modules/spots/components/sections/Feed.vue +0 -64
- package/src/styles/base/border-radius.scss +0 -47
- package/src/styles/base/cursors.scss +0 -23
- package/src/styles/base/height.scss +0 -60
- package/src/styles/base/hovers.scss +0 -110
- package/src/styles/base/positions.scss +0 -192
- package/src/styles/base/transitions.scss +0 -137
- package/src/styles/base/width.scss +0 -2
- package/src/styles/components/block.scss +0 -18
- package/src/styles/components/breadcrumbs.scss +0 -0
- package/src/styles/components/input.scss +0 -319
@@ -1,14 +1,38 @@
|
|
1
1
|
<template>
|
2
2
|
<div id="popularProducts" class="pd-thin">
|
3
3
|
<div class="bg-grey radius-big pd-t-big pd-b-big">
|
4
|
-
|
5
|
-
|
4
|
+
|
5
|
+
<h2 class="mn-b-semi t-center ">{{t('title')}}</h2>
|
6
|
+
|
7
|
+
<div class="embla" ref="emblaNode">
|
8
|
+
<div class="embla__container">
|
9
|
+
|
10
|
+
<div class="embla__slide pd-thin" v-for="(value, key, index) in productsState" :key="key">
|
11
|
+
<transition name="fade" mode="out-in" appear>
|
12
|
+
<div
|
13
|
+
v-if="!value.name"
|
14
|
+
class="h-100 w-100 radius-big flex-center bg-grey"
|
15
|
+
>
|
16
|
+
<Loader class="pos-relative"/>
|
17
|
+
</div>
|
18
|
+
|
19
|
+
<CardProduct
|
20
|
+
v-else
|
21
|
+
@click="$router.push({
|
22
|
+
name: 'Product Organization',
|
23
|
+
params: {
|
24
|
+
_id: value.organization,
|
25
|
+
product: value._id
|
26
|
+
}
|
27
|
+
})"
|
28
|
+
:product="value"
|
29
|
+
class="cursor-pointer transition-ease-in hover-scale-0 h-100 w-100"
|
30
|
+
/>
|
31
|
+
</transition>
|
32
|
+
</div>
|
33
|
+
|
34
|
+
</div>
|
6
35
|
</div>
|
7
|
-
<carousel ref="myCarousel" :items-to-show="3" :transition="330" :wrapAround="true" :autoplay="3000" :pauseAutoplayOnHover="true" :breakpoints="breakpoints">
|
8
|
-
<slide class="pd-thin" v-for="(value, key, index) in products.state.all" :key="key">
|
9
|
-
<CardProduct class="carousel__item h-100 w-100" :product="value"/>
|
10
|
-
</slide>
|
11
|
-
</carousel>
|
12
36
|
</div>
|
13
37
|
</div>
|
14
38
|
</template>
|
@@ -20,17 +44,16 @@
|
|
20
44
|
import { useRouter } from 'vue-router'
|
21
45
|
import { useI18n } from 'vue-i18n'
|
22
46
|
|
23
|
-
import '
|
24
|
-
import
|
25
|
-
|
47
|
+
import emblaCarouselVue from 'embla-carousel-vue'; // Assuming a Vue version exists
|
48
|
+
import Autoplay from 'embla-carousel-autoplay'
|
49
|
+
|
50
|
+
import Loader from '@pf/src/components/Loader/Loader.vue'
|
26
51
|
import CardProduct from '@pf/src/modules/products/components/blocks/CardProduct.vue'
|
27
52
|
|
28
53
|
import * as products from '@pf/src/modules/products/store/products';
|
29
54
|
|
30
55
|
const router = useRouter()
|
31
56
|
|
32
|
-
await products.actions.read({limit: 10})
|
33
|
-
|
34
57
|
const text = {
|
35
58
|
messages: {
|
36
59
|
en: {
|
@@ -46,36 +69,57 @@
|
|
46
69
|
|
47
70
|
const { t } = useI18n(text)
|
48
71
|
|
49
|
-
const
|
72
|
+
const productsState = ref(10)
|
73
|
+
const selectedIndex = ref(0);
|
74
|
+
const scrollSnaps = ref([]);
|
75
|
+
|
76
|
+
const autoplayOptions = {
|
77
|
+
delay: 2000,
|
78
|
+
jump: false,
|
79
|
+
stopOnInteraction: false,
|
80
|
+
stopOnMouseEnter: false,
|
81
|
+
stopOnFocusIn: true,
|
82
|
+
stopOnLastSnap: false,
|
83
|
+
rootNode: (emblaRoot) => emblaRoot.parentElement
|
84
|
+
}
|
50
85
|
|
51
|
-
const
|
52
|
-
320: { itemsToShow: 1 },
|
53
|
-
640: { itemsToShow: 3 },
|
54
|
-
1024: { itemsToShow: 3 },
|
55
|
-
}
|
86
|
+
const [emblaNode, emblaApi] = emblaCarouselVue({ loop: true }, [Autoplay(autoplayOptions)])
|
56
87
|
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
function updateSlideWidth() {
|
61
|
-
if (!root.value) return;
|
62
|
-
|
63
|
-
const rect = root.value.getBoundingClientRect();
|
64
|
-
|
65
|
-
slideWidth.value = rect.width / config.itemsToShow;
|
66
|
-
}
|
88
|
+
const scrollTo = (index) => emblaApi.value && emblaApi.value.scrollTo(index);
|
89
|
+
const onInit = (embla) => scrollSnaps.value = emblaApi.value.scrollSnapList();
|
90
|
+
const onSelect = (embla) => selectedIndex.value = emblaApi.value.selectedScrollSnap();
|
67
91
|
|
68
|
-
onMounted(async
|
69
|
-
|
92
|
+
onMounted(async() => {
|
93
|
+
productsState.value = await products.actions.read({
|
94
|
+
limit: 10,
|
95
|
+
organization: '657e7134efb8110c51b8b713'
|
96
|
+
})
|
97
|
+
|
98
|
+
onInit(emblaApi);
|
99
|
+
onSelect(emblaApi);
|
70
100
|
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
})
|
101
|
+
emblaApi.value.on('reInit', onInit);
|
102
|
+
emblaApi.value.on('reInit', onSelect);
|
103
|
+
emblaApi.value.on('select', onSelect);
|
104
|
+
});
|
75
105
|
</script>
|
76
106
|
|
77
107
|
<style lang="scss">
|
108
|
+
.embla {
|
109
|
+
overflow: hidden;
|
110
|
+
}
|
111
|
+
.embla__container {
|
112
|
+
display: flex;
|
113
|
+
}
|
114
|
+
.embla__slide {
|
115
|
+
flex: 0 0 25%;
|
116
|
+
min-width: 0;
|
117
|
+
}
|
78
118
|
|
79
|
-
|
80
|
-
|
81
|
-
|
119
|
+
@media screen and (max-width: 1025px) {
|
120
|
+
.embla__slide {
|
121
|
+
flex: 0 0 50%;
|
122
|
+
min-width: 0;
|
123
|
+
}
|
124
|
+
}
|
125
|
+
</style>
|
@@ -1,7 +1,8 @@
|
|
1
1
|
<template>
|
2
|
-
<div class="cols-2-1_2 gap-big
|
3
|
-
|
4
|
-
|
2
|
+
<div class="cols-2-1_2 w-100 gap-big">
|
3
|
+
|
4
|
+
<div class="flex-nowrap flex-column flex pos-relative">
|
5
|
+
<div class="h-100 h-max-50vh bg-grey radius-big o-hidden">
|
5
6
|
<!-- PRODUCT IMAGE -->
|
6
7
|
<Images360
|
7
8
|
v-if="product && product.image3d"
|
@@ -9,30 +10,19 @@
|
|
9
10
|
:imagePath="`/assets/images/products/${product.image3d}`"
|
10
11
|
:imageCount="36"
|
11
12
|
/>
|
13
|
+
|
12
14
|
<img
|
13
15
|
v-if="images[0] && !product.image3d"
|
14
|
-
class="h-100 w-100"
|
15
|
-
style="object-fit:
|
16
|
+
class="h-100 bg-grey w-100"
|
17
|
+
style="object-fit: contain;"
|
16
18
|
:src="(FILE_SERVER_URL || '') + images[0]"
|
17
19
|
/>
|
18
|
-
|
19
|
-
|
20
|
-
height="345"
|
21
|
-
viewBox="0 0 524 345"
|
22
|
-
fill="none"
|
23
|
-
xmlns="http://www.w3.org/2000/svg"
|
20
|
+
|
21
|
+
<PlaceholderImage
|
24
22
|
v-if="!images[0] && !product.image3d"
|
25
23
|
class="h-100 w-100"
|
26
24
|
style="object-fit: cover;"
|
27
|
-
|
28
|
-
<rect width="524" height="345" fill="white"/>
|
29
|
-
<rect width="524" height="345" fill="white" />
|
30
|
-
<circle cx="262" cy="172" r="56" fill="#00ff88" fill-opacity="0.1"/>
|
31
|
-
<path
|
32
|
-
fill="#00ff88"
|
33
|
-
d="M229.348 186.819C230.243 191.884 233.393 194.231 238.458 193.273V193.644C238.458 198.832 241.206 201.581 246.364 201.581H291.545C296.733 201.581 299.481 198.74 299.481 193.644V162.576C299.481 157.481 296.733 154.64 291.545 154.64H285.677L284.071 145.653C283.175 140.619 279.995 138.303 274.899 139.198L230.398 147.043C225.302 147.969 223.048 151.15 223.943 156.246L229.348 186.819ZM230.83 186.479L225.456 156.06C224.715 151.86 226.537 149.266 230.737 148.525L275.084 140.712C279.13 140.001 281.848 141.762 282.62 145.993L284.102 154.64H246.364C241.206 154.64 238.458 157.419 238.458 162.576V191.729L238.365 191.76C234.165 192.532 231.571 190.679 230.83 186.479ZM239.971 162.669C239.971 158.376 242.164 156.153 246.456 156.153H291.483C295.59 156.153 297.968 158.376 297.968 162.669V190.093L284.565 177.894C283.145 176.597 281.662 175.856 279.809 175.856C277.987 175.856 276.628 176.566 275.146 177.863L262.052 189.073L257.142 184.565C255.875 183.36 254.764 182.743 253.158 182.743C251.675 182.743 250.656 183.36 249.39 184.503L239.971 193.212V162.669ZM257.636 178.419C261.373 178.419 264.43 175.3 264.43 171.471C264.43 167.734 261.373 164.584 257.636 164.584C253.806 164.584 250.718 167.734 250.718 171.471C250.718 175.3 253.806 178.419 257.636 178.419Z"
|
34
|
-
/>
|
35
|
-
</svg>
|
25
|
+
/>
|
36
26
|
|
37
27
|
</div>
|
38
28
|
|
@@ -43,7 +33,7 @@
|
|
43
33
|
/>
|
44
34
|
</div>
|
45
35
|
|
46
|
-
<div class="h-100 flex-justify flex col">
|
36
|
+
<div class="pos-relative w-100 h-100 flex-column flex-justify flex col">
|
47
37
|
|
48
38
|
<IconEdit
|
49
39
|
@click="$router.push({
|
@@ -69,9 +59,12 @@
|
|
69
59
|
<h3 v-if="recommendation" class="mn-b-semi">
|
70
60
|
{{ recommendation }}
|
71
61
|
</h3>
|
72
|
-
|
62
|
+
|
63
|
+
|
64
|
+
<p v-if="product.description && !product.localization < 1 && !recommendation" class="w-100 mn-b-medium t-transp">
|
73
65
|
{{ product.description }}
|
74
66
|
</p>
|
67
|
+
|
75
68
|
<p v-if="product.localization && product.localization.length > 1 && !recommendation" class="w-100 mn-b-medium t-transp">
|
76
69
|
{{ t('description') }}
|
77
70
|
</p>
|
@@ -82,7 +75,7 @@
|
|
82
75
|
<div
|
83
76
|
v-if="product.information.length > 0"
|
84
77
|
v-for="information in product.information"
|
85
|
-
class="w-100 pd-small radius-small bg-
|
78
|
+
class="w-100 pd-small radius-small bg-grey-transp-30 product-information"
|
86
79
|
>
|
87
80
|
<p class="t-demi">{{ information.name }}</p>
|
88
81
|
<p>{{ information.value }}</p>
|
@@ -111,6 +104,7 @@ import IconEdit from '@pf/src/modules/icons/navigation/IconEdit.vue'
|
|
111
104
|
|
112
105
|
import THC from '@pf/src/modules/products/components/elements/THC.vue'
|
113
106
|
import Price from '@pf/src/modules/products/components/elements/Price.vue'
|
107
|
+
import PlaceholderImage from '@pf/src/modules/icons/placeholders/PlaceholderImage.vue'
|
114
108
|
// import SelectElement from '@/components/elements/SelectElement.vue'
|
115
109
|
|
116
110
|
import { computed } from 'vue'
|
@@ -166,6 +160,10 @@ function validateToCard(product) {
|
|
166
160
|
}
|
167
161
|
|
168
162
|
function addToCart(product) {
|
163
|
+
if (shopcart.state.organization !== product.organization) {
|
164
|
+
shopcart.state.positions = []
|
165
|
+
shopcart.state.organization = product.organization
|
166
|
+
}
|
169
167
|
shopcart.actions.addProductToCart(product)
|
170
168
|
}
|
171
169
|
</script>
|
@@ -1,12 +1,21 @@
|
|
1
|
+
const ObjectId = require('mongoose').Types.ObjectId;
|
2
|
+
|
1
3
|
const controllerFactory = (db) => {
|
2
4
|
const Leftover = db.leftover;
|
3
5
|
|
4
6
|
const getAll = async (req, res) => {
|
5
7
|
try {
|
6
|
-
|
8
|
+
let query = {};
|
9
|
+
let options = {};
|
10
|
+
|
11
|
+
if (req.query.organization) query.organization = new ObjectId(req.query.organization)
|
12
|
+
|
13
|
+
const leftoveres = await Leftover.find(query, null, options).sort({ 'createdAt': 'desc' }).exec();
|
14
|
+
|
7
15
|
if (!leftoveres) {
|
8
16
|
return res.status(404).send({ message: "LEFTOVERES_NOT_FOUND" });
|
9
17
|
}
|
18
|
+
|
10
19
|
res.status(200).send(leftoveres);
|
11
20
|
} catch (err) {
|
12
21
|
res.status(500).send({ message: "ERROR_GET_ALL_LEFTOVERES" });
|
@@ -16,6 +25,7 @@ const controllerFactory = (db) => {
|
|
16
25
|
const create = async (req, res) => {
|
17
26
|
try {
|
18
27
|
const leftover = await Leftover.create({
|
28
|
+
organization: req.body.organization,
|
19
29
|
type: req.body.type,
|
20
30
|
order: req.body.order,
|
21
31
|
positions: req.body.positions
|
@@ -1,6 +1,6 @@
|
|
1
1
|
const {v1: uuidv1, v4: uuidv4, } = require('uuid');
|
2
|
+
const ObjectId = require('mongoose').Types.ObjectId;
|
2
3
|
|
3
|
-
const fetch = require('node-fetch')
|
4
4
|
const path = require('path');
|
5
5
|
|
6
6
|
const OpenAI = require("openai");
|
@@ -26,44 +26,85 @@ const controllerFactory = (db) => {
|
|
26
26
|
res.status(500).send({ message: err.message });
|
27
27
|
}
|
28
28
|
};
|
29
|
+
const ReadCount = async (req, res) => {
|
30
|
+
|
31
|
+
}
|
29
32
|
// Read products
|
30
33
|
const Read = async (req, res) => {
|
31
34
|
try {
|
32
|
-
|
33
35
|
let query = {};
|
34
36
|
let options = {};
|
35
37
|
|
36
38
|
if (req.query.organization) {
|
37
|
-
query.organization = req.query.organization;
|
39
|
+
query.organization = new ObjectId(req.query.organization);
|
38
40
|
}
|
39
41
|
|
40
|
-
// Handle fetching a specific product by _id
|
41
42
|
if (req.query._id) {
|
42
43
|
query._id = req.query._id;
|
43
44
|
}
|
44
45
|
|
45
|
-
if (req.status) {
|
46
|
+
if (req.query.status) {
|
46
47
|
query.status = req.query.status;
|
47
48
|
}
|
48
49
|
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
50
|
+
const categories = req.query.categories?.split(',') || [];
|
51
|
+
|
52
|
+
if (categories.length) {
|
53
|
+
query.category = { $in: categories };
|
54
|
+
}
|
55
|
+
|
56
|
+
const deliveryOptions = req.query.delivery?.split(',') || [];
|
57
|
+
|
58
|
+
if (deliveryOptions.length) {
|
59
|
+
query.delivery = { $in: deliveryOptions };
|
60
|
+
}
|
61
|
+
|
62
|
+
// Handle price ranges
|
63
|
+
const prices = req.query.prices?.split(',') || [];
|
64
|
+
|
65
|
+
console.log(prices)
|
66
|
+
console.log(req.query.prices)
|
67
|
+
|
68
|
+
if (prices.length) {
|
69
|
+
query.price = {
|
70
|
+
$or: prices.map(priceRange => {
|
71
|
+
if (priceRange.startsWith('<')) return { $lt: parseInt(priceRange.slice(1)) }
|
72
|
+
if (priceRange.startsWith('>')) return { $gt: parseInt(priceRange.slice(1)) }
|
73
|
+
|
74
|
+
const [min, max] = priceRange.split('-').map(Number)
|
75
|
+
|
76
|
+
return { $gte: min, $lte: max }
|
77
|
+
})
|
78
|
+
}
|
79
|
+
}
|
80
|
+
|
81
|
+
// Handle pagination and sorting
|
82
|
+
options.skip = parseInt(req.query.skip) || 0;
|
83
|
+
options.limit = parseInt(req.query.limit) || 10;
|
53
84
|
options.sort = { createdAt: -1 };
|
54
85
|
|
86
|
+
// Count functionality
|
87
|
+
if (req.query.count) {
|
88
|
+
try {
|
89
|
+
const count = await Product.countDocuments(query);
|
90
|
+
return res.status(200).json({ count });
|
91
|
+
} catch (err) {
|
92
|
+
return res.status(500).json({ message: err.message });
|
93
|
+
}
|
94
|
+
}
|
95
|
+
|
55
96
|
console.log(query)
|
97
|
+
|
98
|
+
// Fetching products
|
56
99
|
const products = await Product.find(query, null, options);
|
57
100
|
|
58
|
-
|
59
|
-
|
60
|
-
return res.status(404).send({ message: "Products not found." });
|
101
|
+
if (!products.length) {
|
102
|
+
return res.status(200).json([]);
|
61
103
|
}
|
62
|
-
|
63
|
-
res.status(200).
|
104
|
+
|
105
|
+
res.status(200).json(products);
|
64
106
|
} catch (err) {
|
65
|
-
|
66
|
-
return res.status(500).send({ message: err });
|
107
|
+
return res.status(500).json({ message: err.message });
|
67
108
|
}
|
68
109
|
};
|
69
110
|
|
@@ -85,6 +126,7 @@ const controllerFactory = (db) => {
|
|
85
126
|
information: req.body.information,
|
86
127
|
localization: req.body.localization,
|
87
128
|
quantity: req.body.quantity,
|
129
|
+
quantityDiscount: req.body.quantityDiscount
|
88
130
|
},
|
89
131
|
{ new: true }
|
90
132
|
);
|
@@ -204,7 +246,6 @@ const controllerFactory = (db) => {
|
|
204
246
|
try {
|
205
247
|
const products = await Product.find({
|
206
248
|
status: 'published',
|
207
|
-
popularity: { $gt: 10 },
|
208
249
|
}).limit(40);
|
209
250
|
|
210
251
|
if (!products) {
|
@@ -286,97 +327,59 @@ const controllerFactory = (db) => {
|
|
286
327
|
});
|
287
328
|
};
|
288
329
|
// Get product
|
289
|
-
const getProduct = (req, res) => {
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
"$eq": ["$product._id", "$$productId"]
|
300
|
-
}
|
301
|
-
}
|
302
|
-
},{
|
303
|
-
$lookup: {
|
304
|
-
from: "leftovers",
|
305
|
-
let: { "productId": "$_id" },
|
306
|
-
pipeline: [{
|
330
|
+
const getProduct = async (req, res) => {
|
331
|
+
try {
|
332
|
+
const product = await Product.aggregate([{
|
333
|
+
$match: { "_id" : new ObjectId(req.params._id) }
|
334
|
+
},{
|
335
|
+
$lookup: {
|
336
|
+
from: "leftovers",
|
337
|
+
let: { "productId": "$_id" },
|
338
|
+
pipeline: [
|
339
|
+
{
|
307
340
|
$unwind: "$positions"
|
308
|
-
},
|
341
|
+
},
|
342
|
+
{
|
309
343
|
"$match": { "$expr": { "$eq": ["$positions._id", "$$productId"] }}
|
310
|
-
},
|
344
|
+
},
|
345
|
+
{
|
311
346
|
"$project": {
|
312
347
|
_id: "$positions._id",
|
313
348
|
quantity: "$positions.quantity",
|
314
349
|
name: "$positions.name",
|
315
350
|
// "quantity": "$$quantity"
|
316
351
|
}
|
317
|
-
}],
|
318
|
-
as: "variantsMods"
|
319
|
-
},
|
320
|
-
},{
|
321
|
-
$set: {
|
322
|
-
quantity:{
|
323
|
-
$sum:["$quantity",{$sum:"$variantsMods.quantity"}]
|
324
|
-
}
|
325
|
-
}
|
326
|
-
},{
|
327
|
-
$unset: "variants"
|
328
|
-
}],
|
329
|
-
as: "modifications"
|
330
|
-
},
|
331
|
-
},{
|
332
|
-
$lookup: {
|
333
|
-
from: "leftovers",
|
334
|
-
let: { "productId": "$_id" },
|
335
|
-
pipeline: [
|
336
|
-
{
|
337
|
-
$unwind: "$positions"
|
338
|
-
},
|
339
|
-
{
|
340
|
-
"$match": { "$expr": { "$eq": ["$positions._id", "$$productId"] }}
|
341
|
-
},
|
342
|
-
{
|
343
|
-
"$project": {
|
344
|
-
_id: "$positions._id",
|
345
|
-
quantity: "$positions.quantity",
|
346
|
-
name: "$positions.name",
|
347
|
-
// "quantity": "$$quantity"
|
348
352
|
}
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
}
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
353
|
+
],
|
354
|
+
as: "variants"
|
355
|
+
}
|
356
|
+
},{
|
357
|
+
$set: {
|
358
|
+
quantity:{
|
359
|
+
$sum:["$quantity",{$sum:"$variants.quantity"}]
|
360
|
+
}
|
357
361
|
}
|
358
|
-
}
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
if (err) {return res.status(500).send({ message: err }); }
|
365
|
-
// If not found
|
366
|
-
if (!product) {return res.status(404).send({ message: "Product not found." }); }
|
367
|
-
// If success
|
368
|
-
Product.findOneAndUpdate(
|
369
|
-
{ _id: req.params._id },
|
370
|
-
{ $inc: { popularity: 1 } },
|
371
|
-
{ new: true },
|
372
|
-
(err, updatedProduct) => {
|
373
|
-
if (err) { console.error('Error updating popularity:', err); }
|
374
|
-
else { console.log('Popularity updated:', updatedProduct); }
|
362
|
+
},
|
363
|
+
{ $unset: "variants" }
|
364
|
+
])
|
365
|
+
|
366
|
+
if (!product || product.length < 1) {
|
367
|
+
return res.status(404).send({ message: "Product not found." });
|
375
368
|
}
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
|
369
|
+
|
370
|
+
const updatedProduct = await Product.findOneAndUpdate(
|
371
|
+
{ _id: req.params._id },
|
372
|
+
{ $inc: { popularity: 1 } },
|
373
|
+
{ new: true }
|
374
|
+
);
|
375
|
+
|
376
|
+
console.log('Popularity updated:', updatedProduct);
|
377
|
+
|
378
|
+
res.status(200).send(product);
|
379
|
+
} catch (err) {
|
380
|
+
console.error('Error:', err);
|
381
|
+
res.status(500).send({ message: err });
|
382
|
+
}
|
380
383
|
};
|
381
384
|
|
382
385
|
return {
|
@@ -1,8 +1,9 @@
|
|
1
1
|
module.exports = (mongoose) => {
|
2
2
|
const LeftoverSchema = new mongoose.Schema({
|
3
3
|
organization: {
|
4
|
-
type:
|
5
|
-
|
4
|
+
type: mongoose.Schema.Types.ObjectId,
|
5
|
+
ref: 'Organization',
|
6
|
+
},
|
6
7
|
type: {
|
7
8
|
type: String,
|
8
9
|
enum: ['stock-in','stock-out','write-off'],
|
@@ -17,8 +18,9 @@ module.exports = (mongoose) => {
|
|
17
18
|
},
|
18
19
|
positions: [{
|
19
20
|
_id: {
|
20
|
-
type:
|
21
|
-
|
21
|
+
type: mongoose.Schema.Types.ObjectId,
|
22
|
+
ref: 'Product',
|
23
|
+
},
|
22
24
|
name: {
|
23
25
|
type: String
|
24
26
|
},
|
@@ -15,7 +15,6 @@ module.exports = (mongoose) => {
|
|
15
15
|
description: {type: String},
|
16
16
|
sale: {type: Number},
|
17
17
|
price: {type: Number},
|
18
|
-
coverImage: {type: String},
|
19
18
|
images: {type: Array},
|
20
19
|
popularity: {type: Number},
|
21
20
|
localization: {type: Array},
|
@@ -25,6 +24,19 @@ module.exports = (mongoose) => {
|
|
25
24
|
}],
|
26
25
|
// MoySklad
|
27
26
|
quantity: {type: Number},
|
27
|
+
quantityDiscount: [{
|
28
|
+
quantity: {
|
29
|
+
type: Number,
|
30
|
+
required: true,
|
31
|
+
min: [1, 'Quantity cannot be less than 1']
|
32
|
+
},
|
33
|
+
discount: {
|
34
|
+
type: Number,
|
35
|
+
required: true,
|
36
|
+
min: [0, 'Quantity-based discount cannot be less than 0'],
|
37
|
+
max: [100, 'Quantity-based discount cannot be more than 100']
|
38
|
+
},
|
39
|
+
}]
|
28
40
|
}, {
|
29
41
|
timestamps: {
|
30
42
|
currentTime: () => Date.now()
|
@@ -46,9 +46,9 @@ module.exports = function(app, db, allowedOrigins) {
|
|
46
46
|
controller.getProductRecommendation
|
47
47
|
);
|
48
48
|
// // Get product
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
49
|
+
app.get(
|
50
|
+
"/products/:_id",
|
51
|
+
controller.getProduct
|
52
|
+
);
|
53
53
|
};
|
54
54
|
|
@@ -11,6 +11,7 @@ const $axios = axios.create({baseURL: process.env.API_URL, withCredentials: true
|
|
11
11
|
const state = reactive({
|
12
12
|
all: [],
|
13
13
|
current: {
|
14
|
+
organization: "",
|
14
15
|
type: "",
|
15
16
|
order: "",
|
16
17
|
positions: [],
|
@@ -20,7 +21,7 @@ const state = reactive({
|
|
20
21
|
const actions = {
|
21
22
|
async read(options) {
|
22
23
|
try {
|
23
|
-
const response = await $axios.get('/leftovers');
|
24
|
+
const response = await $axios.get('/leftovers', { params: options });
|
24
25
|
state.all = response.data;
|
25
26
|
return response.data;
|
26
27
|
} catch (error) {
|
@@ -40,9 +41,9 @@ const actions = {
|
|
40
41
|
}
|
41
42
|
},
|
42
43
|
|
43
|
-
async create({ type, order, positions }) {
|
44
|
+
async create({ organization, type, order, positions }) {
|
44
45
|
try {
|
45
|
-
const response = await $axios.post('/leftovers', { type, order, positions });
|
46
|
+
const response = await $axios.post('/leftovers', { organization, type, order, positions });
|
46
47
|
state.all.push(response.data);
|
47
48
|
return response.data;
|
48
49
|
} catch (error) {
|
@@ -72,27 +73,6 @@ const actions = {
|
|
72
73
|
throw error;
|
73
74
|
}
|
74
75
|
},
|
75
|
-
|
76
|
-
// In your Vuex store
|
77
|
-
addProductToLeftover({ product, price, quantity, type }) {
|
78
|
-
const existingProduct = state.current.positions.find(item => item._id === product._id);
|
79
|
-
|
80
|
-
if (!existingProduct) {
|
81
|
-
state.current.positions.push({ ...product, price, quantity, type });
|
82
|
-
} else {
|
83
|
-
existingProduct.quantity += quantity;
|
84
|
-
existingProduct.price = price;
|
85
|
-
existingProduct.type = type
|
86
|
-
}
|
87
|
-
},
|
88
|
-
|
89
|
-
deleteItemFromLeftover(product) {
|
90
|
-
const index = state.current.positions.findIndex(c => c._id === product._id);
|
91
|
-
if (index !== -1) {
|
92
|
-
state.current.positions.splice(index, 1);
|
93
|
-
}
|
94
|
-
},
|
95
|
-
|
96
76
|
};
|
97
77
|
|
98
78
|
const history = [];
|