@ozdao/prometheus-framework 0.2.81 → 0.2.83

Sign up to get free protection for your applications and to get access to all the features.
Files changed (388) hide show
  1. package/dist/auth.server.js +1 -1
  2. package/dist/auth.server.mjs +1 -1
  3. package/dist/community.server.js +3 -3
  4. package/dist/community.server.mjs +3 -3
  5. package/dist/credentials.schema-B-KD_ozQ.js +9 -0
  6. package/dist/credentials.schema-C9dmNy7o.mjs +10 -0
  7. package/dist/credentials.schema-CDZCKfEI.mjs +106 -0
  8. package/dist/credentials.schema-CfhPcsuI.js +105 -0
  9. package/dist/events.server.js +4 -15
  10. package/dist/events.server.mjs +3 -14
  11. package/dist/files.server.js +1 -1
  12. package/dist/files.server.mjs +1 -1
  13. package/dist/gallery.server.js +1 -1
  14. package/dist/gallery.server.mjs +1 -1
  15. package/dist/index-B6a1mPgp.mjs +217 -0
  16. package/dist/index-BCCiEK_u.js +216 -0
  17. package/dist/main-8N2Jmsuk.js +91 -0
  18. package/dist/main-CkeuHuCY.mjs +13619 -0
  19. package/dist/main.css +1 -1
  20. package/dist/metadata.schema-Cu_mPkjE.js +77 -0
  21. package/dist/metadata.schema-cbFgazeK.mjs +78 -0
  22. package/dist/middlewares.server.js +1 -1
  23. package/dist/middlewares.server.mjs +1 -1
  24. package/dist/node_modules/@googlemaps/js-api-loader/dist/index.cjs +1 -0
  25. package/dist/node_modules/@googlemaps/js-api-loader/dist/index.js +238 -0
  26. package/dist/orders.server.js +592 -0
  27. package/dist/orders.server.mjs +593 -0
  28. package/dist/organizations.server.js +295 -131
  29. package/dist/organizations.server.mjs +295 -131
  30. package/dist/products.server.js +2 -2
  31. package/dist/products.server.mjs +2 -2
  32. package/dist/profile.schema-24ZpZQJe.mjs +25 -0
  33. package/dist/profile.schema-CkOhhf37.js +24 -0
  34. package/dist/prometheus-framework/src/components/Address/Address.vue2.cjs +1 -1
  35. package/dist/prometheus-framework/src/components/Address/Address.vue2.js +33 -24
  36. package/dist/prometheus-framework/src/components/Block/Block.vue.cjs +1 -1
  37. package/dist/prometheus-framework/src/components/Block/Block.vue.js +23 -20
  38. package/dist/prometheus-framework/src/components/Button/Button.vue.cjs +1 -1
  39. package/dist/prometheus-framework/src/components/Button/Button.vue.js +1 -225
  40. package/dist/prometheus-framework/src/components/Button/Button.vue2.cjs +1 -1
  41. package/dist/prometheus-framework/src/components/Button/Button.vue2.js +102 -1
  42. package/dist/prometheus-framework/src/components/Feed/Feed.vue.cjs +1 -1
  43. package/dist/prometheus-framework/src/components/Feed/Feed.vue.js +71 -60
  44. package/dist/prometheus-framework/src/components/Field/Field.vue.cjs +1 -1
  45. package/dist/prometheus-framework/src/components/Field/Field.vue.js +1 -84
  46. package/dist/prometheus-framework/src/components/Field/Field.vue2.cjs +1 -1
  47. package/dist/prometheus-framework/src/components/Field/Field.vue2.js +84 -1
  48. package/dist/prometheus-framework/src/components/FieldBig/FieldBig.vue.cjs +1 -1
  49. package/dist/prometheus-framework/src/components/FieldBig/FieldBig.vue.js +1 -1
  50. package/dist/prometheus-framework/src/components/FieldPhone/FieldPhone.vue.cjs +1 -1
  51. package/dist/prometheus-framework/src/components/FieldPhone/FieldPhone.vue.js +325 -340
  52. package/dist/prometheus-framework/src/components/FieldPhone/FieldPhone2.vue.cjs +1 -1
  53. package/dist/prometheus-framework/src/components/FieldPhone/FieldPhone2.vue.js +2 -2
  54. package/dist/prometheus-framework/src/components/LocationMarker/LocationMarker.vue2.cjs +1 -1
  55. package/dist/prometheus-framework/src/components/LocationMarker/LocationMarker.vue2.js +53 -44
  56. package/dist/prometheus-framework/src/components/Popup/Popup.vue2.cjs +1 -1
  57. package/dist/prometheus-framework/src/components/Popup/Popup.vue2.js +41 -40
  58. package/dist/prometheus-framework/src/components/Select/Select.vue2.cjs +1 -1
  59. package/dist/prometheus-framework/src/components/Select/Select.vue2.js +37 -31
  60. package/dist/prometheus-framework/src/components/Slider/Slider.vue.cjs +1 -1
  61. package/dist/prometheus-framework/src/components/Slider/Slider.vue.js +18 -19
  62. package/dist/prometheus-framework/src/components/Tab/Tab.vue.cjs +1 -1
  63. package/dist/prometheus-framework/src/components/Tab/Tab.vue.js +1 -36
  64. package/dist/prometheus-framework/src/components/Tab/Tab.vue2.cjs +1 -1
  65. package/dist/prometheus-framework/src/components/Tab/Tab.vue2.js +36 -1
  66. package/dist/prometheus-framework/src/components/Tooltip/Tooltip.vue.cjs +1 -1
  67. package/dist/prometheus-framework/src/components/Tooltip/Tooltip.vue.js +45 -1
  68. package/dist/prometheus-framework/src/components/Tooltip/Tooltip.vue2.cjs +1 -1
  69. package/dist/prometheus-framework/src/components/Tooltip/Tooltip.vue2.js +1 -45
  70. package/dist/prometheus-framework/src/modules/auth/components/layouts/Auth.vue.cjs +1 -1
  71. package/dist/prometheus-framework/src/modules/auth/components/layouts/Auth.vue.js +3 -3
  72. package/dist/prometheus-framework/src/modules/auth/components/pages/EnterCode.vue.cjs +1 -1
  73. package/dist/prometheus-framework/src/modules/auth/components/pages/EnterCode.vue.js +1 -1
  74. package/dist/prometheus-framework/src/modules/auth/components/pages/EnterPassword.vue.cjs +1 -1
  75. package/dist/prometheus-framework/src/modules/auth/components/pages/EnterPassword.vue.js +3 -3
  76. package/dist/prometheus-framework/src/modules/auth/components/pages/Invite.vue.cjs +1 -1
  77. package/dist/prometheus-framework/src/modules/auth/components/pages/Invite.vue.js +30 -30
  78. package/dist/prometheus-framework/src/modules/auth/components/pages/ResetPassword.vue.cjs +1 -1
  79. package/dist/prometheus-framework/src/modules/auth/components/pages/ResetPassword.vue.js +3 -3
  80. package/dist/prometheus-framework/src/modules/auth/components/pages/SignIn.vue.cjs +1 -1
  81. package/dist/prometheus-framework/src/modules/auth/components/pages/SignIn.vue.js +3 -3
  82. package/dist/prometheus-framework/src/modules/auth/components/pages/SignUp.vue.cjs +1 -1
  83. package/dist/prometheus-framework/src/modules/auth/components/pages/SignUp.vue.js +3 -3
  84. package/dist/prometheus-framework/src/modules/auth/store/auth.cjs +1 -1
  85. package/dist/prometheus-framework/src/modules/auth/store/auth.js +26 -26
  86. package/dist/prometheus-framework/src/modules/backoffice/components/pages/Dashboard.vue.cjs +1 -1
  87. package/dist/prometheus-framework/src/modules/backoffice/components/pages/Dashboard.vue.js +78 -103
  88. package/dist/prometheus-framework/src/modules/chats/components/blocks/ChatMessage.vue.cjs +1 -0
  89. package/dist/prometheus-framework/src/modules/chats/components/blocks/ChatMessage.vue.js +28 -0
  90. package/dist/prometheus-framework/src/modules/chats/components/pages/ChatPage.vue.cjs +1 -0
  91. package/dist/prometheus-framework/src/modules/chats/components/pages/ChatPage.vue.js +26 -0
  92. package/dist/prometheus-framework/src/modules/chats/components/pages/ChatPage.vue2.cjs +1 -0
  93. package/dist/prometheus-framework/src/modules/chats/components/pages/ChatPage.vue2.js +1 -0
  94. package/dist/prometheus-framework/src/modules/chats/components/sections/ChatWindow.vue.cjs +1 -0
  95. package/dist/prometheus-framework/src/modules/chats/components/sections/ChatWindow.vue.js +77 -0
  96. package/dist/prometheus-framework/src/modules/chats/components/sections/ChatWindow.vue2.cjs +1 -0
  97. package/dist/prometheus-framework/src/modules/chats/components/sections/ChatWindow.vue2.js +1 -0
  98. package/dist/prometheus-framework/src/modules/chats/store/chat.store.cjs +1 -0
  99. package/dist/prometheus-framework/src/modules/chats/store/chat.store.js +40 -0
  100. package/dist/prometheus-framework/src/modules/community/components/pages/Community.vue.cjs +1 -1
  101. package/dist/prometheus-framework/src/modules/community/components/pages/Community.vue.js +2 -2
  102. package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.cjs +1 -1
  103. package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.js +3 -3
  104. package/dist/prometheus-framework/src/modules/community/components/sections/HotPosts.vue.cjs +1 -1
  105. package/dist/prometheus-framework/src/modules/community/components/sections/HotPosts.vue.js +15 -15
  106. package/dist/prometheus-framework/src/modules/constructor/components/elements/Embed.vue.cjs +1 -1
  107. package/dist/prometheus-framework/src/modules/constructor/components/elements/Embed.vue.js +1 -1
  108. package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue.cjs +1 -5
  109. package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue.js +0 -66
  110. package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue2.cjs +5 -1
  111. package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue2.js +66 -0
  112. package/dist/prometheus-framework/src/modules/constructor/components/sections/Constructor.vue.cjs +1 -1
  113. package/dist/prometheus-framework/src/modules/constructor/components/sections/Constructor.vue.js +1 -1
  114. package/dist/prometheus-framework/src/modules/events/components/blocks/CardEvent.vue.cjs +1 -1
  115. package/dist/prometheus-framework/src/modules/events/components/blocks/CardEvent.vue.js +4 -4
  116. package/dist/prometheus-framework/src/modules/events/components/elements/ButtonCheck.vue.cjs +1 -1
  117. package/dist/prometheus-framework/src/modules/events/components/elements/ButtonCheck.vue.js +1 -1
  118. package/dist/prometheus-framework/src/modules/events/components/elements/ButtonJoin.vue.cjs +1 -1
  119. package/dist/prometheus-framework/src/modules/events/components/elements/ButtonJoin.vue.js +1 -1
  120. package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.cjs +1 -1
  121. package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.js +3 -3
  122. package/dist/prometheus-framework/src/modules/events/components/pages/EditEventTickets.vue.cjs +1 -1
  123. package/dist/prometheus-framework/src/modules/events/components/pages/EditEventTickets.vue.js +2 -2
  124. package/dist/prometheus-framework/src/modules/events/components/pages/Events.vue.cjs +1 -1
  125. package/dist/prometheus-framework/src/modules/events/components/pages/Events.vue.js +29 -27
  126. package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.cjs +1 -1
  127. package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.js +2 -2
  128. package/dist/prometheus-framework/src/modules/gallery/components/sections/GalleryWithCategories.vue.cjs +1 -1
  129. package/dist/prometheus-framework/src/modules/gallery/components/sections/GalleryWithCategories.vue.js +2 -2
  130. package/dist/prometheus-framework/src/modules/globals/components/blocks/BlockSearch.vue.cjs +1 -1
  131. package/dist/prometheus-framework/src/modules/globals/components/blocks/BlockSearch.vue.js +1 -1
  132. package/dist/prometheus-framework/src/modules/globals/components/blocks/CardHeader.vue.cjs +1 -1
  133. package/dist/prometheus-framework/src/modules/globals/components/blocks/CardHeader.vue.js +2 -2
  134. package/dist/prometheus-framework/src/modules/globals/components/sections/SectionPageTitle.vue.cjs +1 -1
  135. package/dist/prometheus-framework/src/modules/globals/components/sections/SectionPageTitle.vue.js +33 -26
  136. package/dist/prometheus-framework/src/modules/globals/localization/vue-i18n.cjs +1 -1
  137. package/dist/prometheus-framework/src/modules/globals/localization/vue-i18n.js +6 -3
  138. package/dist/prometheus-framework/src/modules/globals/services/globals.store.cjs +1 -0
  139. package/dist/prometheus-framework/src/modules/globals/services/globals.store.js +70 -0
  140. package/dist/prometheus-framework/src/modules/icons/entities/IconGallery.vue.cjs +1 -0
  141. package/dist/prometheus-framework/src/modules/icons/entities/IconGallery.vue.js +28 -0
  142. package/dist/prometheus-framework/src/modules/icons/entities/IconLeftovers.vue.cjs +1 -0
  143. package/dist/prometheus-framework/src/modules/icons/entities/IconLeftovers.vue.js +30 -0
  144. package/dist/prometheus-framework/src/modules/icons/entities/IconOrders.vue.cjs +1 -0
  145. package/dist/prometheus-framework/src/modules/icons/entities/IconOrders.vue.js +35 -0
  146. package/dist/prometheus-framework/src/modules/icons/entities/IconProducts.vue.cjs +1 -0
  147. package/dist/prometheus-framework/src/modules/icons/entities/IconProducts.vue.js +28 -0
  148. package/dist/prometheus-framework/src/modules/icons/navigation/IconCheckmark.vue.cjs +1 -0
  149. package/dist/prometheus-framework/src/modules/icons/navigation/IconCheckmark.vue.js +29 -0
  150. package/dist/prometheus-framework/src/modules/icons/placeholders/PlaceholderChat.vue.cjs +1 -0
  151. package/dist/prometheus-framework/src/modules/icons/placeholders/PlaceholderChat.vue.js +30 -0
  152. package/dist/prometheus-framework/src/modules/landing/components/sections/MobileApp.vue.cjs +1 -1
  153. package/dist/prometheus-framework/src/modules/landing/components/sections/MobileApp.vue.js +63 -86
  154. package/dist/prometheus-framework/src/modules/legal/components/pages/Legal.vue.cjs +1 -1
  155. package/dist/prometheus-framework/src/modules/legal/components/pages/Legal.vue.js +2 -2
  156. package/dist/prometheus-framework/src/modules/orders/components/blocks/CardOrder.vue.cjs +1 -1
  157. package/dist/prometheus-framework/src/modules/orders/components/blocks/CardOrder.vue.js +121 -1
  158. package/dist/prometheus-framework/src/modules/orders/components/blocks/CardOrder.vue2.cjs +1 -0
  159. package/dist/prometheus-framework/src/modules/orders/components/blocks/CardOrder.vue2.js +1 -0
  160. package/dist/prometheus-framework/src/modules/orders/components/blocks/StatusHistory.vue.cjs +3 -0
  161. package/dist/prometheus-framework/src/modules/orders/components/blocks/StatusHistory.vue.js +92 -0
  162. package/dist/prometheus-framework/src/modules/orders/components/pages/Order.vue.cjs +1 -0
  163. package/dist/prometheus-framework/src/modules/orders/components/pages/Order.vue.js +202 -0
  164. package/dist/prometheus-framework/src/modules/orders/components/pages/Order.vue2.cjs +1 -0
  165. package/dist/prometheus-framework/src/modules/orders/components/pages/Order.vue2.js +1 -0
  166. package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreate.vue.cjs +1 -0
  167. package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreate.vue.js +127 -0
  168. package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreate.vue2.cjs +1 -0
  169. package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreate.vue2.js +1 -0
  170. package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreateBackoffice.vue.cjs +1 -1
  171. package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreateBackoffice.vue.js +174 -114
  172. package/dist/prometheus-framework/src/modules/orders/components/pages/Orders.vue.cjs +1 -1
  173. package/dist/prometheus-framework/src/modules/orders/components/pages/Orders.vue.js +41 -41
  174. package/dist/prometheus-framework/src/modules/orders/components/partials/ShopCart.vue.cjs +1 -0
  175. package/dist/prometheus-framework/src/modules/orders/components/partials/ShopCart.vue.js +89 -0
  176. package/dist/prometheus-framework/src/modules/orders/components/partials/ShopCart.vue2.cjs +1 -0
  177. package/dist/prometheus-framework/src/modules/orders/components/partials/ShopCart.vue2.js +1 -0
  178. package/dist/prometheus-framework/src/modules/orders/components/sections/AskToLogin.vue.cjs +1 -0
  179. package/dist/prometheus-framework/src/modules/orders/components/sections/AskToLogin.vue.js +24 -0
  180. package/dist/prometheus-framework/src/modules/orders/components/sections/EmptyState.vue.cjs +1 -0
  181. package/dist/prometheus-framework/src/modules/orders/components/sections/EmptyState.vue.js +13 -0
  182. package/dist/prometheus-framework/src/modules/orders/components/sections/FormAddCustomer.vue.cjs +1 -0
  183. package/dist/prometheus-framework/src/modules/orders/components/sections/FormAddCustomer.vue.js +141 -0
  184. package/dist/prometheus-framework/src/modules/orders/components/sections/FormClientDetails.vue.cjs +1 -1
  185. package/dist/prometheus-framework/src/modules/orders/components/sections/FormClientDetails.vue.js +1 -1
  186. package/dist/prometheus-framework/src/modules/orders/components/sections/FormCustomerDetails.vue.cjs +1 -0
  187. package/dist/prometheus-framework/src/modules/orders/components/sections/FormCustomerDetails.vue.js +77 -0
  188. package/dist/prometheus-framework/src/modules/orders/components/sections/FormDelivery.vue.cjs +1 -1
  189. package/dist/prometheus-framework/src/modules/orders/components/sections/FormDelivery.vue.js +46 -35
  190. package/dist/prometheus-framework/src/modules/orders/components/sections/Succes.vue.cjs +1 -0
  191. package/dist/prometheus-framework/src/modules/orders/components/sections/Succes.vue.js +25 -0
  192. package/dist/prometheus-framework/src/modules/orders/orders.client.cjs +1 -0
  193. package/dist/prometheus-framework/src/modules/orders/orders.client.js +56 -0
  194. package/dist/prometheus-framework/src/modules/orders/router/orders.router.cjs +1 -0
  195. package/dist/prometheus-framework/src/modules/orders/router/orders.router.js +58 -0
  196. package/dist/prometheus-framework/src/modules/orders/store/customers.store.cjs +1 -0
  197. package/dist/prometheus-framework/src/modules/orders/store/customers.store.js +5 -0
  198. package/dist/prometheus-framework/src/modules/orders/store/models/customer.cjs +1 -0
  199. package/dist/prometheus-framework/src/modules/orders/store/models/customer.js +30 -0
  200. package/dist/prometheus-framework/src/modules/orders/store/orders.cjs +1 -1
  201. package/dist/prometheus-framework/src/modules/orders/store/orders.js +24 -25
  202. package/dist/prometheus-framework/src/modules/orders/store/shopcart.cjs +1 -1
  203. package/dist/prometheus-framework/src/modules/orders/store/shopcart.js +5 -1
  204. package/dist/prometheus-framework/src/modules/organizations/components/blocks/CardDepartment.vue.cjs +1 -1
  205. package/dist/prometheus-framework/src/modules/organizations/components/blocks/CardDepartment.vue.js +16 -16
  206. package/dist/prometheus-framework/src/modules/organizations/components/blocks/CardOrganization.vue.cjs +1 -1
  207. package/dist/prometheus-framework/src/modules/organizations/components/blocks/CardOrganization.vue.js +1 -1
  208. package/dist/prometheus-framework/src/modules/organizations/components/blocks/DepartmentMemberModify.vue.cjs +1 -1
  209. package/dist/prometheus-framework/src/modules/organizations/components/blocks/DepartmentMemberModify.vue.js +38 -49
  210. package/dist/prometheus-framework/src/modules/organizations/components/elements/ButtonToggleMembership.vue.cjs +1 -1
  211. package/dist/prometheus-framework/src/modules/organizations/components/elements/ButtonToggleMembership.vue.js +1 -1
  212. package/dist/prometheus-framework/src/modules/organizations/components/pages/Department.vue.cjs +1 -1
  213. package/dist/prometheus-framework/src/modules/organizations/components/pages/Department.vue.js +6 -6
  214. package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.cjs +1 -1
  215. package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.js +161 -138
  216. package/dist/prometheus-framework/src/modules/organizations/components/pages/Members.vue.cjs +1 -1
  217. package/dist/prometheus-framework/src/modules/organizations/components/pages/Members.vue.js +198 -78
  218. package/dist/prometheus-framework/src/modules/organizations/components/pages/Organization.vue.cjs +1 -1
  219. package/dist/prometheus-framework/src/modules/organizations/components/pages/Organization.vue.js +82 -125
  220. package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.cjs +1 -1
  221. package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.js +3 -3
  222. package/dist/prometheus-framework/src/modules/organizations/components/pages/Organizations.vue.cjs +1 -1
  223. package/dist/prometheus-framework/src/modules/organizations/components/pages/Organizations.vue.js +1 -1
  224. package/dist/prometheus-framework/src/modules/organizations/components/sections/Documents.vue.cjs +1 -1
  225. package/dist/prometheus-framework/src/modules/organizations/components/sections/Documents.vue.js +2 -2
  226. package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.cjs +1 -1
  227. package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.js +59 -70
  228. package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.cjs +1 -1
  229. package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.js +3 -3
  230. package/dist/prometheus-framework/src/modules/organizations/organizations.client.cjs +1 -1
  231. package/dist/prometheus-framework/src/modules/organizations/organizations.client.js +34 -36
  232. package/dist/prometheus-framework/src/modules/organizations/store/departments.cjs +1 -1
  233. package/dist/prometheus-framework/src/modules/organizations/store/departments.js +38 -18
  234. package/dist/prometheus-framework/src/modules/organizations/store/invites.cjs +1 -1
  235. package/dist/prometheus-framework/src/modules/organizations/store/invites.js +34 -35
  236. package/dist/prometheus-framework/src/modules/products/components/blocks/CardPosition.vue.cjs +1 -1
  237. package/dist/prometheus-framework/src/modules/products/components/blocks/CardPosition.vue.js +1 -1
  238. package/dist/prometheus-framework/src/modules/products/components/blocks/CardProduct.vue.cjs +1 -1
  239. package/dist/prometheus-framework/src/modules/products/components/blocks/CardProduct.vue.js +41 -21
  240. package/dist/prometheus-framework/src/modules/products/components/blocks/LeftoverPositions.vue.cjs +1 -1
  241. package/dist/prometheus-framework/src/modules/products/components/blocks/LeftoverPositions.vue.js +1 -1
  242. package/dist/prometheus-framework/src/modules/products/components/blocks/ListPositions.vue.cjs +1 -1
  243. package/dist/prometheus-framework/src/modules/products/components/blocks/ListPositions.vue.js +1 -1
  244. package/dist/prometheus-framework/src/modules/products/components/pages/Categories.vue.cjs +1 -1
  245. package/dist/prometheus-framework/src/modules/products/components/pages/Categories.vue.js +1 -1
  246. package/dist/prometheus-framework/src/modules/products/components/pages/CategoryEdit.vue.cjs +1 -1
  247. package/dist/prometheus-framework/src/modules/products/components/pages/CategoryEdit.vue.js +2 -2
  248. package/dist/prometheus-framework/src/modules/products/components/pages/EditLeftover.vue.cjs +1 -1
  249. package/dist/prometheus-framework/src/modules/products/components/pages/EditLeftover.vue.js +1 -1
  250. package/dist/prometheus-framework/src/modules/products/components/pages/Leftovers.vue.cjs +1 -1
  251. package/dist/prometheus-framework/src/modules/products/components/pages/Leftovers.vue.js +1 -1
  252. package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.cjs +1 -1
  253. package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.js +3 -3
  254. package/dist/prometheus-framework/src/modules/products/components/pages/Products.vue.cjs +1 -1
  255. package/dist/prometheus-framework/src/modules/products/components/pages/Products.vue.js +3 -3
  256. package/dist/prometheus-framework/src/modules/products/components/sections/EditModifications.vue.cjs +1 -1
  257. package/dist/prometheus-framework/src/modules/products/components/sections/EditModifications.vue.js +1 -1
  258. package/dist/prometheus-framework/src/modules/products/components/sections/EditProductInfo.vue.cjs +1 -1
  259. package/dist/prometheus-framework/src/modules/products/components/sections/EditProductInfo.vue.js +2 -2
  260. package/dist/prometheus-framework/src/modules/products/components/sections/SectionProduct.vue.cjs +1 -1
  261. package/dist/prometheus-framework/src/modules/products/components/sections/SectionProduct.vue.js +1 -1
  262. package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.cjs +1 -1
  263. package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.js +24 -26
  264. package/dist/prometheus-framework/src/modules/users/components/blocks/CardUser.vue.cjs +1 -0
  265. package/dist/prometheus-framework/src/modules/users/components/blocks/CardUser.vue.js +78 -0
  266. package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.cjs +1 -1
  267. package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.js +2 -2
  268. package/dist/prometheus-framework/src/modules/users/components/pages/ProfileBlogposts.vue.cjs +1 -1
  269. package/dist/prometheus-framework/src/modules/users/components/pages/ProfileBlogposts.vue.js +1 -1
  270. package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEdit.vue.cjs +1 -1
  271. package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEdit.vue.js +3 -3
  272. package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEvents.vue.cjs +1 -1
  273. package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEvents.vue.js +1 -1
  274. package/dist/prometheus-framework/src/modules/users/store/users.cjs +1 -1
  275. package/dist/prometheus-framework/src/modules/users/store/users.js +13 -14
  276. package/dist/prometheus-framework/src/modules/wallet/views/components/pages/Wallet.vue.cjs +1 -1
  277. package/dist/prometheus-framework/src/modules/wallet/views/components/pages/Wallet.vue.js +2 -2
  278. package/dist/prometheus-framework.cjs.js +1 -1
  279. package/dist/prometheus-framework.es.js +1 -1
  280. package/dist/queryProcessor-BJdKh0Ow.mjs +162 -0
  281. package/dist/queryProcessor-DRMo_GWK.js +161 -0
  282. package/dist/reports.server.js +1 -1
  283. package/dist/reports.server.mjs +1 -1
  284. package/dist/style.css +1 -1
  285. package/dist/users.server.js +58 -47
  286. package/dist/users.server.mjs +58 -47
  287. package/dist/wallet.server.js +2 -2
  288. package/dist/wallet.server.mjs +2 -2
  289. package/dist/web-CtVocufd.js +1 -0
  290. package/dist/web-DNq1tHCE.mjs +54 -0
  291. package/package.json +1 -1
  292. package/src/components/Address/Address.vue +13 -2
  293. package/src/components/Block/Block.vue +3 -2
  294. package/src/components/Button/Button.vue +9 -12
  295. package/src/components/Feed/Feed.vue +28 -6
  296. package/src/components/FieldPhone/FieldPhone.vue +592 -558
  297. package/src/components/LocationMarker/LocationMarker.vue +26 -22
  298. package/src/components/Popup/Popup.vue +22 -23
  299. package/src/components/Select/Select.vue +43 -32
  300. package/src/components/Slider/Slider.vue +3 -4
  301. package/src/modules/auth/components/pages/Invite.vue +7 -7
  302. package/src/modules/auth/store/auth.js +1 -1
  303. package/src/modules/backoffice/components/pages/Dashboard.vue +44 -29
  304. package/src/modules/chats/components/blocks/ChatMessage.vue +1 -1
  305. package/src/modules/community/components/sections/HotPosts.vue +1 -1
  306. package/src/modules/events/components/blocks/CardEvent.vue +4 -3
  307. package/src/modules/events/components/pages/Events.vue +23 -6
  308. package/src/modules/globals/components/sections/SectionPageTitle.vue +19 -7
  309. package/src/modules/globals/controllers/utils/queryProcessor.js +21 -7
  310. package/src/modules/globals/localization/vue-i18n.js +3 -0
  311. package/src/modules/globals/models/credentials.schema.js +7 -0
  312. package/src/modules/globals/models/metadata.schema.js +17 -0
  313. package/src/modules/globals/models/profile.schema.js +23 -0
  314. package/src/modules/globals/models/socials.schema.js +22 -0
  315. package/src/modules/globals/router/routerGuards.js +1 -0
  316. package/src/modules/globals/services/globals.cashe.js +26 -0
  317. package/src/modules/globals/services/globals.crud.js +115 -0
  318. package/src/modules/globals/services/globals.logger.js +41 -0
  319. package/src/modules/globals/services/globals.store.js +114 -0
  320. package/src/modules/icons/entities/IconGallery.vue +14 -0
  321. package/src/modules/icons/entities/IconLeftovers.vue +14 -0
  322. package/src/modules/icons/entities/IconOrders.vue +15 -0
  323. package/src/modules/icons/entities/IconProducts.vue +14 -0
  324. package/src/modules/landing/components/sections/HeroSection.vue +1 -1
  325. package/src/modules/landing/components/sections/MobileApp.vue +4 -4
  326. package/src/modules/landing/router/landing.js +1 -1
  327. package/src/modules/marketplace/components/sections/Filters.vue +3 -3
  328. package/src/modules/middlewares/server/accessors/AccessController.js +33 -0
  329. package/src/modules/middlewares/server/accessors/ReadDepartments.js +101 -0
  330. package/src/modules/middlewares/server/verifyAccesses.js +33 -0
  331. package/src/modules/middlewares/server/verifyInvites.js +4 -4
  332. package/src/modules/orders/components/pages/OrderCreate.vue +2 -2
  333. package/src/modules/orders/components/pages/OrderCreateBackoffice.vue +105 -68
  334. package/src/modules/orders/components/pages/Orders.vue +2 -2
  335. package/src/modules/orders/components/sections/FormAddCustomer.vue +152 -0
  336. package/src/modules/orders/components/sections/FormCustomerDetails.vue +67 -0
  337. package/src/modules/orders/components/sections/FormDelivery.vue +17 -3
  338. package/src/modules/orders/controllers/applications.controller.js +2 -0
  339. package/src/modules/orders/controllers/orders.controller.js +77 -52
  340. package/src/modules/orders/models/application.model.js +25 -25
  341. package/src/modules/orders/models/customer.model.js +54 -18
  342. package/src/modules/orders/models/order.model.js +1 -1
  343. package/src/modules/orders/models/testimonial.model.js +22 -23
  344. package/src/modules/orders/orders.client.js +51 -51
  345. package/src/modules/orders/orders.server.js +36 -12
  346. package/src/modules/orders/router/orders.router.js +36 -41
  347. package/src/modules/orders/routes/orders.routes.js +3 -21
  348. package/src/modules/orders/store/customers.store.js +5 -0
  349. package/src/modules/orders/store/models/customer.js +29 -0
  350. package/src/modules/orders/store/orders.js +14 -20
  351. package/src/modules/organizations/components/blocks/CardDepartment.vue +3 -3
  352. package/src/modules/organizations/components/blocks/CardOrganization.vue +1 -1
  353. package/src/modules/organizations/components/blocks/DepartmentMemberModify.vue +1 -12
  354. package/src/modules/organizations/components/pages/Department.vue +1 -1
  355. package/src/modules/organizations/components/pages/DepartmentEdit.vue +72 -48
  356. package/src/modules/organizations/components/pages/Members.vue +178 -64
  357. package/src/modules/organizations/components/pages/Organization.vue +1 -41
  358. package/src/modules/organizations/components/sections/MembersAdd.vue +44 -52
  359. package/src/modules/organizations/controllers/departments.controller.js +2 -4
  360. package/src/modules/organizations/controllers/invites.controller.js +24 -23
  361. package/src/modules/organizations/controllers/organizations.controller.js +1 -1
  362. package/src/modules/organizations/models/department.model.js +52 -2
  363. package/src/modules/organizations/models/invite.model.js +29 -32
  364. package/src/modules/organizations/models/membership.model.js +2 -0
  365. package/src/modules/organizations/models/organization.model.js +2 -1
  366. package/src/modules/organizations/organizations.client.js +0 -2
  367. package/src/modules/organizations/routes/departments.routes.js +18 -7
  368. package/src/modules/organizations/routes/invites.routes.js +2 -2
  369. package/src/modules/organizations/store/departments.js +22 -1
  370. package/src/modules/organizations/store/invites.js +74 -90
  371. package/src/modules/products/components/blocks/CardProduct.vue +24 -0
  372. package/src/modules/products/components/pages/Products.vue +1 -1
  373. package/src/modules/reports/components/sections/FormReport.vue +40 -40
  374. package/src/modules/spots/components/pages/Spot.vue +1 -1
  375. package/src/modules/spots/components/pages/SpotEdit.vue +1 -1
  376. package/src/modules/users/components/blocks/CardUser.vue +85 -0
  377. package/src/modules/users/controllers/users.controller.js +36 -13
  378. package/src/modules/users/middlewares/visitor.logger.js +66 -0
  379. package/src/modules/users/models/request.model.js +18 -0
  380. package/src/modules/users/models/user.model.js +26 -55
  381. package/src/modules/users/models/visitor.model.js +14 -0
  382. package/src/modules/users/store/users.js +2 -11
  383. package/src/modules/wallet/controllers/routes/payments.routes.js +2 -0
  384. package/src/components/FieldPhone/FieldPhone(script-setup).vue +0 -1646
  385. package/src/components/FieldPhone/FieldPhone2.vue +0 -671
  386. package/src/modules/orders/components/sections/FormClientDetails.vue +0 -61
  387. package/src/modules/organizations/components/blocks/User.vue +0 -69
  388. /package/src/modules/backoffice/components/admin/{User.vue → UserEdit.vue} +0 -0
