@ozdao/prometheus-framework 0.2.80 → 0.2.82

Sign up to get free protection for your applications and to get access to all the features.
Files changed (303) 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-CDZCKfEI.mjs +106 -0
  6. package/dist/credentials.schema-CfhPcsuI.js +105 -0
  7. package/dist/events.server.js +4 -15
  8. package/dist/events.server.mjs +3 -14
  9. package/dist/files.server.js +1 -1
  10. package/dist/files.server.mjs +1 -1
  11. package/dist/gallery.server.js +1 -1
  12. package/dist/gallery.server.mjs +1 -1
  13. package/dist/index-B6a1mPgp.mjs +217 -0
  14. package/dist/index-BCCiEK_u.js +216 -0
  15. package/dist/main-8N2Jmsuk.js +91 -0
  16. package/dist/main-CkeuHuCY.mjs +13619 -0
  17. package/dist/main.css +1 -1
  18. package/dist/metadata.schema-Cu_mPkjE.js +77 -0
  19. package/dist/metadata.schema-cbFgazeK.mjs +78 -0
  20. package/dist/middlewares.server.js +1 -1
  21. package/dist/middlewares.server.mjs +1 -1
  22. package/dist/node_modules/@googlemaps/js-api-loader/dist/index.cjs +1 -0
  23. package/dist/node_modules/@googlemaps/js-api-loader/dist/index.js +238 -0
  24. package/dist/organizations.server.js +297 -134
  25. package/dist/organizations.server.mjs +295 -132
  26. package/dist/products.server.js +2 -2
  27. package/dist/products.server.mjs +2 -2
  28. package/dist/prometheus-framework/src/components/Address/Address.vue2.cjs +1 -1
  29. package/dist/prometheus-framework/src/components/Address/Address.vue2.js +33 -24
  30. package/dist/prometheus-framework/src/components/Block/Block.vue.cjs +1 -1
  31. package/dist/prometheus-framework/src/components/Block/Block.vue.js +23 -20
  32. package/dist/prometheus-framework/src/components/Button/Button.vue2.cjs +1 -1
  33. package/dist/prometheus-framework/src/components/Button/Button.vue2.js +32 -155
  34. package/dist/prometheus-framework/src/components/Dropdown/Dropdown.vue.cjs +1 -1
  35. package/dist/prometheus-framework/src/components/Dropdown/Dropdown.vue.js +55 -1
  36. package/dist/prometheus-framework/src/components/Dropdown/Dropdown.vue2.cjs +1 -1
  37. package/dist/prometheus-framework/src/components/Dropdown/Dropdown.vue2.js +1 -55
  38. package/dist/prometheus-framework/src/components/Feed/Feed.vue.cjs +1 -1
  39. package/dist/prometheus-framework/src/components/Feed/Feed.vue.js +71 -60
  40. package/dist/prometheus-framework/src/components/FieldPhone/FieldPhone.vue.cjs +1 -1
  41. package/dist/prometheus-framework/src/components/FieldPhone/FieldPhone.vue.js +325 -340
  42. package/dist/prometheus-framework/src/components/FieldPhone/FieldPhone2.vue.cjs +1 -1
  43. package/dist/prometheus-framework/src/components/FieldPhone/FieldPhone2.vue.js +2 -2
  44. package/dist/prometheus-framework/src/components/LocationMarker/LocationMarker.vue2.cjs +1 -1
  45. package/dist/prometheus-framework/src/components/LocationMarker/LocationMarker.vue2.js +53 -44
  46. package/dist/prometheus-framework/src/components/Popup/Popup.vue.cjs +1 -1
  47. package/dist/prometheus-framework/src/components/Popup/Popup.vue.js +1 -72
  48. package/dist/prometheus-framework/src/components/Popup/Popup.vue2.cjs +1 -1
  49. package/dist/prometheus-framework/src/components/Popup/Popup.vue2.js +73 -1
  50. package/dist/prometheus-framework/src/components/Select/Select.vue.cjs +1 -1
  51. package/dist/prometheus-framework/src/components/Select/Select.vue.js +1 -97
  52. package/dist/prometheus-framework/src/components/Select/Select.vue2.cjs +1 -1
  53. package/dist/prometheus-framework/src/components/Select/Select.vue2.js +103 -1
  54. package/dist/prometheus-framework/src/components/Slider/Slider.vue.cjs +1 -1
  55. package/dist/prometheus-framework/src/components/Slider/Slider.vue.js +18 -19
  56. package/dist/prometheus-framework/src/components/Tooltip/Tooltip.vue.cjs +1 -1
  57. package/dist/prometheus-framework/src/components/Tooltip/Tooltip.vue.js +45 -1
  58. package/dist/prometheus-framework/src/components/Tooltip/Tooltip.vue2.cjs +1 -1
  59. package/dist/prometheus-framework/src/components/Tooltip/Tooltip.vue2.js +1 -45
  60. package/dist/prometheus-framework/src/modules/auth/components/pages/Invite.vue.cjs +1 -1
  61. package/dist/prometheus-framework/src/modules/auth/components/pages/Invite.vue.js +28 -28
  62. package/dist/prometheus-framework/src/modules/auth/store/auth.cjs +1 -1
  63. package/dist/prometheus-framework/src/modules/auth/store/auth.js +26 -26
  64. package/dist/prometheus-framework/src/modules/backoffice/components/pages/Dashboard.vue.cjs +1 -1
  65. package/dist/prometheus-framework/src/modules/backoffice/components/pages/Dashboard.vue.js +78 -103
  66. package/dist/prometheus-framework/src/modules/community/components/layouts/Community.vue.cjs +1 -1
  67. package/dist/prometheus-framework/src/modules/community/components/layouts/Community.vue.js +1 -1
  68. package/dist/prometheus-framework/src/modules/community/components/pages/Community.vue.cjs +1 -1
  69. package/dist/prometheus-framework/src/modules/community/components/pages/Community.vue.js +1 -1
  70. package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.cjs +1 -1
  71. package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.js +1 -1
  72. package/dist/prometheus-framework/src/modules/community/components/sections/HotPosts.vue.cjs +1 -1
  73. package/dist/prometheus-framework/src/modules/community/components/sections/HotPosts.vue.js +14 -14
  74. package/dist/prometheus-framework/src/modules/events/components/blocks/CardEvent.vue.cjs +1 -1
  75. package/dist/prometheus-framework/src/modules/events/components/blocks/CardEvent.vue.js +4 -4
  76. package/dist/prometheus-framework/src/modules/events/components/elements/ButtonCheck.vue.cjs +1 -1
  77. package/dist/prometheus-framework/src/modules/events/components/elements/ButtonCheck.vue.js +1 -1
  78. package/dist/prometheus-framework/src/modules/events/components/layouts/layoutEvents.vue.cjs +1 -1
  79. package/dist/prometheus-framework/src/modules/events/components/layouts/layoutEvents.vue.js +1 -1
  80. package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.cjs +1 -1
  81. package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.js +1 -1
  82. package/dist/prometheus-framework/src/modules/events/components/pages/EditEventTickets.vue.cjs +1 -1
  83. package/dist/prometheus-framework/src/modules/events/components/pages/EditEventTickets.vue.js +1 -1
  84. package/dist/prometheus-framework/src/modules/events/components/pages/Event.vue.cjs +3 -3
  85. package/dist/prometheus-framework/src/modules/events/components/pages/Event.vue.js +132 -141
  86. package/dist/prometheus-framework/src/modules/events/components/pages/Events.vue.cjs +1 -1
  87. package/dist/prometheus-framework/src/modules/events/components/pages/Events.vue.js +29 -27
  88. package/dist/prometheus-framework/src/modules/events/components/sections/HeroEvent.vue.cjs +1 -1
  89. package/dist/prometheus-framework/src/modules/events/components/sections/HeroEvent.vue.js +4 -4
  90. package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.cjs +1 -1
  91. package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.js +1 -1
  92. package/dist/prometheus-framework/src/modules/gallery/components/sections/GalleryWithCategories.vue.cjs +1 -1
  93. package/dist/prometheus-framework/src/modules/gallery/components/sections/GalleryWithCategories.vue.js +1 -1
  94. package/dist/prometheus-framework/src/modules/globals/components/blocks/CardHeader.vue.cjs +1 -1
  95. package/dist/prometheus-framework/src/modules/globals/components/blocks/CardHeader.vue.js +2 -2
  96. package/dist/prometheus-framework/src/modules/globals/components/sections/SectionPageTitle.vue.cjs +1 -1
  97. package/dist/prometheus-framework/src/modules/globals/components/sections/SectionPageTitle.vue.js +32 -25
  98. package/dist/prometheus-framework/src/modules/globals/localization/vue-i18n.cjs +1 -1
  99. package/dist/prometheus-framework/src/modules/globals/localization/vue-i18n.js +6 -3
  100. package/dist/prometheus-framework/src/modules/globals/services/globals.store.cjs +1 -0
  101. package/dist/prometheus-framework/src/modules/globals/services/globals.store.js +70 -0
  102. package/dist/prometheus-framework/src/modules/icons/entities/IconGallery.vue.cjs +1 -0
  103. package/dist/prometheus-framework/src/modules/icons/entities/IconGallery.vue.js +28 -0
  104. package/dist/prometheus-framework/src/modules/icons/entities/IconLeftovers.vue.cjs +1 -0
  105. package/dist/prometheus-framework/src/modules/icons/entities/IconLeftovers.vue.js +30 -0
  106. package/dist/prometheus-framework/src/modules/icons/entities/IconOrders.vue.cjs +1 -0
  107. package/dist/prometheus-framework/src/modules/icons/entities/IconOrders.vue.js +35 -0
  108. package/dist/prometheus-framework/src/modules/icons/entities/IconProducts.vue.cjs +1 -0
  109. package/dist/prometheus-framework/src/modules/icons/entities/IconProducts.vue.js +28 -0
  110. package/dist/prometheus-framework/src/modules/landing/components/sections/MobileApp.vue.cjs +1 -1
  111. package/dist/prometheus-framework/src/modules/landing/components/sections/MobileApp.vue.js +63 -86
  112. package/dist/prometheus-framework/src/modules/legal/components/pages/Legal.vue.cjs +1 -1
  113. package/dist/prometheus-framework/src/modules/legal/components/pages/Legal.vue.js +1 -1
  114. package/dist/prometheus-framework/src/modules/mobile/components/Menu/Menu.vue.cjs +1 -1
  115. package/dist/prometheus-framework/src/modules/mobile/components/Menu/Menu.vue.js +1 -13
  116. package/dist/prometheus-framework/src/modules/mobile/components/Menu/Menu.vue2.cjs +1 -1
  117. package/dist/prometheus-framework/src/modules/mobile/components/Menu/Menu.vue2.js +13 -1
  118. package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreateBackoffice.vue.cjs +1 -1
  119. package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreateBackoffice.vue.js +174 -114
  120. package/dist/prometheus-framework/src/modules/orders/components/pages/Orders.vue.cjs +1 -1
  121. package/dist/prometheus-framework/src/modules/orders/components/pages/Orders.vue.js +39 -39
  122. package/dist/prometheus-framework/src/modules/orders/components/sections/FormAddCustomer.vue.cjs +1 -0
  123. package/dist/prometheus-framework/src/modules/orders/components/sections/FormAddCustomer.vue.js +141 -0
  124. package/dist/prometheus-framework/src/modules/orders/components/sections/FormClientDetails.vue.cjs +1 -1
  125. package/dist/prometheus-framework/src/modules/orders/components/sections/FormClientDetails.vue.js +3 -3
  126. package/dist/prometheus-framework/src/modules/orders/components/sections/FormCustomerDetails.vue.cjs +1 -0
  127. package/dist/prometheus-framework/src/modules/orders/components/sections/FormCustomerDetails.vue.js +77 -0
  128. package/dist/prometheus-framework/src/modules/orders/components/sections/FormDelivery.vue.cjs +1 -1
  129. package/dist/prometheus-framework/src/modules/orders/components/sections/FormDelivery.vue.js +46 -35
  130. package/dist/prometheus-framework/src/modules/orders/components/sections/FormPayment.vue.cjs +1 -1
  131. package/dist/prometheus-framework/src/modules/orders/components/sections/FormPayment.vue.js +1 -1
  132. package/dist/prometheus-framework/src/modules/orders/store/customers.store.cjs +1 -0
  133. package/dist/prometheus-framework/src/modules/orders/store/customers.store.js +5 -0
  134. package/dist/prometheus-framework/src/modules/orders/store/models/customer.cjs +1 -0
  135. package/dist/prometheus-framework/src/modules/orders/store/models/customer.js +30 -0
  136. package/dist/prometheus-framework/src/modules/orders/store/orders.cjs +1 -1
  137. package/dist/prometheus-framework/src/modules/orders/store/orders.js +24 -25
  138. package/dist/prometheus-framework/src/modules/organizations/components/blocks/CardDepartment.vue.cjs +1 -1
  139. package/dist/prometheus-framework/src/modules/organizations/components/blocks/CardDepartment.vue.js +16 -16
  140. package/dist/prometheus-framework/src/modules/organizations/components/blocks/CardOrganization.vue.cjs +1 -1
  141. package/dist/prometheus-framework/src/modules/organizations/components/blocks/CardOrganization.vue.js +1 -1
  142. package/dist/prometheus-framework/src/modules/organizations/components/blocks/DepartmentMemberModify.vue.cjs +1 -1
  143. package/dist/prometheus-framework/src/modules/organizations/components/blocks/DepartmentMemberModify.vue.js +39 -50
  144. package/dist/prometheus-framework/src/modules/organizations/components/pages/Department.vue.cjs +1 -1
  145. package/dist/prometheus-framework/src/modules/organizations/components/pages/Department.vue.js +6 -6
  146. package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.cjs +1 -1
  147. package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.js +161 -138
  148. package/dist/prometheus-framework/src/modules/organizations/components/pages/Members.vue.cjs +1 -1
  149. package/dist/prometheus-framework/src/modules/organizations/components/pages/Members.vue.js +199 -79
  150. package/dist/prometheus-framework/src/modules/organizations/components/pages/Organization.vue.cjs +1 -1
  151. package/dist/prometheus-framework/src/modules/organizations/components/pages/Organization.vue.js +83 -126
  152. package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.cjs +1 -1
  153. package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.js +2 -2
  154. package/dist/prometheus-framework/src/modules/organizations/components/sections/DetailsTab.vue.cjs +1 -1
  155. package/dist/prometheus-framework/src/modules/organizations/components/sections/DetailsTab.vue.js +1 -1
  156. package/dist/prometheus-framework/src/modules/organizations/components/sections/Documents.vue.cjs +1 -1
  157. package/dist/prometheus-framework/src/modules/organizations/components/sections/Documents.vue.js +1 -1
  158. package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.cjs +1 -1
  159. package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.js +59 -70
  160. package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.cjs +1 -1
  161. package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.js +3 -3
  162. package/dist/prometheus-framework/src/modules/organizations/organizations.client.cjs +1 -1
  163. package/dist/prometheus-framework/src/modules/organizations/organizations.client.js +34 -36
  164. package/dist/prometheus-framework/src/modules/organizations/store/departments.cjs +1 -1
  165. package/dist/prometheus-framework/src/modules/organizations/store/departments.js +38 -18
  166. package/dist/prometheus-framework/src/modules/organizations/store/invites.cjs +1 -1
  167. package/dist/prometheus-framework/src/modules/organizations/store/invites.js +34 -35
  168. package/dist/prometheus-framework/src/modules/products/components/blocks/CardPosition.vue.cjs +1 -1
  169. package/dist/prometheus-framework/src/modules/products/components/blocks/CardPosition.vue.js +1 -1
  170. package/dist/prometheus-framework/src/modules/products/components/blocks/CardProduct.vue.cjs +1 -1
  171. package/dist/prometheus-framework/src/modules/products/components/blocks/CardProduct.vue.js +41 -21
  172. package/dist/prometheus-framework/src/modules/products/components/blocks/ImagesThumbnails.vue.cjs +1 -1
  173. package/dist/prometheus-framework/src/modules/products/components/blocks/ImagesThumbnails.vue.js +1 -1
  174. package/dist/prometheus-framework/src/modules/products/components/pages/CategoryEdit.vue.cjs +1 -1
  175. package/dist/prometheus-framework/src/modules/products/components/pages/CategoryEdit.vue.js +1 -1
  176. package/dist/prometheus-framework/src/modules/products/components/pages/EditLeftover.vue.cjs +1 -1
  177. package/dist/prometheus-framework/src/modules/products/components/pages/EditLeftover.vue.js +2 -2
  178. package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.cjs +1 -1
  179. package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.js +1 -1
  180. package/dist/prometheus-framework/src/modules/products/components/pages/Products.vue.cjs +1 -1
  181. package/dist/prometheus-framework/src/modules/products/components/pages/Products.vue.js +2 -2
  182. package/dist/prometheus-framework/src/modules/products/components/sections/EditProductInfo.vue.cjs +1 -1
  183. package/dist/prometheus-framework/src/modules/products/components/sections/EditProductInfo.vue.js +1 -1
  184. package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.cjs +1 -1
  185. package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.js +24 -26
  186. package/dist/prometheus-framework/src/modules/users/components/blocks/CardUser.vue.cjs +1 -0
  187. package/dist/prometheus-framework/src/modules/users/components/blocks/CardUser.vue.js +78 -0
  188. package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.cjs +1 -1
  189. package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.js +2 -2
  190. package/dist/prometheus-framework/src/modules/users/store/users.cjs +1 -1
  191. package/dist/prometheus-framework/src/modules/users/store/users.js +13 -14
  192. package/dist/prometheus-framework/src/modules/wallet/views/components/pages/Wallet.vue.cjs +1 -1
  193. package/dist/prometheus-framework/src/modules/wallet/views/components/pages/Wallet.vue.js +4 -4
  194. package/dist/prometheus-framework.cjs.js +1 -1
  195. package/dist/prometheus-framework.es.js +1 -1
  196. package/dist/queryProcessor-BJdKh0Ow.mjs +162 -0
  197. package/dist/queryProcessor-DRMo_GWK.js +161 -0
  198. package/dist/reports.server.js +1 -1
  199. package/dist/reports.server.mjs +1 -1
  200. package/dist/style.css +1 -1
  201. package/dist/users.server.js +69 -38
  202. package/dist/users.server.mjs +67 -36
  203. package/dist/wallet.server.js +2 -2
  204. package/dist/wallet.server.mjs +2 -2
  205. package/dist/web-CtVocufd.js +1 -0
  206. package/dist/web-DNq1tHCE.mjs +54 -0
  207. package/package.json +1 -1
  208. package/src/components/Address/Address.vue +13 -2
  209. package/src/components/Block/Block.vue +3 -2
  210. package/src/components/Button/Button.vue +9 -12
  211. package/src/components/Feed/Feed.vue +28 -6
  212. package/src/components/FieldPhone/FieldPhone.vue +592 -558
  213. package/src/components/LocationMarker/LocationMarker.vue +26 -22
  214. package/src/components/Popup/Popup.vue +22 -23
  215. package/src/components/Select/Select.vue +43 -32
  216. package/src/components/Slider/Slider.vue +3 -4
  217. package/src/modules/auth/components/pages/Invite.vue +7 -7
  218. package/src/modules/auth/store/auth.js +1 -1
  219. package/src/modules/backoffice/components/pages/Dashboard.vue +44 -29
  220. package/src/modules/community/components/sections/HotPosts.vue +1 -1
  221. package/src/modules/events/components/blocks/CardEvent.vue +4 -3
  222. package/src/modules/events/components/pages/Event.vue +4 -3
  223. package/src/modules/events/components/pages/Events.vue +23 -6
  224. package/src/modules/events/components/sections/HeroEvent.vue +1 -1
  225. package/src/modules/globals/components/sections/SectionPageTitle.vue +19 -7
  226. package/src/modules/globals/controllers/utils/queryProcessor.js +21 -7
  227. package/src/modules/globals/localization/vue-i18n.js +3 -0
  228. package/src/modules/globals/models/credentials.schema.js +7 -0
  229. package/src/modules/globals/models/metadata.schema.js +17 -0
  230. package/src/modules/globals/models/profile.schema.js +23 -0
  231. package/src/modules/globals/models/socials.schema.js +22 -0
  232. package/src/modules/globals/router/routerGuards.js +1 -0
  233. package/src/modules/globals/services/globals.cashe.js +26 -0
  234. package/src/modules/globals/services/globals.crud.js +115 -0
  235. package/src/modules/globals/services/globals.logger.js +41 -0
  236. package/src/modules/globals/services/globals.store.js +114 -0
  237. package/src/modules/icons/entities/IconGallery.vue +14 -0
  238. package/src/modules/icons/entities/IconLeftovers.vue +14 -0
  239. package/src/modules/icons/entities/IconOrders.vue +15 -0
  240. package/src/modules/icons/entities/IconProducts.vue +14 -0
  241. package/src/modules/landing/components/sections/HeroSection.vue +1 -1
  242. package/src/modules/landing/components/sections/MobileApp.vue +4 -4
  243. package/src/modules/landing/router/landing.js +1 -1
  244. package/src/modules/marketplace/components/sections/Filters.vue +3 -3
  245. package/src/modules/middlewares/server/accessors/AccessController.js +33 -0
  246. package/src/modules/middlewares/server/accessors/ReadDepartments.js +101 -0
  247. package/src/modules/middlewares/server/verifyAccesses.js +33 -0
  248. package/src/modules/middlewares/server/verifyInvites.js +4 -4
  249. package/src/modules/orders/components/pages/OrderCreate.vue +2 -2
  250. package/src/modules/orders/components/pages/OrderCreateBackoffice.vue +105 -68
  251. package/src/modules/orders/components/pages/Orders.vue +2 -2
  252. package/src/modules/orders/components/sections/FormAddCustomer.vue +152 -0
  253. package/src/modules/orders/components/sections/FormCustomerDetails.vue +67 -0
  254. package/src/modules/orders/components/sections/FormDelivery.vue +17 -3
  255. package/src/modules/orders/controllers/applications.controller.js +2 -0
  256. package/src/modules/orders/controllers/orders.controller.js +77 -52
  257. package/src/modules/orders/models/customer.model.js +54 -18
  258. package/src/modules/orders/models/order.model.js +1 -1
  259. package/src/modules/orders/orders.client.js +51 -51
  260. package/src/modules/orders/orders.server.js +32 -12
  261. package/src/modules/orders/router/orders.router.js +36 -41
  262. package/src/modules/orders/routes/orders.routes.js +3 -21
  263. package/src/modules/orders/store/customers.store.js +5 -0
  264. package/src/modules/orders/store/models/customer.js +29 -0
  265. package/src/modules/orders/store/orders.js +14 -20
  266. package/src/modules/organizations/components/blocks/CardDepartment.vue +3 -3
  267. package/src/modules/organizations/components/blocks/CardOrganization.vue +1 -1
  268. package/src/modules/organizations/components/blocks/DepartmentMemberModify.vue +1 -12
  269. package/src/modules/organizations/components/pages/Department.vue +1 -1
  270. package/src/modules/organizations/components/pages/DepartmentEdit.vue +72 -48
  271. package/src/modules/organizations/components/pages/Members.vue +178 -64
  272. package/src/modules/organizations/components/pages/Organization.vue +1 -41
  273. package/src/modules/organizations/components/sections/MembersAdd.vue +44 -52
  274. package/src/modules/organizations/controllers/departments.controller.js +2 -4
  275. package/src/modules/organizations/controllers/invites.controller.js +24 -23
  276. package/src/modules/organizations/controllers/organizations.controller.js +1 -1
  277. package/src/modules/organizations/models/department.model.js +52 -2
  278. package/src/modules/organizations/models/invite.model.js +29 -32
  279. package/src/modules/organizations/models/membership.model.js +2 -0
  280. package/src/modules/organizations/models/organization.model.js +2 -1
  281. package/src/modules/organizations/organizations.client.js +0 -2
  282. package/src/modules/organizations/routes/departments.routes.js +18 -7
  283. package/src/modules/organizations/routes/invites.routes.js +2 -2
  284. package/src/modules/organizations/store/departments.js +22 -1
  285. package/src/modules/organizations/store/invites.js +74 -90
  286. package/src/modules/products/components/blocks/CardProduct.vue +24 -0
  287. package/src/modules/products/components/pages/Products.vue +1 -1
  288. package/src/modules/reports/components/sections/FormReport.vue +40 -40
  289. package/src/modules/spots/components/pages/Spot.vue +1 -1
  290. package/src/modules/spots/components/pages/SpotEdit.vue +1 -1
  291. package/src/modules/users/components/blocks/CardUser.vue +85 -0
  292. package/src/modules/users/controllers/users.controller.js +36 -13
  293. package/src/modules/users/middlewares/visitor.logger.js +66 -0
  294. package/src/modules/users/models/request.model.js +18 -0
  295. package/src/modules/users/models/user.model.js +26 -55
  296. package/src/modules/users/models/visitor.model.js +14 -0
  297. package/src/modules/users/store/users.js +2 -11
  298. package/src/modules/wallet/controllers/routes/payments.routes.js +2 -0
  299. package/src/components/FieldPhone/FieldPhone(script-setup).vue +0 -1646
  300. package/src/components/FieldPhone/FieldPhone2.vue +0 -671
  301. package/src/modules/orders/components/sections/FormClientDetails.vue +0 -61
  302. package/src/modules/organizations/components/blocks/User.vue +0 -69
  303. /package/src/modules/backoffice/components/admin/{User.vue → UserEdit.vue} +0 -0
