@ozdao/prometheus-framework 0.2.92 → 0.2.93

Sign up to get free protection for your applications and to get access to all the features.
Files changed (231) hide show
  1. package/dist/events.server.js +14 -6
  2. package/dist/events.server.mjs +14 -6
  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/Block/Block.vue.cjs +1 -1
  13. package/dist/prometheus-framework/src/components/Block/Block.vue.js +1 -1
  14. package/dist/prometheus-framework/src/components/Button/Button.vue.cjs +1 -1
  15. package/dist/prometheus-framework/src/components/Button/Button.vue.js +94 -1
  16. package/dist/prometheus-framework/src/components/Button/Button.vue2.cjs +1 -1
  17. package/dist/prometheus-framework/src/components/Button/Button.vue2.js +1 -94
  18. package/dist/prometheus-framework/src/components/Field/Field.vue.cjs +1 -1
  19. package/dist/prometheus-framework/src/components/Field/Field.vue.js +84 -1
  20. package/dist/prometheus-framework/src/components/Field/Field.vue2.cjs +1 -1
  21. package/dist/prometheus-framework/src/components/Field/Field.vue2.js +1 -84
  22. package/dist/prometheus-framework/src/components/FieldBig/FieldBig.vue.cjs +1 -1
  23. package/dist/prometheus-framework/src/components/FieldBig/FieldBig.vue.js +1 -1
  24. package/dist/prometheus-framework/src/components/LocationMarker/LocationMarker.vue2.cjs +1 -1
  25. package/dist/prometheus-framework/src/components/LocationMarker/LocationMarker.vue2.js +25 -20
  26. package/dist/prometheus-framework/src/components/Map/Map.vue.cjs +1 -1
  27. package/dist/prometheus-framework/src/components/Map/Map.vue.js +36 -26
  28. package/dist/prometheus-framework/src/components/Select/Select.vue.cjs +1 -1
  29. package/dist/prometheus-framework/src/components/Select/Select.vue.js +103 -1
  30. package/dist/prometheus-framework/src/components/Select/Select.vue2.cjs +1 -1
  31. package/dist/prometheus-framework/src/components/Select/Select.vue2.js +1 -103
  32. package/dist/prometheus-framework/src/components/Tooltip/Tooltip.vue.cjs +1 -1
  33. package/dist/prometheus-framework/src/components/Tooltip/Tooltip.vue.js +45 -1
  34. package/dist/prometheus-framework/src/components/Tooltip/Tooltip.vue2.cjs +1 -1
  35. package/dist/prometheus-framework/src/components/Tooltip/Tooltip.vue2.js +1 -45
  36. package/dist/prometheus-framework/src/modules/auth/components/layouts/Auth.vue.cjs +1 -1
  37. package/dist/prometheus-framework/src/modules/auth/components/layouts/Auth.vue.js +2 -2
  38. package/dist/prometheus-framework/src/modules/auth/components/pages/EnterCode.vue.cjs +1 -1
  39. package/dist/prometheus-framework/src/modules/auth/components/pages/EnterCode.vue.js +1 -1
  40. package/dist/prometheus-framework/src/modules/auth/components/pages/EnterPassword.vue.cjs +1 -1
  41. package/dist/prometheus-framework/src/modules/auth/components/pages/EnterPassword.vue.js +2 -2
  42. package/dist/prometheus-framework/src/modules/auth/components/pages/Invite.vue.cjs +1 -1
  43. package/dist/prometheus-framework/src/modules/auth/components/pages/Invite.vue.js +2 -2
  44. package/dist/prometheus-framework/src/modules/auth/components/pages/ResetPassword.vue.cjs +1 -1
  45. package/dist/prometheus-framework/src/modules/auth/components/pages/ResetPassword.vue.js +2 -2
  46. package/dist/prometheus-framework/src/modules/auth/components/pages/SignIn.vue.cjs +1 -1
  47. package/dist/prometheus-framework/src/modules/auth/components/pages/SignIn.vue.js +2 -2
  48. package/dist/prometheus-framework/src/modules/auth/components/pages/SignUp.vue.cjs +1 -1
  49. package/dist/prometheus-framework/src/modules/auth/components/pages/SignUp.vue.js +2 -2
  50. package/dist/prometheus-framework/src/modules/community/components/layouts/Community.vue.cjs +1 -1
  51. package/dist/prometheus-framework/src/modules/community/components/layouts/Community.vue.js +1 -1
  52. package/dist/prometheus-framework/src/modules/community/components/pages/Community.vue.cjs +1 -1
  53. package/dist/prometheus-framework/src/modules/community/components/pages/Community.vue.js +3 -3
  54. package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.cjs +1 -1
  55. package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.js +3 -3
  56. package/dist/prometheus-framework/src/modules/community/components/sections/HotPosts.vue.cjs +1 -1
  57. package/dist/prometheus-framework/src/modules/community/components/sections/HotPosts.vue.js +1 -1
  58. package/dist/prometheus-framework/src/modules/constructor/components/elements/Embed.vue.cjs +1 -1
  59. package/dist/prometheus-framework/src/modules/constructor/components/elements/Embed.vue.js +1 -1
  60. package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue.cjs +5 -1
  61. package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue.js +66 -0
  62. package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue2.cjs +1 -5
  63. package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue2.js +0 -66
  64. package/dist/prometheus-framework/src/modules/constructor/components/elements/VideoPlayer.vue.cjs +1 -1
  65. package/dist/prometheus-framework/src/modules/constructor/components/elements/VideoPlayer.vue.js +11 -11
  66. package/dist/prometheus-framework/src/modules/constructor/components/sections/Constructor.vue.cjs +1 -1
  67. package/dist/prometheus-framework/src/modules/constructor/components/sections/Constructor.vue.js +1 -1
  68. package/dist/prometheus-framework/src/modules/events/components/elements/ButtonCheck.vue.cjs +1 -1
  69. package/dist/prometheus-framework/src/modules/events/components/elements/ButtonCheck.vue.js +1 -1
  70. package/dist/prometheus-framework/src/modules/events/components/elements/ButtonJoin.vue.cjs +1 -1
  71. package/dist/prometheus-framework/src/modules/events/components/elements/ButtonJoin.vue.js +1 -1
  72. package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.cjs +1 -1
  73. package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.js +3 -3
  74. package/dist/prometheus-framework/src/modules/events/components/pages/EditEventTickets.vue.cjs +1 -1
  75. package/dist/prometheus-framework/src/modules/events/components/pages/EditEventTickets.vue.js +2 -2
  76. package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.cjs +1 -1
  77. package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.js +3 -3
  78. package/dist/prometheus-framework/src/modules/gallery/components/sections/GalleryWithCategories.vue.cjs +1 -1
  79. package/dist/prometheus-framework/src/modules/gallery/components/sections/GalleryWithCategories.vue.js +3 -3
  80. package/dist/prometheus-framework/src/modules/globals/components/blocks/BlockSearch.vue.cjs +1 -1
  81. package/dist/prometheus-framework/src/modules/globals/components/blocks/BlockSearch.vue.js +1 -1
  82. package/dist/prometheus-framework/src/modules/globals/components/blocks/CardHeader.vue.cjs +1 -1
  83. package/dist/prometheus-framework/src/modules/globals/components/blocks/CardHeader.vue.js +46 -46
  84. package/dist/prometheus-framework/src/modules/legal/components/pages/Legal.vue.cjs +1 -1
  85. package/dist/prometheus-framework/src/modules/legal/components/pages/Legal.vue.js +2 -2
  86. package/dist/prometheus-framework/src/modules/orders/components/blocks/StatusHistory.vue.cjs +2 -2
  87. package/dist/prometheus-framework/src/modules/orders/components/blocks/StatusHistory.vue.js +39 -65
  88. package/dist/prometheus-framework/src/modules/orders/components/pages/Order.vue.cjs +1 -1
  89. package/dist/prometheus-framework/src/modules/orders/components/pages/Order.vue.js +31 -31
  90. package/dist/prometheus-framework/src/modules/orders/components/pages/OrderBackoffice.vue.cjs +1 -0
  91. package/dist/prometheus-framework/src/modules/orders/components/pages/OrderBackoffice.vue.js +242 -0
  92. package/dist/prometheus-framework/src/modules/orders/components/pages/OrderBackoffice.vue2.cjs +1 -0
  93. package/dist/prometheus-framework/src/modules/orders/components/pages/OrderBackoffice.vue2.js +1 -0
  94. package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreate.vue.cjs +1 -1
  95. package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreate.vue.js +62 -62
  96. package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreateBackoffice.vue.cjs +1 -1
  97. package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreateBackoffice.vue.js +30 -30
  98. package/dist/prometheus-framework/src/modules/orders/components/pages/Orders.vue.cjs +1 -1
  99. package/dist/prometheus-framework/src/modules/orders/components/pages/Orders.vue.js +99 -70
  100. package/dist/prometheus-framework/src/modules/orders/components/sections/FormAddCustomer.vue.cjs +1 -1
  101. package/dist/prometheus-framework/src/modules/orders/components/sections/FormAddCustomer.vue.js +3 -3
  102. package/dist/prometheus-framework/src/modules/orders/components/sections/FormCustomerDetails.vue.cjs +1 -1
  103. package/dist/prometheus-framework/src/modules/orders/components/sections/FormCustomerDetails.vue.js +2 -2
  104. package/dist/prometheus-framework/src/modules/orders/components/sections/FormDelivery.vue.cjs +1 -1
  105. package/dist/prometheus-framework/src/modules/orders/components/sections/FormDelivery.vue.js +10 -10
  106. package/dist/prometheus-framework/src/modules/orders/components/sections/FormPayment.vue.cjs +1 -1
  107. package/dist/prometheus-framework/src/modules/orders/components/sections/FormPayment.vue.js +1 -1
  108. package/dist/prometheus-framework/src/modules/orders/router/orders.backoffice.router.cjs +1 -1
  109. package/dist/prometheus-framework/src/modules/orders/router/orders.backoffice.router.js +1 -1
  110. package/dist/prometheus-framework/src/modules/orders/router/orders.router.cjs +1 -1
  111. package/dist/prometheus-framework/src/modules/orders/router/orders.router.js +2 -2
  112. package/dist/prometheus-framework/src/modules/orders/store/orders.cjs +1 -1
  113. package/dist/prometheus-framework/src/modules/orders/store/orders.js +33 -34
  114. package/dist/prometheus-framework/src/modules/orders/store/shopcart.cjs +1 -1
  115. package/dist/prometheus-framework/src/modules/orders/store/shopcart.js +42 -42
  116. package/dist/prometheus-framework/src/modules/organizations/components/blocks/CardDepartment.vue.cjs +1 -1
  117. package/dist/prometheus-framework/src/modules/organizations/components/blocks/CardDepartment.vue.js +27 -25
  118. package/dist/prometheus-framework/src/modules/organizations/components/blocks/DepartmentMemberModify.vue.cjs +1 -1
  119. package/dist/prometheus-framework/src/modules/organizations/components/blocks/DepartmentMemberModify.vue.js +11 -11
  120. package/dist/prometheus-framework/src/modules/organizations/components/elements/ButtonToggleMembership.vue.cjs +1 -1
  121. package/dist/prometheus-framework/src/modules/organizations/components/elements/ButtonToggleMembership.vue.js +1 -1
  122. package/dist/prometheus-framework/src/modules/organizations/components/pages/Department.vue.cjs +1 -1
  123. package/dist/prometheus-framework/src/modules/organizations/components/pages/Department.vue.js +46 -43
  124. package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.cjs +1 -1
  125. package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.js +162 -168
  126. package/dist/prometheus-framework/src/modules/organizations/components/pages/Members.vue.cjs +1 -1
  127. package/dist/prometheus-framework/src/modules/organizations/components/pages/Members.vue.js +27 -26
  128. package/dist/prometheus-framework/src/modules/organizations/components/pages/Organization.vue.cjs +1 -1
  129. package/dist/prometheus-framework/src/modules/organizations/components/pages/Organization.vue.js +7 -7
  130. package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.cjs +1 -1
  131. package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.js +3 -3
  132. package/dist/prometheus-framework/src/modules/organizations/components/sections/Documents.vue.cjs +1 -1
  133. package/dist/prometheus-framework/src/modules/organizations/components/sections/Documents.vue.js +2 -2
  134. package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.cjs +1 -1
  135. package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.js +3 -3
  136. package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.cjs +1 -1
  137. package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.js +3 -3
  138. package/dist/prometheus-framework/src/modules/organizations/store/memberships.cjs +1 -1
  139. package/dist/prometheus-framework/src/modules/organizations/store/memberships.js +1 -1
  140. package/dist/prometheus-framework/src/modules/products/components/blocks/CardPosition.vue.cjs +1 -1
  141. package/dist/prometheus-framework/src/modules/products/components/blocks/CardPosition.vue.js +2 -2
  142. package/dist/prometheus-framework/src/modules/products/components/blocks/CardProduct.vue.cjs +1 -1
  143. package/dist/prometheus-framework/src/modules/products/components/blocks/CardProduct.vue.js +13 -13
  144. package/dist/prometheus-framework/src/modules/products/components/blocks/LeftoverPositions.vue.cjs +1 -1
  145. package/dist/prometheus-framework/src/modules/products/components/blocks/LeftoverPositions.vue.js +1 -1
  146. package/dist/prometheus-framework/src/modules/products/components/blocks/ListPositions.vue.cjs +1 -1
  147. package/dist/prometheus-framework/src/modules/products/components/blocks/ListPositions.vue.js +1 -1
  148. package/dist/prometheus-framework/src/modules/products/components/pages/Categories.vue.cjs +1 -1
  149. package/dist/prometheus-framework/src/modules/products/components/pages/Categories.vue.js +1 -1
  150. package/dist/prometheus-framework/src/modules/products/components/pages/CategoryEdit.vue.cjs +1 -1
  151. package/dist/prometheus-framework/src/modules/products/components/pages/CategoryEdit.vue.js +3 -3
  152. package/dist/prometheus-framework/src/modules/products/components/pages/EditLeftover.vue.cjs +1 -1
  153. package/dist/prometheus-framework/src/modules/products/components/pages/EditLeftover.vue.js +2 -2
  154. package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.cjs +1 -1
  155. package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.js +16 -17
  156. package/dist/prometheus-framework/src/modules/products/components/pages/Products.vue.cjs +1 -1
  157. package/dist/prometheus-framework/src/modules/products/components/pages/Products.vue.js +22 -20
  158. package/dist/prometheus-framework/src/modules/products/components/sections/EditModifications.vue.cjs +1 -1
  159. package/dist/prometheus-framework/src/modules/products/components/sections/EditModifications.vue.js +1 -1
  160. package/dist/prometheus-framework/src/modules/products/components/sections/EditProductInfo.vue.cjs +1 -1
  161. package/dist/prometheus-framework/src/modules/products/components/sections/EditProductInfo.vue.js +3 -3
  162. package/dist/prometheus-framework/src/modules/products/components/sections/SectionProduct.vue.cjs +1 -1
  163. package/dist/prometheus-framework/src/modules/products/components/sections/SectionProduct.vue.js +1 -1
  164. package/dist/prometheus-framework/src/modules/products/store/products.cjs +1 -1
  165. package/dist/prometheus-framework/src/modules/products/store/products.js +59 -38
  166. package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.cjs +1 -1
  167. package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.js +2 -2
  168. package/dist/prometheus-framework/src/modules/spots/components/blocks/CardSpot.vue.cjs +1 -1
  169. package/dist/prometheus-framework/src/modules/spots/components/blocks/CardSpot.vue.js +23 -22
  170. package/dist/prometheus-framework/src/modules/users/components/blocks/CardUser.vue.cjs +1 -1
  171. package/dist/prometheus-framework/src/modules/users/components/blocks/CardUser.vue.js +17 -14
  172. package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.cjs +1 -1
  173. package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.js +2 -2
  174. package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEdit.vue.cjs +1 -1
  175. package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEdit.vue.js +2 -2
  176. package/dist/prometheus-framework/src/modules/wallet/views/components/pages/Wallet.vue.cjs +1 -1
  177. package/dist/prometheus-framework/src/modules/wallet/views/components/pages/Wallet.vue.js +3 -3
  178. package/dist/prometheus-framework.cjs.js +1 -1
  179. package/dist/prometheus-framework.es.js +1 -1
  180. package/dist/style.css +1 -1
  181. package/dist/web-CQQEUA9l.js +1 -0
  182. package/dist/web-D2Em-p-C.mjs +54 -0
  183. package/package.json +1 -1
  184. package/src/components/Address/Address.vue +23 -34
  185. package/src/components/LocationMarker/LocationMarker.vue +6 -1
  186. package/src/components/LocationSelection/LocationSelection.vue +4 -0
  187. package/src/components/Map/Map.vue +29 -15
  188. package/src/modules/constructor/components/elements/VideoPlayer.vue +2 -2
  189. package/src/modules/events/controllers/events.controller.js +4 -4
  190. package/src/modules/globals/components/blocks/CardHeader.vue +2 -2
  191. package/src/modules/integrations/stripe/controllers/services/stripe.service.js +17 -6
  192. package/src/modules/landing/components/pages/Farming.vue +226 -0
  193. package/src/modules/landing/components/pages/Governance.vue +3 -5
  194. package/src/modules/landing/components/pages/Home.vue +0 -3
  195. package/src/modules/landing/components/pages/Hotel.vue +1 -3
  196. package/src/modules/landing/components/pages/Page.vue +0 -3
  197. package/src/modules/landing/components/sections/Examples.vue +4 -56
  198. package/src/modules/landing/components/sections/SectionFeature.vue +41 -0
  199. package/src/modules/landing/components/sections/SectionFeaturesImages.vue +122 -0
  200. package/src/modules/landing/components/sections/SectionFocus.vue +59 -0
  201. package/src/modules/landing/components/sections/SectionHeroVideo.vue +164 -0
  202. package/src/modules/landing/router/landing.js +11 -0
  203. package/src/modules/marketplace/components/sections/Filters.vue +26 -23
  204. package/src/modules/orders/components/blocks/CardOrderItem.vue +8 -0
  205. package/src/modules/orders/components/blocks/StatusHistory.vue +25 -53
  206. package/src/modules/orders/components/pages/Order.vue +2 -6
  207. package/src/modules/orders/components/pages/OrderBackoffice.vue +393 -0
  208. package/src/modules/orders/components/pages/OrderCreate.vue +5 -4
  209. package/src/modules/orders/components/pages/OrderCreateBackoffice.vue +2 -3
  210. package/src/modules/orders/components/pages/Orders.vue +60 -11
  211. package/src/modules/orders/components/sections/FormDelivery.vue +2 -2
  212. package/src/modules/orders/controllers/orders.controller.js +29 -18
  213. package/src/modules/orders/models/order.model.js +8 -2
  214. package/src/modules/orders/router/orders.backoffice.router.js +1 -1
  215. package/src/modules/orders/router/orders.router.js +2 -2
  216. package/src/modules/orders/store/orders.js +3 -7
  217. package/src/modules/orders/store/shopcart.js +1 -1
  218. package/src/modules/organizations/components/blocks/CardDepartment.vue +2 -0
  219. package/src/modules/organizations/components/pages/Department.vue +5 -1
  220. package/src/modules/organizations/components/pages/DepartmentEdit.vue +65 -27
  221. package/src/modules/organizations/components/pages/Members.vue +2 -1
  222. package/src/modules/organizations/components/pages/Organization.vue +1 -1
  223. package/src/modules/organizations/controllers/memberships.controller.js +3 -1
  224. package/src/modules/organizations/store/memberships.js +1 -1
  225. package/src/modules/products/components/blocks/CardProduct.vue +2 -3
  226. package/src/modules/products/components/pages/ProductEdit.vue +10 -13
  227. package/src/modules/products/components/pages/Products.vue +2 -0
  228. package/src/modules/products/store/products.js +25 -2
  229. package/src/modules/spots/components/blocks/CardSpot.vue +2 -2
  230. package/src/modules/users/components/blocks/CardUser.vue +1 -0
  231. package/src/modules/landing/components/sections/AboutSection.vue +0 -69