@@ -0,0 +1,67 @@
1
+ <template>
2
+ <Block :title="title" class="mn-b-thin">
3
+ <Field
4
+ v-model:field="customer.profile.name"
5
+ label="Name"
6
+ placeholder="Enter name"
7
+ class="bg-white pd-small radius-small mn-b-thin"
8
+ />
9
+ <FieldPhone
10
+ v-model="customer.phone"
11
+ @country="(country) => { customer.number = country }"
12
+ :inputOptions="{
13
+ placeholder: 'Enter phone number',
14
+ type: 'tel',
15
+ }"
16
+ :defaultCountry="'TH'"
17
+ :validCharactersOnly="true"
18
+ :dropdownOptions="{
19
+ showDialCodeInSelection: true,
20
+ showFlags: true,
21
+ showDialCodeInList: true
22
+ }"
23
+ mode="national"
24
+ class="w-100 bg-white pd-small mn-b-thin radius-small"
25
+ />
26
+ <div
27
+ class="gap-thin flex-justify-between flex-nowrap flex"
28
+ >
29
+ <Select
30
+ :select="messengerSelected"
31
+ :options="[
32
+ {name: 'Instagram', value: 'instagram'},
33
+ {name: 'Telegram', value: 'telegram'},
34
+ {name: 'WhatsApp', value: 'whatsapp'},
35
+ ]"
36
+ @update:select="(option) => messengerSelected = option"
37
+ placeholder="Messenger"
38
+ size="small"
39
+ class="bg-white pd-small radius-small"
40
+ />
41
+ <Field
42
+ v-model:field="customer.socials[messengerSelected]"
43
+ label="@"
44
+ placeholder="Enter username"
45
+ class="bg-white pd-small radius-small w-100"
46
+ />
47
+ </div>
48
+ </Block>
49
+ </template>
50
+
51
+ <script setup>
52
+ import { ref } from "vue"
53
+ import Block from '@pf/src/components/Block/Block.vue'
54
+ import Field from '@pf/src/components/Field/Field.vue'
55
+ import FieldPhone from '@pf/src/components/FieldPhone/FieldPhone.vue'
56
+ import Select from '@pf/src/components/Select/Select.vue'
57
+
58
+ let messengerSelected = ref('instagram')
59
+
60
+ defineProps({
61
+ customer: Object,
62
+ title: {
63
+ type: String,
64
+ default: 'Personal Data'
65
+ },
66
+ });
67
+ </script>
@@ -1,8 +1,19 @@
1
1
  <template>