@@ -0,0 +1,101 @@
1
+ const AccessController = require('./AccessController');
2
+
3
+ /**
4
+ * @extends AccessController
5
+ */
6
+ class ReadDepartments extends AccessController {
7
+ rule = 'read';
8
+ entity = 'departments';
9
+
10
+ async access(req, res, next) {
11
+ const Department = this.db.department
12
+
13
+ try {
14
+ const userId = req.cookies.user._id
15
+ const organization = req.query.organization
16
+
17
+ // Ищем департаменты организации в которых участвует пользователь
18
+ const departments = await Department.find({
19
+ organization: { $eq: organization },
20
+ members: { $elemMatch: { user: userId } }
21
+ })
22
+
23
+ // Если не найдены департаменты организации в которой состоит пользователь
24
+ if (!departments.length) {
25
+ return res
26
+ .status(403)
27
+ .send({
28
+ message: 'Access Denied. Read Departments. Департаменты не найдены',
29
+ });
30
+ }
31
+
32
+ // Если департаменты найдены
33
+ let hasAccess = false
34
+ departments.forEach((departament) => {
35
+ const accesses = departament.accesses
36
+
37
+ if (getNestedProperty(accesses, rulePath)) {
38
+ hasAccess = true
39
+ }
40
+ })
41
+
42
+ if (hasAccess) {
43
+ next()
44
+ } else {
45
+ return res
46
+ .status(403)
47
+ .send({ message: 'Access Denied. Read Departments. No access' });
48
+ }
49
+ } catch (error) {
50
+ console.error('[canReadDepartments]', error);
51
+ return res.status(500).send({ message: error.message });
52
+ }
53
+ }
54
+
55
+ /**
56
+ * // note: пока не использовался метод
57
+ * @param {Object} req объект
58
+ * @returns
59
+ */
60
+ async departmentsWhereUserIsMember(req) {
61
+ const Department = this.db.department
62
+
63
+ try {
64
+ const userId = req.cookies.user._id
65
+ const organization = req.query.organization
66
+
67
+ // Ищем департаменты организации в которых участвует пользователь
68
+ const departments = await Department.find({
69
+ organization: { $eq: organization },
70
+ members: { $elemMatch: { user: userId } }
71
+ })
72
+
73
+ return departments;
74
+ } catch (error) {
75
+ console.error('[canReadDepartments]', error)
76
+ return res.status(500).send({ message: error.message })
77
+ }
78
+ }
79
+ }
80
+
81
+ module.exports = ReadDepartments;
82
+
83
+ /**
84
+ * Получить параметр объекта по моршруту propertyPath
85
+ * @param {Object} obj
86
+ * @param {String} propertyPath path to obj property
87
+ * @returns undefined or object property of exists
88
+ */
89
+ function getNestedProperty(obj, propertyPath) {
90
+ const properties = propertyPath.split('.');
91
+ let value = obj;
92
+
93
+ for (const property of properties) {
94
+ if (!value.hasOwnProperty(property)) {
95
+ return undefined;
96
+ }
97
+ value = value[property];
98
+ }
99
+
100
+ return value;
101
+ }
@@ -0,0 +1,33 @@
1
+ const ReadDepartments = require('./accessors/ReadDepartments');
2
+
3
+ module.exports = (db) => {
4
+ // Объекты посредников
5
+ const instances = [];
6
+
7
+ // Регистрация посредников отвечающий за проверку прав доступа
8
+ const middlewares = [
9
+ ReadDepartments,
10
+ ];
11
+
12
+ let nextMiddleware = null;
13
+
14
+ // Собираем цепочку посредников
15
+ for (let i = middlewares.length - 1; i >= 0; i--) {
16
+ const Middleware = middlewares[i];
17
+ const middleware = new Middleware();
18
+
19
+ // Передаем в посредники параметры
20
+ middleware.db = db;
21
+
22
+ // Добавляем звено следующего посредника
23
+ middleware.next = nextMiddleware;
24
+
25
+ // Добавляем middleware в начало массива.
26
+ instances.unshift(middleware);
27
+
28
+ nextMiddleware = middleware;
29
+ }
30
+
31
+ // Запускам цепочку зарегестрированных посредников
32
+ return (rule, entity) => instances[0].check(rule, entity);
33
+ };
@@ -7,7 +7,7 @@ const middlewareFactory = (db) => {
7
7
  const Membership = db.membership;
8
8
 
9
9
  const checkInviteExist = async (req, res, next) => {
10
- for (let invite of req.body) {
10
+ for (let invite of req.body.invites) {
11
11
  let query;
12
12
 
13
13
  if (invite.contact.includes('@')) {
@@ -16,7 +16,7 @@ const middlewareFactory = (db) => {
16
16
  query = { invitedPhone: invite.contact };
17
17
  }
18
18
 
19
- query.organization = req.params._id;
19
+ query['owner.target'] = req.body.owner.target;
20
20
 
21
21
  const userInvite = await Invite.findOne(query).exec();
22
22
 
@@ -30,7 +30,7 @@ const middlewareFactory = (db) => {
30
30
  };
31
31
 
32
32
  const checkUsersExist = async (req, res, next) => {
33
- for (let invite of req.body) {
33
+ for (let invite of req.body.invites) {
34
34
  let query;
35
35
 
36
36
  if (invite.contact.includes('@')) {
@@ -43,7 +43,7 @@ const middlewareFactory = (db) => {
43
43
  console.log(req.params);
44
44
 
45
45
  if (user) {
46
- const membership = await Membership.findOne({ user: new ObjectId(user._id), organization: req.params._id }).exec();
46
+ const membership = await Membership.findOne({ user: new ObjectId(user._id), 'owner.target': req.body.owner.target }).exec();
47
47
 
48
48
  if (membership) {
49
49
  console.log(membership);
@@ -21,7 +21,7 @@
21
21
  v-if="orders.state.current.status !== true && shopcart.state.positions.length > 0"
22
22
  class="order-form col"
23
23
  >
24
- <FormClientDetails
24
+ <FormCustomerDetails
25
25
  :order="orders.state.current"
26
26
  />
27
27
  <FormDelivery
@@ -120,7 +120,7 @@ import AskToLogin from '@pf/src/modules/orders/components/sections/AskToLogin.vu
120
120
  import Succes from '@pf/src/modules/orders/components/sections/Succes.vue'
121
121
  import EmptyState from '@pf/src/modules/orders/components/sections/EmptyState.vue'
122
122
 
123
- import FormClientDetails from '@pf/src/modules/orders/components/sections/FormClientDetails.vue'
123
+ import FormCustomerDetails from '@pf/src/modules/orders/components/sections/FormCustomerDetails.vue'
124
124
  import FormDelivery from '@pf/src/modules/orders/components/sections/FormDelivery.vue'
125
125
  import FormPayment from '@pf/src/modules/orders/components/sections/FormPayment.vue'
126
126
  ///////////////////////////////////////////////////////////////////////////////////////////////////
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <div>
2
+ <div class="h-100 flex flex-column pd-thin">
3
3
  <Block class="mn-b-thin">
4
4
  <header class="flex-v-center flex-nowrap flex">
5
5
  <h2 class="mn-r-auto">Create Order</h2>
@@ -13,8 +13,18 @@
13
13
  </header>
14
14
  </Block>
15
15
 
16
+ <Tab
17
+ v-model:selected="tabOrderCreate"
18
+ :tabs="[
19
+ {name: 'Positions', value: 'positions'},
20
+ {name: 'Customer', value: 'customer'},
21
+ {name: 'Delivery', value: 'delivery'},
22
+ {name: 'Payment', value: 'payment'}
23
+ ]"
24
+ class="t-medium radius-medium bg-grey mn-b-small"
25
+ />
26
+
16
27
  <Popup
17
- title="Добавить участника"
18
28
  @close-popup="closeProductsPopup"
19
29
  :isPopupOpen="isOpenProductsPopup"
20
30
  class="bg-white w-min-30r w-max-30r radius-big pd-medium"
@@ -22,9 +32,12 @@
22
32
 
23
33
  <h3 class="mn-b-small">Add to order</h3>
24
34
 
25
- <div class="bg-grey mn-b-thin h-min-20r h-max-20r o-scroll pd-medium radius-big">
35
+ <div class="h-100 bg-grey mn-b-thin o-scroll pd-medium radius-big">
26
36
  <Feed
27
- :search="true"
37
+ :search="{
38
+ placeholder: 'Search products...',
39
+ class: 'bg-white mn-b-thin'
40
+ }"
28
41
  :states="{
29
42
  empty: {
30
43
  title: 'No Products Found',
@@ -60,12 +73,13 @@
60
73
  </Popup>
61
74
 
62
75
  <Block
76
+ v-if="tabOrderCreate === 'positions'"
63
77
  title="Positions"
64
78
  :actions="[{
65
79
  label: '+',
66
80
  function: () => openProductsPopup()
67
81
  }]"
68
- class="mn-b-semi"
82
+ class="mn-b-small"
69
83
  >
70
84
  <span
71
85
  v-if="orders.state.current.positions.length === 0"
@@ -87,71 +101,81 @@
87
101
  </Block>
88
102
 
89
103
  <Block
104
+ v-if="tabOrderCreate === 'customer'"
90
105
  title="Customer"
91
106
  class="mn-b-semi"
107
+ :actions="[{
108
+ label: '+',
109
+ function: () => openCustomerPopup()
110
+ }]"
92
111
  >
93
- <div class="flex-nowrap flex">
94
- <button class="w-100 bg-main pd-small flex-center flex uppercase t-medium">Select</button>
95
- <button @click="openClientPopup()" class="w-100 bg-main pd-small flex-center flex uppercase t-medium">Add new</button>
96
- </div>
97
-
112
+ <CardUser
113
+ v-if="orders.state.current.customer._id"
114
+ :user="orders.state.current.customer"
115
+ :photo="orders.state.current.customer.profile.photo"
116
+ :name="orders.state.current.customer.profile.name || orders.state.current.customer.phone || orders.state.current.customer.email"
117
+ @click="() => {
118
+ orders.mutations.resetCustomer(orders.state.current.customer)
119
+ }"
120
+ class="bg-white pd-thin radius-medium w-100 mn-b-thin"
121
+ />
122
+ <Feed
123
+ v-else
124
+ :search="{
125
+ placeholder: 'Search customer...',
126
+ class: 'bg-white mn-b-thin'
127
+ }"
128
+ :states="{
129
+ empty: {
130
+ title: 'No Products Found',
131
+ description: 'Currently, there are no such products available.'
132
+ }
133
+ }"
134
+ :store="{
135
+ read: (options) => customers.read(options),
136
+ state: null
137
+ }"
138
+ :options="{
139
+ owner: route.params._id
140
+ }"
141
+ v-slot="{
142
+ items
143
+ }"
144
+ class="bg-grey h-max-20r o-scroll"
145
+ >
146
+ <CardUser
147
+ v-for="(user, index) in items"
148
+ :key="user._id"
149
+ :user="user"
150
+ :photo="user.profile.photo"
151
+ :name="user.profile.name || user.phone || user.email"
152
+ @click="() => {
153
+ orders.state.current.customer = user
154
+ }"
155
+ class="bg-white pd-thin radius-medium w-100 mn-b-thin"
156
+ />
157
+ </Feed>
158
+
98
159
  </Block>
