@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.
Files changed (235) hide show
  1. package/dist/{Media-DW8RLbfM.js → Media-_vz04tII.js} +1 -1
  2. package/dist/{Media-y_TX6us_.mjs → Media-sGk7Bp9b.mjs} +1 -1
  3. package/dist/auth.server.js +6 -2
  4. package/dist/auth.server.mjs +6 -2
  5. package/dist/authJwt-CELQKF2s.js +82 -0
  6. package/dist/authJwt-DnXu3BFq.mjs +83 -0
  7. package/dist/builder.js +7 -4
  8. package/dist/builder.mjs +7 -4
  9. package/dist/chats.server.js +1 -1
  10. package/dist/chats.server.mjs +1 -1
  11. package/dist/community.server.js +4 -4
  12. package/dist/community.server.mjs +4 -4
  13. package/dist/events.server.js +4 -4
  14. package/dist/events.server.mjs +4 -4
  15. package/dist/files.server.js +1 -1
  16. package/dist/files.server.mjs +1 -1
  17. package/dist/gallery.server.js +3 -3
  18. package/dist/gallery.server.mjs +3 -3
  19. package/dist/{globals.abac-DT0VjfaZ.js → globals.abac-Bn-4tbX8.js} +110 -16
  20. package/dist/{globals.abac-CvmZM8XG.mjs → globals.abac-DZpTRxKR.mjs} +110 -16
  21. package/dist/globals.server.js +70 -10
  22. package/dist/globals.server.mjs +70 -10
  23. package/dist/{globals.verifier-C_VZYebB.mjs → globals.verifier-BdJxc8-8.mjs} +34 -0
  24. package/dist/{globals.verifier-ChDpCdy_.js → globals.verifier-CKYpYfQl.js} +34 -0
  25. package/dist/{index-CVXl1rB5.js → index-BOmxJQ5W.js} +7 -86
  26. package/dist/{index-Df8vtZx7.mjs → index-C_Fw0Umg.mjs} +7 -86
  27. package/dist/{main-CgmHzhq5.mjs → main-CqMtW7Hq.mjs} +274 -276
  28. package/dist/{main-CCfQH-Dd.js → main-CsGkbSyK.js} +2 -2
  29. package/dist/martyrs/src/components/Block/Block.vue.cjs +1 -1
  30. package/dist/martyrs/src/components/Block/Block.vue.js +1 -1
  31. package/dist/martyrs/src/components/Button/Button.vue2.cjs +1 -1
  32. package/dist/martyrs/src/components/Button/Button.vue2.js +1 -1
  33. package/dist/martyrs/src/components/Chips/{Chips.vue2.cjs → Chips.vue.cjs} +2 -2
  34. package/dist/martyrs/src/components/Chips/Chips.vue.cjs.map +1 -0
  35. package/dist/martyrs/src/components/Chips/{Chips.vue2.js → Chips.vue.js} +2 -2
  36. package/dist/martyrs/src/components/Chips/Chips.vue.js.map +1 -0
  37. package/dist/martyrs/src/components/Dropdown/{Dropdown.vue.cjs → Dropdown.vue2.cjs} +2 -2
  38. package/dist/martyrs/src/components/Dropdown/Dropdown.vue2.cjs.map +1 -0
  39. package/dist/martyrs/src/components/Dropdown/{Dropdown.vue.js → Dropdown.vue2.js} +2 -2
  40. package/dist/martyrs/src/components/Dropdown/{Dropdown.vue.cjs.map → Dropdown.vue2.js.map} +1 -1
  41. package/dist/martyrs/src/components/Feed/Feed.vue.cjs +2 -2
  42. package/dist/martyrs/src/components/Feed/Feed.vue.js +2 -2
  43. package/dist/martyrs/src/components/Loader/{Loader.vue2.cjs → Loader.vue.cjs} +2 -2
  44. package/dist/martyrs/src/components/Loader/{Loader.vue2.js.map → Loader.vue.cjs.map} +1 -1
  45. package/dist/martyrs/src/components/Loader/{Loader.vue2.js → Loader.vue.js} +2 -2
  46. package/dist/martyrs/src/components/Loader/Loader.vue.js.map +1 -0
  47. package/dist/martyrs/src/components/LocationMarker/LocationMarker.vue2.cjs +1 -1
  48. package/dist/martyrs/src/components/LocationMarker/LocationMarker.vue2.js +1 -1
  49. package/dist/martyrs/src/components/Select/Select.vue.cjs +4 -4
  50. package/dist/martyrs/src/components/Select/Select.vue.cjs.map +1 -1
  51. package/dist/martyrs/src/components/Select/Select.vue.js +4 -4
  52. package/dist/martyrs/src/components/Select/Select.vue.js.map +1 -1
  53. package/dist/martyrs/src/components/Slider/Slider.native.vue.cjs +1 -1
  54. package/dist/martyrs/src/components/Slider/Slider.native.vue.js +1 -1
  55. package/dist/martyrs/src/components/Tooltip/{Tooltip.vue2.cjs → Tooltip.vue.cjs} +2 -2
  56. package/dist/martyrs/src/components/Tooltip/{Tooltip.vue2.js.map → Tooltip.vue.cjs.map} +1 -1
  57. package/dist/martyrs/src/components/Tooltip/{Tooltip.vue2.js → Tooltip.vue.js} +2 -2
  58. package/dist/martyrs/src/components/Tooltip/Tooltip.vue.js.map +1 -0
  59. package/dist/martyrs/src/components/UploadImageMultiple/UploadImageMultiple.vue.cjs +1 -1
  60. package/dist/martyrs/src/components/UploadImageMultiple/UploadImageMultiple.vue.js +1 -1
  61. package/dist/martyrs/src/modules/auth/views/components/layouts/Auth.vue.cjs +1 -1
  62. package/dist/martyrs/src/modules/auth/views/components/layouts/Auth.vue.js +1 -1
  63. package/dist/martyrs/src/modules/auth/views/components/pages/Profile.vue.cjs +2 -2
  64. package/dist/martyrs/src/modules/auth/views/components/pages/Profile.vue.js +2 -2
  65. package/dist/martyrs/src/modules/community/community.client.js +27 -27
  66. package/dist/martyrs/src/modules/community/community.client.js.map +1 -1
  67. package/dist/martyrs/src/modules/community/components/blocks/CardBlogpost.vue.cjs +1 -1
  68. package/dist/martyrs/src/modules/community/components/blocks/CardBlogpost.vue.js +1 -1
  69. package/dist/martyrs/src/modules/community/components/pages/BlogPost.vue.cjs +2 -2
  70. package/dist/martyrs/src/modules/community/components/pages/BlogPost.vue.js +2 -2
  71. package/dist/martyrs/src/modules/community/components/sections/HotPosts.vue.cjs +4 -5
  72. package/dist/martyrs/src/modules/community/components/sections/HotPosts.vue.cjs.map +1 -1
  73. package/dist/martyrs/src/modules/community/components/sections/HotPosts.vue.js +4 -5
  74. package/dist/martyrs/src/modules/community/components/sections/HotPosts.vue.js.map +1 -1
  75. package/dist/martyrs/src/modules/events/components/blocks/CardEvent.vue.cjs +1 -1
  76. package/dist/martyrs/src/modules/events/components/blocks/CardEvent.vue.js +1 -1
  77. package/dist/martyrs/src/modules/events/components/pages/EditEvent.vue.cjs +1 -1
  78. package/dist/martyrs/src/modules/events/components/pages/EditEvent.vue.js +1 -1
  79. package/dist/martyrs/src/modules/events/components/pages/Event.vue.cjs +2 -2
  80. package/dist/martyrs/src/modules/events/components/pages/Event.vue.js +2 -2
  81. package/dist/martyrs/src/modules/events/components/sections/EventsHot.vue.cjs +2 -2
  82. package/dist/martyrs/src/modules/events/components/sections/EventsHot.vue.js +2 -2
  83. package/dist/martyrs/src/modules/events/components/sections/Feed.vue.cjs +1 -1
  84. package/dist/martyrs/src/modules/events/components/sections/Feed.vue.js +1 -1
  85. package/dist/martyrs/src/modules/events/components/sections/List.vue.cjs +1 -1
  86. package/dist/martyrs/src/modules/events/components/sections/List.vue.js +1 -1
  87. package/dist/martyrs/src/modules/gallery/components/sections/BackofficeGallery.vue.cjs +1 -1
  88. package/dist/martyrs/src/modules/gallery/components/sections/BackofficeGallery.vue.js +1 -1
  89. package/dist/martyrs/src/modules/globals/views/components/blocks/CardHeader.vue.cjs +3 -3
  90. package/dist/martyrs/src/modules/globals/views/components/blocks/CardHeader.vue.js +3 -3
  91. package/dist/martyrs/src/modules/globals/views/components/blocks/PopupDateSelector.vue.cjs +1 -1
  92. package/dist/martyrs/src/modules/globals/views/components/blocks/PopupDateSelector.vue.js +1 -1
  93. package/dist/martyrs/src/modules/globals/views/components/layouts/Client.vue.cjs +1 -1
  94. package/dist/martyrs/src/modules/globals/views/components/layouts/Client.vue.js +1 -1
  95. package/dist/martyrs/src/modules/globals/views/components/partials/Navigation.vue.cjs +1 -1
  96. package/dist/martyrs/src/modules/globals/views/components/partials/Navigation.vue.js +1 -1
  97. package/dist/martyrs/src/modules/marketplace/views/components/sections/SectionMenu.vue.cjs +1 -1
  98. package/dist/martyrs/src/modules/marketplace/views/components/sections/SectionMenu.vue.js +1 -1
  99. package/dist/martyrs/src/modules/orders/components/blocks/CardOrderUser.vue.cjs +1 -1
  100. package/dist/martyrs/src/modules/orders/components/blocks/CardOrderUser.vue.js +1 -1
  101. package/dist/martyrs/src/modules/orders/components/pages/OrderBackoffice.vue.cjs +1 -1
  102. package/dist/martyrs/src/modules/orders/components/pages/OrderBackoffice.vue.js +1 -1
  103. package/dist/martyrs/src/modules/orders/components/pages/OrderCreate.vue.cjs +88 -27
  104. package/dist/martyrs/src/modules/orders/components/pages/OrderCreate.vue.cjs.map +1 -1
  105. package/dist/martyrs/src/modules/orders/components/pages/OrderCreate.vue.js +89 -28
  106. package/dist/martyrs/src/modules/orders/components/pages/OrderCreate.vue.js.map +1 -1
  107. package/dist/martyrs/src/modules/orders/components/sections/FormDelivery.vue.cjs +2 -2
  108. package/dist/martyrs/src/modules/orders/components/sections/FormDelivery.vue.js +2 -2
  109. package/dist/martyrs/src/modules/orders/store/shopcart.cjs +1 -0
  110. package/dist/martyrs/src/modules/orders/store/shopcart.cjs.map +1 -1
  111. package/dist/martyrs/src/modules/orders/store/shopcart.js +1 -0
  112. package/dist/martyrs/src/modules/orders/store/shopcart.js.map +1 -1
  113. package/dist/martyrs/src/modules/organizations/components/blocks/CardOrganization.vue.cjs +1 -1
  114. package/dist/martyrs/src/modules/organizations/components/blocks/CardOrganization.vue.js +1 -1
  115. package/dist/martyrs/src/modules/organizations/components/pages/DepartmentEdit.vue.cjs +1 -1
  116. package/dist/martyrs/src/modules/organizations/components/pages/DepartmentEdit.vue.js +1 -1
  117. package/dist/martyrs/src/modules/organizations/components/pages/Members.vue.cjs +1 -1
  118. package/dist/martyrs/src/modules/organizations/components/pages/Members.vue.js +1 -1
  119. package/dist/martyrs/src/modules/organizations/components/sections/DetailsTabSection.vue.cjs +2 -2
  120. package/dist/martyrs/src/modules/organizations/components/sections/DetailsTabSection.vue.js +2 -2
  121. package/dist/martyrs/src/modules/organizations/components/sections/Documents.vue.cjs +1 -1
  122. package/dist/martyrs/src/modules/organizations/components/sections/Documents.vue.js +1 -1
  123. package/dist/martyrs/src/modules/organizations/components/sections/Organizations.vue.cjs +1 -1
  124. package/dist/martyrs/src/modules/organizations/components/sections/Organizations.vue.js +1 -1
  125. package/dist/martyrs/src/modules/pages/views/components/blocks/CardPage.vue.cjs +1 -1
  126. package/dist/martyrs/src/modules/pages/views/components/blocks/CardPage.vue.js +1 -1
  127. package/dist/martyrs/src/modules/pages/views/components/pages/PageEdit.vue.cjs +1 -1
  128. package/dist/martyrs/src/modules/pages/views/components/pages/PageEdit.vue.js +1 -1
  129. package/dist/martyrs/src/modules/products/components/blocks/Images360.vue.cjs +1 -1
  130. package/dist/martyrs/src/modules/products/components/blocks/Images360.vue.js +1 -1
  131. package/dist/martyrs/src/modules/products/components/pages/Categories.vue.cjs +1 -1
  132. package/dist/martyrs/src/modules/products/components/pages/Categories.vue.js +1 -1
  133. package/dist/martyrs/src/modules/products/components/pages/CategoryEdit.vue.cjs +21 -2
  134. package/dist/martyrs/src/modules/products/components/pages/CategoryEdit.vue.cjs.map +1 -1
  135. package/dist/martyrs/src/modules/products/components/pages/CategoryEdit.vue.js +21 -2
  136. package/dist/martyrs/src/modules/products/components/pages/CategoryEdit.vue.js.map +1 -1
  137. package/dist/martyrs/src/modules/products/components/pages/Product.vue.cjs +1 -0
  138. package/dist/martyrs/src/modules/products/components/pages/Product.vue.cjs.map +1 -1
  139. package/dist/martyrs/src/modules/products/components/pages/Product.vue.js +1 -0
  140. package/dist/martyrs/src/modules/products/components/pages/Product.vue.js.map +1 -1
  141. package/dist/martyrs/src/modules/products/components/pages/ProductEdit.vue.cjs +2 -2
  142. package/dist/martyrs/src/modules/products/components/pages/ProductEdit.vue.cjs.map +1 -1
  143. package/dist/martyrs/src/modules/products/components/pages/ProductEdit.vue.js +2 -2
  144. package/dist/martyrs/src/modules/products/components/pages/ProductEdit.vue.js.map +1 -1
  145. package/dist/martyrs/src/modules/products/components/pages/ProductRecommmendation.vue.cjs +1 -1
  146. package/dist/martyrs/src/modules/products/components/pages/ProductRecommmendation.vue.js +1 -1
  147. package/dist/martyrs/src/modules/products/components/sections/EditProductInfo.vue.cjs +1 -1
  148. package/dist/martyrs/src/modules/products/components/sections/EditProductInfo.vue.js +1 -1
  149. package/dist/martyrs/src/modules/products/components/sections/PopularProducts.vue.cjs +1 -1
  150. package/dist/martyrs/src/modules/products/components/sections/PopularProducts.vue.js +1 -1
  151. package/dist/martyrs/src/modules/products/store/categories.cjs +2 -0
  152. package/dist/martyrs/src/modules/products/store/categories.cjs.map +1 -1
  153. package/dist/martyrs/src/modules/products/store/categories.js +2 -0
  154. package/dist/martyrs/src/modules/products/store/categories.js.map +1 -1
  155. package/dist/martyrs/src/modules/spots/components/blocks/CardSpot.vue.cjs +1 -1
  156. package/dist/martyrs/src/modules/spots/components/blocks/CardSpot.vue.js +1 -1
  157. package/dist/martyrs/src/modules/spots/components/layouts/Spots.vue.cjs +1 -1
  158. package/dist/martyrs/src/modules/spots/components/layouts/Spots.vue.js +1 -1
  159. package/dist/martyrs/src/modules/spots/components/pages/SpotEdit.vue.cjs +31 -24
  160. package/dist/martyrs/src/modules/spots/components/pages/SpotEdit.vue.cjs.map +1 -1
  161. package/dist/martyrs/src/modules/spots/components/pages/SpotEdit.vue.js +31 -24
  162. package/dist/martyrs/src/modules/spots/components/pages/SpotEdit.vue.js.map +1 -1
  163. package/dist/martyrs/src/modules/spots/components/sections/WorktimeEdit.vue.cjs +807 -0
  164. package/dist/martyrs/src/modules/spots/components/sections/WorktimeEdit.vue.cjs.map +1 -0
  165. package/dist/martyrs/src/modules/spots/components/sections/WorktimeEdit.vue.js +807 -0
  166. package/dist/martyrs/src/modules/spots/components/sections/WorktimeEdit.vue.js.map +1 -0
  167. package/dist/martyrs/src/modules/spots/store/spots.cjs +4 -1
  168. package/dist/martyrs/src/modules/spots/store/spots.cjs.map +1 -1
  169. package/dist/martyrs/src/modules/spots/store/spots.js +4 -1
  170. package/dist/martyrs/src/modules/spots/store/spots.js.map +1 -1
  171. package/dist/martyrs.cjs.js +1 -1
  172. package/dist/martyrs.css +1 -1
  173. package/dist/martyrs.es.js +1 -1
  174. package/dist/notifications.server.js +1 -1
  175. package/dist/notifications.server.mjs +1 -1
  176. package/dist/orders.server.js +5 -4
  177. package/dist/orders.server.mjs +5 -4
  178. package/dist/organizations.server.js +120 -47
  179. package/dist/organizations.server.mjs +120 -47
  180. package/dist/{ownership.schema-C0w02Vw1.mjs → ownership.schema-CNCotD3D.mjs} +10 -4
  181. package/dist/{ownership.schema-Ck2H9clB.js → ownership.schema-MxfJlPtq.js} +10 -4
  182. package/dist/products.server.js +415 -149
  183. package/dist/products.server.mjs +415 -149
  184. package/dist/{profile.schema-h61hhB2w.js → profile.schema-BLSuV_VC.js} +0 -4
  185. package/dist/{profile.schema-kP_zKXNt.mjs → profile.schema-BRuvQ7QV.mjs} +0 -4
  186. package/dist/{queryProcessor-CWnMIe2U.mjs → queryProcessor-CVKI651_.mjs} +62 -8
  187. package/dist/{queryProcessor-D6GuKfTV.js → queryProcessor-DSUqSk3I.js} +62 -8
  188. package/dist/rents.server.js +4 -4
  189. package/dist/rents.server.mjs +4 -4
  190. package/dist/spots.server.js +162 -8
  191. package/dist/spots.server.mjs +162 -8
  192. package/dist/style.css +27 -4
  193. package/dist/wallet.server.js +2 -2
  194. package/dist/wallet.server.mjs +2 -2
  195. package/package.json +1 -1
  196. package/src/builder/rspack/rspack.config.base.js +1 -1
  197. package/src/builder/rspack/rspack.config.client.js +13 -5
  198. package/src/components/Select/Select.vue +4 -2
  199. package/src/modules/auth/models/user.model.js +4 -1
  200. package/src/modules/community/components/sections/HotPosts.vue +1 -1
  201. package/src/modules/globals/controllers/classes/globals.abac.js +148 -23
  202. package/src/modules/globals/controllers/classes/globals.validator.js +37 -0
  203. package/src/modules/globals/controllers/classes/globals.verifier.js +2 -0
  204. package/src/modules/globals/controllers/policies/globals.policies.js +91 -74
  205. package/src/modules/globals/controllers/utils/queryProcessor.js +59 -11
  206. package/src/modules/globals/models/schemas/ownership.schema.js +11 -6
  207. package/src/modules/globals/models/schemas/profile.schema.js +0 -4
  208. package/src/modules/music/components/layouts/MusicLayout.vue +10 -58
  209. package/src/modules/music/components/pages/MusicHome.vue +5 -5
  210. package/src/modules/orders/components/pages/OrderCreate.vue +84 -12
  211. package/src/modules/orders/controllers/orders.controller.js +3 -0
  212. package/src/modules/orders/store/shopcart.js +1 -0
  213. package/src/modules/organizations/models/schemas/accesses.schema.js +18 -0
  214. package/src/modules/organizations/policies/organizations.policies.js +117 -61
  215. package/src/modules/products/components/pages/CategoryEdit.vue +27 -2
  216. package/src/modules/products/components/pages/Product.vue +1 -0
  217. package/src/modules/products/components/pages/ProductEdit.vue +2 -2
  218. package/src/modules/products/controllers/categories.controller.js +297 -133
  219. package/src/modules/products/middlewares/categories.verifier.js +177 -0
  220. package/src/modules/products/models/category.model.js +12 -14
  221. package/src/modules/products/routes/categories.routes.js +50 -11
  222. package/src/modules/products/store/categories.js +2 -0
  223. package/src/modules/spots/components/pages/SpotEdit.vue +21 -17
  224. package/src/modules/spots/components/sections/WorktimeEdit.vue +840 -0
  225. package/src/modules/spots/controllers/queries/getIsOpenNowStage.js +109 -0
  226. package/src/modules/spots/controllers/spots.controller.js +2 -1
  227. package/src/modules/spots/models/spot.model.js +59 -13
  228. package/src/modules/spots/store/spots.js +4 -1
  229. package/dist/martyrs/src/components/Chips/Chips.vue2.cjs.map +0 -1
  230. package/dist/martyrs/src/components/Chips/Chips.vue2.js.map +0 -1
  231. package/dist/martyrs/src/components/Dropdown/Dropdown.vue.js.map +0 -1
  232. package/dist/martyrs/src/components/Loader/Loader.vue2.cjs.map +0 -1
  233. package/dist/martyrs/src/components/Tooltip/Tooltip.vue2.cjs.map +0 -1
  234. package/src/modules/products/middlewares/index.js +0 -11
  235. package/src/modules/products/middlewares/verifyCategory.js +0 -25
