@ozdao/martyrs 0.2.523 → 0.2.525

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (311) hide show
  1. package/dist/_virtual/index.cjs +4 -4
  2. package/dist/_virtual/index.js +4 -4
  3. package/dist/_virtual/index2.cjs +4 -4
  4. package/dist/_virtual/index2.js +4 -4
  5. package/dist/community.server.cjs +1 -1
  6. package/dist/community.server.js +1 -1
  7. package/dist/{crud-CC6k6yY5.cjs → crud-DGM6Xa1R.cjs} +1 -1
  8. package/dist/{crud-BIFl1W1i.js → crud-Ed3dcRsC.js} +1 -1
  9. package/dist/events.server.cjs +1 -1
  10. package/dist/events.server.js +1 -1
  11. package/dist/gallery.server.cjs +1 -1
  12. package/dist/gallery.server.js +1 -1
  13. package/dist/{globals.verifier-DFqKQ7hK.js → globals.verifier-BhqUrneb.js} +31 -1
  14. package/dist/{globals.verifier-C0zj_LLo.cjs → globals.verifier-CJ1lr-NW.cjs} +31 -1
  15. package/dist/inventory.server.cjs +3 -3
  16. package/dist/inventory.server.js +3 -3
  17. package/dist/{main-BM3GslOO.cjs → main-4KvvKtzH.cjs} +6 -6
  18. package/dist/{main-Qcn7YlTx.js → main-Bk4xq-K0.js} +45 -37
  19. package/dist/martyrs/src/components/Button/{Button.vue.cjs → Button.vue2.cjs} +2 -2
  20. package/dist/martyrs/src/components/Button/Button.vue2.cjs.map +1 -0
  21. package/dist/martyrs/src/components/Button/{Button.vue.js → Button.vue2.js} +2 -2
  22. package/dist/martyrs/src/components/Button/{Button.vue.cjs.map → Button.vue2.js.map} +1 -1
  23. package/dist/martyrs/src/components/Feed/Feed.vue.cjs +1 -1
  24. package/dist/martyrs/src/components/Feed/Feed.vue.cjs.map +1 -1
  25. package/dist/martyrs/src/components/Feed/Feed.vue.js +1 -1
  26. package/dist/martyrs/src/components/Feed/Feed.vue.js.map +1 -1
  27. package/dist/martyrs/src/components/FieldBig/FieldBig.vue.cjs +1 -1
  28. package/dist/martyrs/src/components/FieldBig/FieldBig.vue.js +1 -1
  29. package/dist/martyrs/src/components/FieldTags/FieldTags.vue.cjs +1 -1
  30. package/dist/martyrs/src/components/FieldTags/FieldTags.vue.js +1 -1
  31. package/dist/martyrs/src/components/Menu/{Menu.vue2.cjs → Menu.vue.cjs} +2 -2
  32. package/dist/martyrs/src/components/Menu/Menu.vue.cjs.map +1 -0
  33. package/dist/martyrs/src/components/Menu/{Menu.vue2.js → Menu.vue.js} +2 -2
  34. package/dist/martyrs/src/components/Menu/Menu.vue.js.map +1 -0
  35. package/dist/martyrs/src/components/Select/{Select.vue2.cjs → Select.vue.cjs} +2 -2
  36. package/dist/martyrs/src/components/Select/{Select.vue2.js.map → Select.vue.cjs.map} +1 -1
  37. package/dist/martyrs/src/components/Select/{Select.vue2.js → Select.vue.js} +2 -2
  38. package/dist/martyrs/src/components/Select/Select.vue.js.map +1 -0
  39. package/dist/martyrs/src/components/Spoiler/{Spoiler.vue2.cjs → Spoiler.vue.cjs} +2 -2
  40. package/dist/martyrs/src/components/Spoiler/{Spoiler.vue2.js.map → Spoiler.vue.cjs.map} +1 -1
  41. package/dist/martyrs/src/components/Spoiler/{Spoiler.vue2.js → Spoiler.vue.js} +2 -2
  42. package/dist/martyrs/src/components/Spoiler/Spoiler.vue.js.map +1 -0
  43. package/dist/martyrs/src/components/Tree/Tree.vue.cjs +19 -33
  44. package/dist/martyrs/src/components/Tree/Tree.vue.cjs.map +1 -1
  45. package/dist/martyrs/src/components/Tree/Tree.vue.js +19 -33
  46. package/dist/martyrs/src/components/Tree/Tree.vue.js.map +1 -1
  47. package/dist/martyrs/src/modules/auth/views/components/pages/EnterPassword.vue.cjs +1 -1
  48. package/dist/martyrs/src/modules/auth/views/components/pages/EnterPassword.vue.js +1 -1
  49. package/dist/martyrs/src/modules/auth/views/components/pages/Invite.vue.cjs +1 -1
  50. package/dist/martyrs/src/modules/auth/views/components/pages/Invite.vue.js +1 -1
  51. package/dist/martyrs/src/modules/auth/views/components/pages/Profile.vue.cjs +2 -2
  52. package/dist/martyrs/src/modules/auth/views/components/pages/Profile.vue.js +2 -2
  53. package/dist/martyrs/src/modules/auth/views/components/pages/ProfileEditAccount.vue.cjs +1 -1
  54. package/dist/martyrs/src/modules/auth/views/components/pages/ProfileEditAccount.vue.js +1 -1
  55. package/dist/martyrs/src/modules/auth/views/components/pages/ProfileEditProfile.vue.cjs +1 -1
  56. package/dist/martyrs/src/modules/auth/views/components/pages/ProfileEditProfile.vue.js +1 -1
  57. package/dist/martyrs/src/modules/auth/views/components/pages/ResetPassword.vue.cjs +1 -1
  58. package/dist/martyrs/src/modules/auth/views/components/pages/ResetPassword.vue.js +1 -1
  59. package/dist/martyrs/src/modules/auth/views/components/pages/SignIn.vue.cjs +1 -1
  60. package/dist/martyrs/src/modules/auth/views/components/pages/SignIn.vue.js +1 -1
  61. package/dist/martyrs/src/modules/auth/views/components/pages/SignUp.vue.cjs +1 -1
  62. package/dist/martyrs/src/modules/auth/views/components/pages/SignUp.vue.js +1 -1
  63. package/dist/martyrs/src/modules/auth/views/components/sections/ProfileEditCredentials.vue.cjs +1 -1
  64. package/dist/martyrs/src/modules/auth/views/components/sections/ProfileEditCredentials.vue.js +1 -1
  65. package/dist/martyrs/src/modules/community/components/layouts/Community.vue.cjs +1 -1
  66. package/dist/martyrs/src/modules/community/components/layouts/Community.vue.js +1 -1
  67. package/dist/martyrs/src/modules/community/components/pages/BlogPost.vue.cjs +1 -1
  68. package/dist/martyrs/src/modules/community/components/pages/BlogPost.vue.js +1 -1
  69. package/dist/martyrs/src/modules/community/components/pages/CreateBlogPost.vue.cjs +2 -2
  70. package/dist/martyrs/src/modules/community/components/pages/CreateBlogPost.vue.js +2 -2
  71. package/dist/martyrs/src/modules/events/components/elements/ButtonCheck.vue.cjs +1 -1
  72. package/dist/martyrs/src/modules/events/components/elements/ButtonCheck.vue.js +1 -1
  73. package/dist/martyrs/src/modules/events/components/elements/ButtonJoin.vue.cjs +1 -1
  74. package/dist/martyrs/src/modules/events/components/elements/ButtonJoin.vue.js +1 -1
  75. package/dist/martyrs/src/modules/events/components/pages/EditEvent.vue.cjs +1 -1
  76. package/dist/martyrs/src/modules/events/components/pages/EditEvent.vue.js +1 -1
  77. package/dist/martyrs/src/modules/events/components/pages/EditEventTickets.vue.cjs +1 -1
  78. package/dist/martyrs/src/modules/events/components/pages/EditEventTickets.vue.js +1 -1
  79. package/dist/martyrs/src/modules/gallery/components/sections/BackofficeGallery.vue.cjs +2 -2
  80. package/dist/martyrs/src/modules/gallery/components/sections/BackofficeGallery.vue.js +2 -2
  81. package/dist/martyrs/src/modules/globals/views/classes/globals.i18n.cjs +1 -1
  82. package/dist/martyrs/src/modules/globals/views/classes/globals.i18n.js +1 -1
  83. package/dist/martyrs/src/modules/globals/views/components/blocks/CardHeader.vue.cjs +1 -1
  84. package/dist/martyrs/src/modules/globals/views/components/blocks/CardHeader.vue.js +1 -1
  85. package/dist/martyrs/src/modules/globals/views/components/blocks/PopupAuth.vue.cjs +1 -1
  86. package/dist/martyrs/src/modules/globals/views/components/blocks/PopupAuth.vue.js +1 -1
  87. package/dist/martyrs/src/modules/globals/views/components/blocks/PopupDateSelector.vue.cjs +2 -2
  88. package/dist/martyrs/src/modules/globals/views/components/blocks/PopupDateSelector.vue.cjs.map +1 -1
  89. package/dist/martyrs/src/modules/globals/views/components/blocks/PopupDateSelector.vue.js +2 -2
  90. package/dist/martyrs/src/modules/globals/views/components/blocks/PopupDateSelector.vue.js.map +1 -1
  91. package/dist/martyrs/src/modules/globals/views/components/layouts/Client.vue.cjs +1 -1
  92. package/dist/martyrs/src/modules/globals/views/components/layouts/Client.vue.js +1 -1
  93. package/dist/martyrs/src/modules/globals/views/components/partials/Header.vue.cjs +2 -2
  94. package/dist/martyrs/src/modules/globals/views/components/partials/Header.vue.js +2 -2
  95. package/dist/martyrs/src/modules/globals/views/components/partials/Navigation.vue.cjs +1 -1
  96. package/dist/martyrs/src/modules/globals/views/components/partials/Navigation.vue.js +1 -1
  97. package/dist/martyrs/src/modules/globals/views/components/partials/NavigationBar.vue.cjs +1 -1
  98. package/dist/martyrs/src/modules/globals/views/components/partials/NavigationBar.vue.js +1 -1
  99. package/dist/martyrs/src/modules/globals/views/store/globals.cjs +14 -2
  100. package/dist/martyrs/src/modules/globals/views/store/globals.cjs.map +1 -1
  101. package/dist/martyrs/src/modules/globals/views/store/globals.js +14 -2
  102. package/dist/martyrs/src/modules/globals/views/store/globals.js.map +1 -1
  103. package/dist/martyrs/src/modules/inventory/components/forms/AdjustmentForm.vue.cjs +2 -2
  104. package/dist/martyrs/src/modules/inventory/components/forms/AdjustmentForm.vue.js +2 -2
  105. package/dist/martyrs/src/modules/inventory/components/forms/ColumnSettingsMenu.vue.cjs +1 -1
  106. package/dist/martyrs/src/modules/inventory/components/forms/ColumnSettingsMenu.vue.js +1 -1
  107. package/dist/martyrs/src/modules/inventory/components/forms/HistoryView.vue.cjs +1 -1
  108. package/dist/martyrs/src/modules/inventory/components/forms/HistoryView.vue.js +1 -1
  109. package/dist/martyrs/src/modules/inventory/components/forms/StockAlertsForm.vue.cjs +2 -2
  110. package/dist/martyrs/src/modules/inventory/components/forms/StockAlertsForm.vue.js +2 -2
  111. package/dist/martyrs/src/modules/inventory/components/pages/Inventory.vue.cjs +1 -1
  112. package/dist/martyrs/src/modules/inventory/components/pages/InventoryEdit.vue.cjs +2 -2
  113. package/dist/martyrs/src/modules/inventory/components/pages/InventoryEdit.vue.js +2 -2
  114. package/dist/martyrs/src/modules/landing/components/sections/SectionGuide.vue.cjs +1 -1
  115. package/dist/martyrs/src/modules/landing/components/sections/SectionGuide.vue.js +1 -1
  116. package/dist/martyrs/src/modules/marketplace/views/components/layouts/Marketplace.vue.cjs +1 -1
  117. package/dist/martyrs/src/modules/marketplace/views/components/layouts/Marketplace.vue.js +1 -1
  118. package/dist/martyrs/src/modules/music/components/cards/AlbumCard.vue.cjs +1 -1
  119. package/dist/martyrs/src/modules/music/components/cards/AlbumCard.vue.js +1 -1
  120. package/dist/martyrs/src/modules/music/components/cards/ArtistCardSmall.vue.cjs +1 -1
  121. package/dist/martyrs/src/modules/music/components/cards/ArtistCardSmall.vue.js +1 -1
  122. package/dist/martyrs/src/modules/music/components/cards/PlaylistCard.vue.cjs +1 -1
  123. package/dist/martyrs/src/modules/music/components/cards/PlaylistCard.vue.js +1 -1
  124. package/dist/martyrs/src/modules/music/components/cards/TrackListCard.vue.cjs +1 -1
  125. package/dist/martyrs/src/modules/music/components/cards/TrackListCard.vue.js +1 -1
  126. package/dist/martyrs/src/modules/music/components/forms/AlbumForm.vue.cjs +2 -2
  127. package/dist/martyrs/src/modules/music/components/forms/AlbumForm.vue.js +2 -2
  128. package/dist/martyrs/src/modules/music/components/forms/ArtistForm.vue.cjs +2 -2
  129. package/dist/martyrs/src/modules/music/components/forms/ArtistForm.vue.js +2 -2
  130. package/dist/martyrs/src/modules/music/components/forms/PlaylistForm.vue.cjs +1 -1
  131. package/dist/martyrs/src/modules/music/components/forms/PlaylistForm.vue.js +1 -1
  132. package/dist/martyrs/src/modules/music/components/forms/SearchForm.vue.cjs +1 -1
  133. package/dist/martyrs/src/modules/music/components/forms/SearchForm.vue.js +1 -1
  134. package/dist/martyrs/src/modules/music/components/forms/TrackForm.vue.cjs +2 -2
  135. package/dist/martyrs/src/modules/music/components/forms/TrackForm.vue.js +2 -2
  136. package/dist/martyrs/src/modules/music/components/pages/Album.vue.cjs +1 -1
  137. package/dist/martyrs/src/modules/music/components/pages/Album.vue.js +1 -1
  138. package/dist/martyrs/src/modules/music/components/pages/Artist.vue.cjs +1 -1
  139. package/dist/martyrs/src/modules/music/components/pages/Artist.vue.js +1 -1
  140. package/dist/martyrs/src/modules/music/components/pages/MusicLibrary.vue.cjs +1 -1
  141. package/dist/martyrs/src/modules/music/components/pages/MusicLibrary.vue.js +1 -1
  142. package/dist/martyrs/src/modules/music/components/pages/Playlist.vue.cjs +1 -1
  143. package/dist/martyrs/src/modules/music/components/pages/Playlist.vue.js +1 -1
  144. package/dist/martyrs/src/modules/music/components/pages/SearchResults.vue.cjs +1 -1
  145. package/dist/martyrs/src/modules/music/components/pages/SearchResults.vue.js +1 -1
  146. package/dist/martyrs/src/modules/music/components/pages/Track.vue.cjs +1 -1
  147. package/dist/martyrs/src/modules/music/components/pages/Track.vue.js +1 -1
  148. package/dist/martyrs/src/modules/music/components/pages/TrackCreate.vue.cjs +1 -1
  149. package/dist/martyrs/src/modules/music/components/pages/TrackCreate.vue.js +1 -1
  150. package/dist/martyrs/src/modules/music/components/player/MusicPlayer.vue.cjs +1 -1
  151. package/dist/martyrs/src/modules/music/components/player/MusicPlayer.vue.js +1 -1
  152. package/dist/martyrs/src/modules/music/router/music.cjs +1 -1
  153. package/dist/martyrs/src/modules/music/router/music.js +1 -1
  154. package/dist/martyrs/src/modules/notifications/notifications.client.cjs +0 -4
  155. package/dist/martyrs/src/modules/notifications/notifications.client.cjs.map +1 -1
  156. package/dist/martyrs/src/modules/notifications/notifications.client.js +0 -4
  157. package/dist/martyrs/src/modules/notifications/notifications.client.js.map +1 -1
  158. package/dist/martyrs/src/modules/orders/components/forms/FormApplicationDetails.vue.cjs +2 -2
  159. package/dist/martyrs/src/modules/orders/components/forms/FormApplicationDetails.vue.js +2 -2
  160. package/dist/martyrs/src/modules/orders/components/forms/FormCustomerDetails.vue.cjs +2 -2
  161. package/dist/martyrs/src/modules/orders/components/forms/FormCustomerDetails.vue.js +2 -2
  162. package/dist/martyrs/src/modules/orders/components/forms/FormSelectCustomer.vue.cjs +1 -1
  163. package/dist/martyrs/src/modules/orders/components/forms/FormSelectCustomer.vue.js +1 -1
  164. package/dist/martyrs/src/modules/orders/components/pages/OrderBackoffice.vue.cjs +2 -2
  165. package/dist/martyrs/src/modules/orders/components/pages/OrderBackoffice.vue.js +2 -2
  166. package/dist/martyrs/src/modules/orders/components/pages/OrderCreate.vue.cjs +1 -1
  167. package/dist/martyrs/src/modules/orders/components/pages/OrderCreate.vue.js +1 -1
  168. package/dist/martyrs/src/modules/orders/components/pages/OrderCreateBackoffice.vue.cjs +1 -1
  169. package/dist/martyrs/src/modules/orders/components/pages/OrderCreateBackoffice.vue.js +1 -1
  170. package/dist/martyrs/src/modules/orders/components/sections/ApplicationDetails.vue.cjs +1 -1
  171. package/dist/martyrs/src/modules/orders/components/sections/ApplicationDetails.vue.js +1 -1
  172. package/dist/martyrs/src/modules/orders/components/sections/CustomerDetails.vue.cjs +1 -1
  173. package/dist/martyrs/src/modules/orders/components/sections/CustomerDetails.vue.js +1 -1
  174. package/dist/martyrs/src/modules/orders/components/sections/FormPayment.vue.cjs +1 -1
  175. package/dist/martyrs/src/modules/orders/components/sections/FormPayment.vue.js +1 -1
  176. package/dist/martyrs/src/modules/organizations/components/blocks/CardDepartment.vue.cjs +1 -1
  177. package/dist/martyrs/src/modules/organizations/components/blocks/CardDepartment.vue.js +1 -1
  178. package/dist/martyrs/src/modules/organizations/components/elements/ButtonToggleMembership.vue.cjs +1 -1
  179. package/dist/martyrs/src/modules/organizations/components/elements/ButtonToggleMembership.vue.js +1 -1
  180. package/dist/martyrs/src/modules/organizations/components/forms/AddExistingMembersForm.vue.cjs +1 -1
  181. package/dist/martyrs/src/modules/organizations/components/forms/AddExistingMembersForm.vue.js +1 -1
  182. package/dist/martyrs/src/modules/organizations/components/forms/DepartmentForm.vue.cjs +2 -2
  183. package/dist/martyrs/src/modules/organizations/components/forms/DepartmentForm.vue.js +2 -2
  184. package/dist/martyrs/src/modules/organizations/components/forms/InviteForm.vue.cjs +1 -1
  185. package/dist/martyrs/src/modules/organizations/components/forms/InviteForm.vue.js +1 -1
  186. package/dist/martyrs/src/modules/organizations/components/pages/Department.vue.cjs +1 -1
  187. package/dist/martyrs/src/modules/organizations/components/pages/Department.vue.js +1 -1
  188. package/dist/martyrs/src/modules/organizations/components/pages/Organization.vue.cjs +1 -1
  189. package/dist/martyrs/src/modules/organizations/components/pages/Organization.vue.js +1 -1
  190. package/dist/martyrs/src/modules/organizations/components/pages/OrganizationBackoffice.vue.cjs +1 -1
  191. package/dist/martyrs/src/modules/organizations/components/pages/OrganizationBackoffice.vue.js +1 -1
  192. package/dist/martyrs/src/modules/organizations/components/pages/OrganizationEdit.vue.cjs +2 -2
  193. package/dist/martyrs/src/modules/organizations/components/pages/OrganizationEdit.vue.js +2 -2
  194. package/dist/martyrs/src/modules/organizations/components/sections/Documents.vue.cjs +1 -1
  195. package/dist/martyrs/src/modules/organizations/components/sections/Documents.vue.js +1 -1
  196. package/dist/martyrs/src/modules/organizations/components/sections/MembersAdd.vue.cjs +2 -2
  197. package/dist/martyrs/src/modules/organizations/components/sections/MembersAdd.vue.js +2 -2
  198. package/dist/martyrs/src/modules/organizations/components/sections/Organizations.vue.cjs +1 -1
  199. package/dist/martyrs/src/modules/organizations/components/sections/Organizations.vue.js +1 -1
  200. package/dist/martyrs/src/modules/organizations/router/organizations.cjs +1 -1
  201. package/dist/martyrs/src/modules/organizations/router/organizations.js +1 -1
  202. package/dist/martyrs/src/modules/pages/views/components/blocks/CardPage.vue.cjs +1 -1
  203. package/dist/martyrs/src/modules/pages/views/components/blocks/CardPage.vue.js +1 -1
  204. package/dist/martyrs/src/modules/pages/views/components/pages/PageEdit.vue.cjs +1 -1
  205. package/dist/martyrs/src/modules/pages/views/components/pages/PageEdit.vue.js +1 -1
  206. package/dist/martyrs/src/modules/pages/views/components/partials/SidebarPages.vue.cjs +1 -1
  207. package/dist/martyrs/src/modules/pages/views/components/partials/SidebarPages.vue.js +1 -1
  208. package/dist/martyrs/src/modules/products/components/pages/Categories.vue.cjs +48 -19
  209. package/dist/martyrs/src/modules/products/components/pages/Categories.vue.cjs.map +1 -1
  210. package/dist/martyrs/src/modules/products/components/pages/Categories.vue.js +48 -19
  211. package/dist/martyrs/src/modules/products/components/pages/Categories.vue.js.map +1 -1
  212. package/dist/martyrs/src/modules/products/components/pages/CategoryEdit.vue.cjs +2 -2
  213. package/dist/martyrs/src/modules/products/components/pages/CategoryEdit.vue.js +2 -2
  214. package/dist/martyrs/src/modules/products/components/pages/Product.vue.cjs +1 -1
  215. package/dist/martyrs/src/modules/products/components/pages/Product.vue.js +1 -1
  216. package/dist/martyrs/src/modules/products/components/pages/ProductEdit.vue.cjs +78 -46
  217. package/dist/martyrs/src/modules/products/components/pages/ProductEdit.vue.cjs.map +1 -1
  218. package/dist/martyrs/src/modules/products/components/pages/ProductEdit.vue.js +78 -46
  219. package/dist/martyrs/src/modules/products/components/pages/ProductEdit.vue.js.map +1 -1
  220. package/dist/martyrs/src/modules/products/components/pages/Products.vue.cjs +1 -2
  221. package/dist/martyrs/src/modules/products/components/pages/Products.vue.cjs.map +1 -1
  222. package/dist/martyrs/src/modules/products/components/pages/Products.vue.js +1 -2
  223. package/dist/martyrs/src/modules/products/components/pages/Products.vue.js.map +1 -1
  224. package/dist/martyrs/src/modules/products/components/sections/EditAttributes.vue.cjs +1 -1
  225. package/dist/martyrs/src/modules/products/components/sections/EditAttributes.vue.js +1 -1
  226. package/dist/martyrs/src/modules/products/components/sections/EditDiscounts.vue.cjs +2 -2
  227. package/dist/martyrs/src/modules/products/components/sections/EditDiscounts.vue.js +2 -2
  228. package/dist/martyrs/src/modules/products/components/sections/EditVariants.vue.cjs +2 -2
  229. package/dist/martyrs/src/modules/products/components/sections/EditVariants.vue.js +2 -2
  230. package/dist/martyrs/src/modules/products/components/sections/FilterProducts.vue.cjs +1 -1
  231. package/dist/martyrs/src/modules/products/components/sections/FilterProducts.vue.js +1 -1
  232. package/dist/martyrs/src/modules/products/components/sections/ProductConfigurator.vue.cjs +1 -1
  233. package/dist/martyrs/src/modules/products/components/sections/ProductConfigurator.vue.js +1 -1
  234. package/dist/martyrs/src/modules/products/components/sections/ProductsRecommended.vue.cjs +1 -1
  235. package/dist/martyrs/src/modules/products/components/sections/ProductsRecommended.vue.js +1 -1
  236. package/dist/martyrs/src/modules/products/components/sections/SectionProduct.vue.cjs +1 -1
  237. package/dist/martyrs/src/modules/products/components/sections/SectionProduct.vue.js +1 -1
  238. package/dist/martyrs/src/modules/products/store/categories.cjs +2 -4
  239. package/dist/martyrs/src/modules/products/store/categories.cjs.map +1 -1
  240. package/dist/martyrs/src/modules/products/store/categories.js +2 -4
  241. package/dist/martyrs/src/modules/products/store/categories.js.map +1 -1
  242. package/dist/martyrs/src/modules/products/store/products.cjs +12 -2
  243. package/dist/martyrs/src/modules/products/store/products.cjs.map +1 -1
  244. package/dist/martyrs/src/modules/products/store/products.js +12 -2
  245. package/dist/martyrs/src/modules/products/store/products.js.map +1 -1
  246. package/dist/martyrs/src/modules/rents/views/components/pages/Gant/GanttToolbar.vue.cjs +1 -1
  247. package/dist/martyrs/src/modules/rents/views/components/pages/Gant/GanttToolbar.vue.js +1 -1
  248. package/dist/martyrs/src/modules/reports/components/sections/FormReport.vue.cjs +2 -2
  249. package/dist/martyrs/src/modules/reports/components/sections/FormReport.vue.js +2 -2
  250. package/dist/martyrs/src/modules/spots/components/blocks/SpotMemberModify.vue.cjs +1 -1
  251. package/dist/martyrs/src/modules/spots/components/blocks/SpotMemberModify.vue.js +1 -1
  252. package/dist/martyrs/src/modules/spots/components/layouts/Spots.vue.cjs +1 -1
  253. package/dist/martyrs/src/modules/spots/components/layouts/Spots.vue.js +1 -1
  254. package/dist/martyrs/src/modules/spots/components/pages/Map.vue.cjs +1 -1
  255. package/dist/martyrs/src/modules/spots/components/pages/Map.vue.js +1 -1
  256. package/dist/martyrs/src/modules/spots/components/pages/Spot.vue.cjs +1 -1
  257. package/dist/martyrs/src/modules/spots/components/pages/Spot.vue.js +1 -1
  258. package/dist/martyrs/src/modules/spots/components/pages/SpotEdit.vue.cjs +2 -2
  259. package/dist/martyrs/src/modules/spots/components/pages/SpotEdit.vue.js +2 -2
  260. package/dist/martyrs/src/modules/spots/components/pages/Spots.vue.cjs +1 -1
  261. package/dist/martyrs/src/modules/spots/components/pages/Spots.vue.cjs.map +1 -1
  262. package/dist/martyrs/src/modules/spots/components/pages/Spots.vue.js +1 -1
  263. package/dist/martyrs/src/modules/spots/components/pages/Spots.vue.js.map +1 -1
  264. package/dist/martyrs/src/modules/spots/components/sections/WorktimeEdit.vue.cjs +2 -2
  265. package/dist/martyrs/src/modules/spots/components/sections/WorktimeEdit.vue.js +2 -2
  266. package/dist/martyrs/src/modules/wallet/views/components/blocks/CryptoDeposit.vue.cjs +1 -1
  267. package/dist/martyrs/src/modules/wallet/views/components/blocks/CryptoDeposit.vue.js +1 -1
  268. package/dist/martyrs/src/modules/wallet/views/components/pages/Wallet.vue.cjs +2 -2
  269. package/dist/martyrs/src/modules/wallet/views/components/pages/Wallet.vue.js +2 -2
  270. package/dist/martyrs.cjs.js +1 -1
  271. package/dist/martyrs.es.js +1 -1
  272. package/dist/music.server.cjs +2 -2
  273. package/dist/music.server.js +2 -2
  274. package/dist/orders.server.cjs +3 -3
  275. package/dist/orders.server.js +3 -3
  276. package/dist/organizations.server.cjs +2 -2
  277. package/dist/organizations.server.js +2 -2
  278. package/dist/products.server.cjs +121 -45
  279. package/dist/products.server.js +121 -45
  280. package/dist/{queryProcessor-B_X680wC.cjs → queryProcessor-DMSc5-r6.cjs} +17 -20
  281. package/dist/{queryProcessor-CVcLPEnv.js → queryProcessor-rukV_SBd.js} +17 -20
  282. package/dist/rents.server.cjs +2 -2
  283. package/dist/rents.server.js +2 -2
  284. package/dist/spots.server.cjs +1 -1
  285. package/dist/spots.server.js +1 -1
  286. package/dist/{web-DVR8m2fm.js → web-BS-4Xl3x.js} +1 -1
  287. package/dist/{web-B0cfxzgu.cjs → web-CjndIDjT.cjs} +1 -1
  288. package/package.json +1 -1
  289. package/src/components/Feed/Feed.vue +1 -1
  290. package/src/components/Tree/Tree.vue +27 -15
  291. package/src/modules/globals/controllers/classes/globals.validator.js +32 -1
  292. package/src/modules/globals/controllers/utils/queryProcessor.js +27 -20
  293. package/src/modules/globals/views/components/blocks/PopupDateSelector.vue +1 -1
  294. package/src/modules/globals/views/store/globals.js +19 -2
  295. package/src/modules/notifications/notifications.client.js +0 -5
  296. package/src/modules/products/components/pages/Categories.vue +60 -22
  297. package/src/modules/products/components/pages/ProductEdit.vue +45 -21
  298. package/src/modules/products/components/pages/Products.vue +0 -1
  299. package/src/modules/products/controllers/categories.controller.js +107 -44
  300. package/src/modules/products/controllers/products.controller.js +34 -1
  301. package/src/modules/products/middlewares/categories.verifier.js +9 -2
  302. package/src/modules/products/middlewares/variants.verifier.js +2 -2
  303. package/src/modules/products/store/categories.js +2 -4
  304. package/src/modules/products/store/products.js +10 -0
  305. package/src/modules/spots/components/pages/Spots.vue +1 -1
  306. package/dist/martyrs/src/components/Button/Button.vue.js.map +0 -1
  307. package/dist/martyrs/src/components/Menu/Menu.vue2.cjs.map +0 -1
  308. package/dist/martyrs/src/components/Menu/Menu.vue2.js.map +0 -1
  309. package/dist/martyrs/src/components/Select/Select.vue2.cjs.map +0 -1
  310. package/dist/martyrs/src/components/Spoiler/Spoiler.vue2.cjs.map +0 -1
  311. package/src/modules/products/TASKS.MD +0 -1
