@ozdao/prometheus-framework 0.2.91 → 0.2.93

Sign up to get free protection for your applications and to get access to all the features.
Files changed (182) hide show
  1. package/dist/events.server.js +19 -9
  2. package/dist/events.server.mjs +19 -9
  3. package/dist/main-CX2ISR43.mjs +13629 -0
  4. package/dist/main-cffh4bbv.js +92 -0
  5. package/dist/main.css +1 -1
  6. package/dist/orders.server.js +32 -18
  7. package/dist/orders.server.mjs +32 -18
  8. package/dist/organizations.server.js +2 -1
  9. package/dist/organizations.server.mjs +2 -1
  10. package/dist/prometheus-framework/src/components/Address/Address.vue2.cjs +1 -1
  11. package/dist/prometheus-framework/src/components/Address/Address.vue2.js +46 -48
  12. package/dist/prometheus-framework/src/components/LocationMarker/LocationMarker.vue2.cjs +1 -1
  13. package/dist/prometheus-framework/src/components/LocationMarker/LocationMarker.vue2.js +25 -20
  14. package/dist/prometheus-framework/src/components/Map/Map.vue.cjs +1 -1
  15. package/dist/prometheus-framework/src/components/Map/Map.vue.js +36 -26
  16. package/dist/prometheus-framework/src/components/Select/Select.vue.cjs +1 -1
  17. package/dist/prometheus-framework/src/components/Select/Select.vue.js +103 -1
  18. package/dist/prometheus-framework/src/components/Select/Select.vue2.cjs +1 -1
  19. package/dist/prometheus-framework/src/components/Select/Select.vue2.js +1 -103
  20. package/dist/prometheus-framework/src/modules/community/components/layouts/Community.vue.cjs +1 -1
  21. package/dist/prometheus-framework/src/modules/community/components/layouts/Community.vue.js +1 -1
  22. package/dist/prometheus-framework/src/modules/community/components/pages/Community.vue.cjs +1 -1
  23. package/dist/prometheus-framework/src/modules/community/components/pages/Community.vue.js +1 -1
  24. package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.cjs +1 -1
  25. package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.js +1 -1
  26. package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue.cjs +5 -1
  27. package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue.js +66 -0
  28. package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue2.cjs +1 -5
  29. package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue2.js +0 -66
  30. package/dist/prometheus-framework/src/modules/constructor/components/elements/VideoPlayer.vue.cjs +1 -1
  31. package/dist/prometheus-framework/src/modules/constructor/components/elements/VideoPlayer.vue.js +11 -11
  32. package/dist/prometheus-framework/src/modules/constructor/components/sections/Constructor.vue.cjs +1 -1
  33. package/dist/prometheus-framework/src/modules/constructor/components/sections/Constructor.vue.js +1 -1
  34. package/dist/prometheus-framework/src/modules/events/components/layouts/layoutEvents.vue.cjs +1 -1
  35. package/dist/prometheus-framework/src/modules/events/components/layouts/layoutEvents.vue.js +14 -48
  36. package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.cjs +1 -1
  37. package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.js +1 -1
  38. package/dist/prometheus-framework/src/modules/events/components/pages/Events.vue.cjs +1 -1
  39. package/dist/prometheus-framework/src/modules/events/components/pages/Events.vue.js +85 -25
  40. package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.cjs +1 -1
  41. package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.js +1 -1
  42. package/dist/prometheus-framework/src/modules/gallery/components/sections/GalleryWithCategories.vue.cjs +1 -1
  43. package/dist/prometheus-framework/src/modules/gallery/components/sections/GalleryWithCategories.vue.js +1 -1
  44. package/dist/prometheus-framework/src/modules/globals/components/blocks/CardHeader.vue.cjs +1 -1
  45. package/dist/prometheus-framework/src/modules/globals/components/blocks/CardHeader.vue.js +74 -63
  46. package/dist/prometheus-framework/src/modules/landing/components/sections/SectionFeatures.vue.cjs +1 -0
  47. package/dist/prometheus-framework/src/modules/landing/components/sections/SectionFeatures.vue.js +74 -0
  48. package/dist/prometheus-framework/src/modules/landing/landing.client.cjs +1 -1
  49. package/dist/prometheus-framework/src/modules/landing/landing.client.js +4 -2
  50. package/dist/prometheus-framework/src/modules/orders/components/blocks/StatusHistory.vue.cjs +2 -2
  51. package/dist/prometheus-framework/src/modules/orders/components/blocks/StatusHistory.vue.js +39 -65
  52. package/dist/prometheus-framework/src/modules/orders/components/pages/Order.vue.cjs +1 -1
  53. package/dist/prometheus-framework/src/modules/orders/components/pages/Order.vue.js +31 -31
  54. package/dist/prometheus-framework/src/modules/orders/components/pages/OrderBackoffice.vue.cjs +1 -0
  55. package/dist/prometheus-framework/src/modules/orders/components/pages/OrderBackoffice.vue.js +242 -0
  56. package/dist/prometheus-framework/src/modules/orders/components/pages/OrderBackoffice.vue2.cjs +1 -0
  57. package/dist/prometheus-framework/src/modules/orders/components/pages/OrderBackoffice.vue2.js +1 -0
  58. package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreate.vue.cjs +1 -1
  59. package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreate.vue.js +62 -62
  60. package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreateBackoffice.vue.cjs +1 -1
  61. package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreateBackoffice.vue.js +28 -28
  62. package/dist/prometheus-framework/src/modules/orders/components/pages/Orders.vue.cjs +1 -1
  63. package/dist/prometheus-framework/src/modules/orders/components/pages/Orders.vue.js +99 -70
  64. package/dist/prometheus-framework/src/modules/orders/components/sections/FormAddCustomer.vue.cjs +1 -1
  65. package/dist/prometheus-framework/src/modules/orders/components/sections/FormAddCustomer.vue.js +1 -1
  66. package/dist/prometheus-framework/src/modules/orders/components/sections/FormCustomerDetails.vue.cjs +1 -1
  67. package/dist/prometheus-framework/src/modules/orders/components/sections/FormCustomerDetails.vue.js +1 -1
  68. package/dist/prometheus-framework/src/modules/orders/components/sections/FormDelivery.vue.cjs +1 -1
  69. package/dist/prometheus-framework/src/modules/orders/components/sections/FormDelivery.vue.js +10 -10
  70. package/dist/prometheus-framework/src/modules/orders/components/sections/FormPayment.vue.cjs +1 -1
  71. package/dist/prometheus-framework/src/modules/orders/components/sections/FormPayment.vue.js +1 -1
  72. package/dist/prometheus-framework/src/modules/orders/router/orders.backoffice.router.cjs +1 -1
  73. package/dist/prometheus-framework/src/modules/orders/router/orders.backoffice.router.js +7 -9
  74. package/dist/prometheus-framework/src/modules/orders/router/orders.router.cjs +1 -1
  75. package/dist/prometheus-framework/src/modules/orders/router/orders.router.js +2 -2
  76. package/dist/prometheus-framework/src/modules/orders/store/orders.cjs +1 -1
  77. package/dist/prometheus-framework/src/modules/orders/store/orders.js +33 -34
  78. package/dist/prometheus-framework/src/modules/orders/store/shopcart.cjs +1 -1
  79. package/dist/prometheus-framework/src/modules/orders/store/shopcart.js +42 -42
  80. package/dist/prometheus-framework/src/modules/organizations/components/blocks/CardDepartment.vue.cjs +1 -1
  81. package/dist/prometheus-framework/src/modules/organizations/components/blocks/CardDepartment.vue.js +27 -25
  82. package/dist/prometheus-framework/src/modules/organizations/components/blocks/DepartmentMemberModify.vue.cjs +1 -1
  83. package/dist/prometheus-framework/src/modules/organizations/components/blocks/DepartmentMemberModify.vue.js +11 -11
  84. package/dist/prometheus-framework/src/modules/organizations/components/pages/Department.vue.cjs +1 -1
  85. package/dist/prometheus-framework/src/modules/organizations/components/pages/Department.vue.js +46 -43
  86. package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.cjs +1 -1
  87. package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.js +162 -168
  88. package/dist/prometheus-framework/src/modules/organizations/components/pages/Members.vue.cjs +1 -1
  89. package/dist/prometheus-framework/src/modules/organizations/components/pages/Members.vue.js +27 -26
  90. package/dist/prometheus-framework/src/modules/organizations/components/pages/Organization.vue.cjs +1 -1
  91. package/dist/prometheus-framework/src/modules/organizations/components/pages/Organization.vue.js +7 -7
  92. package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.cjs +1 -1
  93. package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.js +1 -1
  94. package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.cjs +1 -1
  95. package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.js +1 -1
  96. package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.cjs +1 -1
  97. package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.js +1 -1
  98. package/dist/prometheus-framework/src/modules/organizations/store/memberships.cjs +1 -1
  99. package/dist/prometheus-framework/src/modules/organizations/store/memberships.js +1 -1
  100. package/dist/prometheus-framework/src/modules/products/components/blocks/CardPosition.vue.cjs +1 -1
  101. package/dist/prometheus-framework/src/modules/products/components/blocks/CardPosition.vue.js +1 -1
  102. package/dist/prometheus-framework/src/modules/products/components/blocks/CardProduct.vue.cjs +1 -1
  103. package/dist/prometheus-framework/src/modules/products/components/blocks/CardProduct.vue.js +37 -26
  104. package/dist/prometheus-framework/src/modules/products/components/pages/CategoryEdit.vue.cjs +1 -1
  105. package/dist/prometheus-framework/src/modules/products/components/pages/CategoryEdit.vue.js +1 -1
  106. package/dist/prometheus-framework/src/modules/products/components/pages/EditLeftover.vue.cjs +1 -1
  107. package/dist/prometheus-framework/src/modules/products/components/pages/EditLeftover.vue.js +1 -1
  108. package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.cjs +1 -1
  109. package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.js +14 -15
  110. package/dist/prometheus-framework/src/modules/products/components/pages/Products.vue.cjs +1 -1
  111. package/dist/prometheus-framework/src/modules/products/components/pages/Products.vue.js +22 -20
  112. package/dist/prometheus-framework/src/modules/products/components/sections/EditProductInfo.vue.cjs +1 -1
  113. package/dist/prometheus-framework/src/modules/products/components/sections/EditProductInfo.vue.js +1 -1
  114. package/dist/prometheus-framework/src/modules/products/store/products.cjs +1 -1
  115. package/dist/prometheus-framework/src/modules/products/store/products.js +59 -38
  116. package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.cjs +1 -1
  117. package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.js +1 -1
  118. package/dist/prometheus-framework/src/modules/spots/components/blocks/CardSpot.vue.cjs +1 -1
  119. package/dist/prometheus-framework/src/modules/spots/components/blocks/CardSpot.vue.js +23 -22
  120. package/dist/prometheus-framework/src/modules/users/components/blocks/CardUser.vue.cjs +1 -1
  121. package/dist/prometheus-framework/src/modules/users/components/blocks/CardUser.vue.js +17 -14
  122. package/dist/prometheus-framework/src/modules/wallet/views/components/pages/Wallet.vue.cjs +1 -1
  123. package/dist/prometheus-framework/src/modules/wallet/views/components/pages/Wallet.vue.js +1 -1
  124. package/dist/prometheus-framework.cjs.js +1 -1
  125. package/dist/prometheus-framework.es.js +1 -1
  126. package/dist/style.css +1 -1
  127. package/dist/web-CQQEUA9l.js +1 -0
  128. package/dist/web-D2Em-p-C.mjs +54 -0
  129. package/package.json +1 -1
  130. package/src/components/Address/Address.vue +23 -34
  131. package/src/components/LocationMarker/LocationMarker.vue +6 -1
  132. package/src/components/LocationSelection/LocationSelection.vue +4 -0
  133. package/src/components/Map/Map.vue +29 -15
  134. package/src/modules/constructor/components/elements/VideoPlayer.vue +2 -2
  135. package/src/modules/events/components/layouts/layoutEvents.vue +2 -59
  136. package/src/modules/events/components/pages/Events.vue +106 -23
  137. package/src/modules/events/controllers/events.controller.js +10 -7
  138. package/src/modules/globals/components/blocks/CardHeader.vue +31 -6
  139. package/src/modules/integrations/stripe/controllers/services/stripe.service.js +17 -6
  140. package/src/modules/landing/components/pages/Farming.vue +226 -0
  141. package/src/modules/landing/components/pages/Governance.vue +3 -5
  142. package/src/modules/landing/components/pages/Home.vue +0 -3
  143. package/src/modules/landing/components/pages/Hotel.vue +1 -3
  144. package/src/modules/landing/components/pages/Page.vue +0 -3
  145. package/src/modules/landing/components/sections/Examples.vue +4 -56
  146. package/src/modules/landing/components/sections/SectionFeature.vue +41 -0
  147. package/src/modules/landing/components/sections/SectionFeaturesImages.vue +122 -0
  148. package/src/modules/landing/components/sections/SectionFocus.vue +59 -0
  149. package/src/modules/landing/components/sections/SectionHeroVideo.vue +164 -0
  150. package/src/modules/landing/landing.client.js +3 -1
  151. package/src/modules/landing/router/landing.js +11 -0
  152. package/src/modules/marketplace/components/sections/Filters.vue +26 -23
  153. package/src/modules/orders/components/blocks/CardOrderItem.vue +8 -0
  154. package/src/modules/orders/components/blocks/StatusHistory.vue +25 -53
  155. package/src/modules/orders/components/pages/Order.vue +2 -6
  156. package/src/modules/orders/components/pages/OrderBackoffice.vue +393 -0
  157. package/src/modules/orders/components/pages/OrderCreate.vue +5 -4
  158. package/src/modules/orders/components/pages/OrderCreateBackoffice.vue +2 -3
  159. package/src/modules/orders/components/pages/Orders.vue +60 -11
  160. package/src/modules/orders/components/sections/FormDelivery.vue +2 -2
  161. package/src/modules/orders/components/sections/SubscribeNewsletter.vue +2 -2
  162. package/src/modules/orders/controllers/orders.controller.js +29 -18
  163. package/src/modules/orders/models/order.model.js +8 -2
  164. package/src/modules/orders/router/orders.backoffice.router.js +3 -5
  165. package/src/modules/orders/router/orders.router.js +2 -2
  166. package/src/modules/orders/store/orders.js +3 -7
  167. package/src/modules/orders/store/shopcart.js +1 -1
  168. package/src/modules/organizations/components/blocks/CardDepartment.vue +2 -0
  169. package/src/modules/organizations/components/pages/Department.vue +5 -1
  170. package/src/modules/organizations/components/pages/DepartmentEdit.vue +65 -27
  171. package/src/modules/organizations/components/pages/Members.vue +2 -1
  172. package/src/modules/organizations/components/pages/Organization.vue +1 -1
  173. package/src/modules/organizations/controllers/memberships.controller.js +3 -1
  174. package/src/modules/organizations/store/memberships.js +1 -1
  175. package/src/modules/products/components/blocks/CardProduct.vue +32 -22
  176. package/src/modules/products/components/pages/ProductEdit.vue +10 -13
  177. package/src/modules/products/components/pages/Products.vue +2 -0
  178. package/src/modules/products/components/sections/HeroRecommendation.vue +1 -1
  179. package/src/modules/products/store/products.js +25 -2
  180. package/src/modules/spots/components/blocks/CardSpot.vue +2 -2
  181. package/src/modules/users/components/blocks/CardUser.vue +1 -0
  182. package/src/modules/landing/components/sections/AboutSection.vue +0 -69
