@ozdao/martyrs 0.2.473 → 0.2.475
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{Media-DW8RLbfM.js → Media-_vz04tII.js} +1 -1
- package/dist/{Media-y_TX6us_.mjs → Media-sGk7Bp9b.mjs} +1 -1
- package/dist/auth.server.js +6 -2
- package/dist/auth.server.mjs +6 -2
- package/dist/authJwt-CELQKF2s.js +82 -0
- package/dist/authJwt-DnXu3BFq.mjs +83 -0
- package/dist/builder.js +7 -4
- package/dist/builder.mjs +7 -4
- package/dist/chats.server.js +1 -1
- package/dist/chats.server.mjs +1 -1
- package/dist/community.server.js +4 -4
- package/dist/community.server.mjs +4 -4
- package/dist/events.server.js +4 -4
- package/dist/events.server.mjs +4 -4
- package/dist/files.server.js +1 -1
- package/dist/files.server.mjs +1 -1
- package/dist/gallery.server.js +3 -3
- package/dist/gallery.server.mjs +3 -3
- package/dist/{globals.abac-DT0VjfaZ.js → globals.abac-Bn-4tbX8.js} +110 -16
- package/dist/{globals.abac-CvmZM8XG.mjs → globals.abac-DZpTRxKR.mjs} +110 -16
- package/dist/globals.server.js +70 -10
- package/dist/globals.server.mjs +70 -10
- package/dist/{globals.verifier-C_VZYebB.mjs → globals.verifier-BdJxc8-8.mjs} +34 -0
- package/dist/{globals.verifier-ChDpCdy_.js → globals.verifier-CKYpYfQl.js} +34 -0
- package/dist/{index-CVXl1rB5.js → index-BOmxJQ5W.js} +7 -86
- package/dist/{index-Df8vtZx7.mjs → index-C_Fw0Umg.mjs} +7 -86
- package/dist/{main-CgmHzhq5.mjs → main-CqMtW7Hq.mjs} +274 -276
- package/dist/{main-CCfQH-Dd.js → main-CsGkbSyK.js} +2 -2
- package/dist/martyrs/src/components/Block/Block.vue.cjs +1 -1
- package/dist/martyrs/src/components/Block/Block.vue.js +1 -1
- package/dist/martyrs/src/components/Button/Button.vue2.cjs +1 -1
- package/dist/martyrs/src/components/Button/Button.vue2.js +1 -1
- package/dist/martyrs/src/components/Chips/{Chips.vue2.cjs → Chips.vue.cjs} +2 -2
- package/dist/martyrs/src/components/Chips/Chips.vue.cjs.map +1 -0
- package/dist/martyrs/src/components/Chips/{Chips.vue2.js → Chips.vue.js} +2 -2
- package/dist/martyrs/src/components/Chips/Chips.vue.js.map +1 -0
- package/dist/martyrs/src/components/Dropdown/{Dropdown.vue.cjs → Dropdown.vue2.cjs} +2 -2
- package/dist/martyrs/src/components/Dropdown/Dropdown.vue2.cjs.map +1 -0
- package/dist/martyrs/src/components/Dropdown/{Dropdown.vue.js → Dropdown.vue2.js} +2 -2
- package/dist/martyrs/src/components/Dropdown/{Dropdown.vue.cjs.map → Dropdown.vue2.js.map} +1 -1
- package/dist/martyrs/src/components/Feed/Feed.vue.cjs +2 -2
- package/dist/martyrs/src/components/Feed/Feed.vue.js +2 -2
- package/dist/martyrs/src/components/Loader/{Loader.vue2.cjs → Loader.vue.cjs} +2 -2
- package/dist/martyrs/src/components/Loader/{Loader.vue2.js.map → Loader.vue.cjs.map} +1 -1
- package/dist/martyrs/src/components/Loader/{Loader.vue2.js → Loader.vue.js} +2 -2
- package/dist/martyrs/src/components/Loader/Loader.vue.js.map +1 -0
- package/dist/martyrs/src/components/LocationMarker/LocationMarker.vue2.cjs +1 -1
- package/dist/martyrs/src/components/LocationMarker/LocationMarker.vue2.js +1 -1
- package/dist/martyrs/src/components/Select/Select.vue.cjs +4 -4
- package/dist/martyrs/src/components/Select/Select.vue.cjs.map +1 -1
- package/dist/martyrs/src/components/Select/Select.vue.js +4 -4
- package/dist/martyrs/src/components/Select/Select.vue.js.map +1 -1
- package/dist/martyrs/src/components/Slider/Slider.native.vue.cjs +1 -1
- package/dist/martyrs/src/components/Slider/Slider.native.vue.js +1 -1
- package/dist/martyrs/src/components/Tooltip/{Tooltip.vue2.cjs → Tooltip.vue.cjs} +2 -2
- package/dist/martyrs/src/components/Tooltip/{Tooltip.vue2.js.map → Tooltip.vue.cjs.map} +1 -1
- package/dist/martyrs/src/components/Tooltip/{Tooltip.vue2.js → Tooltip.vue.js} +2 -2
- package/dist/martyrs/src/components/Tooltip/Tooltip.vue.js.map +1 -0
- package/dist/martyrs/src/components/UploadImageMultiple/UploadImageMultiple.vue.cjs +1 -1
- package/dist/martyrs/src/components/UploadImageMultiple/UploadImageMultiple.vue.js +1 -1
- package/dist/martyrs/src/modules/auth/views/components/layouts/Auth.vue.cjs +1 -1
- package/dist/martyrs/src/modules/auth/views/components/layouts/Auth.vue.js +1 -1
- package/dist/martyrs/src/modules/auth/views/components/pages/Profile.vue.cjs +2 -2
- package/dist/martyrs/src/modules/auth/views/components/pages/Profile.vue.js +2 -2
- package/dist/martyrs/src/modules/community/community.client.js +27 -27
- package/dist/martyrs/src/modules/community/community.client.js.map +1 -1
- package/dist/martyrs/src/modules/community/components/blocks/CardBlogpost.vue.cjs +1 -1
- package/dist/martyrs/src/modules/community/components/blocks/CardBlogpost.vue.js +1 -1
- package/dist/martyrs/src/modules/community/components/pages/BlogPost.vue.cjs +2 -2
- package/dist/martyrs/src/modules/community/components/pages/BlogPost.vue.js +2 -2
- package/dist/martyrs/src/modules/community/components/sections/HotPosts.vue.cjs +4 -5
- package/dist/martyrs/src/modules/community/components/sections/HotPosts.vue.cjs.map +1 -1
- package/dist/martyrs/src/modules/community/components/sections/HotPosts.vue.js +4 -5
- package/dist/martyrs/src/modules/community/components/sections/HotPosts.vue.js.map +1 -1
- package/dist/martyrs/src/modules/events/components/blocks/CardEvent.vue.cjs +1 -1
- package/dist/martyrs/src/modules/events/components/blocks/CardEvent.vue.js +1 -1
- package/dist/martyrs/src/modules/events/components/pages/EditEvent.vue.cjs +1 -1
- package/dist/martyrs/src/modules/events/components/pages/EditEvent.vue.js +1 -1
- package/dist/martyrs/src/modules/events/components/pages/Event.vue.cjs +2 -2
- package/dist/martyrs/src/modules/events/components/pages/Event.vue.js +2 -2
- package/dist/martyrs/src/modules/events/components/sections/EventsHot.vue.cjs +2 -2
- package/dist/martyrs/src/modules/events/components/sections/EventsHot.vue.js +2 -2
- package/dist/martyrs/src/modules/events/components/sections/Feed.vue.cjs +1 -1
- package/dist/martyrs/src/modules/events/components/sections/Feed.vue.js +1 -1
- package/dist/martyrs/src/modules/events/components/sections/List.vue.cjs +1 -1
- package/dist/martyrs/src/modules/events/components/sections/List.vue.js +1 -1
- package/dist/martyrs/src/modules/gallery/components/sections/BackofficeGallery.vue.cjs +1 -1
- package/dist/martyrs/src/modules/gallery/components/sections/BackofficeGallery.vue.js +1 -1
- package/dist/martyrs/src/modules/globals/views/components/blocks/CardHeader.vue.cjs +3 -3
- package/dist/martyrs/src/modules/globals/views/components/blocks/CardHeader.vue.js +3 -3
- package/dist/martyrs/src/modules/globals/views/components/blocks/PopupDateSelector.vue.cjs +1 -1
- package/dist/martyrs/src/modules/globals/views/components/blocks/PopupDateSelector.vue.js +1 -1
- package/dist/martyrs/src/modules/globals/views/components/layouts/Client.vue.cjs +1 -1
- package/dist/martyrs/src/modules/globals/views/components/layouts/Client.vue.js +1 -1
- package/dist/martyrs/src/modules/globals/views/components/partials/Navigation.vue.cjs +1 -1
- package/dist/martyrs/src/modules/globals/views/components/partials/Navigation.vue.js +1 -1
- package/dist/martyrs/src/modules/marketplace/views/components/sections/SectionMenu.vue.cjs +1 -1
- package/dist/martyrs/src/modules/marketplace/views/components/sections/SectionMenu.vue.js +1 -1
- package/dist/martyrs/src/modules/orders/components/blocks/CardOrderUser.vue.cjs +1 -1
- package/dist/martyrs/src/modules/orders/components/blocks/CardOrderUser.vue.js +1 -1
- package/dist/martyrs/src/modules/orders/components/pages/OrderBackoffice.vue.cjs +1 -1
- package/dist/martyrs/src/modules/orders/components/pages/OrderBackoffice.vue.js +1 -1
- package/dist/martyrs/src/modules/orders/components/pages/OrderCreate.vue.cjs +88 -27
- package/dist/martyrs/src/modules/orders/components/pages/OrderCreate.vue.cjs.map +1 -1
- package/dist/martyrs/src/modules/orders/components/pages/OrderCreate.vue.js +89 -28
- package/dist/martyrs/src/modules/orders/components/pages/OrderCreate.vue.js.map +1 -1
- package/dist/martyrs/src/modules/orders/components/sections/FormDelivery.vue.cjs +2 -2
- package/dist/martyrs/src/modules/orders/components/sections/FormDelivery.vue.js +2 -2
- package/dist/martyrs/src/modules/orders/store/shopcart.cjs +1 -0
- package/dist/martyrs/src/modules/orders/store/shopcart.cjs.map +1 -1
- package/dist/martyrs/src/modules/orders/store/shopcart.js +1 -0
- package/dist/martyrs/src/modules/orders/store/shopcart.js.map +1 -1
- package/dist/martyrs/src/modules/organizations/components/blocks/CardOrganization.vue.cjs +1 -1
- package/dist/martyrs/src/modules/organizations/components/blocks/CardOrganization.vue.js +1 -1
- package/dist/martyrs/src/modules/organizations/components/pages/DepartmentEdit.vue.cjs +1 -1
- package/dist/martyrs/src/modules/organizations/components/pages/DepartmentEdit.vue.js +1 -1
- package/dist/martyrs/src/modules/organizations/components/pages/Members.vue.cjs +1 -1
- package/dist/martyrs/src/modules/organizations/components/pages/Members.vue.js +1 -1
- package/dist/martyrs/src/modules/organizations/components/sections/DetailsTabSection.vue.cjs +2 -2
- package/dist/martyrs/src/modules/organizations/components/sections/DetailsTabSection.vue.js +2 -2
- package/dist/martyrs/src/modules/organizations/components/sections/Documents.vue.cjs +1 -1
- package/dist/martyrs/src/modules/organizations/components/sections/Documents.vue.js +1 -1
- package/dist/martyrs/src/modules/organizations/components/sections/Organizations.vue.cjs +1 -1
- package/dist/martyrs/src/modules/organizations/components/sections/Organizations.vue.js +1 -1
- package/dist/martyrs/src/modules/pages/views/components/blocks/CardPage.vue.cjs +1 -1
- package/dist/martyrs/src/modules/pages/views/components/blocks/CardPage.vue.js +1 -1
- package/dist/martyrs/src/modules/pages/views/components/pages/PageEdit.vue.cjs +1 -1
- package/dist/martyrs/src/modules/pages/views/components/pages/PageEdit.vue.js +1 -1
- package/dist/martyrs/src/modules/products/components/blocks/Images360.vue.cjs +1 -1
- package/dist/martyrs/src/modules/products/components/blocks/Images360.vue.js +1 -1
- package/dist/martyrs/src/modules/products/components/pages/Categories.vue.cjs +1 -1
- package/dist/martyrs/src/modules/products/components/pages/Categories.vue.js +1 -1
- package/dist/martyrs/src/modules/products/components/pages/CategoryEdit.vue.cjs +21 -2
- package/dist/martyrs/src/modules/products/components/pages/CategoryEdit.vue.cjs.map +1 -1
- package/dist/martyrs/src/modules/products/components/pages/CategoryEdit.vue.js +21 -2
- package/dist/martyrs/src/modules/products/components/pages/CategoryEdit.vue.js.map +1 -1
- package/dist/martyrs/src/modules/products/components/pages/Product.vue.cjs +1 -0
- package/dist/martyrs/src/modules/products/components/pages/Product.vue.cjs.map +1 -1
- package/dist/martyrs/src/modules/products/components/pages/Product.vue.js +1 -0
- package/dist/martyrs/src/modules/products/components/pages/Product.vue.js.map +1 -1
- package/dist/martyrs/src/modules/products/components/pages/ProductEdit.vue.cjs +2 -2
- package/dist/martyrs/src/modules/products/components/pages/ProductEdit.vue.cjs.map +1 -1
- package/dist/martyrs/src/modules/products/components/pages/ProductEdit.vue.js +2 -2
- package/dist/martyrs/src/modules/products/components/pages/ProductEdit.vue.js.map +1 -1
- package/dist/martyrs/src/modules/products/components/pages/ProductRecommmendation.vue.cjs +1 -1
- package/dist/martyrs/src/modules/products/components/pages/ProductRecommmendation.vue.js +1 -1
- package/dist/martyrs/src/modules/products/components/sections/EditProductInfo.vue.cjs +1 -1
- package/dist/martyrs/src/modules/products/components/sections/EditProductInfo.vue.js +1 -1
- package/dist/martyrs/src/modules/products/components/sections/PopularProducts.vue.cjs +1 -1
- package/dist/martyrs/src/modules/products/components/sections/PopularProducts.vue.js +1 -1
- package/dist/martyrs/src/modules/products/store/categories.cjs +2 -0
- package/dist/martyrs/src/modules/products/store/categories.cjs.map +1 -1
- package/dist/martyrs/src/modules/products/store/categories.js +2 -0
- package/dist/martyrs/src/modules/products/store/categories.js.map +1 -1
- package/dist/martyrs/src/modules/spots/components/blocks/CardSpot.vue.cjs +1 -1
- package/dist/martyrs/src/modules/spots/components/blocks/CardSpot.vue.js +1 -1
- package/dist/martyrs/src/modules/spots/components/layouts/Spots.vue.cjs +1 -1
- package/dist/martyrs/src/modules/spots/components/layouts/Spots.vue.js +1 -1
- package/dist/martyrs/src/modules/spots/components/pages/SpotEdit.vue.cjs +31 -24
- package/dist/martyrs/src/modules/spots/components/pages/SpotEdit.vue.cjs.map +1 -1
- package/dist/martyrs/src/modules/spots/components/pages/SpotEdit.vue.js +31 -24
- package/dist/martyrs/src/modules/spots/components/pages/SpotEdit.vue.js.map +1 -1
- package/dist/martyrs/src/modules/spots/components/sections/WorktimeEdit.vue.cjs +807 -0
- package/dist/martyrs/src/modules/spots/components/sections/WorktimeEdit.vue.cjs.map +1 -0
- package/dist/martyrs/src/modules/spots/components/sections/WorktimeEdit.vue.js +807 -0
- package/dist/martyrs/src/modules/spots/components/sections/WorktimeEdit.vue.js.map +1 -0
- package/dist/martyrs/src/modules/spots/store/spots.cjs +4 -1
- package/dist/martyrs/src/modules/spots/store/spots.cjs.map +1 -1
- package/dist/martyrs/src/modules/spots/store/spots.js +4 -1
- package/dist/martyrs/src/modules/spots/store/spots.js.map +1 -1
- package/dist/martyrs.cjs.js +1 -1
- package/dist/martyrs.css +1 -1
- package/dist/martyrs.es.js +1 -1
- package/dist/notifications.server.js +1 -1
- package/dist/notifications.server.mjs +1 -1
- package/dist/orders.server.js +5 -4
- package/dist/orders.server.mjs +5 -4
- package/dist/organizations.server.js +120 -47
- package/dist/organizations.server.mjs +120 -47
- package/dist/{ownership.schema-C0w02Vw1.mjs → ownership.schema-CNCotD3D.mjs} +10 -4
- package/dist/{ownership.schema-Ck2H9clB.js → ownership.schema-MxfJlPtq.js} +10 -4
- package/dist/products.server.js +415 -149
- package/dist/products.server.mjs +415 -149
- package/dist/{profile.schema-h61hhB2w.js → profile.schema-BLSuV_VC.js} +0 -4
- package/dist/{profile.schema-kP_zKXNt.mjs → profile.schema-BRuvQ7QV.mjs} +0 -4
- package/dist/{queryProcessor-CWnMIe2U.mjs → queryProcessor-CVKI651_.mjs} +62 -8
- package/dist/{queryProcessor-D6GuKfTV.js → queryProcessor-DSUqSk3I.js} +62 -8
- package/dist/rents.server.js +4 -4
- package/dist/rents.server.mjs +4 -4
- package/dist/spots.server.js +162 -8
- package/dist/spots.server.mjs +162 -8
- package/dist/style.css +27 -4
- package/dist/wallet.server.js +2 -2
- package/dist/wallet.server.mjs +2 -2
- package/package.json +1 -1
- package/src/builder/rspack/rspack.config.base.js +1 -1
- package/src/builder/rspack/rspack.config.client.js +13 -5
- package/src/components/Select/Select.vue +4 -2
- package/src/modules/auth/models/user.model.js +4 -1
- package/src/modules/community/components/sections/HotPosts.vue +1 -1
- package/src/modules/globals/controllers/classes/globals.abac.js +148 -23
- package/src/modules/globals/controllers/classes/globals.validator.js +37 -0
- package/src/modules/globals/controllers/classes/globals.verifier.js +2 -0
- package/src/modules/globals/controllers/policies/globals.policies.js +91 -74
- package/src/modules/globals/controllers/utils/queryProcessor.js +59 -11
- package/src/modules/globals/models/schemas/ownership.schema.js +11 -6
- package/src/modules/globals/models/schemas/profile.schema.js +0 -4
- package/src/modules/music/components/layouts/MusicLayout.vue +10 -58
- package/src/modules/music/components/pages/MusicHome.vue +5 -5
- package/src/modules/orders/components/pages/OrderCreate.vue +84 -12
- package/src/modules/orders/controllers/orders.controller.js +3 -0
- package/src/modules/orders/store/shopcart.js +1 -0
- package/src/modules/organizations/models/schemas/accesses.schema.js +18 -0
- package/src/modules/organizations/policies/organizations.policies.js +117 -61
- package/src/modules/products/components/pages/CategoryEdit.vue +27 -2
- package/src/modules/products/components/pages/Product.vue +1 -0
- package/src/modules/products/components/pages/ProductEdit.vue +2 -2
- package/src/modules/products/controllers/categories.controller.js +297 -133
- package/src/modules/products/middlewares/categories.verifier.js +177 -0
- package/src/modules/products/models/category.model.js +12 -14
- package/src/modules/products/routes/categories.routes.js +50 -11
- package/src/modules/products/store/categories.js +2 -0
- package/src/modules/spots/components/pages/SpotEdit.vue +21 -17
- package/src/modules/spots/components/sections/WorktimeEdit.vue +840 -0
- package/src/modules/spots/controllers/queries/getIsOpenNowStage.js +109 -0
- package/src/modules/spots/controllers/spots.controller.js +2 -1
- package/src/modules/spots/models/spot.model.js +59 -13
- package/src/modules/spots/store/spots.js +4 -1
- package/dist/martyrs/src/components/Chips/Chips.vue2.cjs.map +0 -1
- package/dist/martyrs/src/components/Chips/Chips.vue2.js.map +0 -1
- package/dist/martyrs/src/components/Dropdown/Dropdown.vue.js.map +0 -1
- package/dist/martyrs/src/components/Loader/Loader.vue2.cjs.map +0 -1
- package/dist/martyrs/src/components/Tooltip/Tooltip.vue2.cjs.map +0 -1
- package/src/modules/products/middlewares/index.js +0 -11
- package/src/modules/products/middlewares/verifyCategory.js +0 -25
|
@@ -136,7 +136,11 @@ function requireQueryProcessor() {
|
|
|
136
136
|
}
|
|
137
137
|
},
|
|
138
138
|
{
|
|
139
|
-
$project: {
|
|
139
|
+
$project: {
|
|
140
|
+
username: 1,
|
|
141
|
+
profile: 1,
|
|
142
|
+
_id: 1
|
|
143
|
+
}
|
|
140
144
|
}
|
|
141
145
|
],
|
|
142
146
|
as: "creatorUser"
|
|
@@ -147,8 +151,22 @@ function requireQueryProcessor() {
|
|
|
147
151
|
return {
|
|
148
152
|
$lookup: {
|
|
149
153
|
from: "organizations",
|
|
150
|
-
|
|
151
|
-
|
|
154
|
+
let: { creatorId: "$creator.target" },
|
|
155
|
+
pipeline: [
|
|
156
|
+
{
|
|
157
|
+
$match: {
|
|
158
|
+
$expr: { $eq: ["$_id", "$$creatorId"] }
|
|
159
|
+
}
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
$project: {
|
|
163
|
+
name: 1,
|
|
164
|
+
// если нужно, можешь оставить только нужные поля
|
|
165
|
+
profile: 1,
|
|
166
|
+
_id: 1
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
],
|
|
152
170
|
as: "creatorOrganization"
|
|
153
171
|
}
|
|
154
172
|
};
|
|
@@ -157,8 +175,22 @@ function requireQueryProcessor() {
|
|
|
157
175
|
return {
|
|
158
176
|
$lookup: {
|
|
159
177
|
from: "customers",
|
|
160
|
-
|
|
161
|
-
|
|
178
|
+
let: { creatorId: "$creator.target" },
|
|
179
|
+
pipeline: [
|
|
180
|
+
{
|
|
181
|
+
$match: {
|
|
182
|
+
$expr: { $eq: ["_id", "$$creatorId"] }
|
|
183
|
+
}
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
$project: {
|
|
187
|
+
username: 1,
|
|
188
|
+
// если есть, можно заменить на нужные поля у customer
|
|
189
|
+
profile: 1,
|
|
190
|
+
_id: 1
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
],
|
|
162
194
|
as: "creatorCustomer"
|
|
163
195
|
}
|
|
164
196
|
};
|
|
@@ -175,7 +207,13 @@ function requireQueryProcessor() {
|
|
|
175
207
|
}
|
|
176
208
|
},
|
|
177
209
|
{
|
|
178
|
-
$project: {
|
|
210
|
+
$project: {
|
|
211
|
+
username: 1,
|
|
212
|
+
profile: 1,
|
|
213
|
+
email: 1,
|
|
214
|
+
phone: 1,
|
|
215
|
+
_id: 1
|
|
216
|
+
}
|
|
179
217
|
}
|
|
180
218
|
],
|
|
181
219
|
as: "ownerUser"
|
|
@@ -186,8 +224,24 @@ function requireQueryProcessor() {
|
|
|
186
224
|
return {
|
|
187
225
|
$lookup: {
|
|
188
226
|
from: "organizations",
|
|
189
|
-
|
|
190
|
-
|
|
227
|
+
let: { ownerId: "$owner.target" },
|
|
228
|
+
pipeline: [
|
|
229
|
+
{
|
|
230
|
+
$match: {
|
|
231
|
+
$expr: { $eq: ["$_id", "$$ownerId"] }
|
|
232
|
+
}
|
|
233
|
+
},
|
|
234
|
+
{
|
|
235
|
+
$project: {
|
|
236
|
+
official: 1,
|
|
237
|
+
// если нужно
|
|
238
|
+
owner: 1,
|
|
239
|
+
// если нужно
|
|
240
|
+
profile: 1,
|
|
241
|
+
_id: 1
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
],
|
|
191
245
|
as: "ownerOrganization"
|
|
192
246
|
}
|
|
193
247
|
};
|
|
@@ -137,7 +137,11 @@ function requireQueryProcessor() {
|
|
|
137
137
|
}
|
|
138
138
|
},
|
|
139
139
|
{
|
|
140
|
-
$project: {
|
|
140
|
+
$project: {
|
|
141
|
+
username: 1,
|
|
142
|
+
profile: 1,
|
|
143
|
+
_id: 1
|
|
144
|
+
}
|
|
141
145
|
}
|
|
142
146
|
],
|
|
143
147
|
as: "creatorUser"
|
|
@@ -148,8 +152,22 @@ function requireQueryProcessor() {
|
|
|
148
152
|
return {
|
|
149
153
|
$lookup: {
|
|
150
154
|
from: "organizations",
|
|
151
|
-
|
|
152
|
-
|
|
155
|
+
let: { creatorId: "$creator.target" },
|
|
156
|
+
pipeline: [
|
|
157
|
+
{
|
|
158
|
+
$match: {
|
|
159
|
+
$expr: { $eq: ["$_id", "$$creatorId"] }
|
|
160
|
+
}
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
$project: {
|
|
164
|
+
name: 1,
|
|
165
|
+
// если нужно, можешь оставить только нужные поля
|
|
166
|
+
profile: 1,
|
|
167
|
+
_id: 1
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
],
|
|
153
171
|
as: "creatorOrganization"
|
|
154
172
|
}
|
|
155
173
|
};
|
|
@@ -158,8 +176,22 @@ function requireQueryProcessor() {
|
|
|
158
176
|
return {
|
|
159
177
|
$lookup: {
|
|
160
178
|
from: "customers",
|
|
161
|
-
|
|
162
|
-
|
|
179
|
+
let: { creatorId: "$creator.target" },
|
|
180
|
+
pipeline: [
|
|
181
|
+
{
|
|
182
|
+
$match: {
|
|
183
|
+
$expr: { $eq: ["_id", "$$creatorId"] }
|
|
184
|
+
}
|
|
185
|
+
},
|
|
186
|
+
{
|
|
187
|
+
$project: {
|
|
188
|
+
username: 1,
|
|
189
|
+
// если есть, можно заменить на нужные поля у customer
|
|
190
|
+
profile: 1,
|
|
191
|
+
_id: 1
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
],
|
|
163
195
|
as: "creatorCustomer"
|
|
164
196
|
}
|
|
165
197
|
};
|
|
@@ -176,7 +208,13 @@ function requireQueryProcessor() {
|
|
|
176
208
|
}
|
|
177
209
|
},
|
|
178
210
|
{
|
|
179
|
-
$project: {
|
|
211
|
+
$project: {
|
|
212
|
+
username: 1,
|
|
213
|
+
profile: 1,
|
|
214
|
+
email: 1,
|
|
215
|
+
phone: 1,
|
|
216
|
+
_id: 1
|
|
217
|
+
}
|
|
180
218
|
}
|
|
181
219
|
],
|
|
182
220
|
as: "ownerUser"
|
|
@@ -187,8 +225,24 @@ function requireQueryProcessor() {
|
|
|
187
225
|
return {
|
|
188
226
|
$lookup: {
|
|
189
227
|
from: "organizations",
|
|
190
|
-
|
|
191
|
-
|
|
228
|
+
let: { ownerId: "$owner.target" },
|
|
229
|
+
pipeline: [
|
|
230
|
+
{
|
|
231
|
+
$match: {
|
|
232
|
+
$expr: { $eq: ["$_id", "$$ownerId"] }
|
|
233
|
+
}
|
|
234
|
+
},
|
|
235
|
+
{
|
|
236
|
+
$project: {
|
|
237
|
+
official: 1,
|
|
238
|
+
// если нужно
|
|
239
|
+
owner: 1,
|
|
240
|
+
// если нужно
|
|
241
|
+
profile: 1,
|
|
242
|
+
_id: 1
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
],
|
|
192
246
|
as: "ownerOrganization"
|
|
193
247
|
}
|
|
194
248
|
};
|
package/dist/rents.server.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const _commonjsHelpers = require("./_commonjsHelpers-DHfMLFPC.js");
|
|
3
|
-
const globals_verifier = require("./globals.verifier-
|
|
3
|
+
const globals_verifier = require("./globals.verifier-CKYpYfQl.js");
|
|
4
4
|
const globals_cache = require("./globals.cache-CwWvNGFQ.js");
|
|
5
5
|
const globals_logger = require("./globals.logger-BdjooLaD.js");
|
|
6
|
-
const queryProcessor = require("./queryProcessor-
|
|
7
|
-
const index = require("./index-
|
|
8
|
-
const globals_abac = require("./globals.abac-
|
|
6
|
+
const queryProcessor = require("./queryProcessor-DSUqSk3I.js");
|
|
7
|
+
const index = require("./index-BOmxJQ5W.js");
|
|
8
|
+
const globals_abac = require("./globals.abac-Bn-4tbX8.js");
|
|
9
9
|
var rents_services;
|
|
10
10
|
var hasRequiredRents_services;
|
|
11
11
|
function requireRents_services() {
|
package/dist/rents.server.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { g as getDefaultExportFromCjs } from "./_commonjsHelpers-CUmg6egw.mjs";
|
|
2
|
-
import { a as requireGlobals_validator, r as requireGlobals_verifier } from "./globals.verifier-
|
|
2
|
+
import { a as requireGlobals_validator, r as requireGlobals_verifier } from "./globals.verifier-BdJxc8-8.mjs";
|
|
3
3
|
import { r as requireGlobals_cache } from "./globals.cache-BT6q3vOf.mjs";
|
|
4
4
|
import { r as requireGlobals_logger } from "./globals.logger-DusiFsxN.mjs";
|
|
5
|
-
import { r as requireQueryProcessor } from "./queryProcessor-
|
|
6
|
-
import { r as requireMiddlewares } from "./index-
|
|
7
|
-
import { r as requireGlobals_abac } from "./globals.abac-
|
|
5
|
+
import { r as requireQueryProcessor } from "./queryProcessor-CVKI651_.mjs";
|
|
6
|
+
import { r as requireMiddlewares } from "./index-C_Fw0Umg.mjs";
|
|
7
|
+
import { r as requireGlobals_abac } from "./globals.abac-DZpTRxKR.mjs";
|
|
8
8
|
var rents_services;
|
|
9
9
|
var hasRequiredRents_services;
|
|
10
10
|
function requireRents_services() {
|
package/dist/spots.server.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const _commonjsHelpers = require("./_commonjsHelpers-DHfMLFPC.js");
|
|
3
|
-
const queryProcessor = require("./queryProcessor-
|
|
3
|
+
const queryProcessor = require("./queryProcessor-DSUqSk3I.js");
|
|
4
4
|
var spot_model;
|
|
5
5
|
var hasRequiredSpot_model;
|
|
6
6
|
function requireSpot_model() {
|
|
@@ -41,13 +41,34 @@ function requireSpot_model() {
|
|
|
41
41
|
required: true
|
|
42
42
|
}
|
|
43
43
|
},
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
44
|
+
// Обновленная структура для часов работы
|
|
45
|
+
worktime: {
|
|
46
|
+
// Стандартные часы работы
|
|
47
|
+
regular: [{
|
|
48
|
+
// 0 = воскресенье, 6 = суббота (соответствует JavaScript Date.getDay())
|
|
49
|
+
dayOfWeek: { type: Number, min: 0, max: 6, required: true },
|
|
50
|
+
isOpen: { type: Boolean, default: true },
|
|
51
|
+
periods: [{
|
|
52
|
+
open: { type: String, required: true },
|
|
53
|
+
// формат "HH:MM" 24-часовой
|
|
54
|
+
close: { type: String, required: true }
|
|
55
|
+
// формат "HH:MM" 24-часовой
|
|
56
|
+
}]
|
|
57
|
+
}],
|
|
58
|
+
// Особые даты (праздники, особые события и т.д.)
|
|
59
|
+
special: [{
|
|
60
|
+
date: { type: Date, required: true },
|
|
61
|
+
isOpen: { type: Boolean, default: false },
|
|
62
|
+
periods: [{
|
|
63
|
+
open: { type: String },
|
|
64
|
+
// формат "HH:MM" 24-часовой
|
|
65
|
+
close: { type: String }
|
|
66
|
+
// формат "HH:MM" 24-часовой
|
|
67
|
+
}],
|
|
68
|
+
description: { type: String }
|
|
69
|
+
// описание особого дня (например, "Новый год")
|
|
70
|
+
}]
|
|
71
|
+
},
|
|
51
72
|
// Marketplace options
|
|
52
73
|
delivery: [String],
|
|
53
74
|
payment: [String],
|
|
@@ -72,17 +93,149 @@ function requireSpot_model() {
|
|
|
72
93
|
});
|
|
73
94
|
spotSchema.index({ organization: 1 });
|
|
74
95
|
spotSchema.index({ location: "2dsphere" });
|
|
96
|
+
spotSchema.virtual("isOpenNow").get(function() {
|
|
97
|
+
const now = /* @__PURE__ */ new Date();
|
|
98
|
+
const currentDay = now.getDay();
|
|
99
|
+
const currentTime = `${String(now.getHours()).padStart(2, "0")}:${String(now.getMinutes()).padStart(2, "0")}`;
|
|
100
|
+
const today = new Date(now.getFullYear(), now.getMonth(), now.getDate());
|
|
101
|
+
const specialDay = this.worktime?.special?.find(
|
|
102
|
+
(special) => special.date.getTime() === today.getTime()
|
|
103
|
+
);
|
|
104
|
+
if (specialDay) {
|
|
105
|
+
if (!specialDay.isOpen) return false;
|
|
106
|
+
return specialDay.periods.some(
|
|
107
|
+
(period) => period.open <= currentTime && period.close > currentTime
|
|
108
|
+
);
|
|
109
|
+
}
|
|
110
|
+
const regularHours = this.worktime?.regular?.find((day) => day.dayOfWeek === currentDay);
|
|
111
|
+
if (!regularHours || !regularHours.isOpen) return false;
|
|
112
|
+
return regularHours.periods.some(
|
|
113
|
+
(period) => period.open <= currentTime && period.close > currentTime
|
|
114
|
+
);
|
|
115
|
+
});
|
|
116
|
+
spotSchema.set("toJSON", { virtuals: true });
|
|
117
|
+
spotSchema.set("toObject", { virtuals: true });
|
|
75
118
|
const Spot = db.mongoose.model("Spot", spotSchema);
|
|
76
119
|
return Spot;
|
|
77
120
|
};
|
|
78
121
|
return spot_model;
|
|
79
122
|
}
|
|
123
|
+
var getIsOpenNowStage;
|
|
124
|
+
var hasRequiredGetIsOpenNowStage;
|
|
125
|
+
function requireGetIsOpenNowStage() {
|
|
126
|
+
if (hasRequiredGetIsOpenNowStage) return getIsOpenNowStage;
|
|
127
|
+
hasRequiredGetIsOpenNowStage = 1;
|
|
128
|
+
getIsOpenNowStage = function getIsOpenNowStage2() {
|
|
129
|
+
const now = /* @__PURE__ */ new Date();
|
|
130
|
+
const currentDay = now.getDay();
|
|
131
|
+
const currentTime = `${String(now.getHours()).padStart(2, "0")}:${String(now.getMinutes()).padStart(2, "0")}`;
|
|
132
|
+
return {
|
|
133
|
+
$addFields: {
|
|
134
|
+
isOpenNow: {
|
|
135
|
+
$let: {
|
|
136
|
+
vars: {
|
|
137
|
+
// Найдем особую дату на сегодня, если она есть
|
|
138
|
+
specialDay: {
|
|
139
|
+
$filter: {
|
|
140
|
+
input: { $ifNull: ["$worktime.special", []] },
|
|
141
|
+
as: "special",
|
|
142
|
+
cond: {
|
|
143
|
+
$eq: [
|
|
144
|
+
{ $dateToString: { format: "%Y-%m-%d", date: "$$special.date" } },
|
|
145
|
+
{ $dateToString: { format: "%Y-%m-%d", date: /* @__PURE__ */ new Date() } }
|
|
146
|
+
]
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
},
|
|
151
|
+
in: {
|
|
152
|
+
$cond: {
|
|
153
|
+
if: { $gt: [{ $size: "$$specialDay" }, 0] },
|
|
154
|
+
then: {
|
|
155
|
+
$let: {
|
|
156
|
+
vars: { day: { $arrayElemAt: ["$$specialDay", 0] } },
|
|
157
|
+
in: {
|
|
158
|
+
$cond: {
|
|
159
|
+
if: "$$day.isOpen",
|
|
160
|
+
then: {
|
|
161
|
+
$anyElementTrue: {
|
|
162
|
+
$map: {
|
|
163
|
+
input: { $ifNull: ["$$day.periods", []] },
|
|
164
|
+
as: "period",
|
|
165
|
+
in: {
|
|
166
|
+
$and: [
|
|
167
|
+
{ $lte: ["$$period.open", currentTime] },
|
|
168
|
+
{ $gt: ["$$period.close", currentTime] }
|
|
169
|
+
]
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
},
|
|
174
|
+
else: false
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
},
|
|
179
|
+
else: {
|
|
180
|
+
$let: {
|
|
181
|
+
vars: {
|
|
182
|
+
regularDay: {
|
|
183
|
+
$filter: {
|
|
184
|
+
input: { $ifNull: ["$worktime.regular", []] },
|
|
185
|
+
as: "day",
|
|
186
|
+
cond: { $eq: ["$$day.dayOfWeek", currentDay] }
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
},
|
|
190
|
+
in: {
|
|
191
|
+
$cond: {
|
|
192
|
+
if: { $gt: [{ $size: "$$regularDay" }, 0] },
|
|
193
|
+
then: {
|
|
194
|
+
$let: {
|
|
195
|
+
vars: { day: { $arrayElemAt: ["$$regularDay", 0] } },
|
|
196
|
+
in: {
|
|
197
|
+
$cond: {
|
|
198
|
+
if: "$$day.isOpen",
|
|
199
|
+
then: {
|
|
200
|
+
$anyElementTrue: {
|
|
201
|
+
$map: {
|
|
202
|
+
input: { $ifNull: ["$$day.periods", []] },
|
|
203
|
+
as: "period",
|
|
204
|
+
in: {
|
|
205
|
+
$and: [
|
|
206
|
+
{ $lte: ["$$period.open", currentTime] },
|
|
207
|
+
{ $gt: ["$$period.close", currentTime] }
|
|
208
|
+
]
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
},
|
|
213
|
+
else: false
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
},
|
|
218
|
+
else: false
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
};
|
|
229
|
+
};
|
|
230
|
+
return getIsOpenNowStage;
|
|
231
|
+
}
|
|
80
232
|
var spots_controller;
|
|
81
233
|
var hasRequiredSpots_controller;
|
|
82
234
|
function requireSpots_controller() {
|
|
83
235
|
if (hasRequiredSpots_controller) return spots_controller;
|
|
84
236
|
hasRequiredSpots_controller = 1;
|
|
85
237
|
const queryProcessorGlobals = queryProcessor.requireQueryProcessor();
|
|
238
|
+
const getIsOpenNowStage2 = requireGetIsOpenNowStage();
|
|
86
239
|
const controllerFactory = (db) => {
|
|
87
240
|
const Spot = db.spot;
|
|
88
241
|
const read = async (req, res) => {
|
|
@@ -90,6 +243,7 @@ function requireSpots_controller() {
|
|
|
90
243
|
...queryProcessorGlobals.getBasicOptions(
|
|
91
244
|
req.query
|
|
92
245
|
),
|
|
246
|
+
getIsOpenNowStage2(),
|
|
93
247
|
// Tags
|
|
94
248
|
...queryProcessorGlobals.getTagsOptions(req.query.tags),
|
|
95
249
|
// For creator
|
package/dist/spots.server.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { g as getDefaultExportFromCjs } from "./_commonjsHelpers-CUmg6egw.mjs";
|
|
2
|
-
import { r as requireQueryProcessor } from "./queryProcessor-
|
|
2
|
+
import { r as requireQueryProcessor } from "./queryProcessor-CVKI651_.mjs";
|
|
3
3
|
var spot_model;
|
|
4
4
|
var hasRequiredSpot_model;
|
|
5
5
|
function requireSpot_model() {
|
|
@@ -40,13 +40,34 @@ function requireSpot_model() {
|
|
|
40
40
|
required: true
|
|
41
41
|
}
|
|
42
42
|
},
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
43
|
+
// Обновленная структура для часов работы
|
|
44
|
+
worktime: {
|
|
45
|
+
// Стандартные часы работы
|
|
46
|
+
regular: [{
|
|
47
|
+
// 0 = воскресенье, 6 = суббота (соответствует JavaScript Date.getDay())
|
|
48
|
+
dayOfWeek: { type: Number, min: 0, max: 6, required: true },
|
|
49
|
+
isOpen: { type: Boolean, default: true },
|
|
50
|
+
periods: [{
|
|
51
|
+
open: { type: String, required: true },
|
|
52
|
+
// формат "HH:MM" 24-часовой
|
|
53
|
+
close: { type: String, required: true }
|
|
54
|
+
// формат "HH:MM" 24-часовой
|
|
55
|
+
}]
|
|
56
|
+
}],
|
|
57
|
+
// Особые даты (праздники, особые события и т.д.)
|
|
58
|
+
special: [{
|
|
59
|
+
date: { type: Date, required: true },
|
|
60
|
+
isOpen: { type: Boolean, default: false },
|
|
61
|
+
periods: [{
|
|
62
|
+
open: { type: String },
|
|
63
|
+
// формат "HH:MM" 24-часовой
|
|
64
|
+
close: { type: String }
|
|
65
|
+
// формат "HH:MM" 24-часовой
|
|
66
|
+
}],
|
|
67
|
+
description: { type: String }
|
|
68
|
+
// описание особого дня (например, "Новый год")
|
|
69
|
+
}]
|
|
70
|
+
},
|
|
50
71
|
// Marketplace options
|
|
51
72
|
delivery: [String],
|
|
52
73
|
payment: [String],
|
|
@@ -71,17 +92,149 @@ function requireSpot_model() {
|
|
|
71
92
|
});
|
|
72
93
|
spotSchema.index({ organization: 1 });
|
|
73
94
|
spotSchema.index({ location: "2dsphere" });
|
|
95
|
+
spotSchema.virtual("isOpenNow").get(function() {
|
|
96
|
+
const now = /* @__PURE__ */ new Date();
|
|
97
|
+
const currentDay = now.getDay();
|
|
98
|
+
const currentTime = `${String(now.getHours()).padStart(2, "0")}:${String(now.getMinutes()).padStart(2, "0")}`;
|
|
99
|
+
const today = new Date(now.getFullYear(), now.getMonth(), now.getDate());
|
|
100
|
+
const specialDay = this.worktime?.special?.find(
|
|
101
|
+
(special) => special.date.getTime() === today.getTime()
|
|
102
|
+
);
|
|
103
|
+
if (specialDay) {
|
|
104
|
+
if (!specialDay.isOpen) return false;
|
|
105
|
+
return specialDay.periods.some(
|
|
106
|
+
(period) => period.open <= currentTime && period.close > currentTime
|
|
107
|
+
);
|
|
108
|
+
}
|
|
109
|
+
const regularHours = this.worktime?.regular?.find((day) => day.dayOfWeek === currentDay);
|
|
110
|
+
if (!regularHours || !regularHours.isOpen) return false;
|
|
111
|
+
return regularHours.periods.some(
|
|
112
|
+
(period) => period.open <= currentTime && period.close > currentTime
|
|
113
|
+
);
|
|
114
|
+
});
|
|
115
|
+
spotSchema.set("toJSON", { virtuals: true });
|
|
116
|
+
spotSchema.set("toObject", { virtuals: true });
|
|
74
117
|
const Spot = db.mongoose.model("Spot", spotSchema);
|
|
75
118
|
return Spot;
|
|
76
119
|
};
|
|
77
120
|
return spot_model;
|
|
78
121
|
}
|
|
122
|
+
var getIsOpenNowStage;
|
|
123
|
+
var hasRequiredGetIsOpenNowStage;
|
|
124
|
+
function requireGetIsOpenNowStage() {
|
|
125
|
+
if (hasRequiredGetIsOpenNowStage) return getIsOpenNowStage;
|
|
126
|
+
hasRequiredGetIsOpenNowStage = 1;
|
|
127
|
+
getIsOpenNowStage = function getIsOpenNowStage2() {
|
|
128
|
+
const now = /* @__PURE__ */ new Date();
|
|
129
|
+
const currentDay = now.getDay();
|
|
130
|
+
const currentTime = `${String(now.getHours()).padStart(2, "0")}:${String(now.getMinutes()).padStart(2, "0")}`;
|
|
131
|
+
return {
|
|
132
|
+
$addFields: {
|
|
133
|
+
isOpenNow: {
|
|
134
|
+
$let: {
|
|
135
|
+
vars: {
|
|
136
|
+
// Найдем особую дату на сегодня, если она есть
|
|
137
|
+
specialDay: {
|
|
138
|
+
$filter: {
|
|
139
|
+
input: { $ifNull: ["$worktime.special", []] },
|
|
140
|
+
as: "special",
|
|
141
|
+
cond: {
|
|
142
|
+
$eq: [
|
|
143
|
+
{ $dateToString: { format: "%Y-%m-%d", date: "$$special.date" } },
|
|
144
|
+
{ $dateToString: { format: "%Y-%m-%d", date: /* @__PURE__ */ new Date() } }
|
|
145
|
+
]
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
},
|
|
150
|
+
in: {
|
|
151
|
+
$cond: {
|
|
152
|
+
if: { $gt: [{ $size: "$$specialDay" }, 0] },
|
|
153
|
+
then: {
|
|
154
|
+
$let: {
|
|
155
|
+
vars: { day: { $arrayElemAt: ["$$specialDay", 0] } },
|
|
156
|
+
in: {
|
|
157
|
+
$cond: {
|
|
158
|
+
if: "$$day.isOpen",
|
|
159
|
+
then: {
|
|
160
|
+
$anyElementTrue: {
|
|
161
|
+
$map: {
|
|
162
|
+
input: { $ifNull: ["$$day.periods", []] },
|
|
163
|
+
as: "period",
|
|
164
|
+
in: {
|
|
165
|
+
$and: [
|
|
166
|
+
{ $lte: ["$$period.open", currentTime] },
|
|
167
|
+
{ $gt: ["$$period.close", currentTime] }
|
|
168
|
+
]
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
},
|
|
173
|
+
else: false
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
},
|
|
178
|
+
else: {
|
|
179
|
+
$let: {
|
|
180
|
+
vars: {
|
|
181
|
+
regularDay: {
|
|
182
|
+
$filter: {
|
|
183
|
+
input: { $ifNull: ["$worktime.regular", []] },
|
|
184
|
+
as: "day",
|
|
185
|
+
cond: { $eq: ["$$day.dayOfWeek", currentDay] }
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
},
|
|
189
|
+
in: {
|
|
190
|
+
$cond: {
|
|
191
|
+
if: { $gt: [{ $size: "$$regularDay" }, 0] },
|
|
192
|
+
then: {
|
|
193
|
+
$let: {
|
|
194
|
+
vars: { day: { $arrayElemAt: ["$$regularDay", 0] } },
|
|
195
|
+
in: {
|
|
196
|
+
$cond: {
|
|
197
|
+
if: "$$day.isOpen",
|
|
198
|
+
then: {
|
|
199
|
+
$anyElementTrue: {
|
|
200
|
+
$map: {
|
|
201
|
+
input: { $ifNull: ["$$day.periods", []] },
|
|
202
|
+
as: "period",
|
|
203
|
+
in: {
|
|
204
|
+
$and: [
|
|
205
|
+
{ $lte: ["$$period.open", currentTime] },
|
|
206
|
+
{ $gt: ["$$period.close", currentTime] }
|
|
207
|
+
]
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
},
|
|
212
|
+
else: false
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
},
|
|
217
|
+
else: false
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
};
|
|
228
|
+
};
|
|
229
|
+
return getIsOpenNowStage;
|
|
230
|
+
}
|
|
79
231
|
var spots_controller;
|
|
80
232
|
var hasRequiredSpots_controller;
|
|
81
233
|
function requireSpots_controller() {
|
|
82
234
|
if (hasRequiredSpots_controller) return spots_controller;
|
|
83
235
|
hasRequiredSpots_controller = 1;
|
|
84
236
|
const queryProcessorGlobals = requireQueryProcessor();
|
|
237
|
+
const getIsOpenNowStage2 = requireGetIsOpenNowStage();
|
|
85
238
|
const controllerFactory = (db) => {
|
|
86
239
|
const Spot = db.spot;
|
|
87
240
|
const read = async (req, res) => {
|
|
@@ -89,6 +242,7 @@ function requireSpots_controller() {
|
|
|
89
242
|
...queryProcessorGlobals.getBasicOptions(
|
|
90
243
|
req.query
|
|
91
244
|
),
|
|
245
|
+
getIsOpenNowStage2(),
|
|
92
246
|
// Tags
|
|
93
247
|
...queryProcessorGlobals.getTagsOptions(req.query.tags),
|
|
94
248
|
// For creator
|