2
2
  <Block title="Delivery" class="mn-b-thin" :tooltip="'Delivery by mail takes 3-5 days.'">
3
3
 
4
+ <h4 class="mn-b-thin">Spot</h4>
4
5
  <div class="mn-b-small flex-nowrap flex">
5
6
 
7
+ </div>
8
+
9
+ <h4 class="mn-b-thin">Shipping Method</h4>
10
+ <div class="mn-b-small flex-nowrap flex">
11
+ <Radio
12
+ v-model:radio="order.delivery.type"
13
+ label="Pickup"
14
+ value="pickup"
15
+ class="bg-white pd-medium radius-small w-100 mn-r-small"
16
+ />
6
17
  <Radio
7
18
  v-model:radio="order.delivery.type"
8
19
  label="Courier"
@@ -11,14 +22,17 @@
11
22
  />
12
23
  <Radio
13
24
  v-model:radio="order.delivery.type"
14
- label="Post"
15
- value="Post"
25
+ label="Mail"
26
+ value="mail"
16
27
  class="bg-white pd-medium radius-small w-100 mn-r-small"
17
28
  />
18
29
  </div>
30
+
31
+
19
32
 
33
+ <h4 class="mn-b-thin">Address</h4>
20
34
  <Address
21
- label="Address"
35
+ label="Location"
22
36
  :apiKey="GOOGLE_MAPS_API_KEY"