@@ -0,0 +1,393 @@
1
+ <template>
2
+ <div v-if="order && orderOrganization" class="pd-thin">
3
+
4
+ <SectionPageTitle
5
+ :title="`Order is ${order.status}`"
6
+ class="mn-b-small bg-grey bg-grey radius-big"
7
+ />
8
+
9
+ <div v-if="order" class="mn-b-thin pos-relative w-100 bg-main radius-big pd-big">
10
+ <div class="mn-b-small flex-nowrap flex">
11
+ <p class="t-medium p-medium mn-r-auto">
12
+ Progress
13
+ </p>
14
+
15
+ <p class="t-medium p-medium">
16
+ Order No: <span class="p-small t-transp">#{{order._id}}</span>
17
+ </p>
18
+ </div>
19
+
20
+
21
+ <h2 class="mn-b-small"></h2>
22
+
23
+ <div class="radius-extra mn-b-medium flex-nowrap flex pos-relative ">
24
+ <div v-for="(status, index) in statuses" :key="index" class="mn-r-thin w-20">
25
+ <div
26
+ class="bg-grey br-anim br-glow radius-extra h-1r w-100"
27
+ :class="
28
+ { 'br-glow-anim': isActiveStatus(index) },
29
+ { 't-transp': !isActiveStatus(index) },
30
+ { 'blink': order.status === statuses[index] && getNextStatus(order.status) }
31
+ "
32
+ />
33
+ <div
34
+ :class="{ 't-transp': !isActiveStatus(index) }"
35
+ class="mn-t-thin t-medium uppercase">{{ statusLabels[index] }}</div>
36
+ </div>
37
+ </div>
38
+
39
+ <div class="flex-nowrap flex">
40
+ <div class="w-max flex-v-center gap-thin flex-nowrap flex pd-thin radius-small bg-white-transp-20">
41
+ <IconTime class="i-semi t-transp" fill="rgb(var(--black)" />
42
+ <p class="t-medium mn-r-auto">Estimated Arrival {{formatDate(order.deadline)}}</p>
43
+ </div>
44
+
45
+ <button v-if="getNextStatus(order.status) && route.name === 'Order Edit'" @click="openStatusPopup" class="mn-l-auto bg-black t-white button">
46
+ Mark as {{ getStatusLabel(getNextStatus(order.status)) }}
47
+ </button>
48
+ </div>
49
+ </div>
50
+
51
+ <Popup
52
+ title="Change status"
53
+ @close-popup="closeStatusPopup"
54
+ :isPopupOpen="isOpeStatusPopup"
55
+ class="bg-white w-min-30r w-max-30r radius-big pd-big"
56
+ >
57
+ <p class="bg-grey radius-small pd-small mn-b-thin">Estimated Arrival {{formatDate(order.deadline)}}</p>
58
+ <ul class="bg-grey pd-small radius-small flex gap-thin flex-column mn-b-semi">
59
+ <CardOrderItem
60
+ v-for="(product, index) in orderProducts" :key="product._id"
61
+ :editable="false"
62
+ :product="product"
63
+ />
64
+ </ul>
65
+ <button @click="setNextStatus" class="w-100 bg-black-small t-white button">
66
+ {{'Confirm Changing to ' + getStatusLabel(getNextStatus(order.status))}}
67
+ </button>
68
+ </Popup>
69
+
70
+
71
+
72
+ <div v-if="order" class="gap-thin cols-2">
73
+
74
+ <div class="w-100">
75
+
76
+
77
+ <CardOrganization
78
+ v-if="orderOrganization[0]"
79
+ :organization="orderOrganization[0]"
80
+ :showRating="true"
81
+ :showFollowers="false"
82
+ :showProducts="false"
83
+ class="bg-grey mn-b-thin w-100 o-hidden radius-big pd-small "
84
+ />
85
+
86
+
87
+ <div
88
+ class="mn-b-thin bg-grey w-100 o-hidden radius-medium "
89
+ >
90
+ <div class="pd-small flex-nowrap flex">
91
+ <div class="mn-r-auto">
92
+ <span class="d-block t-medium p-medium">Your order is</span>
93
+ <span class=" t-lh-075 h2 d-block mn-b-small">{{order.status}}</span>
94
+ <p class="pd-t-nano pd-b-nano pd-r-thin pd-l-thin radius-extra bg-black t-white w-max">as on 29 aug 2021, Friday</p>
95
+ </div>
96
+ <div class="t-right">
97
+ Cancel order<br>
98
+ Exchange item
99
+ <hr class="mn-b-thin mn-t-thin">
100
+ For Delivery Queries Contact Us
101
+
102
+ </div>
103
+ </div>
104
+
105
+ <div class="pd-small cols-2 br-t br-black-transp-10 br-solid">
106
+ <p class="w-100 t-medium p-medium">
107
+ Phone
108
+ </p>
109
+
110
+ <p class="w-100 t-right ">
111
+ {{order.user?.number}}
112
+ </p>
113
+ </div>
114
+
115
+ <div v-if="order.user?.messenger.type" class="pd-small cols-2 br-t br-black-transp-10 br-solid">
116
+ <p class="w-100 t-medium p-medium">
117
+ {{order.user?.messenger.type}}
118
+ </p>
119
+
120
+ <p class="w-100 t-right ">
121
+ {{order.user?.messenger.value}}
122
+ </p>
123
+ </div>
124
+
125
+ <div class="pd-small cols-2 br-t br-black-transp-10 br-solid">
126
+ <p class="t-medium p-medium">
127
+ Address
128
+ </p>
129
+
130
+ <p class="w-100 t-right">
131
+ <!-- {{order.delivery?.address.slice(0,64)}} -->
132
+ </p>
133
+ </div>
134
+
135
+ <div class="pd-small cols-2 br-t br-black-transp-10 br-solid">
136
+ <p class="mn-b-small t-medium p-medium">
137
+ Delivery
138
+ </p>
139
+
140
+ <p class="w-100 t-right mn-b-small">
141
+ {{order.delivery?.type}}
142
+ </p>
143
+ </div>
144
+
145
+ </div>
146
+
147
+ <StatusHistory
148
+ v-if="orders.state.current.status_history"
149
+ :statuses="statuses"
150
+ :statusHistory="orders.state.current.status_history"
151
+ :statusCurrent="orders.state.current.status"
152
+ :edit="route.name === 'Order Edit'"
153
+ />
154
+
155
+ <!-- <button
156
+ @click="requestPayment(order)"
157
+ v-if="
158
+ order.status === 'Подтвержден'
159
+ && order.payment.type === 'Online'
160
+ && payment.Status !== 'CONFIRMED'
161
+ && payment.Status !== 'REFUNDED'
162
+ "
163
+ class='w-100 button'>Оплатить заказ</button> -->
164
+ <span class="t-transp" v-if="payment && payment.Status === 'CONFIRMED'">Paid</span>
165
+ </div>
166
+
167
+ <div class="bg-grey radius-big pd-medium mn-r-bold pd-r-big br-right-dark w-100">
168
+ <h3 class="mn-b-small">Order Summary</h3>
169
+
170
+ <ul class="flex gap-thin flex-column mn-b-semi">
171
+ <CardOrderItem
172
+ v-for="(product, index) in orderProducts" :key="product._id"
173
+ :editable="false"
174
+ :product="product"
175
+ />
176
+ </ul>
177
+
178
+ <div class="mn-b-medium radius-small br-solid br-1px br-black-transp-10 w-100">
179
+ <div class="pd-small br-solid br-b br-black-transp-10 flex">
180
+ <p class="mn-r-auto t-transp">In total</p>
181
+ <p>{{ cartTotalPrice }} {{returnCurrency()}} </p>
182
+ </div>
183
+ <div class="pd-small br-solid br-b br-black-transp-10 flex">
184
+ <p class="mn-r-auto t-transp">Delivery</p>
185
+ <p>{{returnCurrency()}} {{ Math.trunc(100 + 20 * orderOrganization[0]?.distance - 7,5 * (orderOrganization[0]?.distance / 10))}} </p>
186
+ </div>
187
+ <div class="pd-small flex-bottom flex">
188
+ <p class="mn-r-auto t-transp">In total to pay</p>
189
+ <p class="p-big t-semi">{{returnCurrency()}} {{ Math.trunc(100 + 20 * orderOrganization[0]?.distance - 7,5 * (orderOrganization[0]?.distance / 10)) + cartTotalPrice }}</p>
190
+ </div>
191
+ </div>
192
+
193
+ <h3 class="mn-b-small">Chat With Us</h3>
194
+
195
+ <ChatWindow
196
+ :username="
197
+ route.name === 'Order Status' ? order.user?.name || 'User' : 'Weeder Support'
198
+ "
199
+ :chatID="route.params.order"
200
+ class="radius-semi bg-white o-hidden"
201
+ />
202
+
203
+ </div>
204
+ </div>
205
+ </div>
206
+
207
+ </template>
208
+
209
+
210
+ <script setup="props">
211
+ import { computed, ref, onMounted } from 'vue'
212
+ import { useRouter, useRoute } from 'vue-router'
213
+
214
+ import SectionPageTitle from '@pf/src/modules/globals/components/sections/SectionPageTitle.vue'
215
+
216
+ import Popup from "@pf/src/components/Popup/Popup.vue";
217
+
218
+ import IconTime from '@pf/src/modules/icons/entities/IconTime.vue'
219
+
220
+ // Block
221
+ import CardOrderItem from '@pf/src/modules/orders/components/blocks/CardOrderItem.vue'
222
+ import CardOrganization from '@pf/src/modules/organizations/components/blocks/CardOrganization.vue'
223
+
224
+ import ChatWindow from '@pf/src/modules/chats/components/pages/ChatPage.vue';
225
+
226
+ import StatusHistory from '@pf/src/modules/orders/components/blocks/StatusHistory.vue'
227
+
228
+ import * as globals from '@pf/src/modules/globals/store/globals'
229
+ import * as orders from '@pf/src/modules/orders/store/orders'
230
+ import * as products from '@pf/src/modules/products/store/products'
231
+ import * as organizations from '@pf/src/modules/organizations/store/organizations'
232
+
233
+
234
+ const router = useRouter()
235
+ const route = useRoute()
236
+
237
+ const order = ref(null)
238
+ const productsOrganization = ref(null)
239
+ const orderOrganization = ref(null)
240
+
241
+ const statuses = ['created', 'confirmed', 'packing', 'in delivery', 'delivered'];
242
+ const statusLabels = ['Order Confirming', 'Order Confirmed', 'Packing', 'In Delivery', 'Delivered'];
243
+
244
+ const isActiveStatus = (index) => {
245
+ return statuses.slice(index).includes(order.value.status);
246
+ };
247
+
248
+ // description: 'Your order has been successfully created. Our manager will contact you within five minutes to confirm your order.'
249
+ // description: 'Your order has been confirmed. We are now processing your items and preparing them for shipment.'
250
+ // description: 'Your order is now awaiting shipment. Once shipped, you will receive a notification with tracking information.'
251
+ // description: 'Your order is now awaiting shipment. Once shipped, you will receive a notification with tracking information.'
252
+ // description: 'Your order is currently in transit. Our delivery team is working hard to get your items to you as soon as possible.'
253
+ // description: 'Congratulations! Your order has been successfully delivered. If you have any concerns or feedback, feel free to contact us.'
254
+
255
+
256
+ const isOpeStatusPopup = ref(false);
257
+ const selectedMember = ref(null);
258
+ const orderProducts = ref([]);
259
+
260
+ function openStatusPopup(member) {
261
+ isOpeStatusPopup.value = true;
262
+ if (typeof member === "number") selectedMember.value = member;
263
+ }
264
+
265
+ function closeStatusPopup() {
266
+ isOpeStatusPopup.value = false;
267
+ selectedMember.value = null;
268
+ }
269
+
270
+ onMounted(async()=>{
271
+ order.value = await orders.actions.read({_id: route.params.order})
272
+ order.value = order.value[0]
273
+
274
+ productsOrganization.value = await products.actions.read({
275
+ organization: order.value.owner.target._id,
276
+ limit: 1000,
277
+ });
278
+
279
+ console.log(productsOrganization.value)
280
+
281
+ const productsMap = productsOrganization.value.reduce((map, product) => {
282
+ map[product._id] = product;
283
+ return map;
284
+ }, {});
285
+
286
+ console.log(productsMap)
287
+
288
+ // Сопоставление продуктов с позициями заказа
289
+ orderProducts.value = order.value.positions.map(({ _id, quantity }) => {
290
+ const product = productsMap[_id];
291
+ return {
292
+ name: product.name,
293
+ images: product.images,
294
+ price: product.price,
295
+ _id: product._id,
296
+ quantity
297
+ };
298
+ });
299
+
300
+ orderOrganization.value = await organizations.actions.read({
301
+ _id: order.value?.owner.target._id,
302
+ location: globals.state.position?.location,
303
+ });
304
+
305
+ })
306
+
307
+ let cartTotalPrice = computed(() => {
308
+ return Number(order.value?.positions.reduce((total, product) => {
309
+ return total + product.price * product.quantity;
310
+ }, 0));
311
+ })
312
+
313
+ let cartTotalAmount = computed(() => {
314
+ return Number(order.value?.positions.reduce((total, product) => {
315
+ return total + product.quantity;
316
+ }, 0));
317
+ })
318
+
319
+ // Функция установки нового статуса
320
+ async function setStatus (newStatus) {
321
+ orders.state.current.status = newStatus
322
+
323
+ await orders.actions.update(orders.state.current)
324
+ }
325
+
326
+ function getNextStatus(currentStatus) {
327
+ const currentIndex = statuses.indexOf(currentStatus);
328
+
329
+ if (currentIndex !== -1 && currentIndex + 1 < statuses.length) {
330
+ return statuses[currentIndex + 1];
331
+ }
332
+ return null; // Если следующий статус не существует
333
+ }
334
+
335
+ function getStatusLabel(status) {
336
+ const index = statuses.indexOf(status);
337
+
338
+ return status ? statusLabels[index] : "";
339
+ }
340
+ async function setNextStatus() {
341
+ const nextStatus = getNextStatus(orders.state.current.status);
342
+
343
+ if (nextStatus) {
344
+ orders.state.current.status = nextStatus;
345
+
346
+ await orders.actions.update(orders.state.current)
347
+ } else {
348
+ console.error('Next status is void. Must handle somehow.');
349
+ }
350
+
351
+ closeStatusPopup()
352
+ }
353
+
354
+
355
+ function requestPayment(order) {
356
+ // store.dispatch("payments/newPayment", order);
357
+ }
358
+
359
+ function calculateDeliveryTime(distance, date) {
360
+ if (!distance) {
361
+ return null;
362
+ }
363
+
364
+ const basePreparationTime = 10 * 60 * 1000; // Convert to milliseconds
365
+ const travelTime = Math.ceil((15 + 5 + 3 * distance) / 5) * 5 * 60 * 1000;
366
+
367
+ // Преобразование даты начала в миллисекунды и добавление времени подготовки и доставки
368
+ const startTime = new Date(date).getTime();
369
+ const estimatedDeliveryTime = new Date(startTime + basePreparationTime + travelTime);
370
+
371
+ console.log(date)
372
+ console.log(estimatedDeliveryTime)
373
+
374
+ return estimatedDeliveryTime;
375
+ }
376
+
377
+
378
+ </script>
379
+
380
+ <style lang="scss" scoped>
381
+ .blink {
382
+ animation: blink-animation 1s ease infinite;
383
+ }
384
+
385
+ @keyframes blink-animation {
386
+ 0%, 100% {
387
+ opacity: 1;
388
+ }
389
+ 50% {
390
+ opacity: 0.8;
391
+ }
392
+ }
393
+ </style>
@@ -22,7 +22,7 @@
22
22
  class="order-form col"