99
160
 
100
- <FormDelivery
101
- v-if="orders.state.current.status !== true"
161
+ <FormDelivery
162
+ v-if="tabOrderCreate === 'delivery'"
102
163
  :order="orders.state.current"
103
164
  />
104
165
 
105
166
  <FormPayment
106
- v-if="orders.state.current.status !== true"
167
+ v-if="tabOrderCreate === 'payment'"
107
168
  :order="orders.state.current"
108
169
  />
109
170
 
110
- <!-- <Feed
111
- :search="true"
112
- :states="{
113
- empty: {
114
- title: 'No Products Found',
115
- description: 'Currently, there are no such products available.'
116
- }
117
- }"
118
- :store="{
119
- read: (options) => products.actions.read(options),
120
- state: null
121
- }"
122
- :options="{
123
- organization: route.params._id
124
- }"
125
- v-slot="{
126
- items
127
- }"
128
- class="bg-grey h-min-20r h-max-20r o-scroll"
129
- >
130
- <CardOrderItem
131
- v-for="(product, index) in items" :key="product._id"
132
- :editable="false"
133
- :product="product"
134
- @click="() => {
135
- let p = { ...product };
136
- p.quantity = 1;
137
- globals.actions.add(orders.state.current.positions, p)
138
- closeProductsPopup();
139
- }"
140
- class="bg-white pd-thin radius-medium w-100 mn-b-thin"
141
- />
142
- </Feed> -->
143
-
144
171
  <Popup