@@ -0,0 +1,109 @@
1
+ // getIsOpenNowStage.js
2
+
3
+ /**
4
+ * Создает шаг агрегации для расчета поля isOpenNow
5
+ * @returns {Object} Объект этапа агрегации MongoDB
6
+ */
7
+ module.exports = function getIsOpenNowStage() {
8
+ const now = new Date();
9
+ const currentDay = now.getDay();
10
+ const currentTime = `${String(now.getHours()).padStart(2, '0')}:${String(now.getMinutes()).padStart(2, '0')}`;
11
+
12
+ return {
13
+ $addFields: {
14
+ isOpenNow: {
15
+ $let: {
16
+ vars: {
17
+ // Найдем особую дату на сегодня, если она есть
18
+ specialDay: {
19
+ $filter: {
20
+ input: { $ifNull: ["$worktime.special", []] },
21
+ as: "special",
22
+ cond: {
23
+ $eq: [
24
+ { $dateToString: { format: "%Y-%m-%d", date: "$$special.date" } },
25
+ { $dateToString: { format: "%Y-%m-%d", date: new Date() } }
26
+ ]
27
+ }
28
+ }
29
+ }
30
+ },
31
+ in: {
32
+ $cond: {
33
+ if: { $gt: [{ $size: "$$specialDay" }, 0] },
34
+ then: {
35
+ $let: {
36
+ vars: { day: { $arrayElemAt: ["$$specialDay", 0] } },
37
+ in: {
38
+ $cond: {
39
+ if: "$$day.isOpen",
40
+ then: {
41
+ $anyElementTrue: {
42
+ $map: {
43
+ input: { $ifNull: ["$$day.periods", []] },
44
+ as: "period",
45
+ in: {
46
+ $and: [
47
+ { $lte: ["$$period.open", currentTime] },
48
+ { $gt: ["$$period.close", currentTime] }
49
+ ]
50
+ }
51
+ }
52
+ }
53
+ },
54
+ else: false
55
+ }
56
+ }
57
+ }
58
+ },
59
+ else: {
60
+ $let: {
61
+ vars: {
62
+ regularDay: {
63
+ $filter: {
64
+ input: { $ifNull: ["$worktime.regular", []] },
65
+ as: "day",
66
+ cond: { $eq: ["$$day.dayOfWeek", currentDay] }
67
+ }
68
+ }
69
+ },
70
+ in: {
71
+ $cond: {
72
+ if: { $gt: [{ $size: "$$regularDay" }, 0] },
73
+ then: {
74
+ $let: {
75
+ vars: { day: { $arrayElemAt: ["$$regularDay", 0] } },
76
+ in: {
77
+ $cond: {
78
+ if: "$$day.isOpen",
79
+ then: {
80
+ $anyElementTrue: {
81
+ $map: {
82
+ input: { $ifNull: ["$$day.periods", []] },
83
+ as: "period",
84
+ in: {
85
+ $and: [
86
+ { $lte: ["$$period.open", currentTime] },
87
+ { $gt: ["$$period.close", currentTime] }
88
+ ]
89
+ }
90
+ }
91
+ }
92
+ },
93
+ else: false
94
+ }
95
+ }
96
+ }
97
+ },
98
+ else: false
99
+ }
100
+ }
101
+ }
102
+ }
103
+ }
104
+ }
105
+ }
106
+ }
107
+ }
108
+ };
109
+ };
@@ -1,5 +1,5 @@
1
1
  const queryProcessorGlobals = require('@martyrs/src/modules/globals/controllers/utils/queryProcessor');