23
23
  >
24
24
  <FormCustomerDetails
25
- :order="orders.state.current"
25
+ :customer="orders.state.current.customer"
26
26
  />
27
27
  <FormDelivery
28
28
  v-if="orders.state.current.status !== true && shopcart.state.positions.length > 0"
@@ -148,7 +148,6 @@ const cartTotalPrice = computed(() => shopcart.getters.cartTotalPrice)
148
148
  // Organization
149
149
  const orderOrganization = ref({})
150
150
 
151
- import Radio from '@pf/src/components/Radio/Radio.vue'
152
151
 
153
152
  onMounted(async()=> {
154
153
  orderOrganization.value = await organizations.actions.read({
@@ -201,14 +200,14 @@ async function handleCreate() {
201
200
  orders.state.current.status = 'created';
202
201
 
203
202
  orders.state.current.owner = {
204
- target: orderOrganization.value[0]._id,
203
+ target: shopcart.state.organization,
205
204
  type: 'organization'
206
205
  }
207
206
 
208
207
  if (auth.state.user._id) {
209
208
  orders.state.current.creator = {
210
209
  target: auth.state.user._id,
211
- type: 'user'
210
+ type: 'User'
212
211
  }
213
212
  }
214
213
 
@@ -223,6 +222,8 @@ async function handleCreate() {
223
222
  let order = await orders.actions.create(orders.state.current);
224
223
 
225
224
  if (order) {
225
+ shopcart.actions.resetShopcart()
226
+
226
227
  router.push({
227
228
  name: 'Order Status',
228
229
  params: {
@@ -27,12 +27,12 @@
27
27
  <Popup
28
28
  @close-popup="closeProductsPopup"
29
29
  :isPopupOpen="isOpenProductsPopup"
30
- class="bg-white w-min-30r w-max-30r radius-big pd-medium"
30
+ class="bg-white w-min-30r w-max-30r h-max-100 flex flex-column radius-big pd-medium pos-relative"
31
31
  >
32
32
 
33
33
  <h3 class="mn-b-small">Add to order</h3>
34
34
 
35
- <div class="h-100 bg-grey mn-b-thin o-scroll pd-medium radius-big">
35
+ <div class="bg-grey h-max-100 mn-b-thin o-scroll pd-medium radius-big">
36
36
  <Feed
37
37
  :search="{
38
38
  placeholder: 'Search products...',
@@ -221,7 +221,6 @@
221
221
 
222
222
  import customers from '@pf/src/modules/orders/store/customers.store';
223
223
 
224
-
225
224
  // Accessing router
226
225
  const route = useRoute()
227
226
  const router = useRouter()
@@ -6,13 +6,13 @@
6
6
  :tabs_current="tab"
7
7
  :tabs="[
8
8
  { name: 'All', value: 'all' },
9
- { name: 'Created', value: 'stock-in' },
10
- { name: 'Confirmed', value: 'stock-out' },
11
- { name: 'Preparing', value: 'stock-out' },
12
- { name: 'Prepared', value: 'stock-out' },
13
- { name: 'In delivery', value: 'stock-out' },
14
- { name: 'Delivered', value: 'stock-out' },
15
- { name: 'Closed', value: 'stock-out' }
9
+ { name: 'Created', value: 'created' },
10
+ { name: 'Confirmed', value: 'confirmed' },
11
+ { name: 'Preparing', value: 'preparing' },
12
+ { name: 'Prepared', value: 'prepared' },
13
+ { name: 'In delivery', value: 'in delivery' },
14
+ { name: 'Delivered', value: 'delivered' },
15
+ { name: 'Closed', value: 'closed' }
16
16
  ]"
17
17
  :actions="[
18
18
  { to: { name: 'AdminOrderAdd'}, label: 'Create Order' }
@@ -20,6 +20,29 @@
20
20
  class="mn-b-small bg-grey bg-grey radius-big"
21
21
  />
22
22
 
23
+
24
+
25
+ <Block
26
+ title="Balance"
27
+ class="mn-b-thin"
28
+ >
29
+ <div class="gap-micro flex-nowrap flex">
30
+ <div class="w-100 bg-white radius-small pd-small">
31
+ <p class="mn-b-thin">Total</p>
32
+ <h3>{{formatPrice(totalPrice)}}</h3>
33
+ </div>
34
+ <div class="w-100 bg-white radius-small pd-small">
35
+ <p class="mn-b-thin">Paid</p>
36
+ <h3>{{formatPrice(totalPriceUnpaid)}}</h3>
37
+ </div>
38
+ <div class="w-100 bg-white radius-small pd-small">
39
+ <p class="mn-b-thin">Unpaid</p>
40
+ <h3>{{formatPrice(totalPrice)}}</h3>
41
+ </div>
42
+ </div>
43
+
44
+ </Block>
45
+
23
46
  <Feed
24
47
  :search="true"
25
48
  :states="{
@@ -34,7 +57,7 @@
34
57
  :options="{
35
58
  limit: 15,
36
59
  owner: route.params._id,
37
- ...(tab !== 'all' && { type: tab })
60
+ ...(tab !== 'all' && { status: tab })
38
61
  }"
39
62
  v-slot="{
40
63
  items
@@ -121,8 +144,8 @@
121
144
 
122
145
 
123
146
  <div class="pd-small bg-white radius-small gap-micro flex-v-center flex-nowrap flex">
124
- <IconEvents class="i-semi t-transp" fill="rgb(var(--black)" />
125
- <p class="t-medium mn-r-auto">16:40, 21.04</p>
147
+ <IconTime class="i-semi t-transp" fill="rgb(var(--black)" />
148
+ <p class="t-medium mn-r-auto">{{formatDate(order.deadline)}}</p>
126
149
 
127
150
  <span
128
151
  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"
@@ -155,6 +178,7 @@
155
178
  import '@vuepic/vue-datepicker/dist/main.css'
156
179
 
157
180
  import Tab from '@pf/src/components/Tab/Tab.vue'
181
+ import Block from '@pf/src/components/Block/Block.vue';
158
182
 
159
183
  import * as orders from '@pf/src/modules/orders/store/orders';
160
184
  import * as auth from '@pf/src/modules/auth/store/auth';
@@ -166,7 +190,7 @@
166
190
 
167
191
  import Feed from '@pf/src/components/Feed/Feed.vue'
168
192
 
169
- import IconEvents from '@pf/src/modules/icons/entities/IconEvents.vue'
193
+ import IconTime from '@pf/src/modules/icons/entities/IconTime.vue'
170
194
 
171
195
  const route = useRoute();
172
196
  const router = useRouter();
@@ -176,6 +200,31 @@
176
200
  // Tab logic
177
201
  const tab = ref('all')
178
202
 
203
+ const totalPrice = computed(() => {
204
+ return calculateTotalSum(orders.state.all)
205
+ });
206
+
207
+ const totalPriceUnpaid = computed(() => {
208
+ return calculateSum(orders.state.all,'unpaid')
209
+ });
210
+
211
+
212
+ function calculateTotalSum(orders) {
213
+ return orders.reduce((totalSum, item) => {
214
+ return totalSum + item.positions.reduce((sum, position) => sum + position.price, 0);
215
+ }, 0);
216
+ }
217
+
218
+ function calculateSum(orders, status) {
219
+ return orders.reduce((totalSum, item) => {
220
+ if (item.payment.status === status) {
221
+ return totalSum + item.positions.reduce((sum, position) => sum + position.price, 0);
222
+ }
223
+ return totalSum;
224
+ }, 0);
225
+ }
226
+
227
+
179
228
  onMounted(async () => {
180
229
 
181
230
  });
@@ -6,7 +6,7 @@
6
6
 
7
7
  </div>
8
8
 
9
- <h4 class="mn-b-thin">Shipping Method</h4>
9
+ <h4 class="mn-b-thin">Select zone</h4>
10
10
  <div class="mn-b-small flex-nowrap flex">
11
11
  <Radio
12
12
  v-model:radio="order.delivery.type"
@@ -22,7 +22,7 @@
22
22
  />
23
23
  <Radio
24
24
  v-model:radio="order.delivery.type"
25
- label="Mail"
25
+ label="Post"
26
26
  value="mail"
27
27
  class="bg-white pd-medium radius-small w-100 mn-r-small"
28
28
  />
@@ -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);