145
- title="Добавить участника"
146
- @close-popup="closeClientPopup"
147
- :isPopupOpen="isOpenClientPopup"
148
- class="bg-white w-min-30r w-max-30r radius-big pd-medium"
172
+ title="Add customer"
173
+ @close-popup="closeCustomerPopup"
174
+ :isPopupOpen="isOpenCustomerPopup"
175
+ :class="'bg-white w-min-30r w-max-30r radius-big pd-medium'"
149
176
  >
150
- <h3 class="mn-b-small">Add New Client</h3>
151
-
152
- <FormClientDetails
153
- :order="orders.state.current"
154
- class="bg-grey"
177
+ <FormAddCustomer
178
+ @callbackCustomer="closeCustomerPopup"
155
179
  />
156
180
  </Popup>
157
181
 
@@ -169,29 +193,34 @@
169
193
  </template>
170
194
 
171
195
  <script setup="props">
172
- // Import Vue functionality
173
196
  import { computed, ref, defineProps, onMounted, reactive, toRefs, watch } from 'vue'
174
- import { useRoute,useRouter } from 'vue-router'
175
-
176
- import Feed from '@pf/src/components/Feed/Feed.vue'
197
+ import { useRoute, useRouter } from 'vue-router'
177
198
 
178
199
  import Field from '@pf/src/components/Field/Field.vue'