2
-
2
+ const getIsOpenNowStage = require('./queries/getIsOpenNowStage');
3
3
 
4
4
  const controllerFactory = (db) => {
5
5
  const Spot = db.spot;
@@ -10,6 +10,7 @@ const controllerFactory = (db) => {
10
10
  ...queryProcessorGlobals.getBasicOptions(
11
11
  req.query
12
12
  ),
13
+ getIsOpenNowStage(),
13
14
  // Tags
14
15
  ...queryProcessorGlobals.getTagsOptions(req.query.tags),
15
16
  // For creator
@@ -34,13 +34,29 @@ module.exports = (db) => {
34
34
  required: true
35
35
  }
36
36
  },
37
- worktime: [{
38
- day: String,
39
- time: {
40
- start: String,
41
- end: String
42
- }
43
- }],
37
+ // Обновленная структура для часов работы
38
+ worktime: {
39
+ // Стандартные часы работы
40
+ regular: [{
41
+ // 0 = воскресенье, 6 = суббота (соответствует JavaScript Date.getDay())
42
+ dayOfWeek: { type: Number, min: 0, max: 6, required: true },
43
+ isOpen: { type: Boolean, default: true },
44
+ periods: [{
45
+ open: { type: String, required: true }, // формат "HH:MM" 24-часовой
46
+ close: { type: String, required: true } // формат "HH:MM" 24-часовой
47
+ }]
48
+ }],
49
+ // Особые даты (праздники, особые события и т.д.)
50
+ special: [{
51
+ date: { type: Date, required: true },
52
+ isOpen: { type: Boolean, default: false },
53
+ periods: [{
54
+ open: { type: String }, // формат "HH:MM" 24-часовой
55
+ close: { type: String } // формат "HH:MM" 24-часовой
56
+ }],
57
+ description: { type: String } // описание особого дня (например, "Новый год")
58
+ }]
59
+ },
44
60
  // Marketplace options
45
61
  delivery: [String],
46
62
  payment: [String],
@@ -63,13 +79,43 @@ module.exports = (db) => {
63
79
  },
64
80
  ],
