@ozdao/prometheus-framework 0.2.48 → 0.2.50
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/auth.server.js +27 -25
- package/dist/auth.server.mjs +27 -25
- package/dist/community.server.js +1 -1
- package/dist/community.server.mjs +1 -1
- package/dist/events.server.js +1 -1
- package/dist/events.server.mjs +1 -1
- 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-3981e903.mjs +217 -0
- package/dist/index-4eecfdb9.js +216 -0
- package/dist/main-203b36b6.mjs +13628 -0
- package/dist/main-_b1_i8mt.mjs +13606 -0
- package/dist/main-a7ae4ce5.js +91 -0
- package/dist/main-uiQFxEks.js +91 -0
- package/dist/middlewares.server.js +1 -1
- package/dist/middlewares.server.mjs +1 -1
- package/dist/node_modules/vue-select/dist/vue-select.es.cjs +1 -3
- package/dist/node_modules/vue-select/dist/vue-select.es.js +49 -645
- package/dist/organizations.server.js +13 -27
- package/dist/organizations.server.mjs +13 -27
- package/dist/products.server.js +95 -15
- package/dist/products.server.mjs +95 -15
- package/dist/prometheus-framework/src/components/Button/Button.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Button/Button.vue.js +2 -225
- package/dist/prometheus-framework/src/components/Button/Button.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/Button/Button.vue2.js +225 -2
- 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/Field/Field.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Field/Field.vue.js +2 -76
- package/dist/prometheus-framework/src/components/Field/Field.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/Field/Field.vue2.js +76 -2
- 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/SelectMulti/SelectMulti.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/SelectMulti/SelectMulti.vue.js +6 -6
- package/dist/prometheus-framework/src/components/Tab/Tab.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Tab/Tab.vue.js +2 -44
- package/dist/prometheus-framework/src/components/Tab/Tab.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/Tab/Tab.vue2.js +44 -2
- 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 +44 -32
- 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 +45 -44
- package/dist/prometheus-framework/src/modules/auth/store/invites.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/store/invites.js +5 -5
- 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/pages/CreateBlogPost.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.js +3 -3
- 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/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 +3 -3
- 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 +1 -1
- 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/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/globals/store/globals.cjs +1 -1
- package/dist/prometheus-framework/src/modules/globals/store/globals.js +22 -21
- 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 +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/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 +1 -1
- 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 +17 -17
- 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 +49 -42
- package/dist/prometheus-framework/src/modules/organizations/components/blocks/User.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/blocks/User.vue.js +47 -15
- 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 +38 -37
- 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 +249 -61
- 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 +78 -45
- 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 +161 -86
- 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 +52 -54
- 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 +20 -26
- package/dist/prometheus-framework/src/modules/organizations/organizations.client.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/organizations.client.js +40 -46
- package/dist/prometheus-framework/src/modules/organizations/store/departments.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/store/departments.js +34 -30
- package/dist/prometheus-framework/src/modules/organizations/store/memberships.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/store/memberships.js +30 -28
- 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 +18 -18
- 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/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/Product.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/Product.vue.js +33 -28
- 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 +123 -113
- 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/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/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/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/products/store/products.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/store/products.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 +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 +3 -3
- 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 +1 -1
- package/dist/prometheus-framework.cjs.js +1 -1
- package/dist/prometheus-framework.es.js +1 -1
- package/dist/reports.server.js +1 -1
- package/dist/reports.server.mjs +1 -1
- package/dist/style.css +1 -1
- package/dist/web-7p76PGnO.mjs +55 -0
- package/dist/web-c63f0ecc.js +1 -0
- package/dist/web-d8173758.mjs +55 -0
- package/dist/web-dn8vgptQ.js +1 -0
- package/package.json +1 -1
- package/src/components/SelectMulti/SelectMulti.vue +1 -1
- package/src/modules/auth/components/pages/Invite.vue +17 -6
- package/src/modules/auth/controllers/auth.controller.js +24 -16
- package/src/modules/auth/controllers/invites.controller.js +17 -8
- package/src/modules/auth/store/auth.js +8 -1
- package/src/modules/auth/store/invites.js +1 -0
- package/src/modules/globals/store/globals.js +5 -1
- package/src/modules/landing/components/blocks/MapBlock.vue +37 -0
- package/src/modules/landing/components/pages/404.vue +3 -0
- package/src/modules/landing/components/pages/Governance.vue +155 -0
- package/src/modules/landing/components/pages/Home.vue +52 -0
- package/src/modules/landing/components/pages/Hotel.vue +54 -0
- package/src/modules/landing/components/pages/Page.vue +184 -0
- package/src/modules/landing/components/sections/AboutSection.vue +69 -0
- package/src/modules/landing/components/sections/Examples.vue +90 -0
- package/src/modules/landing/components/sections/FeatureSection.vue +80 -0
- package/src/modules/landing/components/sections/GiftSection.vue +63 -0
- package/src/modules/landing/components/sections/HeroSection.vue +74 -0
- package/src/modules/landing/components/sections/HowItWorksSection.vue +88 -0
- package/src/modules/landing/components/sections/HowToBuyWDR.vue +131 -0
- package/src/modules/landing/components/sections/InstagramSection.vue +181 -0
- package/src/modules/landing/components/sections/MapSection.vue +91 -0
- package/src/modules/landing/components/sections/SectionsSection.vue +69 -0
- package/src/modules/landing/components/sections/SliderFeatures.vue +131 -0
- package/src/modules/landing/components/sections/WhatIsWDRSection.vue +116 -0
- package/src/modules/landing/router/landing.js +34 -0
- package/src/modules/middlewares/server/verifySignUp.js +4 -0
- package/src/modules/organizations/components/blocks/CardDepartment.vue +3 -3
- package/src/modules/organizations/components/blocks/DepartmentMemberModify.vue +52 -44
- package/src/modules/organizations/components/blocks/User.vue +42 -10
- package/src/modules/organizations/components/pages/Department.vue +7 -6
- package/src/modules/organizations/components/pages/DepartmentEdit.vue +110 -134
- package/src/modules/organizations/components/pages/Members.vue +85 -26
- package/src/modules/organizations/components/pages/Organization.vue +60 -4
- package/src/modules/organizations/components/sections/MembersAdd.vue +27 -34
- package/src/modules/organizations/components/sections/Organizations.vue +0 -1
- package/src/modules/organizations/controllers/memberships.controller.js +6 -2
- package/src/modules/organizations/controllers/organizations.controller.js +1 -1
- package/src/modules/organizations/models/department.model.js +0 -19
- package/src/modules/organizations/models/membership.model.js +4 -0
- package/src/modules/organizations/organizations.client.js +1 -6
- package/src/modules/organizations/store/departments.js +48 -44
- package/src/modules/organizations/store/memberships.js +11 -3
- package/src/modules/products/components/blocks/CardPosition.vue +2 -2
- package/src/modules/products/components/pages/Product.vue +6 -1
- package/src/modules/products/components/pages/ProductEdit.vue +48 -28
- package/src/modules/products/controllers/products.controller.js +87 -24
- package/src/modules/products/models/product.model.js +16 -1
- package/src/modules/products/store/products.js +1 -1
- package/src/modules/users/components/pages/ProfileOrganizations.vue +41 -7
- package/src/modules/organizations/components/sections/FeedDepartments.vue +0 -64
- package/src/modules/organizations/components/sections/MembersList.vue +0 -85
- package/src/modules/organizations/store/invites.js +0 -93
@@ -72,7 +72,7 @@ const controllerFactory$5 = (db) => {
|
|
72
72
|
};
|
73
73
|
var departments_controller = controllerFactory$5;
|
74
74
|
const jwt = require$$0$1;
|
75
|
-
const ObjectId$
|
75
|
+
const ObjectId$2 = require$$0.Types.ObjectId;
|
76
76
|
const { Client } = require$$5;
|
77
77
|
const client = new Client({});
|
78
78
|
const addUserStatusFields = addMembersQuantity$1.addUserStatusFields_1;
|
@@ -116,15 +116,15 @@ const controllerFactory$4 = (db) => {
|
|
116
116
|
}));
|
117
117
|
}
|
118
118
|
const matchConditions = [
|
119
|
-
...req.query._id ? [{ _id: new ObjectId$
|
120
|
-
...req.query.owner ? [{ owner: new ObjectId$
|
121
|
-
...req.query.member ? [{ "memberships.user": new ObjectId$
|
122
|
-
...req.query.subscriber ? [{ "memberships.user": new ObjectId$
|
123
|
-
...req.query.postable ? [{ $or: [{ $and: [{ types: { $elemMatch: { $eq: "public" } } }, { "memberships.user": new ObjectId$
|
119
|
+
...req.query._id ? [{ _id: new ObjectId$2(req.query._id) }] : [],
|
120
|
+
...req.query.owner ? [{ owner: new ObjectId$2(req.query.owner) }] : [],
|
121
|
+
...req.query.member ? [{ "memberships.user": new ObjectId$2(req.query.member), "memberships.role": "member" }] : [],
|
122
|
+
...req.query.subscriber ? [{ "memberships.user": new ObjectId$2(req.query.subscriber), "memberships.role": "subscriber" }] : [],
|
123
|
+
...req.query.postable ? [{ $or: [{ $and: [{ types: { $elemMatch: { $eq: "public" } } }, { "memberships.user": new ObjectId$2(req.query.postable) }] }, { $and: [{ types: { $elemMatch: { $in: ["exclusive", "hidden"] } } }, { "memberships.user": new ObjectId$2(req.query.postable) }, { "memberships.role": { $ne: "subscriber" } }] }] }] : [],
|
124
124
|
...req.query.types ? [{ types: { $in: req.query.types } }] : [],
|
125
125
|
// Если req.query.types - строка
|
126
126
|
// to remove
|
127
|
-
...req.query.onlyuser ? [{ "memberships.user": new ObjectId$
|
127
|
+
...req.query.onlyuser ? [{ "memberships.user": new ObjectId$2(req.query.onlyuser) }] : [],
|
128
128
|
...categories.length > 0 ? [{ "products.category": { $in: categories } }] : [],
|
129
129
|
...delivery.length > 0 ? [{ "spots.delivery": { $all: delivery } }] : [],
|
130
130
|
...priceConditions.length > 0 ? [{ $or: priceConditions }] : [],
|
@@ -425,6 +425,7 @@ const controllerFactory$4 = (db) => {
|
|
425
425
|
};
|
426
426
|
};
|
427
427
|
var organizations_controller = controllerFactory$4;
|
428
|
+
const ObjectId$1 = require$$0.Types.ObjectId;
|
428
429
|
const controllerFactory$3 = (db) => {
|
429
430
|
const Membership = db.membership;
|
430
431
|
const read = async (req, res) => {
|
@@ -480,10 +481,9 @@ const controllerFactory$3 = (db) => {
|
|
480
481
|
}
|
481
482
|
};
|
482
483
|
const deleteMembership = async (req, res) => {
|
483
|
-
const { type, target, user: user2, role } = req.body;
|
484
484
|
console.log(req.body);
|
485
485
|
try {
|
486
|
-
const membership = await Membership.
|
486
|
+
const membership = await Membership.findOneAndDelete({ _id: new ObjectId$1(req.body._id) });
|
487
487
|
if (!membership) {
|
488
488
|
return res.status(404).send({ errorCode: "MEMBERSHIP_NOT_FOUND" });
|
489
489
|
} else {
|
@@ -592,23 +592,6 @@ var department_model = (mongoose) => {
|
|
592
592
|
description: { type: String },
|
593
593
|
categories: [String]
|
594
594
|
},
|
595
|
-
// Working hours
|
596
|
-
address: String,
|
597
|
-
// Position on map
|
598
|
-
location: {
|
599
|
-
lat: Number,
|
600
|
-
lng: Number,
|
601
|
-
type: {
|
602
|
-
type: String,
|
603
|
-
enum: ["Point"],
|
604
|
-
// 'location.type' must be 'Point'
|
605
|
-
required: true
|
606
|
-
},
|
607
|
-
coordinates: {
|
608
|
-
type: [Number],
|
609
|
-
required: true
|
610
|
-
}
|
611
|
-
},
|
612
595
|
worktime: [{
|
613
596
|
day: String,
|
614
597
|
time: {
|
@@ -639,7 +622,6 @@ var department_model = (mongoose) => {
|
|
639
622
|
]
|
640
623
|
});
|
641
624
|
departmentSchema.index({ organization: 1 });
|
642
|
-
departmentSchema.index({ location: "2dsphere" });
|
643
625
|
const Department = mongoose.model("Department", departmentSchema);
|
644
626
|
return Department;
|
645
627
|
};
|
@@ -727,6 +709,10 @@ var membership_model = (mongoose) => {
|
|
727
709
|
type: String,
|
728
710
|
default: "subscriber"
|
729
711
|
},
|
712
|
+
label: {
|
713
|
+
type: String,
|
714
|
+
default: "subscriber"
|
715
|
+
},
|
730
716
|
target: {
|
731
717
|
// заменяем 'organization' на 'target', так как это может быть или User, или Organization
|
732
718
|
type: mongoose.Schema.Types.ObjectId,
|
@@ -71,7 +71,7 @@ const controllerFactory$5 = (db) => {
|
|
71
71
|
};
|
72
72
|
var departments_controller = controllerFactory$5;
|
73
73
|
const jwt = require$$0$1;
|
74
|
-
const ObjectId$
|
74
|
+
const ObjectId$2 = require$$0.Types.ObjectId;
|
75
75
|
const { Client } = require$$5;
|
76
76
|
const client = new Client({});
|
77
77
|
const addUserStatusFields = addUserStatusFields_1;
|
@@ -115,15 +115,15 @@ const controllerFactory$4 = (db) => {
|
|
115
115
|
}));
|
116
116
|
}
|
117
117
|
const matchConditions = [
|
118
|
-
...req.query._id ? [{ _id: new ObjectId$
|
119
|
-
...req.query.owner ? [{ owner: new ObjectId$
|
120
|
-
...req.query.member ? [{ "memberships.user": new ObjectId$
|
121
|
-
...req.query.subscriber ? [{ "memberships.user": new ObjectId$
|
122
|
-
...req.query.postable ? [{ $or: [{ $and: [{ types: { $elemMatch: { $eq: "public" } } }, { "memberships.user": new ObjectId$
|
118
|
+
...req.query._id ? [{ _id: new ObjectId$2(req.query._id) }] : [],
|
119
|
+
...req.query.owner ? [{ owner: new ObjectId$2(req.query.owner) }] : [],
|
120
|
+
...req.query.member ? [{ "memberships.user": new ObjectId$2(req.query.member), "memberships.role": "member" }] : [],
|
121
|
+
...req.query.subscriber ? [{ "memberships.user": new ObjectId$2(req.query.subscriber), "memberships.role": "subscriber" }] : [],
|
122
|
+
...req.query.postable ? [{ $or: [{ $and: [{ types: { $elemMatch: { $eq: "public" } } }, { "memberships.user": new ObjectId$2(req.query.postable) }] }, { $and: [{ types: { $elemMatch: { $in: ["exclusive", "hidden"] } } }, { "memberships.user": new ObjectId$2(req.query.postable) }, { "memberships.role": { $ne: "subscriber" } }] }] }] : [],
|
123
123
|
...req.query.types ? [{ types: { $in: req.query.types } }] : [],
|
124
124
|
// Если req.query.types - строка
|
125
125
|
// to remove
|
126
|
-
...req.query.onlyuser ? [{ "memberships.user": new ObjectId$
|
126
|
+
...req.query.onlyuser ? [{ "memberships.user": new ObjectId$2(req.query.onlyuser) }] : [],
|
127
127
|
...categories.length > 0 ? [{ "products.category": { $in: categories } }] : [],
|
128
128
|
...delivery.length > 0 ? [{ "spots.delivery": { $all: delivery } }] : [],
|
129
129
|
...priceConditions.length > 0 ? [{ $or: priceConditions }] : [],
|
@@ -424,6 +424,7 @@ const controllerFactory$4 = (db) => {
|
|
424
424
|
};
|
425
425
|
};
|
426
426
|
var organizations_controller = controllerFactory$4;
|
427
|
+
const ObjectId$1 = require$$0.Types.ObjectId;
|
427
428
|
const controllerFactory$3 = (db) => {
|
428
429
|
const Membership = db.membership;
|
429
430
|
const read = async (req, res) => {
|
@@ -479,10 +480,9 @@ const controllerFactory$3 = (db) => {
|
|
479
480
|
}
|
480
481
|
};
|
481
482
|
const deleteMembership = async (req, res) => {
|
482
|
-
const { type, target, user: user2, role } = req.body;
|
483
483
|
console.log(req.body);
|
484
484
|
try {
|
485
|
-
const membership = await Membership.
|
485
|
+
const membership = await Membership.findOneAndDelete({ _id: new ObjectId$1(req.body._id) });
|
486
486
|
if (!membership) {
|
487
487
|
return res.status(404).send({ errorCode: "MEMBERSHIP_NOT_FOUND" });
|
488
488
|
} else {
|
@@ -591,23 +591,6 @@ var department_model = (mongoose) => {
|
|
591
591
|
description: { type: String },
|
592
592
|
categories: [String]
|
593
593
|
},
|
594
|
-
// Working hours
|
595
|
-
address: String,
|
596
|
-
// Position on map
|
597
|
-
location: {
|
598
|
-
lat: Number,
|
599
|
-
lng: Number,
|
600
|
-
type: {
|
601
|
-
type: String,
|
602
|
-
enum: ["Point"],
|
603
|
-
// 'location.type' must be 'Point'
|
604
|
-
required: true
|
605
|
-
},
|
606
|
-
coordinates: {
|
607
|
-
type: [Number],
|
608
|
-
required: true
|
609
|
-
}
|
610
|
-
},
|
611
594
|
worktime: [{
|
612
595
|
day: String,
|
613
596
|
time: {
|
@@ -638,7 +621,6 @@ var department_model = (mongoose) => {
|
|
638
621
|
]
|
639
622
|
});
|
640
623
|
departmentSchema.index({ organization: 1 });
|
641
|
-
departmentSchema.index({ location: "2dsphere" });
|
642
624
|
const Department = mongoose.model("Department", departmentSchema);
|
643
625
|
return Department;
|
644
626
|
};
|
@@ -726,6 +708,10 @@ var membership_model = (mongoose) => {
|
|
726
708
|
type: String,
|
727
709
|
default: "subscriber"
|
728
710
|
},
|
711
|
+
label: {
|
712
|
+
type: String,
|
713
|
+
default: "subscriber"
|
714
|
+
},
|
729
715
|
target: {
|
730
716
|
// заменяем 'organization' на 'target', так как это может быть или User, или Organization
|
731
717
|
type: mongoose.Schema.Types.ObjectId,
|
package/dist/products.server.js
CHANGED
@@ -5,7 +5,7 @@ require("uuid");
|
|
5
5
|
const require$$0 = require("mongoose");
|
6
6
|
require("path");
|
7
7
|
const require$$3 = require("openai");
|
8
|
-
const index = require("./index-
|
8
|
+
const index = require("./index-4eecfdb9.js");
|
9
9
|
require("jsonwebtoken");
|
10
10
|
require("mongodb");
|
11
11
|
var product_model = (mongoose) => {
|
@@ -27,7 +27,22 @@ var product_model = (mongoose) => {
|
|
27
27
|
images: { type: Array },
|
28
28
|
popularity: { type: Number },
|
29
29
|
localization: { type: Array },
|
30
|
-
ingredients: {
|
30
|
+
ingredients: [{
|
31
|
+
_id: {
|
32
|
+
type: mongoose.Schema.Types.ObjectId,
|
33
|
+
ref: "Product"
|
34
|
+
},
|
35
|
+
price: {
|
36
|
+
type: Number,
|
37
|
+
required: true,
|
38
|
+
min: [0, "Price cannot be less than 0"]
|
39
|
+
},
|
40
|
+
quantity: {
|
41
|
+
type: Number,
|
42
|
+
required: true,
|
43
|
+
min: [1, "Quantity cannot be less than 1"]
|
44
|
+
}
|
45
|
+
}],
|
31
46
|
information: [{
|
32
47
|
name: { type: String },
|
33
48
|
value: { type: String }
|
@@ -293,7 +308,7 @@ const controllerFactory$5 = (db) => {
|
|
293
308
|
const Update = async (req, res) => {
|
294
309
|
try {
|
295
310
|
const { _id } = req.params;
|
296
|
-
console.log(
|
311
|
+
console.log(req.body.ingredients);
|
297
312
|
const updatedProduct = await Product.findOneAndUpdate(
|
298
313
|
{ _id },
|
299
314
|
{
|
@@ -307,7 +322,8 @@ const controllerFactory$5 = (db) => {
|
|
307
322
|
information: req.body.information,
|
308
323
|
localization: req.body.localization,
|
309
324
|
quantity: req.body.quantity,
|
310
|
-
quantityDiscount: req.body.quantityDiscount
|
325
|
+
quantityDiscount: req.body.quantityDiscount,
|
326
|
+
ingredients: req.body.ingredients
|
311
327
|
},
|
312
328
|
{ new: true }
|
313
329
|
);
|
@@ -338,19 +354,19 @@ const controllerFactory$5 = (db) => {
|
|
338
354
|
"withIngredients": [
|
339
355
|
{
|
340
356
|
$match: {
|
341
|
-
|
357
|
+
ingredients: { $exists: true, $not: { $size: 0 } }
|
342
358
|
// Продукты с ингредиентами
|
343
359
|
}
|
344
360
|
},
|
345
361
|
{
|
346
362
|
$lookup: {
|
347
363
|
from: "products",
|
348
|
-
localField: "
|
364
|
+
localField: "ingredients",
|
349
365
|
foreignField: "_id",
|
350
366
|
as: "ingredientDetails"
|
351
367
|
}
|
352
368
|
},
|
353
|
-
{ $unwind: "$ingredientDetails" },
|
369
|
+
// { $unwind: "$ingredientDetails" },
|
354
370
|
{
|
355
371
|
$lookup: {
|
356
372
|
from: "leftovers",
|
@@ -385,9 +401,9 @@ const controllerFactory$5 = (db) => {
|
|
385
401
|
{
|
386
402
|
$match: {
|
387
403
|
$or: [
|
388
|
-
{
|
404
|
+
{ ingredients: { $exists: false } },
|
389
405
|
// Продукты без ингредиентов
|
390
|
-
{
|
406
|
+
{ ingredients: { $size: 0 } }
|
391
407
|
]
|
392
408
|
}
|
393
409
|
},
|
@@ -521,13 +537,21 @@ const controllerFactory$5 = (db) => {
|
|
521
537
|
{
|
522
538
|
$lookup: {
|
523
539
|
from: "leftovers",
|
524
|
-
let: { productId: "$_id",
|
540
|
+
let: { productId: "$_id", ingredientsIds: "$ingredients._id" },
|
525
541
|
pipeline: [
|
526
542
|
{
|
527
543
|
$unwind: "$positions"
|
528
544
|
},
|
529
545
|
{
|
530
|
-
|
546
|
+
$match: {
|
547
|
+
$expr: {
|
548
|
+
$or: [
|
549
|
+
{ $eq: ["$positions._id", "$$productId"] },
|
550
|
+
{ $in: ["$positions._id", { $ifNull: ["$$ingredientsIds", []] }] }
|
551
|
+
// Исправлено
|
552
|
+
]
|
553
|
+
}
|
554
|
+
}
|
531
555
|
},
|
532
556
|
{
|
533
557
|
"$addFields": {
|
@@ -548,18 +572,75 @@ const controllerFactory$5 = (db) => {
|
|
548
572
|
}
|
549
573
|
}
|
550
574
|
],
|
551
|
-
as: "
|
575
|
+
as: "leftovers"
|
576
|
+
}
|
577
|
+
},
|
578
|
+
{
|
579
|
+
$addFields: {
|
580
|
+
ingredientsQuantities: {
|
581
|
+
$cond: {
|
582
|
+
if: { $isArray: "$ingredients" },
|
583
|
+
then: {
|
584
|
+
$map: {
|
585
|
+
input: "$ingredients",
|
586
|
+
as: "ingredient",
|
587
|
+
in: {
|
588
|
+
$let: {
|
589
|
+
vars: {
|
590
|
+
ingredientId: "$$ingredient._id",
|
591
|
+
ingredientQuantity: { $ifNull: ["$$ingredient.quantity", 0] }
|
592
|
+
},
|
593
|
+
in: {
|
594
|
+
$divide: [
|
595
|
+
{
|
596
|
+
$sum: {
|
597
|
+
$map: {
|
598
|
+
input: "$leftovers",
|
599
|
+
as: "leftover",
|
600
|
+
in: {
|
601
|
+
$cond: {
|
602
|
+
if: { $eq: ["$$leftover._id", "$$ingredientId"] },
|
603
|
+
then: "$$leftover.quantity",
|
604
|
+
else: 0
|
605
|
+
}
|
606
|
+
}
|
607
|
+
}
|
608
|
+
}
|
609
|
+
},
|
610
|
+
{
|
611
|
+
$cond: {
|
612
|
+
if: { $eq: ["$$ingredientQuantity", 0] },
|
613
|
+
then: 1,
|
614
|
+
else: "$$ingredientQuantity"
|
615
|
+
}
|
616
|
+
}
|
617
|
+
]
|
618
|
+
}
|
619
|
+
}
|
620
|
+
}
|
621
|
+
}
|
622
|
+
},
|
623
|
+
else: []
|
624
|
+
}
|
625
|
+
}
|
552
626
|
}
|
553
627
|
},
|
554
628
|
{
|
555
629
|
$set: {
|
556
630
|
quantity: {
|
557
|
-
$
|
631
|
+
$cond: {
|
632
|
+
if: { $gt: [{ $size: { $ifNull: ["$ingredients", []] } }, 0] },
|
633
|
+
// Снова проверяем, не пустой ли массив ингредиентов
|
634
|
+
then: { $floor: { $min: "$ingredientsQuantities" } },
|
635
|
+
else: { $sum: "$leftovers.quantity" }
|
636
|
+
// Просто суммируем quantity из leftovers, если ингредиентов нет
|
637
|
+
}
|
558
638
|
}
|
559
639
|
}
|
560
640
|
},
|
561
|
-
{ $unset: "
|
641
|
+
{ $unset: ["leftovers", "ingredientsQuantities"] }
|
562
642
|
]);
|
643
|
+
console.log(product);
|
563
644
|
if (!product || product.length < 1) {
|
564
645
|
return res.status(404).send({ message: "Product not found." });
|
565
646
|
}
|
@@ -568,7 +649,6 @@ const controllerFactory$5 = (db) => {
|
|
568
649
|
{ $inc: { popularity: 1 } },
|
569
650
|
{ new: true }
|
570
651
|
);
|
571
|
-
console.log("Popularity updated:", updatedProduct);
|
572
652
|
res.status(200).send(product);
|
573
653
|
} catch (err) {
|
574
654
|
console.error("Error:", err);
|
package/dist/products.server.mjs
CHANGED
@@ -3,7 +3,7 @@ import "uuid";
|
|
3
3
|
import require$$0 from "mongoose";
|
4
4
|
import "path";
|
5
5
|
import require$$3 from "openai";
|
6
|
-
import { s as server } from "./index-
|
6
|
+
import { s as server } from "./index-3981e903.mjs";
|
7
7
|
import "jsonwebtoken";
|
8
8
|
import "mongodb";
|
9
9
|
var product_model = (mongoose) => {
|
@@ -25,7 +25,22 @@ var product_model = (mongoose) => {
|
|
25
25
|
images: { type: Array },
|
26
26
|
popularity: { type: Number },
|
27
27
|
localization: { type: Array },
|
28
|
-
ingredients: {
|
28
|
+
ingredients: [{
|
29
|
+
_id: {
|
30
|
+
type: mongoose.Schema.Types.ObjectId,
|
31
|
+
ref: "Product"
|
32
|
+
},
|
33
|
+
price: {
|
34
|
+
type: Number,
|
35
|
+
required: true,
|
36
|
+
min: [0, "Price cannot be less than 0"]
|
37
|
+
},
|
38
|
+
quantity: {
|
39
|
+
type: Number,
|
40
|
+
required: true,
|
41
|
+
min: [1, "Quantity cannot be less than 1"]
|
42
|
+
}
|
43
|
+
}],
|
29
44
|
information: [{
|
30
45
|
name: { type: String },
|
31
46
|
value: { type: String }
|
@@ -291,7 +306,7 @@ const controllerFactory$5 = (db) => {
|
|
291
306
|
const Update = async (req, res) => {
|
292
307
|
try {
|
293
308
|
const { _id } = req.params;
|
294
|
-
console.log(
|
309
|
+
console.log(req.body.ingredients);
|
295
310
|
const updatedProduct = await Product.findOneAndUpdate(
|
296
311
|
{ _id },
|
297
312
|
{
|
@@ -305,7 +320,8 @@ const controllerFactory$5 = (db) => {
|
|
305
320
|
information: req.body.information,
|
306
321
|
localization: req.body.localization,
|
307
322
|
quantity: req.body.quantity,
|
308
|
-
quantityDiscount: req.body.quantityDiscount
|
323
|
+
quantityDiscount: req.body.quantityDiscount,
|
324
|
+
ingredients: req.body.ingredients
|
309
325
|
},
|
310
326
|
{ new: true }
|
311
327
|
);
|
@@ -336,19 +352,19 @@ const controllerFactory$5 = (db) => {
|
|
336
352
|
"withIngredients": [
|
337
353
|
{
|
338
354
|
$match: {
|
339
|
-
|
355
|
+
ingredients: { $exists: true, $not: { $size: 0 } }
|
340
356
|
// Продукты с ингредиентами
|
341
357
|
}
|
342
358
|
},
|
343
359
|
{
|
344
360
|
$lookup: {
|
345
361
|
from: "products",
|
346
|
-
localField: "
|
362
|
+
localField: "ingredients",
|
347
363
|
foreignField: "_id",
|
348
364
|
as: "ingredientDetails"
|
349
365
|
}
|
350
366
|
},
|
351
|
-
{ $unwind: "$ingredientDetails" },
|
367
|
+
// { $unwind: "$ingredientDetails" },
|
352
368
|
{
|
353
369
|
$lookup: {
|
354
370
|
from: "leftovers",
|
@@ -383,9 +399,9 @@ const controllerFactory$5 = (db) => {
|
|
383
399
|
{
|
384
400
|
$match: {
|
385
401
|
$or: [
|
386
|
-
{
|
402
|
+
{ ingredients: { $exists: false } },
|
387
403
|
// Продукты без ингредиентов
|
388
|
-
{
|
404
|
+
{ ingredients: { $size: 0 } }
|
389
405
|
]
|
390
406
|
}
|
391
407
|
},
|
@@ -519,13 +535,21 @@ const controllerFactory$5 = (db) => {
|
|
519
535
|
{
|
520
536
|
$lookup: {
|
521
537
|
from: "leftovers",
|
522
|
-
let: { productId: "$_id",
|
538
|
+
let: { productId: "$_id", ingredientsIds: "$ingredients._id" },
|
523
539
|
pipeline: [
|
524
540
|
{
|
525
541
|
$unwind: "$positions"
|
526
542
|
},
|
527
543
|
{
|
528
|
-
|
544
|
+
$match: {
|
545
|
+
$expr: {
|
546
|
+
$or: [
|
547
|
+
{ $eq: ["$positions._id", "$$productId"] },
|
548
|
+
{ $in: ["$positions._id", { $ifNull: ["$$ingredientsIds", []] }] }
|
549
|
+
// Исправлено
|
550
|
+
]
|
551
|
+
}
|
552
|
+
}
|
529
553
|
},
|
530
554
|
{
|
531
555
|
"$addFields": {
|
@@ -546,18 +570,75 @@ const controllerFactory$5 = (db) => {
|
|
546
570
|
}
|
547
571
|
}
|
548
572
|
],
|
549
|
-
as: "
|
573
|
+
as: "leftovers"
|
574
|
+
}
|
575
|
+
},
|
576
|
+
{
|
577
|
+
$addFields: {
|
578
|
+
ingredientsQuantities: {
|
579
|
+
$cond: {
|
580
|
+
if: { $isArray: "$ingredients" },
|
581
|
+
then: {
|
582
|
+
$map: {
|
583
|
+
input: "$ingredients",
|
584
|
+
as: "ingredient",
|
585
|
+
in: {
|
586
|
+
$let: {
|
587
|
+
vars: {
|
588
|
+
ingredientId: "$$ingredient._id",
|
589
|
+
ingredientQuantity: { $ifNull: ["$$ingredient.quantity", 0] }
|
590
|
+
},
|
591
|
+
in: {
|
592
|
+
$divide: [
|
593
|
+
{
|
594
|
+
$sum: {
|
595
|
+
$map: {
|
596
|
+
input: "$leftovers",
|
597
|
+
as: "leftover",
|
598
|
+
in: {
|
599
|
+
$cond: {
|
600
|
+
if: { $eq: ["$$leftover._id", "$$ingredientId"] },
|
601
|
+
then: "$$leftover.quantity",
|
602
|
+
else: 0
|
603
|
+
}
|
604
|
+
}
|
605
|
+
}
|
606
|
+
}
|
607
|
+
},
|
608
|
+
{
|
609
|
+
$cond: {
|
610
|
+
if: { $eq: ["$$ingredientQuantity", 0] },
|
611
|
+
then: 1,
|
612
|
+
else: "$$ingredientQuantity"
|
613
|
+
}
|
614
|
+
}
|
615
|
+
]
|
616
|
+
}
|
617
|
+
}
|
618
|
+
}
|
619
|
+
}
|
620
|
+
},
|
621
|
+
else: []
|
622
|
+
}
|
623
|
+
}
|
550
624
|
}
|
551
625
|
},
|
552
626
|
{
|
553
627
|
$set: {
|
554
628
|
quantity: {
|
555
|
-
$
|
629
|
+
$cond: {
|
630
|
+
if: { $gt: [{ $size: { $ifNull: ["$ingredients", []] } }, 0] },
|
631
|
+
// Снова проверяем, не пустой ли массив ингредиентов
|
632
|
+
then: { $floor: { $min: "$ingredientsQuantities" } },
|
633
|
+
else: { $sum: "$leftovers.quantity" }
|
634
|
+
// Просто суммируем quantity из leftovers, если ингредиентов нет
|
635
|
+
}
|
556
636
|
}
|
557
637
|
}
|
558
638
|
},
|
559
|
-
{ $unset: "
|
639
|
+
{ $unset: ["leftovers", "ingredientsQuantities"] }
|
560
640
|
]);
|
641
|
+
console.log(product);
|
561
642
|
if (!product || product.length < 1) {
|
562
643
|
return res.status(404).send({ message: "Product not found." });
|
563
644
|
}
|
@@ -566,7 +647,6 @@ const controllerFactory$5 = (db) => {
|
|
566
647
|
{ $inc: { popularity: 1 } },
|
567
648
|
{ new: true }
|
568
649
|
);
|
569
|
-
console.log("Popularity updated:", updatedProduct);
|
570
650
|
res.status(200).send(product);
|
571
651
|
} catch (err) {
|
572
652
|
console.error("Error:", err);
|
@@ -1 +1 @@
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e="";exports.default=e;
|