179
200
  import Button from "@pf/src/components/Button/Button.vue";
201
+ import Tab from '@pf/src/components/Tab/Tab.vue'
180
202
  import Popup from '@pf/src/components/Popup/Popup.vue';
181
203
  import Block from '@pf/src/components/Block/Block.vue';
204
+ import Feed from '@pf/src/components/Feed/Feed.vue'
182
205
 
183
206
  import CardOrderItem from '@pf/src/modules/orders/components/blocks/CardOrderItem.vue'
184
207
  import CardPosition from '@pf/src/modules/products/components/blocks/CardPosition.vue';
208
+ import CardUser from '@pf/src/modules/users/components/blocks/CardUser.vue'
185
209
 
186
- import FormClientDetails from '@pf/src/modules/orders/components/sections/FormClientDetails.vue'
210
+ import BlockSearch from '@pf/src/modules/globals/components/blocks/BlockSearch.vue'
211
+
212
+ import FormAddCustomer from '@pf/src/modules/orders/components/sections/FormAddCustomer.vue'
187
213
  import FormDelivery from '@pf/src/modules/orders/components/sections/FormDelivery.vue'
188
214
  import FormPayment from '@pf/src/modules/orders/components/sections/FormPayment.vue'
189
215
 
190
216
  // Import your store