65
81
  });
66
-
67
- spotSchema.index({ organization: 1 })
68
-
82
+
83
+ // Индексы
84
+ spotSchema.index({ organization: 1 });
69
85
  spotSchema.index({ location: '2dsphere' });
86
+
87
+ // Виртуальное свойство для проверки открыт ли спот в данный момент
88
+ spotSchema.virtual('isOpenNow').get(function() {
89
+ const now = new Date();
90
+ const currentDay = now.getDay();
91
+ const currentTime = `${String(now.getHours()).padStart(2, '0')}:${String(now.getMinutes()).padStart(2, '0')}`;
92
+
93
+ // Проверка особых дат
94
+ const today = new Date(now.getFullYear(), now.getMonth(), now.getDate());
95
+ const specialDay = this.worktime?.special?.find(special =>
96
+ special.date.getTime() === today.getTime()
97
+ );
98
+
99
+ if (specialDay) {
100
+ if (!specialDay.isOpen) return false;
101
+ return specialDay.periods.some(period =>
102
+ period.open <= currentTime && period.close > currentTime
103
+ );
104
+ }
105
+
106
+ // Проверка обычных часов работы
107
+ const regularHours = this.worktime?.regular?.find(day => day.dayOfWeek === currentDay);
108
+ if (!regularHours || !regularHours.isOpen) return false;
109
+
110
+ return regularHours.periods.some(period =>
111
+ period.open <= currentTime && period.close > currentTime
112
+ );
113
+ });
70
114
 