@@ -1,4 +1,5 @@
1
1
  const { sendChatMessageTelegram } = require('@pf/src/modules/globals/utils/mailing');
2
+
2
3
  const queryProcessorGlobals = require('@pf/src/modules/globals/controllers/utils/queryProcessor');
3
4
 
4
5
  function formatPositions(positions) {
@@ -21,18 +22,8 @@ function formatOrderMessage(order) {
21
22
  `;
22
23
  }
23
24
 
24
- function initializeOrder(orderData, userId) {
25
- orderData.status = 'created';
26
- orderData.status_history = orderData.status_history || [];
27
- orderData.status_history.push({
28
- status: orderData.status,
29
- changedBy: userId,
30
- timestamp: new Date(),
31
- comment: ''
32
- });
33
- }
34
25
 
35
- async function findOrCreateCustomer(Customer, customerInfo, orderOwner, visitor) {
26
+ async function findOrCreateCustomer(Customer, customerInfo, orderOwner, orderCreator) {
36
27
  let searchCriteria = {};
37
28
 
38
29
  if (customerInfo.phone) {
@@ -55,8 +46,14 @@ async function findOrCreateCustomer(Customer, customerInfo, orderOwner, visitor)
55
46
  const newCustomerData = {
56
47
  ...customerInfo,
57
48
  owner: orderOwner,
58
- creator: customerInfo.creator || { type: 'Visitor', target: visitor || orderOwner.target },
59
- identity: customerInfo.indentity || { type: 'Visitor', target: visitor || orderOwner.target }
49
+ creator: {
50
+ type: customerInfo.creator.type || orderCreator.type,
51
+ target: customerInfo.creator.target || orderCreator.target,
52
+ },
53
+ identity: {
54
+ type: customerInfo.identity.type || orderCreator.type,
55
+ target: customerInfo.identity.target || orderCreator.target,
56
+ },
60
57
  };
61
58
  customer = await Customer.create(newCustomerData);
62
59
  }
@@ -73,6 +70,20 @@ async function findOrCreateCustomer(Customer, customerInfo, orderOwner, visitor)
73
70
  }
74
71
  }
75
72
 
73
+ function initializeOrder(orderData, userId) {
74
+ orderData.status = 'created';
75
+
76
+ orderData.status_history = orderData.status_history || [];
77
+
78
+ orderData.status_history.push({
79
+ status: orderData.status,
80
+ changedBy: userId,
81
+ timestamp: new Date(),
82
+ comment: ''
83
+ });
84
+ }
85
+
86
+
76
87
  const controllerFactory = (db) => {
77
88
  const Order = db.order;
78
89
  const Customer = db.customer;
@@ -81,16 +92,16 @@ const controllerFactory = (db) => {
81
92
  const create = async (req, res) => {
82
93
  const orderData = req.body;
83
94
  const userId = req.userId;
84
-
95
+
85
96
  initializeOrder(orderData, userId);
86
97
 
87
98
  try {
88
99
  if (!orderData.customer.target) {
89
- let customer = await findOrCreateCustomer(Customer, orderData.customer, orderData.owner, orderData.visitor);
100
+ let customer = await findOrCreateCustomer(Customer, orderData.customer, orderData.owner, orderData.creator);
90
101
 
91
102
  orderData.customer = { type: 'Customer', target: customer._id };
92
103
 
93
- if (!orderData.creator?.target) {
104
+ if (!orderData.creator.target) {
94
105
  orderData.creator = { type: 'Customer', target: customer._id };
95
106
  }
96
107
  }
@@ -162,7 +173,8 @@ const controllerFactory = (db) => {
162
173
 
163
174
  // Обновление заказа
164
175
  const update = async (req, res) => {
165
- const order = await Order.findById(new db.mongoose.Schema.Types.ObjectId(req.body._id));
176
+ console.log(req.body)
177
+ const order = await Order.findOne({ _id: req.body._id });
166
178
 
167
179
  if (!order) {
168
180
  return res.status(404).send({ errorCode: "ORDER_NOT_FOUND", message: "Order not found." });
@@ -178,7 +190,6 @@ const controllerFactory = (db) => {
178
190
  comment: ''
179
191
  });
180
192
  }
181
-
182
193
  try {
183
194
  await order.save(); // Сохранение обновленного заказа
184
195
  res.status(200).send(order);
@@ -23,6 +23,10 @@ module.exports = (db) => {
23
23
  status: {
24
24
  type: String
25
25
  },
26
+ deadline: {
27
+ type: Date,
28
+ default: () => new Date(Date.now() + 30 * 60000) // Добавляет 30 минут к текущему времени
29
+ },
26
30
  status_history: [{
27
31
  status: {
28
32
  type: String,
@@ -49,11 +53,13 @@ module.exports = (db) => {
49
53
  payment: {
50
54
  type: {
51
55
  type: String,
52
- trim: true
56
+ trim: true,
57
+ default: 'cash'
53
58
  },
54
59
  status: {
55
60
  type: String,
56
- trim: true
61
+ trim: true,
62
+ default: 'unpaid'
57
63
  }
58
64
  },
59
65
  delivery: {
@@ -1,16 +1,15 @@
1
- import layoutEmpty from '@pf/src/modules/globals/components/layouts/Empty.vue'
1
+ import layoutEmpty from '@pf/src/modules/globals/components/layouts/Empty.vue';
2
2
 
3
3
  const orders = [
4
4
  {
5
5
  path: 'orders',
6
- name: 'Backoffice Orders',
7
6
  meta: {
8
7
  title: {
9
8
  en: 'Backoffice Orders',
10
9
  ru: 'Управление Заказами'
11
10
  },
12
- authorize: []
13
11
  },
12
+ component: layoutEmpty,
14
13
  children: [{
15
14
  path: '',
16
15
  name: 'Backoffice Orders',
@@ -19,7 +18,6 @@ const orders = [
19
18
  en: 'Backoffice Orders',
20
19
  ru: 'Управление Заказами'
21
20
  },
22
- authorize: []
23
21
  },
24
22
  component: () => import(/* webpackChunkName: 'BackofficeOrders' */ '@pf/src/modules/orders/components/pages/Orders.vue'),
25
23
  },{
@@ -29,7 +27,7 @@ const orders = [
29
27
  },{
30
28
  path: ':order',
31
29
  name: 'AdminOrderEdit',
32
- component: () => import(/* webpackChunkName: 'BackofficeOrders' */ '@pf/src/modules/orders/components/pages/OrderCreateBackoffice.vue')
30
+ component: () => import(/* webpackChunkName: 'BackofficeOrders' */ '@pf/src/modules/orders/components/pages/OrderBackoffice.vue')
33
31
  }]
34
32
  }
35
33
  ];
@@ -28,7 +28,7 @@ const orders = {
28
28
  ru: 'Заказ'
29
29
  }
30
30
  },
31
- component: () => import(/* webpackChunkName: 'Order' */ '@pf/src/modules/orders/components/pages/Order.vue')
31
+ component: () => import(/* webpackChunkName: 'Order' */ '@pf/src/modules/orders/components/pages/OrderBackoffice.vue')
32
32
  },
33
33
  {
34
34
  path: ':order/edit',
@@ -39,7 +39,7 @@ const orders = {
39
39
  ru: 'Заказ'
40
40
  }
41
41
  },
42
- component: () => import(/* webpackChunkName: 'Order' */ '@pf/src/modules/orders/components/pages/Order.vue')
42
+ component: () => import(/* webpackChunkName: 'Order' */ '@pf/src/modules/orders/components/pages/OrderBackoffice.vue')
43
43
  }]
44
44
  };
45
45
 
@@ -12,7 +12,7 @@ import customerInitState from "@pf/src/modules/orders/store/models/customer"
12
12
  const state = reactive({
13
13
  all: [],
14
14
  current: {
15
- _id: null,
15
+ _id: undefined,
16
16
  positions: [],
17
17
  status: null,
18
18
  comment: '',
@@ -58,11 +58,7 @@ const actions = {
58
58
  async read( options = {}) {
59
59
  try {
60
60
 
61
- if (options._id) {
62
- options.params = { _id: options._id };
63
- }
64
-
65
- const response = await $axios.get('/api/orders/read', { params: options.params });
61
+ const response = await $axios.get('/api/orders/read', { params: options });
66
62
 
67
63
  if (options._id) {
68
64
  set(response.data[0], 'current')
@@ -79,7 +75,7 @@ const actions = {
79
75
 
80
76
  async update(order) {
81
77
  try {
82
- const response = await $axios.post(`/api/orders/${order._id}`, order);
78
+ const response = await $axios.post(`/api/orders/update`, order);
83
79
 
84
80
  const index = state.all.findIndex(o => o._id === order._id);
85
81
 
@@ -124,7 +124,7 @@ const actions = {
124
124
  },
125
125
 
126
126
 
127
- resetShopcart({ state }) {
127
+ resetShopcart() {
128
128
  state.positions = [];
129
129
 
130
130
  localStorage.removeItem('shopcart');
@@ -36,6 +36,8 @@
36
36
  v-for="(member, index) in department.members"
37
37
  :key="index"
38
38
  :user="member.user"
39
+ :photo="member.user.profile.photo"
40
+ :name="member.user.profile.name || member.user.phone || member.user.email || member.user._id"
39
41
  :position="member.position"
40
42
  @click="$router.push(`/app/profile/${member.user._id}`)"
41
43
  />
@@ -39,7 +39,9 @@
39
39
  class="br-b br-solid br-grey"
40
40
  v-for="(member, index) in departments.state.department.members"
41
41
  :key="index"
42
- :user="member"
42
+ :user="member.user"
43
+ :photo="member.user.profile.photo"
44
+ :name="member.user.profile.name || member.user.phone || member.user.email || member.user._id"
43
45
  :position="member.position"
44
46
  @click="$router.push(`/app/profile/${member.user._id}`)"
45
47
  />
@@ -65,6 +67,8 @@ import DepartmentSub from '@pf/src/modules/organizations/components/blocks/Depar
65
67
  import User from '@pf/src/modules/users/components/blocks/CardUser.vue';
66
68
  import * as departments from '@pf/src/modules/organizations/store/departments';
67
69
 
70
+ import IconEdit from '@pf/src/modules/icons/navigation/IconEdit.vue'
71
+
68
72
  const router = useRouter();
69
73
  const route = useRoute();
70
74
 
@@ -5,8 +5,9 @@
5
5
  <h1 v-if="route.params.department" class="mn-r-auto">Edit Department</h1>
6
6
  <h1 v-else class="mn-r-auto">Create Department</h1>
7
7
 
8
- <section class="flex-nowrap flex pd-thin">
9
- <Button :submit="onSubmit" :callback="redirectTo" class="bg-main">Save Department</Button>
8
+ <section class="flex-nowrap flex gap-thin pd-thin">
9
+ <Button v-if="route.params.department" :submit="onDelete" :callback="redirectToDash" class="bg-red">Delete</Button>
10
+ <Button :submit="onSubmit" :callback="redirectTo" class="bg-main">Save</Button>
10
11
  </section>
11
12
 
12
13
  </header>
@@ -52,16 +53,18 @@
52
53
  }]"
53
54
  class="cols-1 gap-thin mn-b-thin"
54
55
  >
55
- <!-- {{departments.state.department.members[0]}} -->
56
- <User
57
- class="bg-grey o-hidden radius-small mn-b-thin"
56
+ <CardUser
57
+ class="bg-white pd-thin radius-medium w-100"
58
58
  v-for="(member, index) in departments.state.department.members"
59
59
  :key="index"
60
60
  :user="member.user"
61
61
  :photo="member.user.profile.photo"
62
62
  :name="member.user.profile.name || member.user.phone || member.user.email || member.user._id"
63
63
  :position="member.position"
64
- @click="openMemberPopup(index)"
64
+ :action="{
65
+ label: 'x',
66
+ method: () => removeMember(member)
67
+ }"
65
68
  />
66
69
  </Block>
67
70
 
@@ -71,12 +74,42 @@
71
74
  :isPopupOpen="isOpenAddMemberPopup"
72
75
  class="bg-white w-max-30r radius-big pd-big"
73
76
  >
74
- <DepartmentMemberModify
75
- :members="departments.state.department.members"
76
- :member="selectedMember"
77
- :users="memberships.state.memberships"
78
- @callback="closeMemberPopup"
79
- />
77
+ <Feed
78
+ :search="{
79
+ placeholder: 'Search customer...',
80
+ class: 'bg-grey mn-b-thin'
81
+ }"
82
+ :states="{
83
+ empty: {
84
+ title: 'No Products Found',
85
+ description: 'Currently, there are no such products available.'
86
+ }
87
+ }"
88
+ :store="{
89
+ read: (options) => memberships.actions.read(options),
90
+ state: null
91
+ }"
92
+ :options="{
93
+ target: route.params._id
94
+ }"
95
+ v-slot="{
96
+ items
97
+ }"
98
+ class="bg-grey pd-medium w-min-20r w-max-40r radius-big h-max-20r o-scroll"
99
+ >
100
+ <CardUser
101
+ v-for="(user, index) in items"
102
+ :key="user._id"
103
+ :user="user.user"
104
+ :photo="user.user.profile?.photo"
105
+ :name="user.user.profile?.name || user.user.phone || user.user.email"
106
+ @click="() => {
107
+ globals.actions.add(departments.state.department.members, { _id: user.user._id, user: user.user, position: 'Member'})
108
+ closeMemberPopup();
109
+ }"
110
+ class="bg-white pd-thin radius-medium w-100 mn-b-thin"
111
+ />
112
+ </Feed>
80
113
  </Popup>
81
114
 
82
115
 
@@ -178,13 +211,11 @@
178
211
 
179
212
  </div>
180
213
 
181
- <section v-if="route.params.department" class="flex-nowrap flex pd-thin">
182
- <Button :submit="onDelete" :callback="redirectToDash" class="bg-grey">Delete Department</Button>
183
- </section>
214
+
184
215
 
185
216
 
186
217
 
187
- <div id="dash" class="pd-medium bg-white">
218
+ <!-- <div id="dash" class="pd-medium bg-white">
188
219
 
189
220
  <Popup title="Добавить подотдел" @close-popup="closeDepartmentPopup" :isPopupOpen="isOpenDepartmentPopup">
190
221
  <DepartmentSubDepartmentModify
@@ -214,7 +245,7 @@
214
245
  </ul>
215
246
 
216
247
 
217
- </div>
248
+ </div> -->
218
249
  </div>
219
250
  </template>
220
251
 
@@ -234,13 +265,15 @@ import LocationMarker from "@pf/src/components/LocationMarker/LocationMarker.vue
234
265
  import Button from "@pf/src/components/Button/Button.vue";
235
266
  import Popup from "@pf/src/components/Popup/Popup.vue";
236
267
  import Block from '@pf/src/components/Block/Block.vue';
268
+ import Feed from '@pf/src/components/Feed/Feed.vue'
237
269
 
238
270
  import EditArray from "@pf/src/modules/organizations/components/blocks/EditArray.vue";
239
271
  import DepartmentSub from "@pf/src/modules/organizations/components/blocks/DepartmentSub.vue";
240
- import DepartmentMemberModify from "@pf/src/modules/organizations/components/blocks/DepartmentMemberModify.vue";
241
272
  import DepartmentSubDepartmentModify from "@pf/src/modules/organizations/components/blocks/DepartmentMemberModify.vue";
242
- import User from '@pf/src/modules/users/components/blocks/CardUser.vue';
243
273
 
274
+ import CardUser from '@pf/src/modules/users/components/blocks/CardUser.vue'
275
+
276
+ import * as globals from "@pf/src/modules/globals/store/globals";
244
277
  import * as departments from "@pf/src/modules/organizations/store/departments";
245
278
  import * as memberships from "@pf/src/modules/organizations/store/memberships";
246
279
 
@@ -248,11 +281,7 @@ const router = useRouter();
248
281
  const route = useRoute();
249
282
 
250
283
  async function fetchData() {
251
- if (route.params.department) {
252
- await memberships.actions.read({target: route.params._id});
253
- }
254
284
  const users = ref(memberships.state.memberships);
255
-
256
285
  // await departments.actions.read({organization: route.params._id});
257
286
  if (route.params.department) await departments.actions.readOne(route.params.department);
258
287
  }
@@ -307,10 +336,19 @@ function redirectTo() {
307
336
  }
308
337
 
309
338
  async function onDelete() {
310
- await departments.actions.delete(
311
- route.params._id,
312
- departments.state.department
313
- );
339
+ if (confirm("Are you sure you want to delete this department?")) {
340
+ await departments.actions.delete(
341
+ route.params._id,
342
+ departments.state.department
343
+ );
344
+ }
345
+
346
+ }
347
+
348
+ function removeMember(member) {
349
+ if (confirm("Are you sure you want to remove this member?")) {
350
+ globals.actions.delete(departments.state.department.members, { _id: member.user._id})
351
+ }
314
352
  }
315
353
 
316
354
  function redirectDash() {
@@ -82,7 +82,8 @@
82
82
  read: (options) => memberships.actions.read(options)
83
83
  }"
84
84
  :options="{
85
- target: route.params._id
85
+ target: route.params._id,
86
+ role: ['member','owner']
86
87
  }"
87
88
  v-slot="{
88
89
  items
@@ -129,7 +129,7 @@
129
129
  <button
130
130
  v-if="auth.state.user._id === organization.state.current.owner"
131
131
  @click="$router.push(`/spots/${organization.state.current._id}/spots/create`)"
132
- class="mn-b-thin button w-100"
132
+ class="mn-b-thin bg-main button w-100"
133
133
  >
134
134
  Add spot
135
135
  </button>
@@ -5,13 +5,15 @@ const controllerFactory = (db) => {
5
5
 
6
6
  const read = async (req, res) => {
7
7
  try {
8
+
8
9
  const memberships = await Membership.aggregate([
9
10
  {
10
11
  $match: {
11
12
  ...(req.query.user && { user: new ObjectId(req.query.user) }),
12
13
  ...(req.query.type && { type: req.query.type }),
13
14
  ...(req.query.target && { target: new ObjectId(req.query.target) }),
14
- ...(req.query.role && { role: req.query.role }),
15
+ // ...(req.query.role && { role: req.query.role }),
16
+ ...(req.query.role && { role: { $in: req.query.role } }),
15
17
  },
16
18
  },
17
19
  {
@@ -28,7 +28,7 @@ const actions = {
28
28
  if (options._id) params._id = options._id;
29
29
  if (options.user) params.user = options.user;
30
30
  if (options.target) params.target = options.target;
31
- if (options.roles) params.roles = options.roles;
31
+ if (options.role) params.role = options.role;
32
32
 
33
33
  try {
34
34
  const response = await $axios.get(`/api/memberships`, { params: params });
@@ -13,27 +13,27 @@
13
13
  : 'bg-white'
14
14
  "
15
15
  >
16
-
17
- <router-link
18
- :to="{
19
- name: 'ProductEdit',
20
- params: {
21
- _id: $route.params.organization,
22
- product: product._id
23
- }
24
- }"
25
- class="
26
- z-index-2
27
- cursor-pointer
28
- pos-absolute pos-t-regular pos-r-regular
29
- radius-extra pd-thin bg-second
30
- "
31
- >
32
- <IconEdit
33
- class="i-regular"
34
- classes="fill-white"
35
- />
36
- </router-link>
16
+ <router-link
17
+ v-if="user && user.roles && (user.roles.includes('ROLE_MODERATOR') || user.roles.includes('ROLE_ADMIN'))"
18
+ :to="{
19
+ name: 'ProductEdit',
20
+ params: {
21
+ _id: $route.params.organization,
22
+ product: product._id
23
+ }
24
+ }"
25
+ class="
26
+ z-index-2
27
+ cursor-pointer
28
+ pos-absolute pos-t-regular pos-r-regular
29
+ radius-extra pd-thin bg-second
30
+ "
31
+ >
32
+ <IconEdit
33
+ class="i-regular"
34
+ classes="fill-white"
35
+ />
36
+ </router-link>
37
37
 
38
38
  <!-- Product Image Sqaure -->
39
39
 
@@ -121,7 +121,17 @@
121
121
 
122
122
  import PlaceholderImage from '@pf/src/modules/icons/placeholders/PlaceholderImage.vue'
123
123
 
124
- const props = defineProps(['product'])
124
+ const props = defineProps({
125
+ product: {
126
+ type: Object
127
+ },
128
+ user: {
129
+ type: [Object, String]
130
+ },
131
+ type: {
132
+ type: Object
133
+ }
134
+ })
125
135
 
126
136
  const { t } = useI18n()
127
137
  </script>
@@ -270,10 +270,18 @@
270
270
  }
271
271
 
272
272
  onMounted(async() => {
273
+ products.mutations.resetProduct();
273
274
 
274
- // Data prefetching
275
- await categories.actions.fetchCategories()
275
+ if (route.params.product) {
276
+ await products.actions.read({ _id: route.params.product });
277
+ }
278
+
279
+ if (!products.state.current.ingredients) {
280
+ products.state.current.ingredients = []
281
+ }
276
282
 
283
+ // Data prefetching
284
+ await categories.actions.fetchCategories()
277
285
 
278
286
  try {
279
287
  const productsResponse = await products.actions.read({
@@ -284,17 +292,6 @@
284
292
  } catch (error) {
285
293
  console.error('error');
286
294
  }
287
-
288
- if (route.params.product) {
289
- await products.actions.read({ _id: route.params.product });
290
- } else {
291
- // await commit('products/clearProductState')
292
- }
293
-
294
- if (!products.state.current.ingredients) {
295
- products.state.current.ingredients = []
296
- }
297
-
298
295
  })
299
296
 
300
297
  function onImagesUpdate(newImages) {
@@ -68,6 +68,7 @@
68
68
  v-for="product in items"
69
69
  :key="product._id"
70
70
  :product="product"
71
+ :user="auth.state.access"
71
72
  class="h-max"
72
73
  @click.capture="$router.push({
73
74
  name: 'Product Organization',
@@ -99,6 +100,7 @@
99
100
  import CardProduct from '@pf/src/modules/products/components/blocks/CardProduct.vue'
100
101
 
101
102
  // Accessing router and store
103
+ import * as auth from '@pf/src/modules/auth/store/auth';
102
104
  import * as products from '@pf/src/modules/products/store/products';
103
105
 
104
106
  const route = useRoute()
@@ -161,7 +161,7 @@
161
161
  position: absolute;
162
162
  top: 50%;
163
163
  left: 50%;
164
- opacity: 0.03;
164
+ opacity: 0.066;
165
165
  transform: translate(-50%, -50%) rotate(0deg);
166
166
  transform-origin: center center;
167
167
  animation: spin 5s linear infinite;
@@ -98,8 +98,8 @@ const actions = {
98
98
 
99
99
  query.sort = 'createdAt';
100
100
 
101
- query.skip = options.skip || 0;
102
- query.limit = options.limit || 10;
101
+ query.skip = options.skip;
102
+ query.limit = options.limit;
103
103
 
104
104
  try {
105
105
  const response = await $axios.get('/api/products/read', { params: query });
@@ -230,6 +230,28 @@ const actions = {
230
230
  },
231
231
  };
232
232
 
233
+ const mutations = {
234
+ resetProduct(product) {
235
+ state.current = {
236
+ recommendation: false,
237
+ category: [],
238
+ status: 'unpublished',
239
+ information: [],
240
+ images: [],
241
+ files: [],
242
+ image3d: false,
243
+ name: '',
244
+ sale: 0,
245
+ price: 0,
246
+ localization: [],
247
+ modifications: [],
248
+ quantityDiscount: [],
249
+ ingredients: [],
250
+ description: ''
251
+ }
252
+ }
253
+ }
254
+
233
255
  function set(product,property) {
234
256
  state[property] = product
235
257
  }
@@ -264,5 +286,6 @@ watch(state, (newState, oldState) => {
264
286
  export {
265
287
  state,
266
288
  actions,
289
+ mutations,
267
290
  getters
268
291
  }
@@ -1,6 +1,6 @@
1
1
  <template>
2
- <div class="radius-big o-hidden cols-2-1_3">
3
- <Map :location="{lat: spot.location.coordinates[1] ,lng: spot.location.coordinates[0]}" class=""/>
2
+ <div class="radius-big o-hidden pos-relative cols-2-1_3">
3
+ <Map :apiKey="GOOGLE_MAPS_API_KEY" :location="{lat: spot.location.coordinates[1] ,lng: spot.location.coordinates[0]}" class=""/>
4
4
 
5
5
  <div class="pd-medium w-100">
6
6
 
@@ -32,6 +32,7 @@
32
32
 
33
33
  <div v-if="action || role" class="mn-l-auto flex-v-center flex">
34
34
  <span
35
+ v-if="role"
35
36
  class="flex-child flex-child-shrink-0 capitalize w-max t-medium radius-big pd-b-nano pd-t-nano pd-r-thin pd-l-thin bg-main"
36
37
  >
37
38
  {{role}}