191
- import * as auth from '@pf/src/modules/auth/store/auth';
192
217
  import * as globals from '@pf/src/modules/globals/store/globals';
218
+ import * as auth from '@pf/src/modules/auth/store/auth';
193
219
  import * as orders from '@pf/src/modules/orders/store/orders';
194
- import * as products from '@pf/src/modules/products/store/products';
220
+ import * as products from '@pf/src/modules/products/store/products';
221
+
222
+ import customers from '@pf/src/modules/orders/store/customers.store';
223
+
195
224
 
196
225
  // Accessing router
197
226
  const route = useRoute()
@@ -203,6 +232,9 @@
203
232
  }, 0));
204
233
  })
205
234
 
235
+ // Tab
236
+ const tabOrderCreate = ref('positions')
237
+
206
238
  // Popup
207
239
  const isOpenProductsPopup = ref(false);
208
240
 
@@ -214,14 +246,14 @@
214
246
  isOpenProductsPopup.value = false;
215
247
  }
216
248
 
217
- const isOpenClientPopup = ref(false);
249
+ const isOpenCustomerPopup = ref(false);
218
250
 
219
- function openClientPopup() {
220
- isOpenClientPopup.value = true;
251
+ function openCustomerPopup() {
252
+ isOpenCustomerPopup.value = true;
221
253
  }
222
254
 
223
- function closeClientPopup() {
224
- isOpenClientPopup.value = false;
255
+ function closeCustomerPopup() {
256
+ isOpenCustomerPopup.value = false;
225
257
  }
226
258
 
227
259
  // Data
@@ -239,6 +271,11 @@
239
271
  target: route.params._id,
240
272
  }
241
273
 
274
+ orders.state.current.customer = {
275
+ type: 'Customer',
276
+ target: orders.state.current.customer._id || null,
277
+ }
278
+
242
279
  orders.actions.create(orders.state.current)
243
280
  }