@@ -5,14 +5,14 @@ import { a as applyEngagementSchema } from "./engagement.schema-Dh1adRsn.js";
5
5
  import { m as middlewareIndexFactory } from "./index-_Edcmck_.js";
6
6
  import { m as mailing } from "./mailing-DuEFRsa3.js";
7
7
  import { uuid } from "uuidv4";
8
- import { q as queryProcessorGlobals } from "./queryProcessor-CVcLPEnv.js";
8
+ import { q as queryProcessorGlobals } from "./queryProcessor-rukV_SBd.js";
9
9
  import { Types } from "mongoose";
10
10
  import { g as globalsabac } from "./globals.abac-DNdtSYop.js";
11
11
  import { C as CacheNamespaced } from "./globals.logger-VRHh-WUW.js";
12
12
  import { a as addUserStatusFields, b as addMembersQuantity } from "./addUserStatusFields-Cc-JpmPo.js";
13
13
  import jwt from "jsonwebtoken";
14
14
  import * as googleMapsServicesJs from "@googlemaps/google-maps-services-js";
15
- import { V as Verifier, a as Validator } from "./globals.verifier-DFqKQ7hK.js";
15
+ import { V as Verifier, a as Validator } from "./globals.verifier-BhqUrneb.js";
16
16
  const controllerFactory$2 = (db) => {
17
17
  const Department = db.department;
18
18
  const readOne = (req, res) => {
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
3
  const globals_logger = require("./globals.logger-BuW7JHMY.cjs");
4
- const queryProcessor = require("./queryProcessor-B_X680wC.cjs");
4
+ const queryProcessor = require("./queryProcessor-DMSc5-r6.cjs");
5
5
  const OpenAI = require("openai");
6
6
  const mongoose = require("mongoose");
7
7
  const common_schema = require("./common.schema-BzFEVNn3.cjs");
@@ -10,8 +10,8 @@ const metadata_schema = require("./metadata.schema-RlxNv46L.cjs");
10
10
  const ownership_schema = require("./ownership.schema-D1p5XSpt.cjs");
11
11
  const authJwt = require("./authJwt-BIZ2GIfT.cjs");
12
12
  const globals_abac = require("./globals.abac-CPXLas7N.cjs");
13
- const globals_verifier = require("./globals.verifier-C0zj_LLo.cjs");
14
- const crud = require("./crud-CC6k6yY5.cjs");
13
+ const globals_verifier = require("./globals.verifier-CJ1lr-NW.cjs");
14
+ const crud = require("./crud-DGM6Xa1R.cjs");
15
15
  const abac = require("./abac-DOyUjhee.cjs");
16
16
  const controllerFactory$1 = (db) => {
17
17
  const Category = db.category;
@@ -27,19 +27,15 @@ const controllerFactory$1 = (db) => {
27
27
  return slug;
28
28
  };
29
29
  const buildTreeFromUrl = (categories, sortParam = "order", sortOrder = "asc") => {
30
- console.log("cat buildtree", categories);
31
30
  categories.sort((a, b) => a.url.localeCompare(b.url));
32
31
  const tree = [];
33
32
  const nodeMap = /* @__PURE__ */ new Map();
34
- console.log("cat buildtree", categories);
35
33
  categories.forEach((cat) => {
36
34
  const node = { ...cat, children: [] };
37
35
  nodeMap.set(cat.url, node);
38
36
  const parentUrl = cat.url.substring(0, cat.url.lastIndexOf("/"));
39
- console.log("cat parent buildtree", parentUrl);
40
37
  if (parentUrl && nodeMap.has(parentUrl)) {
41
38
  nodeMap.get(parentUrl).children.push(node);
42
- console.log("cat nodeMap buildtree", nodeMap);
43
39
  } else if (cat.level === 0) {
44
40
  tree.push(node);
45
41
  }
@@ -57,33 +53,68 @@ const controllerFactory$1 = (db) => {
57
53
  return tree;
58
54
  };
59
55
  const updateCategoryPaths = async (categoryId, newParentId = null) => {
60
- const category = await Category.findById(categoryId);
61
- if (!category) return;
62
- let newPath = [];
56
+ const [category, parent] = await Promise.all([
57
+ Category.findById(categoryId).lean(),
58
+ newParentId ? Category.findById(newParentId).lean() : null
59
+ ]);
60
+ if (!category) {
61
+ console.log("Category not found");
62
+ return;
63
+ }
64
+ const oldUrl = category.url;
65
+ const oldLevel = category.level;
66
+ const oldParent = category.parent ? category.parent.toString() : null;
67
+ const newParentStr = newParentId ? newParentId.toString() : null;
68
+ if (oldParent === newParentStr) {
69
+ console.log("Parent not changed, skipping path update");
70
+ return;
71
+ }
63
72
  let newLevel = 0;
64
73
  let newUrl = `/${category.slug}`;
65
- if (newParentId) {
66
- const parent = await Category.findById(newParentId);
67
- if (parent) {
68
- newPath = [...parent.path, newParentId];
69
- newLevel = parent.level + 1;
70
- newUrl = `${parent.url}/${category.slug}`;
71
- }
74
+ if (parent) {
75
+ newLevel = parent.level + 1;
76
+ newUrl = `${parent.url}/${category.slug}`;
72
77
  }
73
- await Category.updateOne(
74
- { _id: categoryId },
75
- { path: newPath, level: newLevel, url: newUrl }
76
- );
77
- const oldUrlPattern = new RegExp(`^${category.url}/`);
78
- await Category.updateMany(
79
- { url: oldUrlPattern },
80
- [{
81
- $set: {
82
- url: { $concat: [newUrl, { $substr: ["$url", { $strLenCP: category.url }, -1] }] },
83
- level: { $add: ["$level", newLevel - category.level] }
78
+ if (oldUrl === newUrl) {
79
+ console.log("URL not changed, skipping update");
80
+ return;
81
+ }
82
+ console.log(`URL change: "${oldUrl}" -> "${newUrl}"`);
83
+ const bulkOps = [];
84
+ bulkOps.push({
85
+ updateOne: {
86
+ filter: { _id: categoryId },
87
+ update: {
88
+ $set: {
89
+ level: newLevel,
90
+ url: newUrl,
91
+ parent: newParentId
92
+ }
84
93
  }
85
- }]
86
- );
94
+ }
95
+ });
96
+ const levelDiff = newLevel - oldLevel;
97
+ const oldUrlLength = oldUrl.length;
98
+ bulkOps.push({
99
+ updateMany: {
100
+ filter: { url: { $regex: `^${oldUrl.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}/` } },
101
+ update: [
102
+ {
103
+ $set: {
104
+ url: {
105
+ $concat: [
106
+ newUrl,
107
+ { $substr: ["$url", oldUrlLength, -1] }
108
+ ]
109
+ },
110
+ level: { $add: ["$level", levelDiff] }
111
+ }
112
+ }
113
+ ]
114
+ }
115
+ });
116
+ const result = await Category.bulkWrite(bulkOps, { ordered: false });
117
+ console.log(`Updated ${result.modifiedCount} documents`);
87
118
  };
88
119
  return {
89
120
  async read(req, res) {
@@ -191,13 +222,11 @@ const controllerFactory$1 = (db) => {
191
222
  data.creator ||= { type: "user", target: req.userId };
192
223
  data.owner ||= req.query.owner ? { type: "organization", target: req.query.owner } : { type: "platform", target: null };
193
224
  const slug = await generateSlug(data.name, data.parent);
194
- let path = [];
195
225
  let level = 0;
196
226
  let url = `/${slug}`;
197
227
  if (data.parent) {
198
228
  const parent = await Category.findById(data.parent);
199
229
  if (!parent) throw new Error("Parent category not found");
200
- path = [...parent.path, data.parent];
201
230
  level = parent.level + 1;
202
231
  url = `${parent.url}/${slug}`;
203
232
  }
@@ -207,7 +236,6 @@ const controllerFactory$1 = (db) => {
207
236
  ...data,
208
237
  slug,
209
238
  url,
210
- path,
211
239
  level,
212
240
  order
213
241
  });
@@ -249,24 +277,39 @@ const controllerFactory$1 = (db) => {
249
277
  }
250
278
  },
251
279
  async updateOrder(req, res) {
280
+ const startTime = Date.now();
252
281
  try {
253
- const { categories } = req.verifiedBody;
254
- const bulkOps = categories.map((cat) => ({
282
+ console.log("📥 BACKEND RECEIVED:", JSON.stringify(req.body, null, 2));
283
+ const { movedCategory, affectedCategories } = req.verifiedBody;
284
+ if (!affectedCategories || affectedCategories.length === 0) {
285
+ return res.json({ message: "No changes to update" });
286
+ }
287
+ const bulkOps = affectedCategories.map((cat) => ({
255
288
  updateOne: {
256
289
  filter: { _id: cat._id },
257
290
  update: { $set: { order: cat.order } }
258
291
  }
259
292
  }));
260
- const movedCategories = categories.filter((cat) => cat.parent !== void 0);
261
- for (const cat of movedCategories) {
262
- await updateCategoryPaths(cat._id, cat.parent);
293
+ console.log(`Starting bulkWrite with ${bulkOps.length} operations`);
294
+ const bulkStart = Date.now();
295
+ await Category.bulkWrite(bulkOps, { ordered: false });
296
+ console.log(`BulkWrite completed in ${Date.now() - bulkStart}ms`);
297
+ if (movedCategory) {
298
+ const pathStart = Date.now();
299
+ console.log("Starting updateCategoryPaths...");
300
+ await updateCategoryPaths(movedCategory._id, movedCategory.newParent);
301
+ console.log(`updateCategoryPaths completed in ${Date.now() - pathStart}ms`);
263
302
  }
264
- await Category.bulkWrite(bulkOps);
303
+ const cacheStart = Date.now();
265
304
  await cache.delByTags(["categories"]);
266
- logger.info(`Categories order updated: ${categories.map((c) => c._id).join(", ")}`);
305
+ console.log(`Cache clear completed in ${Date.now() - cacheStart}ms`);
306
+ const totalTime = Date.now() - startTime;
307
+ console.log(`=== UPDATE ORDER COMPLETE in ${totalTime}ms ===`);
308
+ logger.info(`Categories order updated: ${affectedCategories.length} items in ${totalTime}ms`);
267
309
  res.json({ message: "Order updated successfully" });
268
310
  } catch (err) {
269
311
  logger.error(`Category order update error: ${err.message}`);
312
+ console.error("Full error:", err);
270
313
  res.status(500).json({ message: "Failed to update categories order" });
271
314
  }
272
315
  },
@@ -720,13 +763,39 @@ const productLookupConfigs = {
720
763
  };
721
764
  const controllerFactory = (db) => {
722
765
  const Product = db.product;
766
+ const Variant = db.variant;
767
+ const generateSKU = () => {
768
+ const timestamp = Date.now().toString(36);
769
+ const random = Math.random().toString(36).substring(2, 5);
770
+ return `VAR-${timestamp}-${random}`.toUpperCase();
771
+ };
723
772
  const Create = async (req, res) => {
724
773
  try {
725
774
  const productData = {
726
775
  ...req.body,
727
776
  category: req.body.category?.map((cat) => cat._id) || []
728
777
  };
729
- const product = await new Product(productData).save();
778
+ const { defaultVariant, ...cleanProductData } = productData;
779
+ const product = await new Product(cleanProductData).save();
780
+ if (defaultVariant && defaultVariant.price !== null && defaultVariant.price > 0) {
781
+ const variantData = {
782
+ product: product._id,
783
+ name: product.name,
784
+ price: parseFloat(defaultVariant.price),
785
+ quantity: parseInt(defaultVariant.quantity) || 1,
786
+ unit: defaultVariant.unit || "pcs",
787
+ status: product.status,
788
+ // используем статус из товара
789
+ sku: generateSKU(),
790
+ owner: product.owner,
791
+ creator: product.creator,
792
+ images: [],
793
+ cost: 0,
794
+ ingredients: [],
795
+ attributes: []
796
+ };
797
+ await new Variant(variantData).save();
798
+ }
730
799
  return res.status(201).json(product);
731
800
  } catch (err) {
732
801
  console.log(err);
@@ -1212,9 +1281,16 @@ const verifierFactory$1 = function(db) {
1212
1281
  order: { rule: "optional", validator: globals_verifier.Validator.schema().number() }
1213
1282
  };
1214
1283
  const orderBodyValidatorConfig = {
1215
- categories: {
1284
+ movedCategory: {
1285
+ rule: "optional",
1286
+ validator: globals_verifier.Validator.schema().object({
1287
+ _id: globals_verifier.Validator.schema().string().required(),
1288
+ newParent: globals_verifier.Validator.schema().oneOfTypes(["string", "null"])
1289
+ })
1290
+ },
1291
+ affectedCategories: {
1216
1292
  rule: "optional",
1217
- validator: globals_verifier.Validator.schema().array().required(),
1293
+ validator: globals_verifier.Validator.schema().array(),
1218
1294
  default: []
1219
1295
  }
1220
1296
  };
@@ -1373,7 +1449,7 @@ const verifierFactory = function(db) {
1373
1449
  },
1374
1450
  description: {
1375
1451
  rule: "optional",
1376
- validator: globals_verifier.Validator.schema().string().max(5e3, "Description must not exceed 5000 characters")
1452
+ validator: globals_verifier.Validator.schema().string().length({ max: 5e3 }, "Description must not exceed 5000 characters")
1377
1453
  },
1378
1454
  sku: {
1379
1455
  rule: "optional",
@@ -1440,7 +1516,7 @@ const verifierFactory = function(db) {
1440
1516
  },
1441
1517
  description: {
1442
1518
  rule: "optional",
1443
- validator: globals_verifier.Validator.schema().string().max(5e3, "Description must not exceed 5000 characters")
1519
+ validator: globals_verifier.Validator.schema().string().length({ max: 5e3 }, "Description must not exceed 5000 characters")
1444
1520
  },
1445
1521
  sku: {
1446
1522
  rule: "optional",
@@ -1,5 +1,5 @@
1
1
  import { L as LoggerNamespaced, C as CacheNamespaced } from "./globals.logger-VRHh-WUW.js";
2
- import { q as queryProcessorGlobals } from "./queryProcessor-CVcLPEnv.js";
2
+ import { q as queryProcessorGlobals } from "./queryProcessor-rukV_SBd.js";
3
3
  import OpenAI from "openai";
4
4
  import { Types } from "mongoose";
5
5
  import { a as applyCommonSchema } from "./common.schema-Bw1O5_2Q.js";
@@ -8,8 +8,8 @@ import { a as applyMetadataSchema } from "./metadata.schema-CWmcDJN7.js";
8
8
  import { a as applyOwnershipSchema } from "./ownership.schema-BqH4v5vH.js";
9
9
  import { m as middlewareFactory } from "./authJwt-J1csaMWA.js";
10
10
  import { g as globalsabac } from "./globals.abac-DNdtSYop.js";
11
- import { a as Validator, V as Verifier } from "./globals.verifier-DFqKQ7hK.js";
12
- import { C as CRUD } from "./crud-BIFl1W1i.js";
11
+ import { a as Validator, V as Verifier } from "./globals.verifier-BhqUrneb.js";
12
+ import { C as CRUD } from "./crud-Ed3dcRsC.js";
13
13
  import { A as ABAC } from "./abac-CnJsrv8S.js";
14
14
  const controllerFactory$1 = (db) => {
15
15
  const Category = db.category;
@@ -25,19 +25,15 @@ const controllerFactory$1 = (db) => {
25
25
  return slug;
26
26
  };
27
27
  const buildTreeFromUrl = (categories, sortParam = "order", sortOrder = "asc") => {
28
- console.log("cat buildtree", categories);
29
28
  categories.sort((a, b) => a.url.localeCompare(b.url));
30
29
  const tree = [];
31
30
  const nodeMap = /* @__PURE__ */ new Map();
32
- console.log("cat buildtree", categories);
33
31
  categories.forEach((cat) => {
34
32
  const node = { ...cat, children: [] };
35
33
  nodeMap.set(cat.url, node);
36
34
  const parentUrl = cat.url.substring(0, cat.url.lastIndexOf("/"));
37
- console.log("cat parent buildtree", parentUrl);
38
35
  if (parentUrl && nodeMap.has(parentUrl)) {
39
36
  nodeMap.get(parentUrl).children.push(node);
40
- console.log("cat nodeMap buildtree", nodeMap);
41
37
  } else if (cat.level === 0) {
42
38
  tree.push(node);
43
39
  }
@@ -55,33 +51,68 @@ const controllerFactory$1 = (db) => {
55
51
  return tree;
56
52
  };
57
53
  const updateCategoryPaths = async (categoryId, newParentId = null) => {
58
- const category = await Category.findById(categoryId);
59
- if (!category) return;
60
- let newPath = [];
54
+ const [category, parent] = await Promise.all([
55
+ Category.findById(categoryId).lean(),
56
+ newParentId ? Category.findById(newParentId).lean() : null
57
+ ]);
58
+ if (!category) {
59
+ console.log("Category not found");
60
+ return;
61
+ }
62
+ const oldUrl = category.url;
63
+ const oldLevel = category.level;
64
+ const oldParent = category.parent ? category.parent.toString() : null;
65
+ const newParentStr = newParentId ? newParentId.toString() : null;
66
+ if (oldParent === newParentStr) {
67
+ console.log("Parent not changed, skipping path update");
68
+ return;
69
+ }
61
70
  let newLevel = 0;
62
71
  let newUrl = `/${category.slug}`;
63
- if (newParentId) {
64
- const parent = await Category.findById(newParentId);
65
- if (parent) {
66
- newPath = [...parent.path, newParentId];
67
- newLevel = parent.level + 1;
68
- newUrl = `${parent.url}/${category.slug}`;
69
- }
72
+ if (parent) {
73
+ newLevel = parent.level + 1;
74
+ newUrl = `${parent.url}/${category.slug}`;
70
75
  }
71
- await Category.updateOne(
72
- { _id: categoryId },
73
- { path: newPath, level: newLevel, url: newUrl }
74
- );
75
- const oldUrlPattern = new RegExp(`^${category.url}/`);
76
- await Category.updateMany(
77
- { url: oldUrlPattern },
78
- [{
79
- $set: {
80
- url: { $concat: [newUrl, { $substr: ["$url", { $strLenCP: category.url }, -1] }] },
81
- level: { $add: ["$level", newLevel - category.level] }
76
+ if (oldUrl === newUrl) {
77
+ console.log("URL not changed, skipping update");
78
+ return;
79
+ }
80
+ console.log(`URL change: "${oldUrl}" -> "${newUrl}"`);
81
+ const bulkOps = [];
82
+ bulkOps.push({
83
+ updateOne: {
84
+ filter: { _id: categoryId },
85
+ update: {
86
+ $set: {
87
+ level: newLevel,
88
+ url: newUrl,
89
+ parent: newParentId
90
+ }
82
91
  }
83
- }]
84
- );
92
+ }
93
+ });
94
+ const levelDiff = newLevel - oldLevel;
95
+ const oldUrlLength = oldUrl.length;
96
+ bulkOps.push({
97
+ updateMany: {
98
+ filter: { url: { $regex: `^${oldUrl.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}/` } },
99
+ update: [
100
+ {
101
+ $set: {
102
+ url: {
103
+ $concat: [
104
+ newUrl,
105
+ { $substr: ["$url", oldUrlLength, -1] }
106
+ ]
107
+ },
108
+ level: { $add: ["$level", levelDiff] }
109
+ }
110
+ }
111
+ ]
112
+ }
113
+ });
114
+ const result = await Category.bulkWrite(bulkOps, { ordered: false });
115
+ console.log(`Updated ${result.modifiedCount} documents`);
85
116
  };
86
117
  return {
87
118
  async read(req, res) {
@@ -189,13 +220,11 @@ const controllerFactory$1 = (db) => {
189
220
  data.creator ||= { type: "user", target: req.userId };
190
221
  data.owner ||= req.query.owner ? { type: "organization", target: req.query.owner } : { type: "platform", target: null };
191
222
  const slug = await generateSlug(data.name, data.parent);
192
- let path = [];
193
223
  let level = 0;
194
224
  let url = `/${slug}`;
195
225
  if (data.parent) {
196
226
  const parent = await Category.findById(data.parent);
197
227
  if (!parent) throw new Error("Parent category not found");
198
- path = [...parent.path, data.parent];
199
228
  level = parent.level + 1;
200
229
  url = `${parent.url}/${slug}`;
201
230
  }
@@ -205,7 +234,6 @@ const controllerFactory$1 = (db) => {
205
234
  ...data,
206
235
  slug,
207
236
  url,
208
- path,
209
237
  level,
210
238
  order
211
239
  });
@@ -247,24 +275,39 @@ const controllerFactory$1 = (db) => {
247
275
  }
248
276
  },
249
277
  async updateOrder(req, res) {
278
+ const startTime = Date.now();
250
279
  try {
251
- const { categories } = req.verifiedBody;
252
- const bulkOps = categories.map((cat) => ({
280
+ console.log("📥 BACKEND RECEIVED:", JSON.stringify(req.body, null, 2));
281
+ const { movedCategory, affectedCategories } = req.verifiedBody;
282
+ if (!affectedCategories || affectedCategories.length === 0) {
283
+ return res.json({ message: "No changes to update" });
284
+ }
285
+ const bulkOps = affectedCategories.map((cat) => ({
253
286
  updateOne: {
254
287
  filter: { _id: cat._id },
255
288
  update: { $set: { order: cat.order } }
256
289
  }
257
290
  }));
258
- const movedCategories = categories.filter((cat) => cat.parent !== void 0);
259
- for (const cat of movedCategories) {
260
- await updateCategoryPaths(cat._id, cat.parent);
291
+ console.log(`Starting bulkWrite with ${bulkOps.length} operations`);
292
+ const bulkStart = Date.now();
293
+ await Category.bulkWrite(bulkOps, { ordered: false });
294
+ console.log(`BulkWrite completed in ${Date.now() - bulkStart}ms`);
295
+ if (movedCategory) {
296
+ const pathStart = Date.now();
297
+ console.log("Starting updateCategoryPaths...");
298
+ await updateCategoryPaths(movedCategory._id, movedCategory.newParent);
299
+ console.log(`updateCategoryPaths completed in ${Date.now() - pathStart}ms`);
261
300
  }
262
- await Category.bulkWrite(bulkOps);
301
+ const cacheStart = Date.now();
263
302
  await cache.delByTags(["categories"]);
264
- logger.info(`Categories order updated: ${categories.map((c) => c._id).join(", ")}`);
303
+ console.log(`Cache clear completed in ${Date.now() - cacheStart}ms`);
304
+ const totalTime = Date.now() - startTime;
305
+ console.log(`=== UPDATE ORDER COMPLETE in ${totalTime}ms ===`);
306
+ logger.info(`Categories order updated: ${affectedCategories.length} items in ${totalTime}ms`);
265
307
  res.json({ message: "Order updated successfully" });
266
308
  } catch (err) {
267
309
  logger.error(`Category order update error: ${err.message}`);
310
+ console.error("Full error:", err);
268
311
  res.status(500).json({ message: "Failed to update categories order" });
269
312
  }
270
313
  },
@@ -718,13 +761,39 @@ const productLookupConfigs = {
718
761
  };
719
762
  const controllerFactory = (db) => {
720
763
  const Product = db.product;
764
+ const Variant = db.variant;
765
+ const generateSKU = () => {
766
+ const timestamp = Date.now().toString(36);
767
+ const random = Math.random().toString(36).substring(2, 5);
768
+ return `VAR-${timestamp}-${random}`.toUpperCase();
769
+ };
721
770
  const Create = async (req, res) => {
722
771
  try {
723
772
  const productData = {
724
773
  ...req.body,
725
774
  category: req.body.category?.map((cat) => cat._id) || []
726
775
  };
727
- const product = await new Product(productData).save();
776
+ const { defaultVariant, ...cleanProductData } = productData;
777
+ const product = await new Product(cleanProductData).save();
778
+ if (defaultVariant && defaultVariant.price !== null && defaultVariant.price > 0) {
779
+ const variantData = {
780
+ product: product._id,
781
+ name: product.name,
782
+ price: parseFloat(defaultVariant.price),
783
+ quantity: parseInt(defaultVariant.quantity) || 1,
784
+ unit: defaultVariant.unit || "pcs",
785
+ status: product.status,
786
+ // используем статус из товара
787
+ sku: generateSKU(),
788
+ owner: product.owner,
789
+ creator: product.creator,
790
+ images: [],
791
+ cost: 0,
792
+ ingredients: [],
793
+ attributes: []
794
+ };
795
+ await new Variant(variantData).save();
796
+ }
728
797
  return res.status(201).json(product);
729
798
  } catch (err) {
730
799
  console.log(err);
@@ -1210,9 +1279,16 @@ const verifierFactory$1 = function(db) {
1210
1279
  order: { rule: "optional", validator: Validator.schema().number() }
1211
1280
  };
1212
1281
  const orderBodyValidatorConfig = {
1213
- categories: {
1282
+ movedCategory: {
1283
+ rule: "optional",
1284
+ validator: Validator.schema().object({
1285
+ _id: Validator.schema().string().required(),
1286
+ newParent: Validator.schema().oneOfTypes(["string", "null"])
1287
+ })
1288
+ },
1289
+ affectedCategories: {
1214
1290
  rule: "optional",
1215
- validator: Validator.schema().array().required(),
1291
+ validator: Validator.schema().array(),
1216
1292
  default: []
1217
1293
  }
1218
1294
  };
@@ -1371,7 +1447,7 @@ const verifierFactory = function(db) {
1371
1447
  },
1372
1448
  description: {
1373
1449
  rule: "optional",
1374
- validator: Validator.schema().string().max(5e3, "Description must not exceed 5000 characters")
1450
+ validator: Validator.schema().string().length({ max: 5e3 }, "Description must not exceed 5000 characters")
1375
1451
  },
1376
1452
  sku: {
1377
1453
  rule: "optional",
@@ -1438,7 +1514,7 @@ const verifierFactory = function(db) {
1438
1514
  },
1439
1515
  description: {
1440
1516
  rule: "optional",
1441
- validator: Validator.schema().string().max(5e3, "Description must not exceed 5000 characters")
1517
+ validator: Validator.schema().string().length({ max: 5e3 }, "Description must not exceed 5000 characters")
1442
1518
  },
1443
1519
  sku: {
1444
1520
  rule: "optional",
@@ -62,44 +62,41 @@ function getFilterDate(dateStart, dateEnd, fieldNames = { start: "createdAt", en
62
62
  }
63
63
  return matchStage.$and.length > 0 ? [{ $match: matchStage }] : [];
64
64
  }
65
- function createSearchQuery(search, options = {}) {
65
+ function getSearchOptions(search, options = {}) {
66
66
  if (!search) {
67
- return {};
67
+ return [];
68
68
  }
69
69
  const fields = options.fields || ["name"];
70
70
  const allowDotNotation = options.allowDotNotation || false;
71
+ const escapeRegex = (str) => str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
71
72
  let regexPattern = "";
72
73
  if (allowDotNotation) {
73
74
  const parts = search.split(".");
74
75
  if (parts.length === 2) {
75
76
  regexPattern = parts.map(function(part) {
76
- return part.substr(0, part.length - 1) + ".{1}";
77
+ return escapeRegex(part);
77
78
  }).join("\\.");
78
79
  } else {
79
- regexPattern = search.substr(0, search.length - 1) + ".{1}";
80
+ regexPattern = escapeRegex(search);
80
81
  }
81
82
  } else {
82
- regexPattern = search.substr(0, search.length - 1) + ".{1}";
83
+ regexPattern = escapeRegex(search);
83
84
  }
85
+ let query;
84
86
  if (fields.length === 1) {
85
- return {
87
+ query = {
86
88
  [fields[0]]: { $regex: regexPattern, $options: "i" }
87
89
  };
90
+ } else {
91
+ query = {
92
+ $or: fields.map(function(field) {
93
+ return {
94
+ [field]: { $regex: regexPattern, $options: "i" }
95
+ };
96
+ })
97
+ };
88
98
  }
89
- return {
90
- $or: fields.map(function(field) {
91
- return {
92
- [field]: { $regex: regexPattern, $options: "i" }
93
- };
94
- })
95
- };
96
- }
97
- function getSearchOptions(search, options) {
98
- const query = createSearchQuery(search, options);
99
- if (Object.keys(query).length) {
100
- return [{ $match: query }];
101
- }
102
- return [];
99
+ return [{ $match: query }];
103
100
  }
104
101
  function getTagsOptions(tags) {
105
102
  if (tags) {