115
+ spotSchema.set('toJSON', { virtuals: true });
116
+ spotSchema.set('toObject', { virtuals: true });
71
117
 
118
+
72
119
  const Spot = db.mongoose.model('Spot', spotSchema);
73
-
74
- return Spot
75
- }
120
+ return Spot;
121
+ };
@@ -26,7 +26,10 @@ const state = reactive({
26
26
  address: undefined,
27
27
  location: undefined,
28
28
 
29
- worktime: [],
29
+ worktime: {
30
+ regular: [],
31
+ special: []
32
+ },
30
33
  delivery: [],
31
34
  payment: [],
32
35
  members: [],
@@ -1 +0,0 @@
1
- {"version":3,"file":"Chips.vue2.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"Chips.vue2.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"Dropdown.vue.js","sources":["../../../../../src/components/Dropdown/Dropdown.vue"],"sourcesContent":["<template>\n <div class=\"dropdown pos-relative\" v-click-outside=\"clickedOutside\" @click.stop=\"isOpen = !isOpen\">\n <div v-if=\"isComponentLabel\" class=\"w-100 h-100 flex-center flex\">\n <component :is=\"label.component\" v-bind=\"label.props\" :class=\"label.class\"></component>\n </div>\n <div v-else>\n {{ label }}\n </div>\n <transition name=\"TransitionTranslateY\" mode=\"out-in\">\n <div \n v-show=\"isOpen\" \n :style=\"{ left: align === 'left' ? '0' : 'auto', right: align === 'right' ? '0' : 'auto' }\" \n class=\"dropdown-content radius-big\" \n >\n <slot></slot>\n </div>\n </transition>\n </div>\n</template>\n\n<script setup>\nimport { ref, computed } from 'vue';\nimport clickOutside from '../FieldPhone/click-outside';\n\nlet vClickOutside = clickOutside\n\nconst props = defineProps({\n label: {\n type: [String, Object],\n default: 'Open'\n },\n align: {\n type: String,\n default: 'left'\n }\n})\n\nconst isOpen = ref(false);\nconst isComponentLabel = computed(() => typeof props.label === 'object');\n\nfunction clickedOutside () {\n isOpen.value = false\n}\n</script>\n\n<style >\n.dropdown-content {\n display: block;\n position: absolute;\n box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);\n z-index: 1;\n}\n\n/*.dropdown:hover .dropdown-content {\n display: block;\n}*/\n</style>\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAwBA,QAAI,gBAAgB;AAEpB,UAAM,QAAQ;AAWd,UAAM,SAAS,IAAI,KAAK;AACxB,UAAM,mBAAmB,SAAS,MAAM,OAAO,MAAM,UAAU,QAAQ;AAEvE,aAAS,iBAAkB;AACzB,aAAO,QAAQ;AAAA,IACjB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"Loader.vue2.cjs","sources":["../../../../../src/components/Loader/Loader.vue"],"sourcesContent":["<template>\n <div class=\"circular-loader\" :class=\"{ 'circular-loader-centered': centered }\">\n <svg viewBox=\"25 25 50 50\">\n <circle class=\"circular-loader-fill\" cx=\"50\" cy=\"50\" r=\"20\" fill=\"none\" stroke-width=\"4\" stroke-miterlimit=\"10\" />\n <circle class=\"circular-loader-circle\" cx=\"50\" cy=\"50\" r=\"20\" fill=\"none\" stroke-width=\"4\" stroke-miterlimit=\"10\" />\n </svg>\n <div v-if=\"progress\" class=\"progress-text\">{{ progress }}</div>\n <div v-if=\"status\" class=\"uppercase t-semi w-m-10r status-text\">{{ status }}</div>\n </div>\n</template>\n\n<script>\nexport default {\n props: {\n progress: {\n type: Number,\n default: null,\n },\n status: {\n type: String,\n default: null,\n },\n centered: {\n type: Boolean,\n default: true, // По умолчанию лоадер центрирован (для обратной совместимости)\n },\n },\n};\n</script>\n\n<style>\n.circular-loader {\n position: relative;\n z-index: 50;\n height: 2rem;\n width: 2rem;\n}\n\n.circular-loader-centered {\n top: calc(50% - 1rem);\n left: calc(50% - 1rem);\n}\n\n.circular-loader svg {\n animation: rotate 2s linear infinite;\n}\n\n.circular-loader-circle {\n stroke-dasharray: 1, 200;\n stroke-dashoffset: 0;\n stroke-linecap: round;\n stroke: rgb(var(--main));\n animation: dash 1.5s ease-in-out infinite;\n}\n\n.circular-loader-fill {\n stroke-linecap: round;\n stroke: rgba(var(--black),0.2);\n}\n\n.progress-text {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n font-size: 0.8rem;\n color: rgb(var(--main));;\n}\n\n.status-text {\n position: absolute;\n top: 120%;\n left: calc(50% - 5rem);\n font-size: 0.8rem;\n width: 10rem !important;\n text-align: center;\n}\n\n@keyframes rotate {\n 100% {\n transform: rotate(360deg);\n }\n}\n\n@keyframes dash {\n 0% {\n stroke-dasharray: 1, 200;\n stroke-dashoffset: 0;\n }\n 50% {\n stroke-dasharray: 89, 200;\n stroke-dashoffset: -35;\n }\n 100% {\n stroke-dasharray: 1, 200;\n stroke-dashoffset: -124;\n }\n}\n</style>"],"names":["_createElementBlock","_normalizeClass","_createElementVNode","_toDisplayString","_createCommentVNode"],"mappings":";;;;;AAYA,MAAK,YAAU;AAAA,EACb,OAAO;AAAA,IACL,UAAU;AAAA,MACR,MAAM;AAAA,MACN,SAAS;AAAA,IACV;AAAA,IACD,QAAQ;AAAA,MACN,MAAM;AAAA,MACN,SAAS;AAAA,IACV;AAAA,IACD,UAAU;AAAA,MACR,MAAM;AAAA,MACN,SAAS;AAAA;AAAA,IACV;AAAA,EACF;AACH;;EA3BA,KAAA;AAAA,EAMyB,OAAM;;;EAN/B,KAAA;AAAA,EAOuB,OAAM;;;0BAN3BA,IAOM,mBAAA,OAAA;AAAA,IAPD,OADPC,IAAA,eAAA,CACa,mBAAiB,EAAA,4BAAuC,OAAQ,UAAA,CAAA;AAAA;8BACzEC,IAGM,mBAAA,OAAA,EAHD,SAAQ,iBAAa;AAAA,MACxBA,IAAAA,mBAAkH,UAAA;AAAA,QAA1G,OAAM;AAAA,QAAuB,IAAG;AAAA,QAAK,IAAG;AAAA,QAAK,GAAE;AAAA,QAAK,MAAK;AAAA,QAAO,gBAAa;AAAA,QAAI,qBAAkB;AAAA;MAC3GA,IAAAA,mBAAoH,UAAA;AAAA,QAA5G,OAAM;AAAA,QAAyB,IAAG;AAAA,QAAK,IAAG;AAAA,QAAK,GAAE;AAAA,QAAK,MAAK;AAAA,QAAO,gBAAa;AAAA,QAAI,qBAAkB;AAAA;;IAEpG,OAAQ,6BAAnBF,IAA+D,mBAAA,OAA/D,YAA+DG,IAAAA,gBAAjB,OAAQ,QAAA,GAAA,CAAA,KAN1DC,IAAA,mBAAA,IAAA,IAAA;AAAA,IAOe,OAAM,2BAAjBJ,IAAkF,mBAAA,OAAlF,YAAkFG,IAAAA,gBAAf,OAAM,MAAA,GAAA,CAAA,KAP7EC,IAAA,mBAAA,IAAA,IAAA;AAAA;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"Tooltip.vue2.cjs","sources":["../../../../../src/components/Tooltip/Tooltip.vue"],"sourcesContent":["<template>\n <div class=\"cursor-pointer tooltip-container\" @mouseover=\"showTooltip\" @mouseleave=\"hideTooltip\">\n <slot></slot>\n <div class=\"tooltip-content\" :style=\"tooltipStyle\">\n {{ text }}\n </div>\n </div>\n</template>\n\n<script setup>\nimport { ref, reactive } from 'vue';\n\nconst props = defineProps({\n text: {\n type: String,\n required: true\n }\n});\n\nconst visible = ref(false);\n\nconst tooltipStyle = reactive({\n position: 'absolute',\n width: 'max-content',\n zIndex: 1000,\n background: '#333',\n color: '#fff',\n padding: '5px 10px',\n borderRadius: '3px',\n fontSize: '14px',\n display: 'none',\n});\n\nfunction showTooltip(event) {\n visible.value = true;\n tooltipStyle.left = `${(event.clientX / 100) + 10 }px`;\n tooltipStyle.top = `${(event.clientY / 100) + 10 }px`;\n tooltipStyle.display = 'block';\n}\n\nfunction hideTooltip() {\n visible.value = false;\n tooltipStyle.display = 'none';\n}\n</script>\n\n<style >\n.tooltip-container {\n position: relative;\n display: inline-block;\n}\n\n.tooltip-content {\n pointer-events: none;\n}\n</style>"],"names":["ref","reactive"],"mappings":";;;;;;;;;;;;;AAmBA,UAAM,UAAUA,IAAG,IAAC,KAAK;AAEzB,UAAM,eAAeC,IAAAA,SAAS;AAAA,MAC5B,UAAU;AAAA,MACV,OAAO;AAAA,MACP,QAAQ;AAAA,MACR,YAAY;AAAA,MACZ,OAAO;AAAA,MACP,SAAS;AAAA,MACT,cAAc;AAAA,MACd,UAAU;AAAA,MACV,SAAS;AAAA,IACX,CAAC;AAED,aAAS,YAAY,OAAO;AAC1B,cAAQ,QAAQ;AAChB,mBAAa,OAAO,GAAI,MAAM,UAAU,MAAO,EAAE;AACjD,mBAAa,MAAM,GAAI,MAAM,UAAU,MAAO,EAAE;AAChD,mBAAa,UAAU;AAAA,IACzB;AAEA,aAAS,cAAc;AACrB,cAAQ,QAAQ;AAChB,mBAAa,UAAU;AAAA,IACzB;;;;;;;;;;;;;;;;;"}
@@ -1,11 +0,0 @@
1
- // middlewareIndexFactory.js
2
-
3
- const middlewareIndexFactory = (db) => {
4
- const verifyCategory = require("./verifyCategory")(db);
5
-
6
- return {
7
- verifyCategory
8
- };
9
- };
10
-
11
- module.exports = middlewareIndexFactory;
@@ -1,25 +0,0 @@
1
- // middlewareFactory.js
2
- const middlewareFactory = (db) => {
3
- const Category = db.category;
4
-
5
- const checkCategoryExistOrNot = async (req, res, next) => {
6
- try {
7
- const category = await Category.findOne({ url: req.body.url });
8
-
9
- if (category) {
10
- res.status(400).send({ message: "Failed! Category with this URL is already in use!" });
11
- return;
12
- }
13
-
14
- next();
15
- } catch (err) {
16
- res.status(500).send({ message: err });
17
- }
18
- };
19
-
20
- return {
21
- checkCategoryExistOrNot
22
- };
23
- };
24
-
25
- module.exports = middlewareFactory;