244
281
 
@@ -64,8 +64,8 @@
64
64
 
65
65
  <div class="mn-b-small pd-small bg-white radius-small flex-nowrap flex">
66
66
  <div class="w-100">
67
- <h3 class="mn-b-thin">{{order.customer.target.slice(0,8)}}</h3>
68
- <p class="t-truncate">{{order.delivery.address}}</p>
67
+ <h3 class="mn-b-thin">{{order.customer.target.profile.name || order.customer.target.phone || order.customer.target.email || 'No name'}}</h3>
68
+ <p class="t-truncate">{{order.delivery.address || 'Not specified'}}</p>
69
69
  </div>
70
70
 
71
71
  <div class=" w-100 t-right">
@@ -0,0 +1,152 @@
1
+ <template>
2
+ <Block class="pos-relative mn-b-thin">
3
+ <BlockSearch
4
+ v-click-outside="() => {searchUserShow = false}"
5
+ v-if="!dataCustomer.user"
6
+ @search="(event) => { searchUser = event; searchUserShow = true }"
7
+ placeholder="Enter name, phone or email"
8
+ class="bg-white"
9
+ />
10
+ <CardUser
11
+ v-else
12
+ :user="dataCustomer.user"
13
+ :photo="dataCustomer.user.profile.photo"
14
+ :name="dataCustomer.user.profile.name || dataCustomer.user.phone || dataCustomer.user.email"
15
+ @click="() => {
16
+ dataCustomer.user = null
17
+ }"
18
+ class="bg-white pd-thin radius-medium w-100"
19
+ />
20
+
21
+ <div
22
+ v-if="searchUser && searchUserShow && !dataCustomer.user "
23
+ class="mn-t-thin pos-absolute w-100 pos-t-100 pos-l-0 z-index-3 bg-grey pd-small radius-small
24
+ ">
25
+ <Feed
26
+ :states="{
27
+ empty: {
28
+ title: 'No User Found',
29
+ description: 'Currently, there are no such user.'
30
+ }
31
+ }"
32
+ :store="{
33
+ read: (options) => users.actions.read(options),
34
+ state: null
35
+ }"
36
+ :options="{
37
+ search: searchUser
38
+ }"
39
+ :showLoadMore="false"
40
+ v-slot="{
41
+ items
42
+ }"
43
+ class="h-max-20r o-scroll"
44
+ >
45
+ <CardUser
46
+ v-for="(user, index) in items" :key="user._id"
47
+ :user="user"
48
+ :photo="user.profile.photo"
49
+ :name="user.profile.name || user.phone || user.email"
50
+ @click="() => {
51
+ dataCustomer.user = user
52
+ dataCustomer.profile = user.profile
53
+ dataCustomer.phone = user.phone
54
+ dataCustomer.email = user.email
55
+ dataCustomer.socials = user.socials
56
+ }"
57
+ class="bg-white pd-thin radius-medium w-100 mn-b-thin"
58
+ />
59
+ </Feed>
60
+ </div>
61
+ </Block>
62
+
63
+ <FormCustomerDetails
64
+ :customer="dataCustomer"
65
+ class="mn-b-thin bg-grey"
66
+ />
67
+
68
+ <Button
69
+ :submit="addCustomer"
70
+ :callback="callbackCustomer"
71
+ @error="setError"
72
+ class="w-100 pd-small radius-big bg-main t-black uppercase t-medium"
73
+ >
74
+ Add Customer
75
+ </Button>
76
+ </template>
77
+
78
+ <script setup>
79
+ import { ref } from "vue"
80
+ import { useRoute, useRouter } from 'vue-router'
81
+
82
+ import Block from '@pf/src/components/Block/Block.vue'
83
+ import Field from '@pf/src/components/Field/Field.vue'
84
+ import Select from '@pf/src/components/Select/Select.vue'
85
+ import Feed from '@pf/src/components/Feed/Feed.vue'
86
+ import Button from '@pf/src/components/Button/Button.vue'
87
+
88
+ import BlockSearch from '@pf/src/modules/globals/components/blocks/BlockSearch.vue'
89
+
90
+ import CardUser from '@pf/src/modules/users/components/blocks/CardUser.vue'
91
+
92
+ import FormCustomerDetails from '@pf/src/modules/orders/components/sections/FormCustomerDetails.vue'
93
+
94
+ import * as users from '@pf/src/modules/users/store/users';
95
+ import * as auth from '@pf/src/modules/auth/store/auth';
96
+
97
+ import { setError } from '@pf/src/modules/globals/store/globals'
98
+
99
+ import customers from '@pf/src/modules/orders/store/customers.store';
100
+ import customerInitState from "@pf/src/modules/orders/store/models/customer"
101
+
102
+ import clickOutside from '@pf/src/components/FieldPhone/click-outside';
103
+
104
+ // Directives
105
+ let vClickOutside = clickOutside
106
+ // Props
107
+ const props = defineProps({
108
+ order: Object,
109
+ });
110
+ // Emits
111
+ const emits = defineEmits(['callbackCustomer']);
112
+ // Router
113
+ const route = useRoute()
114
+
115
+ let dataCustomer = ref(customerInitState)
116
+
117
+ let searchUser = ref(null)
118
+ let searchUserShow = ref(false)
119
+
120
+ async function addCustomer() {
121
+ let customerData = {
122
+ identity: {
123
+ type: dataCustomer.value.user ? 'User' : 'Visitor',
124
+ target: dataCustomer.value.user ? dataCustomer.value.user._id : null
125
+ },
126
+ owner: {
127
+ type: 'Organization',
128
+ target: route.params._id
129
+ },
130
+ creator: {
131
+ type: 'User',
132
+ target: auth.state.user._id
133
+ },
134
+ phone: dataCustomer.value.phone,
135
+ email: dataCustomer.value.email,
136
+ profile: dataCustomer.value.profile,
137
+ socials: dataCustomer.value.socials
138
+ }
139
+
140
+ try {
141
+ let customer = await customers.create(customerData)
142
+
143
+ dataCustomer.value = customer
144
+ } catch(err) {
145
+ console.log(err)
146
+ }
147
+ }
148
+
149
+ function callbackCustomer() {
150
+ emits('callbackCustomer', dataCustomer.value)
151
+ }
152
+ </script>