23
37
  :address="order.delivery.address"
24
38
  :location="order.delivery.location"
@@ -15,9 +15,11 @@ const middlewareFactory = (db) => {
15
15
  const read = async (req, res) => {
16
16
  try {
17
17
  const applications = await Application.find({});
18
+
18
19
  if (!applications) {
19
20
  return res.status(404).send({ message: "Applications not found." });
20
21
  }
22
+
21
23
  res.status(200).send(applications);
22
24
  } catch (err) {
23
25
  res.status(500).send({ message: err });
@@ -21,76 +21,87 @@ function formatOrderMessage(order) {
21
21
  `;
22
22
  }
23
23
 
24
- const controllerFactory = (db) => {
25
- const Order = db.order;
26
- const Customer = db.customer;
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
+ }
27
34
 
28
- // Создание заказа
29
- const create = async (req, res) => {
30
- delete req.body._id;
35
+ async function findOrCreateCustomer(Customer, customerInfo, orderOwner, visitor) {
36
+ let searchCriteria = {};
31
37
 
32
- req.body.status = 'created';
33
- req.body.status_history = req.body.status_history || [];
38
+ if (customerInfo.phone) {
39
+ searchCriteria.phone = customerInfo.phone;
40
+ }
34
41
 
35
- // Добавление записи в историю изменений статусов
36
- req.body.status_history.push({
37
- status: req.body.status,
38
- changedBy: req.userId,
39
- timestamp: new Date(),
40
- comment: ''
41
- });
42
+ if (customerInfo.email) {
43
+ searchCriteria.email = customerInfo.email;
44
+ }
42
45
 
43
- console.log(req.body)
46
+ let customer = null;
44
47
 
45
- try {
46
- // Поиск или создание клиента
47
- let searchCriteria = {};
48
+ // Проверяем, есть ли критерии для поиска
49
+ if (Object.keys(searchCriteria).length > 0) {
50
+ customer = await Customer.findOne({ $or: [searchCriteria] });
51
+ }
48
52
 
49
- if (req.body.customer.phone) {
50
- searchCriteria.phone = req.body.customer.phone;
51
- }
53
+ if (!customer) {
54
+ // Создаем нового клиента с указанием владельца и создателя
55
+ const newCustomerData = {
56
+ ...customerInfo,
57
+ owner: orderOwner,
58
+ creator: customerInfo.creator || { type: 'Visitor', target: visitor || orderOwner.target },
59
+ identity: customerInfo.indentity || { type: 'Visitor', target: visitor || orderOwner.target }
60
+ };
61
+ customer = await Customer.create(newCustomerData);
62
+ }
52
63
 
53
- if (req.body.customer.email) {
54
- searchCriteria.email = req.body.customer.email;
55
- }
64
+ return customer;
65
+ }
56
66
 
57
- let customer = await Customer.findOne({ $or: [searchCriteria] });
67
+ async function sendOrderMessage(orderData) {
68
+ try {
69
+ const formattedMessage = formatOrderMessage(orderData);
70
+ await sendChatMessageTelegram(process.env.TELEGRAM_BOT_USERS.split(","), formattedMessage);
71
+ } catch (err) {
72
+ console.error(err);
73
+ }
74
+ }
58
75
 
59
- if (!customer) {
60
- customer = await Customer.create(req.body.customer);
61
- }
76
+ const controllerFactory = (db) => {
77
+ const Order = db.order;
78
+ const Customer = db.customer;
62
79
 
63
- // Присвоение идентификатора клиента заказу
64
- req.body.customer = {
65
- type: 'Customer',
66
- target: customer._id
67
- }
80
+ // Создание заказа
81
+ const create = async (req, res) => {
82
+ const orderData = req.body;
83
+ const userId = req.userId;
84
+
85
+ initializeOrder(orderData, userId);
86
+
87
+ try {
88
+ if (!orderData.customer.target) {
89
+ let customer = await findOrCreateCustomer(Customer, orderData.customer, orderData.owner, orderData.visitor);
68
90
 
69
- if (!req.body.creator?.target) {
70
- req.body.creator = {
71
- type: 'Customer',
72
- target: customer._id
91
+ orderData.customer = { type: 'Customer', target: customer._id };
92
+
93
+ if (!orderData.creator?.target) {
94
+ orderData.creator = { type: 'Customer', target: customer._id };
73
95
  }
74
96
  }
75
97
 
76
- } catch (err) {
77
- console.log(err);
78
- return res.status(500).send({ errorCode: "CLIENT_PROCESSING_FAILED", message: "Error occurred while processing the customer.", error: err });
79
- }
98
+ await sendOrderMessage(orderData);
80
99
 
81
- try {
82
- const formattedMessage = formatOrderMessage(req.body);
83
- console.log(formattedMessage)
84
- const messageSent = await sendChatMessageTelegram(process.env.TELEGRAM_BOT_USERS.split(","),formattedMessage)
85
- } catch (err) {
86
- console.log(err)
87
- }
100
+ const order = await Order.create(orderData);
88
101
 
89
- try {
90
- const order = await Order.create(req.body);
91
102
  res.status(201).send(order);
92
103
  } catch (err) {
93
- console.log(err)
104
+ console.error(err);
94
105
  res.status(500).send({ errorCode: "CREATE_ORDER_FAILED", message: "Error occurred while creating the order.", error: err });
95
106
  }
96
107
  };
@@ -101,6 +112,20 @@ const controllerFactory = (db) => {
101
112
  ...queryProcessorGlobals.getBasicOptions(
102
113
  req.query
103
114
  ),
115
+ // For customer
116
+ {
117
+ $lookup: {
118
+ from: "customers",
119
+ localField: "customer.target",
120
+ foreignField: "_id",
121
+ as: "customerTarget"
122
+ }
123
+ },
124
+ {
125
+ $addFields: {
126
+ "customer.target": { $arrayElemAt: ["$customerTarget", 0] }
127
+ }
128
+ },
104
129
  // For creator
105
130
  queryProcessorGlobals.getCreatorUserLookupStage(),
106
131
  queryProcessorGlobals.getCreatorOrganizationLookupStage(),
@@ -1,29 +1,29 @@
1
- const mongoose = require('mongoose');
2
-
3
- const ApplicationSchema = new mongoose.Schema({
4
- status: {
5
- type: String,
6
- default: 'created'
7
- },
8
- type: {
9
- type: String,
10
- default: 'newsletter'
11
- },
12
- contacts: {
13
- name: {
14
- type: String
15
- },
16
- phone: {
17
- type: String
1
+ module.exports = (db) => {
2
+ const ApplicationSchema = new db.mongoose.Schema({
3
+ status: {
4
+ type: String,
5
+ default: 'created'
18
6
  },
19
- email: {
20
- type: String
7
+ type: {
8
+ type: String,
9
+ default: 'newsletter'
21
10
  },
22
- }
23
- }, {
24
- timestamps: { currentTime: () => Date.now() }
25
- });
11
+ contacts: {
12
+ name: {
13
+ type: String
14
+ },
15
+ phone: {
16
+ type: String
17
+ },
18
+ email: {
19
+ type: String
20
+ },
21
+ }
22
+ }, {
23
+ timestamps: { currentTime: () => Date.now() }
24
+ });
26
25
 
27
- const Application = mongoose.model("Application", ApplicationSchema);
26
+ const Application = db.mongoose.model("Application", ApplicationSchema);
28
27
 
29
- module.exports = Application;
28
+ return Application;
29
+ }
@@ -1,29 +1,65 @@
1
1
  const applyOwnershipSchema = require('@pf/src/modules/globals/models/ownership.schema.js');
2
+ const applyProfileSchema = require('@pf/src/modules/globals/models/profile.schema.js');
3
+ const applyCredentialsSchema = require('@pf/src/modules/globals/models/credentials.schema.js');
2
4
 
3
5
  module.exports = (db) => {
4
6
 
5
- const CustomerSchema = new db.mongoose.Schema({
6
- // target: {
7
- // type: {
8
- // type: String,
9
- // required: true
10
- // },
11
- // target: {
12
- // type: db.mongoose.Schema.Types.ObjectId,
13
- // refPath: 'target.type',
14
- // required: true,
15
- // },
16
- // },
17
- referralCode: {
18
- type: String
7
+ const CustomerSchema = new db.mongoose.Schema({
8
+ identity: {
9
+ type: {
10
+ type: String,
11
+ enum: ['Visitor','User','Organization'],
12
+ required: true
13
+ },
14
+ target: {
15
+ type: db.mongoose.Schema.Types.ObjectId,
16
+ refPath: 'target.type',
17
+ },
18
+ },
19
+ referral: {
20
+ code: {
21
+ type: String
22
+ },
19
23
  }
20
- },{
21
- timestamps: { currentTime: () => Date.now()
22
- }
24
+ }, {
25
+ timestamps: {
26
+ currentTime: () => Date.now()
27
+ }
28
+ });
29
+
30
+ applyCredentialsSchema(CustomerSchema, db);
31
+ applyProfileSchema(CustomerSchema, db);
32
+ applyOwnershipSchema(CustomerSchema, db);
23
33
 
34
+ CustomerSchema.index({
35
+ owner: 1,
36
+ email: 1
37
+ }, {
38
+ unique: true,
39
+ partialFilterExpression: {
40
+ email: { $exists: true, $ne: "" }
41
+ }
24
42
  });
25
43
 
26
- // applyOwnershipSchema(CustomerSchema,db);
44
+ CustomerSchema.index({
45
+ owner: 1,
46
+ phone: 1
47
+ }, {
48
+ unique: true,
49
+ partialFilterExpression: {
50
+ phone: { $exists: true, $ne: "" }
51
+ }
52
+ });
53
+
54
+ CustomerSchema.index({
55
+ owner: 1,
56
+ identity: 1
57
+ }, {
58
+ unique: true,
59
+ partialFilterExpression: {
60
+ identity: { $exists: true, $ne: "" }
61
+ }
62
+ });
27
63
 
28
64
  const Customer = db.mongoose.model("Customer", CustomerSchema);
29
65
 
@@ -11,7 +11,7 @@ module.exports = (db) => {
11
11
  target: {
12
12
  type: db.mongoose.Schema.Types.ObjectId,
13
13
  refPath: 'customer.type',
14
- required: true,
14
+ required: true
15
15
  },
16
16
  },
17
17
  positions: {
@@ -1,25 +1,24 @@
1
- const mongoose = require('mongoose');
2
- const Schema = mongoose.Schema;
1
+ module.exports = (db) => {
2
+ const testimonialSchema = new db.mongoose.Schema({
3
+ source: {
4
+ type: String
5
+ },
6
+ author: {
7
+ type: Schema.Types.ObjectId,
8
+ ref: 'User',
9
+ required: true,
10
+ },
11
+ rating: {
12
+ type: String,
13
+ required: true
14
+ },
15
+ description: {
16
+ type: String,
17
+ required: true
18
+ },
19
+ });
3
20
 
21
+ const Testimonial = db.mongoose.model('Testimonial', testimonialSchema);
4
22
 
5
- const testimonialSchema = new mongoose.Schema({
6
- source: {
7
- type: String
8
- },
9
- author: {
10
- type: Schema.Types.ObjectId,
11
- ref: 'User',
12
- required: true,
13
- },
14
- rating: {
15
- type: String,
16
- required: true
17
- },
18
- description: {
19
- type: String,
20
- required: true
21
- },
22
- });
23
-
24
- module.exports = mongoose.model('Testimonial', testimonialSchema);
25
-
23
+ return Testimonial;
24
+ }
@@ -1,67 +1,67 @@
1
- // Importing Vue components from the components directory
2
-
1
+ // Store
2
+ import * as storeOrders from './store/orders.js';
3
+ import * as storeShopcart from './store/shopcart.js';
4
+ // Router
5
+ import routerOrders from './router/orders.router.js';
6
+ // Views
3
7
  import Orders from './components/pages/Orders.vue';
4
8
  import Order from './components/pages/Order.vue';
5
- import EditOrder from './components/pages/EditOrder.vue';
6
-
9
+ import OrderCreate from './components/pages/OrderCreate.vue';
10
+ import OrderCreateBackoffice from './components/pages/OrderCreateBackoffice.vue';
7
11
  // import Favorites from './components/pages/Favorites.vue';
8
-
9
12
  // Importing blocks components
10
13
  import CardOrderItem from './components/blocks/CardOrderItem.vue';
11
14
  import CardOrder from './components/blocks/CardOrder.vue';
12
-
13
15
  import StatusHistory from './components/blocks/StatusHistory.vue';
14
-
15
- import FormOrder from './components/pages/FormOrder.vue';
16
-
17
16
  // Importing sections components
18
- import FormClientDetails from './components/sections/FormClientDetails.vue';
17
+ import FormCustomerDetails from './components/sections/FormCustomerDetails.vue';
19
18
  import FormPayment from './components/sections/FormPayment.vue';
20
19
  import FormDelivery from './components/sections/FormDelivery.vue';
21
-
22
20
  import EmptyState from './components/sections/EmptyState.vue';
23
21
  import AskToLogin from './components/sections/AskToLogin.vue';
24
22
  import Succes from './components/sections/Succes.vue';
25
-
26
23
  // Importing partials components
27
24
  import ShopCart from './components/partials/ShopCart.vue';
28
25
 
29
- // Importing Vuex store modules from the store directory
30
- import * as ordersStore from './store/orders.js';
31
- import * as shopcartStore from './store/shopcart.js';
32
-
33
- // Importing Vue Router routes from the router directory
34
- import ordersRoutes from './router/orders.router.js';
35
-
36
- // Exporting components, store modules, and routes
37
- export {
38
- // Pages
39
- FormOrder,
40
- Order,
41
- Orders,
42
- EditOrder,
43
- // Favorites,
44
-
45
- // Blocks
46
- CardOrderItem,
47
- CardOrder,
48
- StatusHistory,
49
-
50
- // Sections
51
- FormClientDetails,
52
- AskToLogin,
53
- FormDelivery,
54
- EmptyState,
55
- Succes,
56
- FormPayment,
57
-
58
- // Partials
59
- ShopCart,
60
-
61
- // Store
62
- ordersStore,
63
- shopcartStore,
64
-
65
- // Router
66
- ordersRoutes
67
- };
26
+ // Пример функции инициализации для модуля заказов
27
+ function initializeOrders(app, store, router) {
28
+ router.addRoute('Home', routerOrders);
29
+ store.addStore('orders', storeOrders);
30
+ store.addStore('shopcart', storeShopcart);
31
+ }
32
+
33
+ const ModuleOrder = {
34
+ initialize: initializeOrders,
35
+ views: {
36
+ store: {
37
+ storeOrders,
38
+ storeShopcart
39
+ },
40
+ router: {
41
+ routerOrders
42
+ },
43
+ components: {
44
+ // Pages
45
+ Orders,
46
+ Order,
47
+ OrderCreate,
48
+ OrderCreateBackoffice,
49
+ // Favorites,
50
+ // Blocks
51
+ CardOrderItem,
52
+ CardOrder,
53
+ StatusHistory,
54
+ // Sections
55
+ FormCustomerDetails,
56
+ AskToLogin,
57
+ FormDelivery,
58
+ EmptyState,
59
+ Succes,
60
+ FormPayment,
61
+ // Partials
62
+ ShopCart,
63
+ }
64
+ }
65
+ }
66
+
67
+ export default ModuleOrder
@@ -1,15 +1,39 @@
1
- // Importing controllers from the controllers directory
2
- const ordersController = require('./controllers/orders.controller.js');
3
- // Importing routes from the routes directory
4
- const ordersRoutes = require('./routes/orders.routes.js');
5
- // Models
6
- const OrderModel = require('./models/order.model.js');
7
- const CustomerModel = require('./models/customer.model.js');
1
+ const ModelOrder = require('./models/order.model.js');
2
+ const ModelCustomer = require('./models/customer.model.js');
3
+ const ModelTestimonial = require('./models/testimonial.model.js');
4
+ const ModelApplication = require('./models/application.model.js');
8
5
 
6
+ const RoutesOrder = require('./routes/orders.routes.js');
7
+
8
+ const FactoryOrder = require('./controllers/orders.controller.js');
9
+
10
+ const CRUD = require('@pf/src/modules/globals/services/globals.crud');
11
+
12
+ function initializeOrders(app, db, origins, publicPath) {
13
+ // Setup models in the database object
14
+ db.order = ModelOrder(db);
15
+ db.customer = ModelCustomer(db);
16
+ db.testimonial = ModelTestimonial(db);
17
+ db.application = ModelApplication(db);
18
+
19
+ // Setup routes if the app object is provided
20
+ if (app) {
21
+ RoutesOrder(app,db,origins,publicPath)
22
+ }
23
+
24
+ new CRUD('/api/customers', app, db, db.customer)
25
+ }
9
26
  // Exporting controllers, routes, and models
10
27
  module.exports = {
11
- ordersController,
12
- ordersRoutes,
13
- UserModel,
14
- CustomerModel
15
- };
28
+ initialize: initializeOrders,
29
+ models: {
30
+ ModelOrder,
31
+ ModelCustomer,
32
+ },
33
+ routes: {
34
+ RoutesOrder,
35
+ },
36
+ controllers: {
37
+ FactoryOrder
38
+ }
39
+ };