@ozdao/prometheus-framework 0.2.81 → 0.2.82
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/auth.server.js +1 -1
- package/dist/auth.server.mjs +1 -1
- package/dist/community.server.js +3 -3
- package/dist/community.server.mjs +3 -3
- package/dist/credentials.schema-CDZCKfEI.mjs +106 -0
- package/dist/credentials.schema-CfhPcsuI.js +105 -0
- package/dist/events.server.js +4 -15
- package/dist/events.server.mjs +3 -14
- package/dist/files.server.js +1 -1
- package/dist/files.server.mjs +1 -1
- package/dist/gallery.server.js +1 -1
- package/dist/gallery.server.mjs +1 -1
- package/dist/index-B6a1mPgp.mjs +217 -0
- package/dist/index-BCCiEK_u.js +216 -0
- package/dist/main-8N2Jmsuk.js +91 -0
- package/dist/main-CkeuHuCY.mjs +13619 -0
- package/dist/main.css +1 -1
- package/dist/metadata.schema-Cu_mPkjE.js +77 -0
- package/dist/metadata.schema-cbFgazeK.mjs +78 -0
- package/dist/middlewares.server.js +1 -1
- package/dist/middlewares.server.mjs +1 -1
- package/dist/node_modules/@googlemaps/js-api-loader/dist/index.cjs +1 -0
- package/dist/node_modules/@googlemaps/js-api-loader/dist/index.js +238 -0
- package/dist/organizations.server.js +297 -134
- package/dist/organizations.server.mjs +295 -132
- package/dist/products.server.js +2 -2
- package/dist/products.server.mjs +2 -2
- package/dist/prometheus-framework/src/components/Address/Address.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/Address/Address.vue2.js +33 -24
- package/dist/prometheus-framework/src/components/Block/Block.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Block/Block.vue.js +23 -20
- package/dist/prometheus-framework/src/components/Button/Button.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Button/Button.vue.js +1 -225
- package/dist/prometheus-framework/src/components/Button/Button.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/Button/Button.vue2.js +102 -1
- package/dist/prometheus-framework/src/components/Feed/Feed.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Feed/Feed.vue.js +71 -60
- package/dist/prometheus-framework/src/components/Field/Field.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Field/Field.vue.js +1 -84
- package/dist/prometheus-framework/src/components/Field/Field.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/Field/Field.vue2.js +84 -1
- package/dist/prometheus-framework/src/components/FieldBig/FieldBig.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/FieldBig/FieldBig.vue.js +1 -1
- package/dist/prometheus-framework/src/components/FieldPhone/FieldPhone.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/FieldPhone/FieldPhone.vue.js +325 -340
- package/dist/prometheus-framework/src/components/FieldPhone/FieldPhone2.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/FieldPhone/FieldPhone2.vue.js +2 -2
- package/dist/prometheus-framework/src/components/LocationMarker/LocationMarker.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/LocationMarker/LocationMarker.vue2.js +53 -44
- package/dist/prometheus-framework/src/components/Popup/Popup.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/Popup/Popup.vue2.js +41 -40
- package/dist/prometheus-framework/src/components/Select/Select.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/Select/Select.vue2.js +37 -31
- package/dist/prometheus-framework/src/components/Slider/Slider.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Slider/Slider.vue.js +18 -19
- package/dist/prometheus-framework/src/components/Tab/Tab.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Tab/Tab.vue.js +1 -36
- package/dist/prometheus-framework/src/components/Tab/Tab.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/Tab/Tab.vue2.js +36 -1
- package/dist/prometheus-framework/src/components/Tooltip/Tooltip.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Tooltip/Tooltip.vue.js +45 -1
- package/dist/prometheus-framework/src/components/Tooltip/Tooltip.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/Tooltip/Tooltip.vue2.js +1 -45
- 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 +30 -30
- 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 +26 -26
- 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 +78 -103
- 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 +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 +2 -2
- 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 +15 -15
- 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 +1 -1
- package/dist/prometheus-framework/src/modules/events/components/blocks/CardEvent.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/events/components/blocks/CardEvent.vue.js +4 -4
- package/dist/prometheus-framework/src/modules/events/components/elements/ButtonCheck.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/events/components/elements/ButtonCheck.vue.js +1 -1
- 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/pages/EditEvent.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/events/components/pages/EditEventTickets.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/events/components/pages/EditEventTickets.vue.js +2 -2
- 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 +29 -27
- 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 +2 -2
- 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 +2 -2
- package/dist/prometheus-framework/src/modules/globals/components/blocks/BlockSearch.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/globals/components/blocks/BlockSearch.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 +2 -2
- package/dist/prometheus-framework/src/modules/globals/components/sections/SectionPageTitle.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/globals/components/sections/SectionPageTitle.vue.js +33 -26
- package/dist/prometheus-framework/src/modules/globals/localization/vue-i18n.cjs +1 -1
- package/dist/prometheus-framework/src/modules/globals/localization/vue-i18n.js +6 -3
- package/dist/prometheus-framework/src/modules/globals/services/globals.store.cjs +1 -0
- package/dist/prometheus-framework/src/modules/globals/services/globals.store.js +70 -0
- package/dist/prometheus-framework/src/modules/icons/entities/IconGallery.vue.cjs +1 -0
- package/dist/prometheus-framework/src/modules/icons/entities/IconGallery.vue.js +28 -0
- package/dist/prometheus-framework/src/modules/icons/entities/IconLeftovers.vue.cjs +1 -0
- package/dist/prometheus-framework/src/modules/icons/entities/IconLeftovers.vue.js +30 -0
- package/dist/prometheus-framework/src/modules/icons/entities/IconOrders.vue.cjs +1 -0
- package/dist/prometheus-framework/src/modules/icons/entities/IconOrders.vue.js +35 -0
- package/dist/prometheus-framework/src/modules/icons/entities/IconProducts.vue.cjs +1 -0
- package/dist/prometheus-framework/src/modules/icons/entities/IconProducts.vue.js +28 -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 +63 -86
- 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 +2 -2
- package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreateBackoffice.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreateBackoffice.vue.js +174 -114
- 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 +40 -40
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormAddCustomer.vue.cjs +1 -0
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormAddCustomer.vue.js +141 -0
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormClientDetails.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormClientDetails.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormCustomerDetails.vue.cjs +1 -0
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormCustomerDetails.vue.js +77 -0
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormDelivery.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormDelivery.vue.js +46 -35
- package/dist/prometheus-framework/src/modules/orders/store/customers.store.cjs +1 -0
- package/dist/prometheus-framework/src/modules/orders/store/customers.store.js +5 -0
- package/dist/prometheus-framework/src/modules/orders/store/models/customer.cjs +1 -0
- package/dist/prometheus-framework/src/modules/orders/store/models/customer.js +30 -0
- package/dist/prometheus-framework/src/modules/orders/store/orders.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/store/orders.js +24 -25
- package/dist/prometheus-framework/src/modules/organizations/components/blocks/CardDepartment.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/blocks/CardDepartment.vue.js +16 -16
- 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 +1 -1
- 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 +38 -49
- 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/Department.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/Department.vue.js +6 -6
- 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 +161 -138
- 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 +198 -78
- 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 +82 -125
- 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 +3 -3
- 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/Documents.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/Documents.vue.js +2 -2
- 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 +59 -70
- 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 +3 -3
- package/dist/prometheus-framework/src/modules/organizations/organizations.client.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/organizations.client.js +34 -36
- package/dist/prometheus-framework/src/modules/organizations/store/departments.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/store/departments.js +38 -18
- package/dist/prometheus-framework/src/modules/organizations/store/invites.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/store/invites.js +34 -35
- 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 +1 -1
- package/dist/prometheus-framework/src/modules/products/components/blocks/CardProduct.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/blocks/CardProduct.vue.js +41 -21
- package/dist/prometheus-framework/src/modules/products/components/blocks/LeftoverPositions.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/blocks/LeftoverPositions.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/products/components/blocks/ListPositions.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/blocks/ListPositions.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/Categories.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/Categories.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/CategoryEdit.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/CategoryEdit.vue.js +2 -2
- 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 +1 -1
- 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 +3 -3
- package/dist/prometheus-framework/src/modules/products/components/pages/Products.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/Products.vue.js +3 -3
- package/dist/prometheus-framework/src/modules/products/components/sections/EditModifications.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/sections/EditModifications.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 +2 -2
- 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 +1 -1
- 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 +24 -26
- package/dist/prometheus-framework/src/modules/users/components/blocks/CardUser.vue.cjs +1 -0
- package/dist/prometheus-framework/src/modules/users/components/blocks/CardUser.vue.js +78 -0
- 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/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/users/store/users.cjs +1 -1
- package/dist/prometheus-framework/src/modules/users/store/users.js +13 -14
- package/dist/prometheus-framework/src/modules/wallet/views/components/pages/Wallet.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/wallet/views/components/pages/Wallet.vue.js +2 -2
- package/dist/prometheus-framework.cjs.js +1 -1
- package/dist/prometheus-framework.es.js +1 -1
- package/dist/queryProcessor-BJdKh0Ow.mjs +162 -0
- package/dist/queryProcessor-DRMo_GWK.js +161 -0
- 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 +69 -38
- package/dist/users.server.mjs +67 -36
- package/dist/wallet.server.js +2 -2
- package/dist/wallet.server.mjs +2 -2
- package/dist/web-CtVocufd.js +1 -0
- package/dist/web-DNq1tHCE.mjs +54 -0
- package/package.json +1 -1
- package/src/components/Address/Address.vue +13 -2
- package/src/components/Block/Block.vue +3 -2
- package/src/components/Button/Button.vue +9 -12
- package/src/components/Feed/Feed.vue +28 -6
- package/src/components/FieldPhone/FieldPhone.vue +592 -558
- package/src/components/LocationMarker/LocationMarker.vue +26 -22
- package/src/components/Popup/Popup.vue +22 -23
- package/src/components/Select/Select.vue +43 -32
- package/src/components/Slider/Slider.vue +3 -4
- package/src/modules/auth/components/pages/Invite.vue +7 -7
- package/src/modules/auth/store/auth.js +1 -1
- package/src/modules/backoffice/components/pages/Dashboard.vue +44 -29
- package/src/modules/community/components/sections/HotPosts.vue +1 -1
- package/src/modules/events/components/blocks/CardEvent.vue +4 -3
- package/src/modules/events/components/pages/Events.vue +23 -6
- package/src/modules/globals/components/sections/SectionPageTitle.vue +19 -7
- package/src/modules/globals/controllers/utils/queryProcessor.js +21 -7
- package/src/modules/globals/localization/vue-i18n.js +3 -0
- package/src/modules/globals/models/credentials.schema.js +7 -0
- package/src/modules/globals/models/metadata.schema.js +17 -0
- package/src/modules/globals/models/profile.schema.js +23 -0
- package/src/modules/globals/models/socials.schema.js +22 -0
- package/src/modules/globals/router/routerGuards.js +1 -0
- package/src/modules/globals/services/globals.cashe.js +26 -0
- package/src/modules/globals/services/globals.crud.js +115 -0
- package/src/modules/globals/services/globals.logger.js +41 -0
- package/src/modules/globals/services/globals.store.js +114 -0
- package/src/modules/icons/entities/IconGallery.vue +14 -0
- package/src/modules/icons/entities/IconLeftovers.vue +14 -0
- package/src/modules/icons/entities/IconOrders.vue +15 -0
- package/src/modules/icons/entities/IconProducts.vue +14 -0
- package/src/modules/landing/components/sections/HeroSection.vue +1 -1
- package/src/modules/landing/components/sections/MobileApp.vue +4 -4
- package/src/modules/landing/router/landing.js +1 -1
- package/src/modules/marketplace/components/sections/Filters.vue +3 -3
- package/src/modules/middlewares/server/accessors/AccessController.js +33 -0
- package/src/modules/middlewares/server/accessors/ReadDepartments.js +101 -0
- package/src/modules/middlewares/server/verifyAccesses.js +33 -0
- package/src/modules/middlewares/server/verifyInvites.js +4 -4
- package/src/modules/orders/components/pages/OrderCreate.vue +2 -2
- package/src/modules/orders/components/pages/OrderCreateBackoffice.vue +105 -68
- package/src/modules/orders/components/pages/Orders.vue +2 -2
- package/src/modules/orders/components/sections/FormAddCustomer.vue +152 -0
- package/src/modules/orders/components/sections/FormCustomerDetails.vue +67 -0
- package/src/modules/orders/components/sections/FormDelivery.vue +17 -3
- package/src/modules/orders/controllers/applications.controller.js +2 -0
- package/src/modules/orders/controllers/orders.controller.js +77 -52
- package/src/modules/orders/models/customer.model.js +54 -18
- package/src/modules/orders/models/order.model.js +1 -1
- package/src/modules/orders/orders.client.js +51 -51
- package/src/modules/orders/orders.server.js +32 -12
- package/src/modules/orders/router/orders.router.js +36 -41
- package/src/modules/orders/routes/orders.routes.js +3 -21
- package/src/modules/orders/store/customers.store.js +5 -0
- package/src/modules/orders/store/models/customer.js +29 -0
- package/src/modules/orders/store/orders.js +14 -20
- package/src/modules/organizations/components/blocks/CardDepartment.vue +3 -3
- package/src/modules/organizations/components/blocks/CardOrganization.vue +1 -1
- package/src/modules/organizations/components/blocks/DepartmentMemberModify.vue +1 -12
- package/src/modules/organizations/components/pages/Department.vue +1 -1
- package/src/modules/organizations/components/pages/DepartmentEdit.vue +72 -48
- package/src/modules/organizations/components/pages/Members.vue +178 -64
- package/src/modules/organizations/components/pages/Organization.vue +1 -41
- package/src/modules/organizations/components/sections/MembersAdd.vue +44 -52
- package/src/modules/organizations/controllers/departments.controller.js +2 -4
- package/src/modules/organizations/controllers/invites.controller.js +24 -23
- package/src/modules/organizations/controllers/organizations.controller.js +1 -1
- package/src/modules/organizations/models/department.model.js +52 -2
- package/src/modules/organizations/models/invite.model.js +29 -32
- package/src/modules/organizations/models/membership.model.js +2 -0
- package/src/modules/organizations/models/organization.model.js +2 -1
- package/src/modules/organizations/organizations.client.js +0 -2
- package/src/modules/organizations/routes/departments.routes.js +18 -7
- package/src/modules/organizations/routes/invites.routes.js +2 -2
- package/src/modules/organizations/store/departments.js +22 -1
- package/src/modules/organizations/store/invites.js +74 -90
- package/src/modules/products/components/blocks/CardProduct.vue +24 -0
- package/src/modules/products/components/pages/Products.vue +1 -1
- package/src/modules/reports/components/sections/FormReport.vue +40 -40
- package/src/modules/spots/components/pages/Spot.vue +1 -1
- package/src/modules/spots/components/pages/SpotEdit.vue +1 -1
- package/src/modules/users/components/blocks/CardUser.vue +85 -0
- package/src/modules/users/controllers/users.controller.js +36 -13
- package/src/modules/users/middlewares/visitor.logger.js +66 -0
- package/src/modules/users/models/request.model.js +18 -0
- package/src/modules/users/models/user.model.js +26 -55
- package/src/modules/users/models/visitor.model.js +14 -0
- package/src/modules/users/store/users.js +2 -11
- package/src/modules/wallet/controllers/routes/payments.routes.js +2 -0
- package/src/components/FieldPhone/FieldPhone(script-setup).vue +0 -1646
- package/src/components/FieldPhone/FieldPhone2.vue +0 -671
- package/src/modules/orders/components/sections/FormClientDetails.vue +0 -61
- package/src/modules/organizations/components/blocks/User.vue +0 -69
- /package/src/modules/backoffice/components/admin/{User.vue → UserEdit.vue} +0 -0
@@ -1,64 +1,152 @@
|
|
1
1
|
<template>
|
2
|
-
<
|
3
|
-
<
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
2
|
+
<div class="pd-thin">
|
3
|
+
<SectionPageTitle
|
4
|
+
title="Members"
|
5
|
+
@update:tabs_current="(update) => tab = update"
|
6
|
+
:tabs_current="tab"
|
7
|
+
:tabs="[
|
8
|
+
{ name: `Members (${organization.state.current.numberOfMembers})`, value: 'members' },
|
9
|
+
{ name: 'Departments', value: 'departments' },
|
10
|
+
{ name: 'Invites', value: 'invites' }
|
11
|
+
]"
|
12
|
+
:actions="[
|
13
|
+
{ method: openMembersAddPopup, label: 'Invite members' }
|
14
|
+
]"
|
15
|
+
class="mn-b-small bg-grey bg-grey radius-big"
|
16
|
+
/>
|
17
|
+
|
18
|
+
<Popup
|
19
|
+
title="Add members"
|
20
|
+
@close-popup="closeMembersAddPopup"
|
21
|
+
:isPopupOpen="isOpenMembersAddPopup"
|
22
|
+
class="bg-white w-min-30r w-max-30r radius-big pd-medium"
|
23
|
+
>
|
9
24
|
<MembersAdd
|
25
|
+
text="Please enter your email or phone number to send an invitation link:"
|
10
26
|
:organization="organizationData"
|
11
27
|
@send-invite="handleSendInvite"
|
12
28
|
/>
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
29
|
+
</Popup>
|
30
|
+
|
31
|
+
<Block
|
32
|
+
v-if="tab === 'departments'"
|
33
|
+
class="mn-b-semi"
|
34
|
+
>
|
35
|
+
<Feed
|
36
|
+
:states="{
|
37
|
+
empty: {
|
38
|
+
title: 'No Departments Found',
|
39
|
+
description: 'Currently, there are no departments available.',
|
40
|
+
action: 'Add department',
|
41
|
+
callback: () => $router.push(`/organizations/${route.params._id}/departments/create`)
|
42
|
+
}
|
43
|
+
}"
|
44
|
+
:store="{
|
45
|
+
read: (options) => departments.actions.read(options),
|
46
|
+
state: null
|
47
|
+
}"
|
48
|
+
:options="{
|
49
|
+
organization: route.params._id,
|
50
|
+
user: auth.state.user._id,
|
51
|
+
hidden: false,
|
52
|
+
}"
|
53
|
+
v-slot="{
|
54
|
+
items
|
55
|
+
}"
|
56
|
+
>
|
57
|
+
<CardDepartment
|
58
|
+
v-for="(department, index) in items"
|
59
|
+
:key="index"
|
60
|
+
:department="department"
|
61
|
+
:organization="route.params._id"
|
62
|
+
class="radius-big bg-white pos-relative mn-b-thin"
|
63
|
+
/>
|
64
|
+
</Feed>
|
65
|
+
</Block>
|
66
|
+
|
67
|
+
<section class="mn-b-big radius-medium bg-white">
|
68
|
+
<!-- Members -->
|
69
|
+
<div
|
70
|
+
v-if="tab === 'members'"
|
71
|
+
class="cols-1 gap-thin"
|
72
|
+
>
|
73
|
+
<Feed
|
74
|
+
:search="true"
|
75
|
+
:states="{
|
76
|
+
empty: {
|
77
|
+
title: 'No Members Found',
|
78
|
+
description: 'Currently, there are no members.'
|
79
|
+
}
|
80
|
+
}"
|
81
|
+
:store="{
|
82
|
+
read: (options) => memberships.actions.read(options)
|
83
|
+
}"
|
84
|
+
:options="{
|
85
|
+
target: route.params._id
|
86
|
+
}"
|
87
|
+
v-slot="{
|
88
|
+
items
|
89
|
+
}"
|
90
|
+
class="gap-thin cols-1"
|
28
91
|
>
|
29
|
-
<
|
30
|
-
v-for="(member,
|
92
|
+
<CardUser
|
93
|
+
v-for="(member,index) in items"
|
31
94
|
:key="index"
|
32
|
-
:user="member"
|
33
|
-
|
34
|
-
|
35
|
-
|
95
|
+
:user="member"
|
96
|
+
:_id="member.user._id"
|
97
|
+
:photo="member.user.profile.photo"
|
98
|
+
:phone="member.user.phone"
|
99
|
+
:email="member.user.email"
|
100
|
+
:name="member.user.profile.name || 'No name'"
|
101
|
+
:role="member.label || member.role"
|
102
|
+
@click="$router.push(`/profile/${member.user._id}`)"
|
103
|
+
:action=" member.role !== 'owner' ? {
|
104
|
+
label: 'x',
|
105
|
+
method: () => removeMember(index, member)
|
106
|
+
} : null"
|
107
|
+
class="w-100 bg-grey radius-big flex-nowrap flex pd-medium"
|
108
|
+
/>
|
109
|
+
</Feed>
|
110
|
+
</div>
|
111
|
+
<!-- Invites -->
|
112
|
+
<div
|
113
|
+
v-if="tab === 'invites'"
|
114
|
+
>
|
115
|
+
<Feed
|
116
|
+
:search="true"
|
117
|
+
:states="{
|
118
|
+
empty: {
|
119
|
+
title: 'No Invites Found',
|
120
|
+
description: 'Currently, there are no members.'
|
121
|
+
}
|
122
|
+
}"
|
123
|
+
:store="{
|
124
|
+
read: (options) => invites.actions.read(options)
|
125
|
+
}"
|
126
|
+
:options="{
|
127
|
+
owner: route.params._id
|
128
|
+
}"
|
129
|
+
v-slot="{
|
130
|
+
items
|
131
|
+
}"
|
132
|
+
class="gap-thin cols-1"
|
133
|
+
>
|
134
|
+
<CardUser
|
135
|
+
v-for="invite in items"
|
136
|
+
:key="index"
|
137
|
+
:user="{ type: 'invite'} "
|
138
|
+
:name="invite.email || invite.phone"
|
139
|
+
:role="invite.status"
|
140
|
+
:action="{
|
141
|
+
label: 'x',
|
142
|
+
method: () => removeInvite(index, invite)
|
143
|
+
}"
|
144
|
+
class="w-100 bg-grey radius-big flex-nowrap flex pd-medium"
|
36
145
|
/>
|
37
|
-
</
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
>
|
42
|
-
<span v-if="invites.length < 1">В организации нет приглашений</span>
|
43
|
-
<div
|
44
|
-
v-for="(invite, index) in invites.state.invites"
|
45
|
-
class="br-grey br-1px br-solid radius-small mn-b-thin flex-nowrap flex-v-center flex pd-medium"
|
46
|
-
>
|
47
|
-
|
48
|
-
<span class="w-100 mn-r-small">{{invite.invitedEmail}} {{invite.invitedPhone}}</span>
|
49
|
-
<span class="t-transp">{{invite.status}}</span>
|
50
|
-
|
51
|
-
<div class="mn-l-medium flex-v-center flex">
|
52
|
-
<button @click="removeInvite(index,invite)" class="button-small button">×</button>
|
53
|
-
</div>
|
54
|
-
|
55
|
-
</div>
|
56
|
-
</div>
|
57
|
-
|
58
|
-
|
59
|
-
</section>
|
60
|
-
</div>
|
61
|
-
</transition>
|
146
|
+
</Feed>
|
147
|
+
</div>
|
148
|
+
</section>
|
149
|
+
</div>
|
62
150
|
</template>
|
63
151
|
|
64
152
|
<script setup>
|
@@ -68,7 +156,9 @@ import { useRoute, useRouter } from 'vue-router'
|
|
68
156
|
import Feed from '@pf/src/components/Feed/Feed.vue'
|
69
157
|
import Tab from '@pf/src/components/Tab/Tab.vue'
|
70
158
|
import Block from '@pf/src/components/Block/Block.vue'
|
159
|
+
import Popup from '@pf/src/components/Popup/Popup.vue';
|
71
160
|
|
161
|
+
import SectionPageTitle from '@pf/src/modules/globals/components/sections/SectionPageTitle.vue'
|
72
162
|
import PlaceholderUserpic from '@pf/src/modules/icons/placeholders/PlaceholderUserpic.vue'
|
73
163
|
|
74
164
|
import MembersAdd from '@pf/src/modules/organizations/components/sections/MembersAdd.vue';
|
@@ -77,8 +167,8 @@ import MembersAdd from '@pf/src/modules/organizations/components/sections/Member
|
|
77
167
|
import Menu from '@pf/src/modules/mobile/components/Menu/Menu.vue'
|
78
168
|
import MenuItem from '@pf/src/modules/mobile/components/Menu/MenuItem.vue'
|
79
169
|
|
80
|
-
import
|
81
|
-
|
170
|
+
import CardUser from '@pf/src/modules/users/components/blocks/CardUser.vue';
|
171
|
+
import CardDepartment from '@pf/src/modules/organizations/components/blocks/CardDepartment.vue';
|
82
172
|
|
83
173
|
import * as auth from '@pf/src/modules/auth/store/auth'
|
84
174
|
import * as invites from '@pf/src/modules/organizations/store/invites';
|
@@ -90,12 +180,22 @@ const route = useRoute()
|
|
90
180
|
const router = useRouter()
|
91
181
|
const organizationData = ref(null)
|
92
182
|
|
93
|
-
|
183
|
+
// Tab logic
|
184
|
+
const tab = ref('members')
|
185
|
+
// Popup
|
186
|
+
const isOpenMembersAddPopup = ref(false);
|
187
|
+
|
188
|
+
function openMembersAddPopup() {
|
189
|
+
isOpenMembersAddPopup.value = true;
|
190
|
+
}
|
191
|
+
|
192
|
+
function closeMembersAddPopup() {
|
193
|
+
isOpenMembersAddPopup.value = false;
|
194
|
+
}
|
94
195
|
|
95
196
|
onMounted(async () => {
|
96
197
|
organizationData.value = (await organization.actions.read({_id: route.params._id, user: auth.state.user._id}))[0]
|
97
|
-
|
98
|
-
await invites.actions.read(organizationData.value._id);
|
198
|
+
;
|
99
199
|
})
|
100
200
|
|
101
201
|
const FirstLevelDepartments = computed(() => {
|
@@ -110,18 +210,32 @@ const FirstLevelDepartments = computed(() => {
|
|
110
210
|
);
|
111
211
|
});
|
112
212
|
|
113
|
-
async function handleSendInvite(
|
114
|
-
await invites.actions.create(
|
213
|
+
async function handleSendInvite(list) {
|
214
|
+
await invites.actions.create({
|
215
|
+
owner: {
|
216
|
+
type: 'Organization',
|
217
|
+
target: organizationData.value._id
|
218
|
+
},
|
219
|
+
creator: {
|
220
|
+
type: 'User',
|
221
|
+
target: auth.state.user._id
|
222
|
+
},
|
223
|
+
invites: list,
|
224
|
+
});
|
115
225
|
}
|
116
226
|
|
117
227
|
async function removeMember(index,member) {
|
118
|
-
|
119
|
-
|
228
|
+
if (confirm("Confirm remove of member") == true) {
|
229
|
+
memberships.state.memberships.splice(index, 1);
|
230
|
+
await memberships.actions.delete(member._id);
|
231
|
+
}
|
120
232
|
}
|
121
233
|
|
122
234
|
async function removeInvite(index,invite) {
|
123
|
-
|
124
|
-
|
235
|
+
if (confirm("Confirm remove of member") == true) {
|
236
|
+
invites.state.invites.splice(index, 1);
|
237
|
+
await invites.actions.delete(invite._id);
|
238
|
+
}
|
125
239
|
}
|
126
240
|
</script>
|
127
241
|
|
@@ -10,44 +10,6 @@
|
|
10
10
|
class="mn-b-semi"
|
11
11
|
/>
|
12
12
|
|
13
|
-
<Block
|
14
|
-
:title="`${organization.state.current.numberOfMembers} members`"
|
15
|
-
:actions="[{
|
16
|
-
label: '>',
|
17
|
-
function: () => $router.push(`/organizations/${route.params._id}/departments/create`)
|
18
|
-
}]"
|
19
|
-
class="mn-b-semi"
|
20
|
-
>
|
21
|
-
<Feed
|
22
|
-
:states="{
|
23
|
-
empty: {
|
24
|
-
title: 'No Departments Found',
|
25
|
-
description: 'Currently, there are no departments available.'
|
26
|
-
}
|
27
|
-
}"
|
28
|
-
:store="{
|
29
|
-
read: (options) => departments.actions.read(options),
|
30
|
-
state: null
|
31
|
-
}"
|
32
|
-
:options="{
|
33
|
-
organization: route.params._id,
|
34
|
-
user: auth.state.user._id,
|
35
|
-
hidden: false,
|
36
|
-
}"
|
37
|
-
v-slot="{
|
38
|
-
items
|
39
|
-
}"
|
40
|
-
>
|
41
|
-
<CardDepartment
|
42
|
-
v-for="(department, index) in items"
|
43
|
-
:key="index"
|
44
|
-
:department="department"
|
45
|
-
:organization="route.params._id"
|
46
|
-
class="radius-big bg-white pos-relative mn-b-thin"
|
47
|
-
/>
|
48
|
-
</Feed>
|
49
|
-
</Block>
|
50
|
-
|
51
13
|
<Tab
|
52
14
|
v-model:selected="tabOrganization"
|
53
15
|
:tabs="[
|
@@ -192,9 +154,7 @@
|
|
192
154
|
import MenuItem from '@pf/src/modules/mobile/components/Menu/MenuItem.vue'
|
193
155
|
// Organizations
|
194
156
|
import DepartmentSub from '@pf/src/modules/organizations/components/blocks/DepartmentSub.vue';
|
195
|
-
import User from '@pf/src/modules/
|
196
|
-
// Ssds
|
197
|
-
import CardDepartment from '@pf/src/modules/organizations/components/blocks/CardDepartment.vue';
|
157
|
+
import User from '@pf/src/modules/users/components/blocks/CardUser.vue';
|
198
158
|
// Feeds
|
199
159
|
import FeedEvents from '@pf/src/modules/events/components/sections/Feed.vue';
|
200
160
|
import FeedCommunity from '@pf/src/modules/community/components/sections/Feed.vue';
|
@@ -1,9 +1,7 @@
|
|
1
1
|
<template>
|
2
2
|
<div>
|
3
|
-
|
4
|
-
|
5
|
-
<p class="mn-b-small t-transp p-medium">Укажите email или телефон, чтобы отправить ссылку с приглашением:</p>
|
6
|
-
|
3
|
+
<p class="mn-b-thin t-transp p-medium">{{text}}</p>
|
4
|
+
<section class="cols-1 mn-b-small radius-medium pd-semi bg-grey">
|
7
5
|
<div
|
8
6
|
v-for="(member, index) in members"
|
9
7
|
:key="index"
|
@@ -13,40 +11,45 @@
|
|
13
11
|
gap-thin
|
14
12
|
radius-small
|
15
13
|
mn-b-thin
|
16
|
-
"
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
/>
|
34
|
-
<div v-if="index > 0" class="mn-r-medium flex-v-center flex">
|
35
|
-
<button @click="removeMember(index)" class="button-small button">×</button>
|
14
|
+
"
|
15
|
+
>
|
16
|
+
<Field
|
17
|
+
v-model:field="member.contact"
|
18
|
+
placeholder="Enter email or phone"
|
19
|
+
class="w-100 pd-small radius-small bg-white"
|
20
|
+
:validation="contactValidation"
|
21
|
+
>
|
22
|
+
<div
|
23
|
+
v-if="index < 1"
|
24
|
+
@click="() => members.push({contact: ''})"
|
25
|
+
class="radius-small h-100 i-big flex-center flex aspect-1x1 bg-green"
|
26
|
+
>
|
27
|
+
<IconAdd
|
28
|
+
class="i-medium"
|
29
|
+
:fill="'rgb(var(--white)'"
|
30
|
+
/>
|
36
31
|
</div>
|
37
|
-
</div>
|
38
32
|
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
33
|
+
<div
|
34
|
+
v-else
|
35
|
+
@click="() => members.splice(index, 1)"
|
36
|
+
class="radius-small h-100 i-big flex-center flex aspect-1x1 bg-red"
|
37
|
+
>
|
38
|
+
<IconDelete
|
39
|
+
class="i-medium"
|
40
|
+
:fill="'rgb(var(--white)'"
|
41
|
+
/>
|
42
|
+
</div>
|
43
|
+
</Field>
|
44
|
+
</div>
|
49
45
|
</section>
|
46
|
+
|
47
|
+
|
48
|
+
<Button
|
49
|
+
:submit="submitMembers"
|
50
|
+
class="w-100 bg-main">
|
51
|
+
<span>Invite to organization</span>
|
52
|
+
</Button>
|
50
53
|
</div>
|
51
54
|
</template>
|
52
55
|
|
@@ -56,12 +59,17 @@
|
|
56
59
|
import Field from '@pf/src/components/Field/Field.vue'
|
57
60
|
import Select from '@pf/src/components/Select/Select.vue'
|
58
61
|
import Button from '@pf/src/components/Button/Button.vue'
|
62
|
+
|
63
|
+
import IconDelete from '@pf/src/modules/icons/navigation/IconDelete.vue';
|
64
|
+
import IconAdd from '@pf/src/modules/icons/navigation/IconAdd.vue';
|
59
65
|
// Import validation
|
60
66
|
import * as inputsValidation from '@pf/src/modules/middlewares/client/inputs.validation'
|
67
|
+
|
61
68
|
import * as invites from '@pf/src/modules/organizations/store/invites';
|
62
69
|
// Props
|
63
70
|
const props = defineProps({
|
64
71
|
organization: Object,
|
72
|
+
text: String,
|
65
73
|
});
|
66
74
|
|
67
75
|
// Validation
|
@@ -69,25 +77,9 @@
|
|
69
77
|
// Define Emits
|
70
78
|
const emits = defineEmits(['send-invite']);
|
71
79
|
// Define State
|
72
|
-
const members = ref([{ contact: ''
|
73
|
-
// Define Methods
|
74
|
-
function addMember() {
|
75
|
-
members.value.push({ contact: '', role: ''});
|
76
|
-
}
|
77
|
-
|
78
|
-
function removeMember(index) {
|
79
|
-
members.value.splice(index, 1);
|
80
|
-
}
|
81
|
-
async function handleSendInvite(invite) {
|
82
|
-
await invites.actions.create(props.organization._id, members.value)
|
83
|
-
}
|
84
|
-
|
80
|
+
const members = ref([{ contact: ''}]);
|
85
81
|
|
86
82
|
async function submitMembers() {
|
87
83
|
emits('send-invite', members.value);
|
88
84
|
}
|
89
|
-
|
90
|
-
function reloadPage() {
|
91
|
-
// location.reload();
|
92
|
-
}
|
93
85
|
</script>
|
@@ -17,10 +17,8 @@ const controllerFactory = (db) => {
|
|
17
17
|
};
|
18
18
|
|
19
19
|
const read = (req, res) => {
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
console.log(req.query)
|
20
|
+
let query = {};
|
21
|
+
let options = {};
|
24
22
|
|
25
23
|
if (req.query.organization) {
|
26
24
|
query.organization = new db.mongoose.Types.ObjectId(req.query.organization);
|
@@ -21,10 +21,12 @@ const сontrollerFactory = (db) => {
|
|
21
21
|
|
22
22
|
const read = async (req, res) => {
|
23
23
|
try {
|
24
|
-
const invites = await Invite.find({
|
25
|
-
|
26
|
-
|
24
|
+
const invites = await Invite.find({ 'owner.target': req.params._id })
|
25
|
+
|
26
|
+
if (!invites || invites.length === 0) {
|
27
|
+
return res.status(200).send([]);
|
27
28
|
}
|
29
|
+
|
28
30
|
res.send(invites);
|
29
31
|
} catch (err) {
|
30
32
|
res.status(500).send({ message: err.message });
|
@@ -32,12 +34,12 @@ const сontrollerFactory = (db) => {
|
|
32
34
|
};
|
33
35
|
|
34
36
|
const create = async (req, res) => {
|
35
|
-
const
|
36
|
-
const
|
37
|
+
const creator = req.body.creator
|
38
|
+
const owner = req.body.owner
|
39
|
+
const list = req.body.invites
|
37
40
|
|
38
41
|
try {
|
39
|
-
|
40
|
-
for (let invite of invites) {
|
42
|
+
for (let invite of list) {
|
41
43
|
let user = null;
|
42
44
|
|
43
45
|
if (invite.contact.includes('@')) {
|
@@ -47,46 +49,45 @@ const сontrollerFactory = (db) => {
|
|
47
49
|
}
|
48
50
|
|
49
51
|
if (user) {
|
50
|
-
|
51
|
-
console.log(invite)
|
52
52
|
|
53
53
|
const membership = new Membership({
|
54
54
|
user: user._id,
|
55
55
|
type: 'organization',
|
56
|
-
target:
|
57
|
-
role:
|
56
|
+
target: req.body.owner.target,
|
57
|
+
role: 'member',
|
58
|
+
label: 'member'
|
58
59
|
});
|
59
60
|
|
60
61
|
await membership.save();
|
61
|
-
res.status(200).json({ message: 'Invites sent successfully!' });
|
62
62
|
} else {
|
63
63
|
const newInvite = new Invite({
|
64
64
|
code: uuid(),
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
65
|
+
creator: creator,
|
66
|
+
owner: owner,
|
67
|
+
role: 'member',
|
68
|
+
email: invite.contact.includes('@') ? invite.contact : null,
|
69
|
+
phone: !invite.contact.includes('@') ? invite.contact : null,
|
70
70
|
});
|
71
|
+
|
71
72
|
const savedInvite = await newInvite.save();
|
72
73
|
|
73
|
-
if (savedInvite.
|
74
|
-
const to = savedInvite.
|
74
|
+
if (savedInvite.email !== null) {
|
75
|
+
const to = savedInvite.email;
|
75
76
|
const subject = 'You have been added to the organization';
|
76
77
|
const text = `You have been invited to join an organization on ${process.env.APP_NAME}! Use this link to register: ${process.env.API_URL}/auth/invite?inviteCode=${newInvite.code}&type=email"`;
|
78
|
+
|
77
79
|
await sendEmail(to, subject, text);
|
78
80
|
}
|
79
81
|
|
80
|
-
if (savedInvite.
|
81
|
-
const phone = savedInvite.
|
82
|
+
if (savedInvite.phone !== null) {
|
83
|
+
const phone = savedInvite.phone;
|
82
84
|
const message = `You have been invited to join an organization on ${process.env.APP_NAME}! Use this link to register: ${process.env.API_URL}/auth/invite?inviteCode=${newInvite.code}&type=phone`;
|
83
85
|
|
84
86
|
await sendSms(phone, message);
|
85
87
|
}
|
86
|
-
|
87
|
-
res.status(200).json({ message: 'Invites sent successfully!' });
|
88
88
|
}
|
89
89
|
}
|
90
|
+
res.status(200).json({ message: 'Invites sent successfully!' });
|
90
91
|
} catch (error) {
|
91
92
|
console.error(error);
|
92
93
|
res.status(500).json({ message: 'Something went wrong' });
|
@@ -21,11 +21,59 @@ module.exports = (mongoose) => {
|
|
21
21
|
start: String,
|
22
22
|
end: String
|
23
23
|
}
|
24
|
-
}],
|
24
|
+
}],
|
25
25
|
hidden: {
|
26
26
|
type: Boolean,
|
27
27
|
default: false,
|
28
28
|
},
|
29
|
+
|
30
|
+
accesses: {
|
31
|
+
products: {
|
32
|
+
read: {
|
33
|
+
type: Boolean,
|
34
|
+
default: false,
|
35
|
+
},
|
36
|
+
edit: {
|
37
|
+
type: Boolean,
|
38
|
+
default: false,
|
39
|
+
},
|
40
|
+
delete: {
|
41
|
+
type: Boolean,
|
42
|
+
default: false,
|
43
|
+
},
|
44
|
+
},
|
45
|
+
|
46
|
+
orders: {
|
47
|
+
read: {
|
48
|
+
type: Boolean,
|
49
|
+
default: false,
|
50
|
+
},
|
51
|
+
confirm: {
|
52
|
+
type: Boolean,
|
53
|
+
default: false,
|
54
|
+
},
|
55
|
+
delete: {
|
56
|
+
type: Boolean,
|
57
|
+
default: false,
|
58
|
+
},
|
59
|
+
},
|
60
|
+
|
61
|
+
departments: {
|
62
|
+
read: {
|
63
|
+
type: Boolean,
|
64
|
+
default: false,
|
65
|
+
},
|
66
|
+
edit: {
|
67
|
+
type: Boolean,
|
68
|
+
default: false,
|
69
|
+
},
|
70
|
+
delete: {
|
71
|
+
type: Boolean,
|
72
|
+
default: false,
|
73
|
+
},
|
74
|
+
},
|
75
|
+
},
|
76
|
+
|
29
77
|
// Marketplace options
|
30
78
|
delivery: [String],
|
31
79
|
payment: [String],
|
@@ -47,8 +95,10 @@ module.exports = (mongoose) => {
|
|
47
95
|
ref: 'Department',
|
48
96
|
},
|
49
97
|
],
|
98
|
+
}, {
|
99
|
+
timestamps: true
|
50
100
|
});
|
51
|
-
|
101
|
+
|
52
102
|
departmentSchema.index({ organization: 1 })
|
53
103
|
|
54
104
|
const Department = mongoose.model('Department', departmentSchema);
|