@ozdao/martyrs 0.2.505 → 0.2.507
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.
- package/dist/_virtual/index.cjs +4 -4
- package/dist/_virtual/index.js +4 -4
- package/dist/_virtual/index2.cjs +4 -4
- package/dist/_virtual/index2.js +4 -4
- package/dist/auth.server.cjs +1 -1
- package/dist/auth.server.js +1 -1
- package/dist/builder.cjs +52 -60
- package/dist/builder.js +52 -60
- package/dist/chats.server.cjs +1 -1
- package/dist/chats.server.js +1 -1
- package/dist/events.server.cjs +1 -1
- package/dist/events.server.js +1 -1
- package/dist/{mailing-q7sR8gCV.cjs → mailing-Bs9ThyVZ.cjs} +1 -24
- package/dist/{mailing-C11EYWm-.js → mailing-DzlhsxCC.js} +1 -24
- package/dist/main-AWSb_d2P.cjs +11 -0
- package/dist/{main-CJm5myDI.js → main-Dq-UfO4G.js} +2562 -2477
- package/dist/martyrs/src/components/Button/Button.vue2.cjs +1 -1
- package/dist/martyrs/src/components/Button/Button.vue2.js +1 -1
- package/dist/martyrs/src/components/Checkbox/Checkbox.vue.cjs +3 -3
- package/dist/martyrs/src/components/Checkbox/Checkbox.vue.cjs.map +1 -1
- package/dist/martyrs/src/components/Checkbox/Checkbox.vue.js +3 -3
- package/dist/martyrs/src/components/Checkbox/Checkbox.vue.js.map +1 -1
- package/dist/martyrs/src/components/Feed/Carousel.vue.cjs +1 -1
- package/dist/martyrs/src/components/Feed/Carousel.vue.js +1 -1
- package/dist/martyrs/src/components/Feed/Feed.vue.cjs +15 -46
- package/dist/martyrs/src/components/Feed/Feed.vue.cjs.map +1 -1
- package/dist/martyrs/src/components/Feed/Feed.vue.js +22 -53
- package/dist/martyrs/src/components/Feed/Feed.vue.js.map +1 -1
- package/dist/martyrs/src/components/Field/Field.vue.cjs +14 -6
- package/dist/martyrs/src/components/Field/Field.vue.cjs.map +1 -1
- package/dist/martyrs/src/components/Field/Field.vue.js +14 -6
- package/dist/martyrs/src/components/Field/Field.vue.js.map +1 -1
- package/dist/martyrs/src/components/FieldBig/FieldBig.vue.cjs +58 -11
- package/dist/martyrs/src/components/FieldBig/FieldBig.vue.cjs.map +1 -1
- package/dist/martyrs/src/components/FieldBig/FieldBig.vue.js +60 -13
- package/dist/martyrs/src/components/FieldBig/FieldBig.vue.js.map +1 -1
- package/dist/martyrs/src/components/FieldPhone/FieldPhone.vue.cjs +1 -1
- package/dist/martyrs/src/components/FieldPhone/FieldPhone.vue.cjs.map +1 -1
- package/dist/martyrs/src/components/FieldPhone/FieldPhone.vue.js +1 -1
- package/dist/martyrs/src/components/FieldPhone/FieldPhone.vue.js.map +1 -1
- package/dist/martyrs/src/components/FieldTags/FieldTags.vue.cjs +1 -1
- package/dist/martyrs/src/components/FieldTags/FieldTags.vue.js +1 -1
- package/dist/martyrs/src/components/Loader/{Loader.vue2.cjs → Loader.vue.cjs} +2 -2
- package/dist/martyrs/src/components/Loader/{Loader.vue2.js.map → Loader.vue.cjs.map} +1 -1
- package/dist/martyrs/src/components/Loader/{Loader.vue2.js → Loader.vue.js} +2 -2
- package/dist/martyrs/src/components/Loader/Loader.vue.js.map +1 -0
- package/dist/martyrs/src/components/LocationMarker/LocationMarker.vue2.cjs +1 -1
- package/dist/martyrs/src/components/LocationMarker/LocationMarker.vue2.js +1 -1
- package/dist/martyrs/src/components/Menu/{Menu.vue2.cjs → Menu.vue.cjs} +2 -2
- package/dist/martyrs/src/components/Menu/Menu.vue.cjs.map +1 -0
- package/dist/martyrs/src/components/Menu/{Menu.vue2.js → Menu.vue.js} +2 -2
- package/dist/martyrs/src/components/Menu/Menu.vue.js.map +1 -0
- package/dist/martyrs/src/components/PhotoViewer/PhotoViewer.vue.cjs +2 -2
- package/dist/martyrs/src/components/PhotoViewer/PhotoViewer.vue.cjs.map +1 -1
- package/dist/martyrs/src/components/PhotoViewer/PhotoViewer.vue.js +2 -2
- package/dist/martyrs/src/components/PhotoViewer/PhotoViewer.vue.js.map +1 -1
- package/dist/martyrs/src/components/UploadImageMultiple/UploadImageMultiple.vue.cjs +1 -1
- package/dist/martyrs/src/components/UploadImageMultiple/UploadImageMultiple.vue.js +1 -1
- package/dist/martyrs/src/modules/auth/views/components/pages/Profile.vue.cjs +3 -3
- package/dist/martyrs/src/modules/auth/views/components/pages/Profile.vue.cjs.map +1 -1
- package/dist/martyrs/src/modules/auth/views/components/pages/Profile.vue.js +3 -3
- package/dist/martyrs/src/modules/auth/views/components/pages/Profile.vue.js.map +1 -1
- package/dist/martyrs/src/modules/auth/views/components/pages/ProfileEdit.vue.cjs +42 -10
- package/dist/martyrs/src/modules/auth/views/components/pages/ProfileEdit.vue.cjs.map +1 -1
- package/dist/martyrs/src/modules/auth/views/components/pages/ProfileEdit.vue.js +44 -12
- package/dist/martyrs/src/modules/auth/views/components/pages/ProfileEdit.vue.js.map +1 -1
- package/dist/martyrs/src/modules/auth/views/components/pages/ProfileEditAccount.vue.cjs +11 -15
- package/dist/martyrs/src/modules/auth/views/components/pages/ProfileEditAccount.vue.cjs.map +1 -1
- package/dist/martyrs/src/modules/auth/views/components/pages/ProfileEditAccount.vue.js +21 -25
- package/dist/martyrs/src/modules/auth/views/components/pages/ProfileEditAccount.vue.js.map +1 -1
- package/dist/martyrs/src/modules/auth/views/components/pages/ProfileEditProfile.vue.cjs +12 -16
- package/dist/martyrs/src/modules/auth/views/components/pages/ProfileEditProfile.vue.cjs.map +1 -1
- package/dist/martyrs/src/modules/auth/views/components/pages/ProfileEditProfile.vue.js +33 -37
- package/dist/martyrs/src/modules/auth/views/components/pages/ProfileEditProfile.vue.js.map +1 -1
- package/dist/martyrs/src/modules/auth/views/components/pages/ProfileEditSidebar.vue.cjs +13 -9
- package/dist/martyrs/src/modules/auth/views/components/pages/ProfileEditSidebar.vue.cjs.map +1 -1
- package/dist/martyrs/src/modules/auth/views/components/pages/ProfileEditSidebar.vue.js +13 -9
- package/dist/martyrs/src/modules/auth/views/components/pages/ProfileEditSidebar.vue.js.map +1 -1
- package/dist/martyrs/src/modules/auth/views/router/users.cjs +0 -4
- package/dist/martyrs/src/modules/auth/views/router/users.cjs.map +1 -1
- package/dist/martyrs/src/modules/auth/views/router/users.js +0 -4
- package/dist/martyrs/src/modules/auth/views/router/users.js.map +1 -1
- package/dist/martyrs/src/modules/community/components/pages/BlogPost.vue.cjs +1 -1
- package/dist/martyrs/src/modules/community/components/pages/BlogPost.vue.js +1 -1
- package/dist/martyrs/src/modules/community/components/pages/CreateBlogPost.vue.cjs +1 -1
- package/dist/martyrs/src/modules/community/components/pages/CreateBlogPost.vue.js +1 -1
- package/dist/martyrs/src/modules/community/components/pages/Posts.vue.cjs +431 -0
- package/dist/martyrs/src/modules/community/components/pages/Posts.vue.cjs.map +1 -0
- package/dist/martyrs/src/modules/community/components/pages/Posts.vue.js +431 -0
- package/dist/martyrs/src/modules/community/components/pages/Posts.vue.js.map +1 -0
- package/dist/martyrs/src/modules/community/router/blogposts.cjs +17 -0
- package/dist/martyrs/src/modules/community/router/blogposts.cjs.map +1 -1
- package/dist/martyrs/src/modules/community/router/blogposts.js +17 -0
- package/dist/martyrs/src/modules/community/router/blogposts.js.map +1 -1
- package/dist/martyrs/src/modules/events/components/pages/EditEvent.vue.cjs +1 -1
- package/dist/martyrs/src/modules/events/components/pages/EditEvent.vue.js +1 -1
- package/dist/martyrs/src/modules/events/components/pages/Event.vue.cjs +1 -3
- package/dist/martyrs/src/modules/events/components/pages/Event.vue.cjs.map +1 -1
- package/dist/martyrs/src/modules/events/components/pages/Event.vue.js +1 -3
- package/dist/martyrs/src/modules/events/components/pages/Event.vue.js.map +1 -1
- package/dist/martyrs/src/modules/events/components/pages/EventsBackoffice.vue.cjs +1 -1
- package/dist/martyrs/src/modules/events/components/pages/EventsBackoffice.vue.cjs.map +1 -1
- package/dist/martyrs/src/modules/events/components/pages/EventsBackoffice.vue.js +1 -1
- package/dist/martyrs/src/modules/events/components/pages/EventsBackoffice.vue.js.map +1 -1
- package/dist/martyrs/src/modules/events/components/sections/Feed.vue.cjs +1 -1
- package/dist/martyrs/src/modules/events/components/sections/Feed.vue.js +1 -1
- package/dist/martyrs/src/modules/events/components/sections/List.vue.cjs +1 -1
- package/dist/martyrs/src/modules/events/components/sections/List.vue.js +1 -1
- package/dist/martyrs/src/modules/globals/views/classes/globals.i18n.cjs +1 -1
- package/dist/martyrs/src/modules/globals/views/classes/globals.i18n.js +1 -1
- package/dist/martyrs/src/modules/globals/views/classes/globals.websocket.cjs +4 -6
- package/dist/martyrs/src/modules/globals/views/classes/globals.websocket.cjs.map +1 -1
- package/dist/martyrs/src/modules/globals/views/classes/globals.websocket.js +4 -6
- package/dist/martyrs/src/modules/globals/views/classes/globals.websocket.js.map +1 -1
- package/dist/martyrs/src/modules/globals/views/components/blocks/{BlockMultiselect.vue2.cjs → BlockMultiselect.vue.cjs} +2 -2
- package/dist/martyrs/src/modules/globals/views/components/blocks/{BlockMultiselect.vue2.js.map → BlockMultiselect.vue.cjs.map} +1 -1
- package/dist/martyrs/src/modules/globals/views/components/blocks/{BlockMultiselect.vue2.js → BlockMultiselect.vue.js} +2 -2
- package/dist/martyrs/src/modules/globals/views/components/blocks/BlockMultiselect.vue.js.map +1 -0
- package/dist/martyrs/src/modules/globals/views/components/blocks/Card.vue.cjs +5 -2
- package/dist/martyrs/src/modules/globals/views/components/blocks/Card.vue.cjs.map +1 -1
- package/dist/martyrs/src/modules/globals/views/components/blocks/Card.vue.js +6 -3
- package/dist/martyrs/src/modules/globals/views/components/blocks/Card.vue.js.map +1 -1
- package/dist/martyrs/src/modules/globals/views/components/blocks/CardHeader.vue.cjs +1 -1
- package/dist/martyrs/src/modules/globals/views/components/blocks/CardHeader.vue.js +1 -1
- package/dist/martyrs/src/modules/globals/views/components/blocks/PopupDateSelector.vue.cjs +1 -1
- package/dist/martyrs/src/modules/globals/views/components/blocks/PopupDateSelector.vue.js +1 -1
- package/dist/martyrs/src/modules/globals/views/components/layouts/Client.vue.cjs +2 -3
- package/dist/martyrs/src/modules/globals/views/components/layouts/Client.vue.cjs.map +1 -1
- package/dist/martyrs/src/modules/globals/views/components/layouts/Client.vue.js +2 -3
- package/dist/martyrs/src/modules/globals/views/components/layouts/Client.vue.js.map +1 -1
- package/dist/martyrs/src/modules/globals/views/components/sections/Filters.vue2.cjs +324 -0
- package/dist/martyrs/src/modules/globals/views/components/sections/Filters.vue2.cjs.map +1 -0
- package/dist/martyrs/src/modules/globals/views/components/sections/Filters.vue2.js +324 -0
- package/dist/martyrs/src/modules/globals/views/components/sections/Filters.vue2.js.map +1 -0
- package/dist/martyrs/src/modules/icons/entities/IconLock.vue.cjs +32 -0
- package/dist/martyrs/src/modules/icons/entities/IconLock.vue.cjs.map +1 -0
- package/dist/martyrs/src/modules/icons/entities/IconLock.vue.js +32 -0
- package/dist/martyrs/src/modules/icons/entities/IconLock.vue.js.map +1 -0
- package/dist/martyrs/src/modules/icons/icons.client.cjs +2 -0
- package/dist/martyrs/src/modules/icons/icons.client.cjs.map +1 -1
- package/dist/martyrs/src/modules/icons/icons.client.js +116 -114
- package/dist/martyrs/src/modules/icons/icons.client.js.map +1 -1
- package/dist/martyrs/src/modules/icons/pages/IconsPage.vue.cjs +5 -3
- package/dist/martyrs/src/modules/icons/pages/IconsPage.vue.cjs.map +1 -1
- package/dist/martyrs/src/modules/icons/pages/IconsPage.vue.js +117 -115
- package/dist/martyrs/src/modules/icons/pages/IconsPage.vue.js.map +1 -1
- package/dist/martyrs/src/modules/inventory/components/pages/Inventory.vue.cjs +1 -1
- package/dist/martyrs/src/modules/landing/components/sections/SubscribeNewsletter.vue.cjs +11 -36
- package/dist/martyrs/src/modules/landing/components/sections/SubscribeNewsletter.vue.cjs.map +1 -1
- package/dist/martyrs/src/modules/landing/components/sections/SubscribeNewsletter.vue.js +11 -36
- package/dist/martyrs/src/modules/landing/components/sections/SubscribeNewsletter.vue.js.map +1 -1
- package/dist/martyrs/src/modules/landing/landing.client.cjs +3 -0
- package/dist/martyrs/src/modules/landing/landing.client.cjs.map +1 -1
- package/dist/martyrs/src/modules/landing/landing.client.js +3 -0
- package/dist/martyrs/src/modules/landing/landing.client.js.map +1 -1
- package/dist/martyrs/src/modules/landing/locales/en.cjs +12 -0
- package/dist/martyrs/src/modules/landing/locales/en.cjs.map +1 -0
- package/dist/martyrs/src/modules/landing/locales/en.js +12 -0
- package/dist/martyrs/src/modules/landing/locales/en.js.map +1 -0
- package/dist/martyrs/src/modules/landing/locales/index.cjs +10 -0
- package/dist/martyrs/src/modules/landing/locales/index.cjs.map +1 -0
- package/dist/martyrs/src/modules/landing/locales/index.js +10 -0
- package/dist/martyrs/src/modules/landing/locales/index.js.map +1 -0
- package/dist/martyrs/src/modules/landing/locales/ru.cjs +12 -0
- package/dist/martyrs/src/modules/landing/locales/ru.cjs.map +1 -0
- package/dist/martyrs/src/modules/landing/locales/ru.js +12 -0
- package/dist/martyrs/src/modules/landing/locales/ru.js.map +1 -0
- package/dist/martyrs/src/modules/marketplace/views/components/sections/SectionMenu.vue.cjs +1 -1
- package/dist/martyrs/src/modules/marketplace/views/components/sections/SectionMenu.vue.js +1 -1
- package/dist/martyrs/src/modules/music/components/forms/AlbumForm.vue.cjs +1 -1
- package/dist/martyrs/src/modules/music/components/forms/AlbumForm.vue.js +1 -1
- package/dist/martyrs/src/modules/music/components/forms/ArtistForm.vue.cjs +2 -2
- package/dist/martyrs/src/modules/music/components/forms/ArtistForm.vue.js +2 -2
- package/dist/martyrs/src/modules/music/components/forms/PlaylistForm.vue.cjs +1 -1
- package/dist/martyrs/src/modules/music/components/forms/PlaylistForm.vue.js +1 -1
- package/dist/martyrs/src/modules/music/components/forms/TrackForm.vue.cjs +1 -1
- package/dist/martyrs/src/modules/music/components/forms/TrackForm.vue.js +1 -1
- package/dist/martyrs/src/modules/music/components/pages/Album.vue.cjs +2 -2
- package/dist/martyrs/src/modules/music/components/pages/Album.vue.cjs.map +1 -1
- package/dist/martyrs/src/modules/music/components/pages/Album.vue.js +2 -2
- package/dist/martyrs/src/modules/music/components/pages/Album.vue.js.map +1 -1
- package/dist/martyrs/src/modules/music/components/pages/Artist.vue.cjs +1 -1
- package/dist/martyrs/src/modules/music/components/pages/Artist.vue.js +1 -1
- package/dist/martyrs/src/modules/music/components/pages/Playlist.vue.cjs +2 -2
- package/dist/martyrs/src/modules/music/components/pages/Playlist.vue.cjs.map +1 -1
- package/dist/martyrs/src/modules/music/components/pages/Playlist.vue.js +2 -2
- package/dist/martyrs/src/modules/music/components/pages/Playlist.vue.js.map +1 -1
- package/dist/martyrs/src/modules/music/components/pages/SearchResults.vue.cjs +1 -1
- package/dist/martyrs/src/modules/music/components/pages/SearchResults.vue.js +1 -1
- package/dist/martyrs/src/modules/music/components/pages/Track.vue.cjs +2 -2
- package/dist/martyrs/src/modules/music/components/pages/Track.vue.cjs.map +1 -1
- package/dist/martyrs/src/modules/music/components/pages/Track.vue.js +2 -2
- package/dist/martyrs/src/modules/music/components/pages/Track.vue.js.map +1 -1
- package/dist/martyrs/src/modules/music/components/pages/TrackCreate.vue.cjs +1 -1
- package/dist/martyrs/src/modules/music/components/pages/TrackCreate.vue.js +1 -1
- package/dist/martyrs/src/modules/music/router/music.cjs +2 -4
- package/dist/martyrs/src/modules/music/router/music.cjs.map +1 -1
- package/dist/martyrs/src/modules/music/router/music.js +2 -4
- package/dist/martyrs/src/modules/music/router/music.js.map +1 -1
- package/dist/martyrs/src/modules/orders/components/blocks/CardApplication.vue.cjs +86 -0
- package/dist/martyrs/src/modules/orders/components/blocks/CardApplication.vue.cjs.map +1 -0
- package/dist/martyrs/src/modules/orders/components/blocks/CardApplication.vue.js +86 -0
- package/dist/martyrs/src/modules/orders/components/blocks/CardApplication.vue.js.map +1 -0
- package/dist/martyrs/src/modules/orders/components/blocks/CardCustomer.vue.cjs +103 -0
- package/dist/martyrs/src/modules/orders/components/blocks/CardCustomer.vue.cjs.map +1 -0
- package/dist/martyrs/src/modules/orders/components/blocks/CardCustomer.vue.js +103 -0
- package/dist/martyrs/src/modules/orders/components/blocks/CardCustomer.vue.js.map +1 -0
- package/dist/martyrs/src/modules/orders/components/elements/FieldSubscribeNewsletter.vue.cjs +194 -0
- package/dist/martyrs/src/modules/orders/components/elements/FieldSubscribeNewsletter.vue.cjs.map +1 -0
- package/dist/martyrs/src/modules/orders/components/elements/FieldSubscribeNewsletter.vue.js +194 -0
- package/dist/martyrs/src/modules/orders/components/elements/FieldSubscribeNewsletter.vue.js.map +1 -0
- package/dist/martyrs/src/modules/orders/components/forms/FormApplicationDetails.vue.cjs +138 -0
- package/dist/martyrs/src/modules/orders/components/forms/FormApplicationDetails.vue.cjs.map +1 -0
- package/dist/martyrs/src/modules/orders/components/forms/FormApplicationDetails.vue.js +138 -0
- package/dist/martyrs/src/modules/orders/components/forms/FormApplicationDetails.vue.js.map +1 -0
- package/dist/martyrs/src/modules/orders/components/forms/FormCustomerDetails.vue.cjs +189 -0
- package/dist/martyrs/src/modules/orders/components/forms/FormCustomerDetails.vue.cjs.map +1 -0
- package/dist/martyrs/src/modules/orders/components/forms/FormCustomerDetails.vue.js +189 -0
- package/dist/martyrs/src/modules/orders/components/forms/FormCustomerDetails.vue.js.map +1 -0
- package/dist/martyrs/src/modules/orders/components/forms/FormSelectCustomer.vue.cjs +173 -0
- package/dist/martyrs/src/modules/orders/components/forms/FormSelectCustomer.vue.cjs.map +1 -0
- package/dist/martyrs/src/modules/orders/components/forms/FormSelectCustomer.vue.js +173 -0
- package/dist/martyrs/src/modules/orders/components/forms/FormSelectCustomer.vue.js.map +1 -0
- package/dist/martyrs/src/modules/orders/components/pages/Applications.vue.cjs +233 -0
- package/dist/martyrs/src/modules/orders/components/pages/Applications.vue.cjs.map +1 -0
- package/dist/martyrs/src/modules/orders/components/pages/Applications.vue.js +233 -0
- package/dist/martyrs/src/modules/orders/components/pages/Applications.vue.js.map +1 -0
- package/dist/martyrs/src/modules/orders/components/pages/Customers.vue.cjs +234 -0
- package/dist/martyrs/src/modules/orders/components/pages/Customers.vue.cjs.map +1 -0
- package/dist/martyrs/src/modules/orders/components/pages/Customers.vue.js +234 -0
- package/dist/martyrs/src/modules/orders/components/pages/Customers.vue.js.map +1 -0
- package/dist/martyrs/src/modules/orders/components/pages/OrderCreate.vue.cjs +9 -8
- package/dist/martyrs/src/modules/orders/components/pages/OrderCreate.vue.cjs.map +1 -1
- package/dist/martyrs/src/modules/orders/components/pages/OrderCreate.vue.js +9 -8
- package/dist/martyrs/src/modules/orders/components/pages/OrderCreate.vue.js.map +1 -1
- package/dist/martyrs/src/modules/orders/components/pages/OrderCreateBackoffice.vue.cjs +8 -82
- package/dist/martyrs/src/modules/orders/components/pages/OrderCreateBackoffice.vue.cjs.map +1 -1
- package/dist/martyrs/src/modules/orders/components/pages/OrderCreateBackoffice.vue.js +9 -83
- package/dist/martyrs/src/modules/orders/components/pages/OrderCreateBackoffice.vue.js.map +1 -1
- package/dist/martyrs/src/modules/orders/components/sections/ApplicationDetails.vue.cjs +119 -0
- package/dist/martyrs/src/modules/orders/components/sections/ApplicationDetails.vue.cjs.map +1 -0
- package/dist/martyrs/src/modules/orders/components/sections/ApplicationDetails.vue.js +119 -0
- package/dist/martyrs/src/modules/orders/components/sections/ApplicationDetails.vue.js.map +1 -0
- package/dist/martyrs/src/modules/orders/components/sections/CustomerDetails.vue.cjs +139 -0
- package/dist/martyrs/src/modules/orders/components/sections/CustomerDetails.vue.cjs.map +1 -0
- package/dist/martyrs/src/modules/orders/components/sections/CustomerDetails.vue.js +139 -0
- package/dist/martyrs/src/modules/orders/components/sections/CustomerDetails.vue.js.map +1 -0
- package/dist/martyrs/src/modules/orders/components/sections/FormDelivery.vue.cjs +1 -3
- package/dist/martyrs/src/modules/orders/components/sections/FormDelivery.vue.cjs.map +1 -1
- package/dist/martyrs/src/modules/orders/components/sections/FormDelivery.vue.js +1 -3
- package/dist/martyrs/src/modules/orders/components/sections/FormDelivery.vue.js.map +1 -1
- package/dist/martyrs/src/modules/orders/locales/en.cjs +38 -0
- package/dist/martyrs/src/modules/orders/locales/en.cjs.map +1 -0
- package/dist/martyrs/src/modules/orders/locales/en.js +38 -0
- package/dist/martyrs/src/modules/orders/locales/en.js.map +1 -0
- package/dist/martyrs/src/modules/orders/locales/index.cjs +10 -0
- package/dist/martyrs/src/modules/orders/locales/index.cjs.map +1 -0
- package/dist/martyrs/src/modules/orders/locales/index.js +10 -0
- package/dist/martyrs/src/modules/orders/locales/index.js.map +1 -0
- package/dist/martyrs/src/modules/orders/locales/ru.cjs +38 -0
- package/dist/martyrs/src/modules/orders/locales/ru.cjs.map +1 -0
- package/dist/martyrs/src/modules/orders/locales/ru.js +38 -0
- package/dist/martyrs/src/modules/orders/locales/ru.js.map +1 -0
- package/dist/martyrs/src/modules/orders/orders.client.cjs +78 -3
- package/dist/martyrs/src/modules/orders/orders.client.cjs.map +1 -1
- package/dist/martyrs/src/modules/orders/orders.client.js +80 -5
- package/dist/martyrs/src/modules/orders/orders.client.js.map +1 -1
- package/dist/martyrs/src/modules/orders/router/applications.router.cjs +17 -0
- package/dist/martyrs/src/modules/orders/router/applications.router.cjs.map +1 -0
- package/dist/martyrs/src/modules/orders/router/applications.router.js +17 -0
- package/dist/martyrs/src/modules/orders/router/applications.router.js.map +1 -0
- package/dist/martyrs/src/modules/orders/router/customers.router.cjs +18 -0
- package/dist/martyrs/src/modules/orders/router/customers.router.cjs.map +1 -0
- package/dist/martyrs/src/modules/orders/router/customers.router.js +18 -0
- package/dist/martyrs/src/modules/orders/router/customers.router.js.map +1 -0
- package/dist/martyrs/src/modules/orders/store/applications.cjs +4 -42
- package/dist/martyrs/src/modules/orders/store/applications.cjs.map +1 -1
- package/dist/martyrs/src/modules/orders/store/applications.js +3 -41
- package/dist/martyrs/src/modules/orders/store/applications.js.map +1 -1
- package/dist/martyrs/src/modules/orders/store/models/application.cjs +20 -0
- package/dist/martyrs/src/modules/orders/store/models/application.cjs.map +1 -0
- package/dist/martyrs/src/modules/orders/store/models/application.js +20 -0
- package/dist/martyrs/src/modules/orders/store/models/application.js.map +1 -0
- package/dist/martyrs/src/modules/orders/store/models/customer.cjs +13 -1
- package/dist/martyrs/src/modules/orders/store/models/customer.cjs.map +1 -1
- package/dist/martyrs/src/modules/orders/store/models/customer.js +13 -1
- package/dist/martyrs/src/modules/orders/store/models/customer.js.map +1 -1
- package/dist/martyrs/src/modules/organizations/components/pages/DepartmentEdit.vue.cjs +1 -1
- package/dist/martyrs/src/modules/organizations/components/pages/DepartmentEdit.vue.js +1 -1
- package/dist/martyrs/src/modules/organizations/components/pages/Members.vue.cjs +1 -1
- package/dist/martyrs/src/modules/organizations/components/pages/Members.vue.js +1 -1
- package/dist/martyrs/src/modules/organizations/components/pages/Organization.vue.cjs +18 -194
- package/dist/martyrs/src/modules/organizations/components/pages/Organization.vue.cjs.map +1 -1
- package/dist/martyrs/src/modules/organizations/components/pages/Organization.vue.js +19 -195
- package/dist/martyrs/src/modules/organizations/components/pages/Organization.vue.js.map +1 -1
- package/dist/martyrs/src/modules/organizations/components/pages/OrganizationBackoffice.vue.cjs +1 -1
- package/dist/martyrs/src/modules/organizations/components/pages/OrganizationBackoffice.vue.js +1 -1
- package/dist/martyrs/src/modules/organizations/components/pages/Organizations.vue.cjs +1 -1
- package/dist/martyrs/src/modules/organizations/components/pages/Organizations.vue.cjs.map +1 -1
- package/dist/martyrs/src/modules/organizations/components/pages/Organizations.vue.js +1 -1
- package/dist/martyrs/src/modules/organizations/components/pages/Organizations.vue.js.map +1 -1
- package/dist/martyrs/src/modules/organizations/components/sections/DetailsTabSection.vue.cjs +2 -11
- package/dist/martyrs/src/modules/organizations/components/sections/DetailsTabSection.vue.cjs.map +1 -1
- package/dist/martyrs/src/modules/organizations/components/sections/DetailsTabSection.vue.js +6 -15
- package/dist/martyrs/src/modules/organizations/components/sections/DetailsTabSection.vue.js.map +1 -1
- package/dist/martyrs/src/modules/organizations/components/sections/Documents.vue.cjs +1 -1
- package/dist/martyrs/src/modules/organizations/components/sections/Documents.vue.js +1 -1
- package/dist/martyrs/src/modules/organizations/components/sections/Organizations.vue.cjs +1 -1
- package/dist/martyrs/src/modules/organizations/components/sections/Organizations.vue.js +1 -1
- package/dist/martyrs/src/modules/organizations/configs/navigation.organization.config.cjs +85 -89
- package/dist/martyrs/src/modules/organizations/configs/navigation.organization.config.cjs.map +1 -1
- package/dist/martyrs/src/modules/organizations/configs/navigation.organization.config.js +92 -96
- package/dist/martyrs/src/modules/organizations/configs/navigation.organization.config.js.map +1 -1
- package/dist/martyrs/src/modules/organizations/router/organizations.cjs +5 -1
- package/dist/martyrs/src/modules/organizations/router/organizations.cjs.map +1 -1
- package/dist/martyrs/src/modules/organizations/router/organizations.js +5 -1
- package/dist/martyrs/src/modules/organizations/router/organizations.js.map +1 -1
- package/dist/martyrs/src/modules/pages/views/components/blocks/CardPage.vue.cjs +1 -1
- package/dist/martyrs/src/modules/pages/views/components/blocks/CardPage.vue.js +1 -1
- package/dist/martyrs/src/modules/pages/views/components/pages/Page.vue.cjs +3 -6
- package/dist/martyrs/src/modules/pages/views/components/pages/Page.vue.cjs.map +1 -1
- package/dist/martyrs/src/modules/pages/views/components/pages/Page.vue.js +3 -6
- package/dist/martyrs/src/modules/pages/views/components/pages/Page.vue.js.map +1 -1
- package/dist/martyrs/src/modules/products/components/blocks/CardCategory.vue.cjs +1 -1
- package/dist/martyrs/src/modules/products/components/blocks/CardCategory.vue.cjs.map +1 -1
- package/dist/martyrs/src/modules/products/components/blocks/CardCategory.vue.js +1 -1
- package/dist/martyrs/src/modules/products/components/blocks/CardCategory.vue.js.map +1 -1
- package/dist/martyrs/src/modules/products/components/blocks/ProductImages.vue.cjs +2 -2
- package/dist/martyrs/src/modules/products/components/blocks/ProductImages.vue.cjs.map +1 -1
- package/dist/martyrs/src/modules/products/components/blocks/ProductImages.vue.js +2 -2
- package/dist/martyrs/src/modules/products/components/blocks/ProductImages.vue.js.map +1 -1
- package/dist/martyrs/src/modules/products/components/elements/Image360.vue.cjs +1 -1
- package/dist/martyrs/src/modules/products/components/elements/Image360.vue.js +1 -1
- package/dist/martyrs/src/modules/products/components/pages/Categories.vue.cjs +22 -19
- package/dist/martyrs/src/modules/products/components/pages/Categories.vue.cjs.map +1 -1
- package/dist/martyrs/src/modules/products/components/pages/Categories.vue.js +22 -19
- package/dist/martyrs/src/modules/products/components/pages/Categories.vue.js.map +1 -1
- package/dist/martyrs/src/modules/products/components/pages/CategoryEdit.vue.cjs +27 -18
- package/dist/martyrs/src/modules/products/components/pages/CategoryEdit.vue.cjs.map +1 -1
- package/dist/martyrs/src/modules/products/components/pages/CategoryEdit.vue.js +27 -18
- package/dist/martyrs/src/modules/products/components/pages/CategoryEdit.vue.js.map +1 -1
- package/dist/martyrs/src/modules/products/components/pages/Product.vue.cjs +1 -1
- package/dist/martyrs/src/modules/products/components/pages/Product.vue.js +1 -1
- package/dist/martyrs/src/modules/products/components/pages/ProductEdit.vue.cjs +1 -1
- package/dist/martyrs/src/modules/products/components/pages/ProductEdit.vue.js +1 -1
- package/dist/martyrs/src/modules/products/components/pages/ProductRecommmendation.vue.cjs +1 -1
- package/dist/martyrs/src/modules/products/components/pages/ProductRecommmendation.vue.js +1 -1
- package/dist/martyrs/src/modules/products/components/pages/Products.vue.cjs +361 -106
- package/dist/martyrs/src/modules/products/components/pages/Products.vue.cjs.map +1 -1
- package/dist/martyrs/src/modules/products/components/pages/Products.vue.js +379 -124
- package/dist/martyrs/src/modules/products/components/pages/Products.vue.js.map +1 -1
- package/dist/martyrs/src/modules/products/components/sections/EditVariants.vue.cjs +20 -6
- package/dist/martyrs/src/modules/products/components/sections/EditVariants.vue.cjs.map +1 -1
- package/dist/martyrs/src/modules/products/components/sections/EditVariants.vue.js +20 -6
- package/dist/martyrs/src/modules/products/components/sections/EditVariants.vue.js.map +1 -1
- package/dist/martyrs/src/modules/products/components/sections/ProductsRecommended.vue.cjs +32 -2
- package/dist/martyrs/src/modules/products/components/sections/ProductsRecommended.vue.cjs.map +1 -1
- package/dist/martyrs/src/modules/products/components/sections/ProductsRecommended.vue.js +33 -3
- package/dist/martyrs/src/modules/products/components/sections/ProductsRecommended.vue.js.map +1 -1
- package/dist/martyrs/src/modules/products/router/products.router.cjs +15 -0
- package/dist/martyrs/src/modules/products/router/products.router.cjs.map +1 -1
- package/dist/martyrs/src/modules/products/router/products.router.js +15 -0
- package/dist/martyrs/src/modules/products/router/products.router.js.map +1 -1
- package/dist/martyrs/src/modules/products/store/categories.cjs +25 -7
- package/dist/martyrs/src/modules/products/store/categories.cjs.map +1 -1
- package/dist/martyrs/src/modules/products/store/categories.js +25 -7
- package/dist/martyrs/src/modules/products/store/categories.js.map +1 -1
- package/dist/martyrs/src/modules/reports/components/sections/FormReport.vue.cjs +1 -1
- package/dist/martyrs/src/modules/reports/components/sections/FormReport.vue.cjs.map +1 -1
- package/dist/martyrs/src/modules/reports/components/sections/FormReport.vue.js +1 -1
- package/dist/martyrs/src/modules/reports/components/sections/FormReport.vue.js.map +1 -1
- package/dist/martyrs/src/modules/spots/components/pages/Spots.vue.cjs +345 -0
- package/dist/martyrs/src/modules/spots/components/pages/Spots.vue.cjs.map +1 -0
- package/dist/martyrs/src/modules/spots/components/pages/Spots.vue.js +345 -0
- package/dist/martyrs/src/modules/spots/components/pages/Spots.vue.js.map +1 -0
- package/dist/martyrs/src/modules/spots/router/spots.cjs +17 -0
- package/dist/martyrs/src/modules/spots/router/spots.cjs.map +1 -1
- package/dist/martyrs/src/modules/spots/router/spots.js +17 -0
- package/dist/martyrs/src/modules/spots/router/spots.js.map +1 -1
- package/dist/martyrs.cjs.js +1 -1
- package/dist/martyrs.css +1 -1
- package/dist/martyrs.es.js +1 -1
- package/dist/notifications.server.cjs +1 -1
- package/dist/notifications.server.js +1 -1
- package/dist/orders.server.cjs +459 -201
- package/dist/orders.server.js +459 -201
- package/dist/organizations.server.cjs +1 -1
- package/dist/organizations.server.js +1 -1
- package/dist/products.server.cjs +439 -255
- package/dist/products.server.js +439 -255
- package/dist/style.css +115 -139
- package/dist/{tickets.controller-DQQcjyui.js → tickets.controller-C56OvH6v.js} +1 -1
- package/dist/{tickets.controller-D0V0gJCA.cjs → tickets.controller-DdnndM6c.cjs} +1 -1
- package/dist/wallet.server.cjs +1 -1
- package/dist/wallet.server.js +1 -1
- package/dist/{web-Dkk0_7TA.js → web-BXajFCU2.js} +1 -1
- package/dist/{web-stVkXd0l.cjs → web-DaBwwCQ5.cjs} +1 -1
- package/package.json +1 -1
- package/src/builder/modes/ssr.dev.js +10 -10
- package/src/builder/rspack/rspack.config.ssr.client.js +50 -50
- package/src/components/Checkbox/Checkbox.vue +3 -4
- package/src/components/Feed/Feed.old.vue +522 -0
- package/src/components/Feed/Feed.vue +4 -4
- package/src/components/Field/Field.vue +7 -1
- package/src/components/FieldBig/FieldBig.vue +62 -8
- package/src/components/FieldPhone/FieldPhone.vue +1 -1
- package/src/components/PhotoViewer/PhotoViewer.vue +1 -1
- package/src/modules/STYLES.MD +198 -0
- package/src/modules/auth/views/components/pages/Profile.vue +1 -1
- package/src/modules/auth/views/components/pages/ProfileEdit.vue +42 -8
- package/src/modules/auth/views/components/pages/ProfileEditAccount.vue +9 -11
- package/src/modules/auth/views/components/pages/ProfileEditProfile.vue +9 -11
- package/src/modules/auth/views/components/pages/ProfileEditSidebar.vue +7 -4
- package/src/modules/auth/views/router/users.js +0 -4
- package/src/modules/community/components/pages/Posts.vue +444 -0
- package/src/modules/community/router/blogposts.js +15 -0
- package/src/modules/events/components/pages/EventsBackoffice.vue +1 -1
- package/src/modules/globals/views/classes/globals.websocket.js +7 -8
- package/src/modules/globals/views/components/blocks/Card.vue +2 -1
- package/src/modules/globals/views/components/layouts/Client.vue +1 -2
- package/src/modules/globals/views/components/partials/FooterAlt.vue +161 -188
- package/src/modules/globals/views/components/sections/Filters.vue +261 -121
- package/src/modules/globals/views/components/sections/filters/FilterCheckbox.vue +78 -0
- package/src/modules/globals/views/components/sections/filters/FilterDateRange.vue +177 -0
- package/src/modules/globals/views/components/sections/filters/FilterRange.vue +51 -50
- package/src/modules/icons/entities/IconLock.vue +14 -0
- package/src/modules/icons/icons.client.js +2 -1
- package/src/modules/icons/pages/IconsPage.vue +4 -2
- package/src/modules/landing/components/sections/SubscribeNewsletter.vue +11 -61
- package/src/modules/landing/landing.client.js +6 -0
- package/src/modules/landing/locales/en.js +9 -0
- package/src/modules/landing/locales/index.js +7 -0
- package/src/modules/landing/locales/ru.js +9 -0
- package/src/modules/music/components/pages/Album.vue +1 -1
- package/src/modules/music/components/pages/Playlist.vue +1 -1
- package/src/modules/music/components/pages/Track.vue +1 -1
- package/src/modules/orders/components/blocks/CardApplication.vue +74 -0
- package/src/modules/orders/components/blocks/CardCustomer.vue +90 -0
- package/src/modules/orders/components/elements/FieldSubscribeNewsletter.vue +199 -0
- package/src/modules/orders/components/forms/FormApplicationDetails.vue +117 -0
- package/src/modules/orders/components/forms/FormCustomerDetails.vue +165 -0
- package/src/modules/orders/components/forms/FormSelectCustomer.vue +172 -0
- package/src/modules/orders/components/pages/Applications.vue +240 -0
- package/src/modules/orders/components/pages/Customers.vue +239 -0
- package/src/modules/orders/components/pages/OrderCreate.vue +2 -2
- package/src/modules/orders/components/pages/OrderCreateBackoffice.vue +5 -76
- package/src/modules/orders/components/sections/ApplicationDetails.vue +91 -0
- package/src/modules/orders/components/sections/CustomerDetails.vue +107 -0
- package/src/modules/orders/locales/en.js +35 -0
- package/src/modules/orders/locales/index.js +7 -0
- package/src/modules/orders/locales/ru.js +35 -0
- package/src/modules/orders/middlewares/applications.verifier.js +189 -0
- package/src/modules/orders/middlewares/customers.verifier.js +251 -0
- package/src/modules/orders/models/application.model.js +21 -0
- package/src/modules/orders/models/customer.model.js +26 -0
- package/src/modules/orders/orders.client.js +86 -1
- package/src/modules/orders/orders.server.js +3 -1
- package/src/modules/orders/router/applications.router.js +15 -0
- package/src/modules/orders/router/customers.router.js +17 -0
- package/src/modules/orders/routes/applications.routes.js +124 -12
- package/src/modules/orders/routes/customers.routes.js +43 -0
- package/src/modules/orders/store/applications.js +3 -159
- package/src/modules/orders/store/models/application.js +18 -0
- package/src/modules/orders/store/models/customer.js +12 -0
- package/src/modules/organizations/components/pages/Organization.new.vue +593 -0
- package/src/modules/organizations/components/pages/Organization.vue +11 -202
- package/src/modules/organizations/components/pages/Organizations.vue +1 -1
- package/src/modules/organizations/components/sections/DetailsTabSection.vue +2 -2
- package/src/modules/organizations/configs/navigation.organization.config.js +69 -85
- package/src/modules/organizations/router/organizations.js +5 -0
- package/src/modules/pages/views/components/pages/Page.vue +1 -1
- package/src/modules/products/TASKS.MD +157 -0
- package/src/modules/products/components/blocks/CardCategory.vue +1 -1
- package/src/modules/products/components/blocks/ProductImages.vue +1 -1
- package/src/modules/products/components/pages/Categories.vue +27 -22
- package/src/modules/products/components/pages/CategoryEdit.vue +24 -13
- package/src/modules/products/components/pages/Products.vue +415 -174
- package/src/modules/products/components/sections/EditVariants.vue +14 -0
- package/src/modules/products/components/sections/ProductsRecommended.vue +46 -2
- package/src/modules/products/controllers/categories.controller.js +321 -282
- package/src/modules/products/controllers/configs/products.lookup.config.js +9 -0
- package/src/modules/products/controllers/products.controller.js +2 -1
- package/src/modules/products/controllers/queries/products.queries.js +183 -11
- package/src/modules/products/middlewares/categories.verifier.js +58 -15
- package/src/modules/products/middlewares/variants.verifier.js +12 -0
- package/src/modules/products/migrations/categories-to-materialized-path.js +433 -0
- package/src/modules/products/migrations/path-to-url.js +27 -0
- package/src/modules/products/models/category.model.js +8 -23
- package/src/modules/products/models/variant.model.js +3 -0
- package/src/modules/products/router/products.router.js +12 -0
- package/src/modules/products/store/categories.js +26 -7
- package/src/modules/rents/TASK.MD +161 -0
- package/src/modules/reports/components/sections/FormReport.vue +1 -1
- package/src/modules/spots/components/pages/Spots.vue +342 -0
- package/src/modules/spots/router/spots.js +15 -0
- package/src/styles/base/all.scss +2 -3
- package/src/styles/layout.scss +16 -0
- package/dist/main-DTaE01lg.cjs +0 -11
- package/dist/martyrs/src/components/BottomSheet/BottomSheet.vue.cjs +0 -96
- package/dist/martyrs/src/components/BottomSheet/BottomSheet.vue.cjs.map +0 -1
- package/dist/martyrs/src/components/BottomSheet/BottomSheet.vue.js +0 -96
- package/dist/martyrs/src/components/BottomSheet/BottomSheet.vue.js.map +0 -1
- package/dist/martyrs/src/components/Loader/Loader.vue2.cjs.map +0 -1
- package/dist/martyrs/src/components/Menu/Menu.vue2.cjs.map +0 -1
- package/dist/martyrs/src/components/Menu/Menu.vue2.js.map +0 -1
- package/dist/martyrs/src/modules/globals/views/components/blocks/BlockMultiselect.vue2.cjs.map +0 -1
- package/dist/martyrs/src/modules/orders/components/sections/FormAddCustomer.vue.cjs +0 -155
- package/dist/martyrs/src/modules/orders/components/sections/FormAddCustomer.vue.cjs.map +0 -1
- package/dist/martyrs/src/modules/orders/components/sections/FormAddCustomer.vue.js +0 -155
- package/dist/martyrs/src/modules/orders/components/sections/FormAddCustomer.vue.js.map +0 -1
- package/dist/martyrs/src/modules/orders/components/sections/FormCustomerDetails.vue.cjs +0 -81
- package/dist/martyrs/src/modules/orders/components/sections/FormCustomerDetails.vue.cjs.map +0 -1
- package/dist/martyrs/src/modules/orders/components/sections/FormCustomerDetails.vue.js +0 -81
- package/dist/martyrs/src/modules/orders/components/sections/FormCustomerDetails.vue.js.map +0 -1
- package/src/modules/orders/components/sections/FormAddCustomer.vue +0 -152
- package/src/modules/orders/components/sections/FormCustomerDetails.vue +0 -67
- package/src/modules/orders/controllers/applications.controller.js +0 -122
package/dist/orders.server.cjs
CHANGED
|
@@ -1,98 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
3
|
-
|
|
3
|
+
require("node-cache");
|
|
4
4
|
const queryProcessor = require("./queryProcessor-B_X680wC.cjs");
|
|
5
|
-
|
|
5
|
+
require("./mailing-Bs9ThyVZ.cjs");
|
|
6
6
|
const profile_schema = require("./profile.schema-pidHrksV.cjs");
|
|
7
|
-
const credentials_schema = require("./credentials.schema-DwhGdrwC.cjs");
|
|
8
7
|
const ownership_schema = require("./ownership.schema-D1p5XSpt.cjs");
|
|
9
|
-
const
|
|
8
|
+
const credentials_schema = require("./credentials.schema-DwhGdrwC.cjs");
|
|
9
|
+
const crud = require("./crud-JN_LFj01.cjs");
|
|
10
|
+
const abac = require("./abac-6LjoG9u-.cjs");
|
|
10
11
|
const axios = require("axios");
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
this.model = model;
|
|
14
|
-
this.cache = new globals_logger.Cache();
|
|
15
|
-
this.logger = new globals_logger.Logger(db);
|
|
16
|
-
this.app = app;
|
|
17
|
-
this.basePath = basePath;
|
|
18
|
-
if (!options || options && !options.disableDefaultRoutes) this.registerRoutes();
|
|
19
|
-
}
|
|
20
|
-
registerRoutes() {
|
|
21
|
-
this.app.post(`${this.basePath}/create`, this.create.bind(this));
|
|
22
|
-
this.app.get(`${this.basePath}/read`, this.read.bind(this));
|
|
23
|
-
this.app.put(`${this.basePath}/update`, this.update.bind(this));
|
|
24
|
-
this.app.delete(`${this.basePath}/delete`, this.delete.bind(this));
|
|
25
|
-
}
|
|
26
|
-
async create(req, res) {
|
|
27
|
-
try {
|
|
28
|
-
const createdData = await this.model.create(req.body);
|
|
29
|
-
await this.cache.flush();
|
|
30
|
-
res.status(201).json(createdData);
|
|
31
|
-
} catch (error) {
|
|
32
|
-
console.log(error);
|
|
33
|
-
this.logger.error("Ошибка создания данных", error);
|
|
34
|
-
res.status(500).json({ error: error.message });
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
async read(req, res) {
|
|
38
|
-
try {
|
|
39
|
-
let stages = [];
|
|
40
|
-
stages = [
|
|
41
|
-
...queryProcessor.queryProcessorGlobals.getBasicOptions(req.query),
|
|
42
|
-
// For creator
|
|
43
|
-
queryProcessor.queryProcessorGlobals.getCreatorUserLookupStage(),
|
|
44
|
-
queryProcessor.queryProcessorGlobals.getCreatorOrganizationLookupStage(),
|
|
45
|
-
// For owner
|
|
46
|
-
queryProcessor.queryProcessorGlobals.getOwnerUserLookupStage(),
|
|
47
|
-
queryProcessor.queryProcessorGlobals.getOwnerOrganizationLookupStage(),
|
|
48
|
-
queryProcessor.queryProcessorGlobals.getAddFieldsCreatorOwnerStage(),
|
|
49
|
-
// Pagination
|
|
50
|
-
...queryProcessor.queryProcessorGlobals.getSortingOptions(req.query.sortParam, req.query.sortOrder),
|
|
51
|
-
...queryProcessor.queryProcessorGlobals.getPaginationOptions(req.query.skip, req.query.limit),
|
|
52
|
-
queryProcessor.queryProcessorGlobals.removeTempPropeties()
|
|
53
|
-
];
|
|
54
|
-
const cacheKey = JSON.stringify({ stages });
|
|
55
|
-
let data = await this.cache.get(cacheKey);
|
|
56
|
-
if (!data) {
|
|
57
|
-
data = await this.model.aggregate(stages).exec();
|
|
58
|
-
await this.cache.set(cacheKey, data);
|
|
59
|
-
}
|
|
60
|
-
res.json(data);
|
|
61
|
-
} catch (error) {
|
|
62
|
-
this.logger.error(error);
|
|
63
|
-
res.status(500).json({ error: error.message });
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
async update(req, res) {
|
|
67
|
-
try {
|
|
68
|
-
const updatedData = await this.model.findOneAndUpdate({ _id: req.body._id }, req.body, {
|
|
69
|
-
new: true,
|
|
70
|
-
runValidators: true
|
|
71
|
-
});
|
|
72
|
-
if (!updatedData) {
|
|
73
|
-
throw new Error("Документ не найден.");
|
|
74
|
-
}
|
|
75
|
-
await this.cache.flush();
|
|
76
|
-
res.json(updatedData);
|
|
77
|
-
} catch (error) {
|
|
78
|
-
this.logger.error("Ошибка обновления данных", error);
|
|
79
|
-
res.status(404).json({ error: error.message });
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
async delete(req, res) {
|
|
83
|
-
try {
|
|
84
|
-
const deletedData = await this.model.findOneAndDelete({ _id: req.body._id });
|
|
85
|
-
if (!deletedData) {
|
|
86
|
-
throw new Error("Документ не найден.");
|
|
87
|
-
}
|
|
88
|
-
await this.cache.flush();
|
|
89
|
-
res.status(204).send();
|
|
90
|
-
} catch (error) {
|
|
91
|
-
this.logger.error("Ошибка удаления данных", error);
|
|
92
|
-
res.status(404).json({ error: error.message });
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
}
|
|
12
|
+
const globals_verifier = require("./globals.verifier-C0zj_LLo.cjs");
|
|
13
|
+
const index = require("./index-BFxqqmgh.cjs");
|
|
96
14
|
const controllerFactory = (db) => {
|
|
97
15
|
const Order = db.order;
|
|
98
16
|
const Customer = db.customer;
|
|
@@ -590,12 +508,29 @@ const ModelApplication = (db) => {
|
|
|
590
508
|
email: {
|
|
591
509
|
type: String
|
|
592
510
|
}
|
|
511
|
+
},
|
|
512
|
+
text: {
|
|
513
|
+
type: String
|
|
514
|
+
},
|
|
515
|
+
chat: {
|
|
516
|
+
type: String
|
|
517
|
+
},
|
|
518
|
+
customer: {
|
|
519
|
+
type: {
|
|
520
|
+
type: String,
|
|
521
|
+
enum: ["Customer"]
|
|
522
|
+
},
|
|
523
|
+
target: {
|
|
524
|
+
type: db.mongoose.Schema.Types.ObjectId,
|
|
525
|
+
ref: "Customer"
|
|
526
|
+
}
|
|
593
527
|
}
|
|
594
528
|
},
|
|
595
529
|
{
|
|
596
530
|
timestamps: { currentTime: () => Date.now() }
|
|
597
531
|
}
|
|
598
532
|
);
|
|
533
|
+
ownership_schema.applyOwnershipSchema(ApplicationSchema, db);
|
|
599
534
|
const Application = db.mongoose.model("Application", ApplicationSchema);
|
|
600
535
|
return Application;
|
|
601
536
|
};
|
|
@@ -614,10 +549,34 @@ const ModelCustomer = (db) => {
|
|
|
614
549
|
refPath: "target.type"
|
|
615
550
|
}
|
|
616
551
|
},
|
|
552
|
+
source: {
|
|
553
|
+
type: String,
|
|
554
|
+
enum: ["web", "mobile", "api", "import", "manual", "referral", "social", "email"],
|
|
555
|
+
default: "web"
|
|
556
|
+
},
|
|
617
557
|
referral: {
|
|
618
558
|
code: {
|
|
619
559
|
type: String
|
|
560
|
+
},
|
|
561
|
+
source: {
|
|
562
|
+
type: db.mongoose.Schema.Types.ObjectId,
|
|
563
|
+
ref: "Customer"
|
|
620
564
|
}
|
|
565
|
+
},
|
|
566
|
+
tags: [{
|
|
567
|
+
type: String
|
|
568
|
+
}],
|
|
569
|
+
notes: {
|
|
570
|
+
type: String
|
|
571
|
+
},
|
|
572
|
+
lastActivity: {
|
|
573
|
+
type: Date,
|
|
574
|
+
default: Date.now
|
|
575
|
+
},
|
|
576
|
+
status: {
|
|
577
|
+
type: String,
|
|
578
|
+
enum: ["active", "inactive", "blocked"],
|
|
579
|
+
default: "active"
|
|
621
580
|
}
|
|
622
581
|
},
|
|
623
582
|
{
|
|
@@ -783,125 +742,229 @@ const ModelTestimonial = (db) => {
|
|
|
783
742
|
const Testimonial = db.mongoose.model("Testimonial", testimonialSchema);
|
|
784
743
|
return Testimonial;
|
|
785
744
|
};
|
|
786
|
-
const
|
|
787
|
-
const
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
745
|
+
const verifierFactory$1 = function(db) {
|
|
746
|
+
const createVerifier = new globals_verifier.Verifier({
|
|
747
|
+
"contacts.name": {
|
|
748
|
+
rule: "optional",
|
|
749
|
+
validator: globals_verifier.Validator.schema().string().min(1, "Name must be at least 1 character").max(255, "Name must not exceed 255 characters")
|
|
750
|
+
},
|
|
751
|
+
"contacts.email": {
|
|
752
|
+
rule: "optional",
|
|
753
|
+
validator: globals_verifier.Validator.schema().string().email("Invalid email format").max(255, "Email must not exceed 255 characters")
|
|
754
|
+
},
|
|
755
|
+
"contacts.phone": {
|
|
756
|
+
rule: "optional",
|
|
757
|
+
validator: globals_verifier.Validator.schema().string().pattern(/^\+?[1-9]\d{1,14}$/, "Invalid phone format")
|
|
758
|
+
},
|
|
759
|
+
type: {
|
|
760
|
+
rule: "optional",
|
|
761
|
+
default: "newsletter",
|
|
762
|
+
validator: globals_verifier.Validator.schema().string().oneOf(["newsletter", "support", "inquiry", "feedback", "other"])
|
|
763
|
+
},
|
|
764
|
+
text: {
|
|
765
|
+
rule: "optional",
|
|
766
|
+
validator: globals_verifier.Validator.schema().string().max(2e3, "Text must not exceed 2000 characters")
|
|
767
|
+
},
|
|
768
|
+
chat: {
|
|
769
|
+
rule: "optional",
|
|
770
|
+
validator: globals_verifier.Validator.schema().string().max(255, "Chat ID must not exceed 255 characters")
|
|
771
|
+
},
|
|
772
|
+
status: {
|
|
773
|
+
rule: "optional",
|
|
774
|
+
default: "created",
|
|
775
|
+
validator: globals_verifier.Validator.schema().string().oneOf(["created", "in_progress", "completed", "cancelled"])
|
|
776
|
+
},
|
|
777
|
+
owner: {
|
|
778
|
+
rule: "optional",
|
|
779
|
+
validator: globals_verifier.Validator.schema().object({
|
|
780
|
+
type: globals_verifier.Validator.schema().string().oneOf(["user", "organization", "User", "Organization"]),
|
|
781
|
+
target: globals_verifier.Validator.schema().string().pattern(/^[0-9a-fA-F]{24}$/)
|
|
782
|
+
})
|
|
798
783
|
}
|
|
799
|
-
};
|
|
800
|
-
const
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
}
|
|
813
|
-
|
|
784
|
+
});
|
|
785
|
+
const updateVerifier = new globals_verifier.Verifier({
|
|
786
|
+
_id: {
|
|
787
|
+
rule: "required",
|
|
788
|
+
validator: globals_verifier.Validator.schema().string().required("Application ID is required").pattern(/^[0-9a-fA-F]{24}$/, "Invalid ID format")
|
|
789
|
+
},
|
|
790
|
+
"contacts.name": {
|
|
791
|
+
rule: "optional",
|
|
792
|
+
validator: globals_verifier.Validator.schema().string().min(1, "Name must be at least 1 character").max(255, "Name must not exceed 255 characters")
|
|
793
|
+
},
|
|
794
|
+
"contacts.email": {
|
|
795
|
+
rule: "optional",
|
|
796
|
+
validator: globals_verifier.Validator.schema().string().email("Invalid email format").max(255, "Email must not exceed 255 characters")
|
|
797
|
+
},
|
|
798
|
+
"contacts.phone": {
|
|
799
|
+
rule: "optional",
|
|
800
|
+
validator: globals_verifier.Validator.schema().string().pattern(/^\+?[1-9]\d{1,14}$/, "Invalid phone format")
|
|
801
|
+
},
|
|
802
|
+
type: {
|
|
803
|
+
rule: "optional",
|
|
804
|
+
validator: globals_verifier.Validator.schema().string().oneOf(["newsletter", "support", "inquiry", "feedback", "other"])
|
|
805
|
+
},
|
|
806
|
+
text: {
|
|
807
|
+
rule: "optional",
|
|
808
|
+
validator: globals_verifier.Validator.schema().string().max(2e3, "Text must not exceed 2000 characters")
|
|
809
|
+
},
|
|
810
|
+
chat: {
|
|
811
|
+
rule: "optional",
|
|
812
|
+
validator: globals_verifier.Validator.schema().string().max(255, "Chat ID must not exceed 255 characters")
|
|
813
|
+
},
|
|
814
|
+
status: {
|
|
815
|
+
rule: "optional",
|
|
816
|
+
validator: globals_verifier.Validator.schema().string().oneOf(["created", "in_progress", "completed", "cancelled"])
|
|
814
817
|
}
|
|
815
|
-
};
|
|
816
|
-
const
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
818
|
+
});
|
|
819
|
+
const readVerifier = new globals_verifier.Verifier({
|
|
820
|
+
_id: {
|
|
821
|
+
rule: "optional",
|
|
822
|
+
validator: globals_verifier.Validator.schema().string().pattern(/^[0-9a-fA-F]{24}$/)
|
|
823
|
+
},
|
|
824
|
+
owner: {
|
|
825
|
+
rule: "optional",
|
|
826
|
+
validator: globals_verifier.Validator.schema().string()
|
|
827
|
+
},
|
|
828
|
+
status: {
|
|
829
|
+
rule: "optional",
|
|
830
|
+
validator: globals_verifier.Validator.schema().string().oneOf(["created", "in_progress", "completed", "cancelled"])
|
|
831
|
+
},
|
|
832
|
+
type: {
|
|
833
|
+
rule: "optional",
|
|
834
|
+
validator: globals_verifier.Validator.schema().string().oneOf(["newsletter", "support", "inquiry", "feedback", "other"])
|
|
835
|
+
},
|
|
836
|
+
skip: {
|
|
837
|
+
rule: "optional",
|
|
838
|
+
default: 0,
|
|
839
|
+
validator: globals_verifier.Validator.schema().integer().min(0)
|
|
840
|
+
},
|
|
841
|
+
limit: {
|
|
842
|
+
rule: "optional",
|
|
843
|
+
default: 20,
|
|
844
|
+
validator: globals_verifier.Validator.schema().integer().min(1).max(100)
|
|
845
|
+
},
|
|
846
|
+
sortParam: {
|
|
847
|
+
rule: "optional",
|
|
848
|
+
validator: globals_verifier.Validator.schema().string().oneOf(["contacts.name", "contacts.email", "type", "status", "createdAt", "updatedAt"])
|
|
849
|
+
},
|
|
850
|
+
sortOrder: {
|
|
851
|
+
rule: "optional",
|
|
852
|
+
default: "desc",
|
|
853
|
+
validator: globals_verifier.Validator.schema().string().oneOf(["asc", "desc"])
|
|
827
854
|
}
|
|
828
|
-
};
|
|
829
|
-
const
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
return res.status(404).send({ message: "Something wrong when deleting application." });
|
|
834
|
-
}
|
|
835
|
-
res.status(200).send(application);
|
|
836
|
-
} catch (err) {
|
|
837
|
-
res.status(500).send({ message: err });
|
|
855
|
+
});
|
|
856
|
+
const deleteVerifier = new globals_verifier.Verifier({
|
|
857
|
+
_id: {
|
|
858
|
+
rule: "required",
|
|
859
|
+
validator: globals_verifier.Validator.schema().string().required("Application ID is required").pattern(/^[0-9a-fA-F]{24}$/)
|
|
838
860
|
}
|
|
861
|
+
});
|
|
862
|
+
return {
|
|
863
|
+
createVerifier,
|
|
864
|
+
readVerifier,
|
|
865
|
+
updateVerifier,
|
|
866
|
+
deleteVerifier
|
|
839
867
|
};
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
868
|
+
};
|
|
869
|
+
const { getInstance: getInstance$1 } = abac.ABAC;
|
|
870
|
+
function setupApplicationsRoutes(app, db) {
|
|
871
|
+
const abac2 = getInstance$1(db);
|
|
872
|
+
const verifier = verifierFactory$1();
|
|
873
|
+
const applicationsCRUD = new crud.CRUD({
|
|
874
|
+
app,
|
|
875
|
+
db,
|
|
876
|
+
model: db.application,
|
|
877
|
+
modelName: "application",
|
|
878
|
+
basePath: "/api/applications",
|
|
879
|
+
auth: true,
|
|
880
|
+
verifiers: {
|
|
881
|
+
create: verifier.createVerifier,
|
|
882
|
+
read: verifier.readVerifier,
|
|
883
|
+
update: verifier.updateVerifier,
|
|
884
|
+
delete: verifier.deleteVerifier
|
|
885
|
+
},
|
|
886
|
+
abac: abac2,
|
|
887
|
+
cache: {
|
|
888
|
+
enabled: true,
|
|
889
|
+
ttl: 300,
|
|
890
|
+
tags: ["application", "orders"]
|
|
891
|
+
},
|
|
892
|
+
events: {
|
|
893
|
+
enabled: true,
|
|
894
|
+
logReads: false
|
|
895
|
+
}
|
|
896
|
+
});
|
|
897
|
+
applicationsCRUD.addAction("telegram-webhook", {
|
|
898
|
+
method: "post",
|
|
899
|
+
path: "/telegram-webhook",
|
|
900
|
+
auth: false,
|
|
901
|
+
abac: { enabled: false },
|
|
902
|
+
handler: async (req, res) => {
|
|
903
|
+
const update = req.body;
|
|
904
|
+
if (update.callback_query) {
|
|
905
|
+
const callbackQuery = update.callback_query;
|
|
906
|
+
const callbackData = callbackQuery.data;
|
|
907
|
+
const [action, applicationId] = callbackData.split("_");
|
|
908
|
+
try {
|
|
909
|
+
let updatedApplication = null;
|
|
910
|
+
switch (action) {
|
|
911
|
+
case "confirm":
|
|
912
|
+
updatedApplication = await db.application.findOneAndUpdate({ _id: applicationId }, { status: "confirmed" }, { new: true });
|
|
913
|
+
break;
|
|
914
|
+
case "lost":
|
|
915
|
+
updatedApplication = await db.application.findOneAndUpdate({ _id: applicationId }, { status: "lost" }, { new: true });
|
|
916
|
+
break;
|
|
917
|
+
case "delete":
|
|
918
|
+
updatedApplication = await db.application.findOneAndDelete({ _id: applicationId });
|
|
919
|
+
break;
|
|
920
|
+
}
|
|
921
|
+
if (!updatedApplication) {
|
|
922
|
+
console.log("Application not found or not updated.");
|
|
923
|
+
} else {
|
|
924
|
+
console.log("Application updated:", updatedApplication);
|
|
925
|
+
}
|
|
926
|
+
} catch (err) {
|
|
927
|
+
console.log("Error updating application:", err);
|
|
928
|
+
}
|
|
929
|
+
const queryId = callbackQuery.id;
|
|
930
|
+
const telegramToken = "6206215053:AAHYCYzpFZF9jDZC-TC03NSff8oo2ExqsSU";
|
|
931
|
+
axios.post(`https://api.telegram.org/bot${telegramToken}/answerCallbackQuery`, {
|
|
932
|
+
callback_query_id: queryId
|
|
933
|
+
});
|
|
845
934
|
}
|
|
846
|
-
res.
|
|
847
|
-
} catch (err) {
|
|
848
|
-
res.status(500).send({ message: err });
|
|
935
|
+
res.sendStatus(200);
|
|
849
936
|
}
|
|
850
|
-
};
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
937
|
+
});
|
|
938
|
+
applicationsCRUD.addAction("public-create", {
|
|
939
|
+
method: "post",
|
|
940
|
+
path: "/public",
|
|
941
|
+
auth: false,
|
|
942
|
+
abac: { enabled: false },
|
|
943
|
+
handler: async (req, res) => {
|
|
857
944
|
try {
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
}
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
console.log("Error updating application:", err);
|
|
945
|
+
const applicationData = {
|
|
946
|
+
...req.body,
|
|
947
|
+
owner: {
|
|
948
|
+
type: "platform",
|
|
949
|
+
target: "000000000000000000000000"
|
|
950
|
+
// заглушка для отдела платформы
|
|
951
|
+
},
|
|
952
|
+
creator: {
|
|
953
|
+
type: "platform",
|
|
954
|
+
target: "000000000000000000000000"
|
|
955
|
+
}
|
|
956
|
+
};
|
|
957
|
+
const application = new db.application(applicationData);
|
|
958
|
+
const saved = await application.save();
|
|
959
|
+
res.status(201).json(saved);
|
|
960
|
+
} catch (error) {
|
|
961
|
+
console.error("Error creating public application:", error);
|
|
962
|
+
res.status(500).json({ error: error.message });
|
|
877
963
|
}
|
|
878
|
-
const queryId = callbackQuery.id;
|
|
879
|
-
const telegramToken = "6206215053:AAHYCYzpFZF9jDZC-TC03NSff8oo2ExqsSU";
|
|
880
|
-
axios.post(`https://api.telegram.org/bot${telegramToken}/answerCallbackQuery`, {
|
|
881
|
-
callback_query_id: queryId
|
|
882
|
-
});
|
|
883
964
|
}
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
read,
|
|
888
|
-
create,
|
|
889
|
-
update,
|
|
890
|
-
delete: deleteMethod,
|
|
891
|
-
handleTelegramWebhook,
|
|
892
|
-
get
|
|
893
|
-
};
|
|
894
|
-
};
|
|
895
|
-
const RoutesApplications = function(app, db, origins) {
|
|
896
|
-
const controller = middlewareFactory(db);
|
|
897
|
-
index.middlewareIndexFactory(db);
|
|
898
|
-
app.post("/applications", controller.create);
|
|
899
|
-
app.get("/applications", controller.read);
|
|
900
|
-
app.post("/applications/:_id", controller.update);
|
|
901
|
-
app.delete("/applications/:_id", controller.delete);
|
|
902
|
-
app.get("/applications/:_id", controller.get);
|
|
903
|
-
app.post("/applications/telegram-webhook", controller.handleTelegramWebhook);
|
|
904
|
-
};
|
|
965
|
+
});
|
|
966
|
+
return applicationsCRUD;
|
|
967
|
+
}
|
|
905
968
|
const RoutesOrder = function(app, db, origins, publicPath) {
|
|
906
969
|
const controller = controllerFactory(db);
|
|
907
970
|
const middleware = index.middlewareIndexFactory(db);
|
|
@@ -934,6 +997,200 @@ const RoutesOrder = function(app, db, origins, publicPath) {
|
|
|
934
997
|
controller.deleteOrder
|
|
935
998
|
);
|
|
936
999
|
};
|
|
1000
|
+
const verifierFactory = function(db) {
|
|
1001
|
+
const createVerifier = new globals_verifier.Verifier({
|
|
1002
|
+
email: {
|
|
1003
|
+
rule: "optional",
|
|
1004
|
+
validator: globals_verifier.Validator.schema().string().email("Invalid email format").max(255, "Email must not exceed 255 characters")
|
|
1005
|
+
},
|
|
1006
|
+
phone: {
|
|
1007
|
+
rule: "optional",
|
|
1008
|
+
validator: globals_verifier.Validator.schema().string().pattern(/^\+?[1-9]\d{1,14}$/, "Invalid phone format")
|
|
1009
|
+
},
|
|
1010
|
+
"profile.name": {
|
|
1011
|
+
rule: "optional",
|
|
1012
|
+
validator: globals_verifier.Validator.schema().string().min(1, "Name must be at least 1 character").max(255, "Name must not exceed 255 characters")
|
|
1013
|
+
},
|
|
1014
|
+
"profile.description": {
|
|
1015
|
+
rule: "optional",
|
|
1016
|
+
validator: globals_verifier.Validator.schema().string().max(1e3, "Description must not exceed 1000 characters")
|
|
1017
|
+
},
|
|
1018
|
+
"profile.photo": {
|
|
1019
|
+
rule: "optional",
|
|
1020
|
+
validator: globals_verifier.Validator.schema().string().max(500, "Photo URL must not exceed 500 characters")
|
|
1021
|
+
},
|
|
1022
|
+
source: {
|
|
1023
|
+
rule: "optional",
|
|
1024
|
+
default: "web",
|
|
1025
|
+
validator: globals_verifier.Validator.schema().string().oneOf(["web", "mobile", "api", "import", "manual", "referral", "social", "email"])
|
|
1026
|
+
},
|
|
1027
|
+
"referral.code": {
|
|
1028
|
+
rule: "optional",
|
|
1029
|
+
validator: globals_verifier.Validator.schema().string().max(50, "Referral code must not exceed 50 characters")
|
|
1030
|
+
},
|
|
1031
|
+
"referral.source": {
|
|
1032
|
+
rule: "optional",
|
|
1033
|
+
validator: globals_verifier.Validator.schema().string().pattern(/^[0-9a-fA-F]{24}$/, "Invalid referral source ID format")
|
|
1034
|
+
},
|
|
1035
|
+
tags: {
|
|
1036
|
+
rule: "optional",
|
|
1037
|
+
validator: globals_verifier.Validator.schema().array().items(globals_verifier.Validator.schema().string().max(50)).max(20, "Cannot have more than 20 tags")
|
|
1038
|
+
},
|
|
1039
|
+
notes: {
|
|
1040
|
+
rule: "optional",
|
|
1041
|
+
validator: globals_verifier.Validator.schema().string().max(2e3, "Notes must not exceed 2000 characters")
|
|
1042
|
+
},
|
|
1043
|
+
status: {
|
|
1044
|
+
rule: "optional",
|
|
1045
|
+
default: "active",
|
|
1046
|
+
validator: globals_verifier.Validator.schema().string().oneOf(["active", "inactive", "blocked"])
|
|
1047
|
+
},
|
|
1048
|
+
"identity.type": {
|
|
1049
|
+
rule: "required",
|
|
1050
|
+
validator: globals_verifier.Validator.schema().string().oneOf(["Visitor", "User", "Organization"])
|
|
1051
|
+
},
|
|
1052
|
+
"identity.target": {
|
|
1053
|
+
rule: "optional",
|
|
1054
|
+
validator: globals_verifier.Validator.schema().string().pattern(/^[0-9a-fA-F]{24}$/, "Invalid identity target ID format")
|
|
1055
|
+
},
|
|
1056
|
+
owner: {
|
|
1057
|
+
rule: "required",
|
|
1058
|
+
validator: globals_verifier.Validator.schema().object({
|
|
1059
|
+
type: globals_verifier.Validator.schema().string().oneOf(["user", "organization", "User", "Organization"]),
|
|
1060
|
+
target: globals_verifier.Validator.schema().string().pattern(/^[0-9a-fA-F]{24}$/)
|
|
1061
|
+
})
|
|
1062
|
+
}
|
|
1063
|
+
});
|
|
1064
|
+
const updateVerifier = new globals_verifier.Verifier({
|
|
1065
|
+
_id: {
|
|
1066
|
+
rule: "required",
|
|
1067
|
+
validator: globals_verifier.Validator.schema().string().required("Customer ID is required").pattern(/^[0-9a-fA-F]{24}$/, "Invalid ID format")
|
|
1068
|
+
},
|
|
1069
|
+
email: {
|
|
1070
|
+
rule: "optional",
|
|
1071
|
+
validator: globals_verifier.Validator.schema().string().email("Invalid email format").max(255, "Email must not exceed 255 characters")
|
|
1072
|
+
},
|
|
1073
|
+
phone: {
|
|
1074
|
+
rule: "optional",
|
|
1075
|
+
validator: globals_verifier.Validator.schema().string().pattern(/^\+?[1-9]\d{1,14}$/, "Invalid phone format")
|
|
1076
|
+
},
|
|
1077
|
+
"profile.name": {
|
|
1078
|
+
rule: "optional",
|
|
1079
|
+
validator: globals_verifier.Validator.schema().string().min(1, "Name must be at least 1 character").max(255, "Name must not exceed 255 characters")
|
|
1080
|
+
},
|
|
1081
|
+
"profile.description": {
|
|
1082
|
+
rule: "optional",
|
|
1083
|
+
validator: globals_verifier.Validator.schema().string().max(1e3, "Description must not exceed 1000 characters")
|
|
1084
|
+
},
|
|
1085
|
+
"profile.photo": {
|
|
1086
|
+
rule: "optional",
|
|
1087
|
+
validator: globals_verifier.Validator.schema().string().max(500, "Photo URL must not exceed 500 characters")
|
|
1088
|
+
},
|
|
1089
|
+
source: {
|
|
1090
|
+
rule: "optional",
|
|
1091
|
+
validator: globals_verifier.Validator.schema().string().oneOf(["web", "mobile", "api", "import", "manual", "referral", "social", "email"])
|
|
1092
|
+
},
|
|
1093
|
+
"referral.code": {
|
|
1094
|
+
rule: "optional",
|
|
1095
|
+
validator: globals_verifier.Validator.schema().string().max(50, "Referral code must not exceed 50 characters")
|
|
1096
|
+
},
|
|
1097
|
+
"referral.source": {
|
|
1098
|
+
rule: "optional",
|
|
1099
|
+
validator: globals_verifier.Validator.schema().string().pattern(/^[0-9a-fA-F]{24}$/, "Invalid referral source ID format")
|
|
1100
|
+
},
|
|
1101
|
+
tags: {
|
|
1102
|
+
rule: "optional",
|
|
1103
|
+
validator: globals_verifier.Validator.schema().array().items(globals_verifier.Validator.schema().string().max(50)).max(20, "Cannot have more than 20 tags")
|
|
1104
|
+
},
|
|
1105
|
+
notes: {
|
|
1106
|
+
rule: "optional",
|
|
1107
|
+
validator: globals_verifier.Validator.schema().string().max(2e3, "Notes must not exceed 2000 characters")
|
|
1108
|
+
},
|
|
1109
|
+
status: {
|
|
1110
|
+
rule: "optional",
|
|
1111
|
+
validator: globals_verifier.Validator.schema().string().oneOf(["active", "inactive", "blocked"])
|
|
1112
|
+
}
|
|
1113
|
+
});
|
|
1114
|
+
const readVerifier = new globals_verifier.Verifier({
|
|
1115
|
+
_id: {
|
|
1116
|
+
rule: "optional",
|
|
1117
|
+
validator: globals_verifier.Validator.schema().string().pattern(/^[0-9a-fA-F]{24}$/)
|
|
1118
|
+
},
|
|
1119
|
+
owner: {
|
|
1120
|
+
rule: "optional",
|
|
1121
|
+
validator: globals_verifier.Validator.schema().string()
|
|
1122
|
+
},
|
|
1123
|
+
status: {
|
|
1124
|
+
rule: "optional",
|
|
1125
|
+
validator: globals_verifier.Validator.schema().string().oneOf(["active", "inactive", "blocked"])
|
|
1126
|
+
},
|
|
1127
|
+
source: {
|
|
1128
|
+
rule: "optional",
|
|
1129
|
+
validator: globals_verifier.Validator.schema().string().oneOf(["web", "mobile", "api", "import", "manual", "referral", "social", "email"])
|
|
1130
|
+
},
|
|
1131
|
+
skip: {
|
|
1132
|
+
rule: "optional",
|
|
1133
|
+
default: 0,
|
|
1134
|
+
validator: globals_verifier.Validator.schema().integer().min(0)
|
|
1135
|
+
},
|
|
1136
|
+
limit: {
|
|
1137
|
+
rule: "optional",
|
|
1138
|
+
default: 20,
|
|
1139
|
+
validator: globals_verifier.Validator.schema().integer().min(1).max(100)
|
|
1140
|
+
},
|
|
1141
|
+
sortParam: {
|
|
1142
|
+
rule: "optional",
|
|
1143
|
+
validator: globals_verifier.Validator.schema().string().oneOf(["profile.name", "email", "phone", "lastActivity", "createdAt", "updatedAt"])
|
|
1144
|
+
},
|
|
1145
|
+
sortOrder: {
|
|
1146
|
+
rule: "optional",
|
|
1147
|
+
default: "desc",
|
|
1148
|
+
validator: globals_verifier.Validator.schema().string().oneOf(["asc", "desc"])
|
|
1149
|
+
}
|
|
1150
|
+
});
|
|
1151
|
+
const deleteVerifier = new globals_verifier.Verifier({
|
|
1152
|
+
_id: {
|
|
1153
|
+
rule: "required",
|
|
1154
|
+
validator: globals_verifier.Validator.schema().string().required("Customer ID is required").pattern(/^[0-9a-fA-F]{24}$/)
|
|
1155
|
+
}
|
|
1156
|
+
});
|
|
1157
|
+
return {
|
|
1158
|
+
createVerifier,
|
|
1159
|
+
readVerifier,
|
|
1160
|
+
updateVerifier,
|
|
1161
|
+
deleteVerifier
|
|
1162
|
+
};
|
|
1163
|
+
};
|
|
1164
|
+
const { getInstance } = abac.ABAC;
|
|
1165
|
+
function setupCustomersRoutes(app, db) {
|
|
1166
|
+
const abac2 = getInstance(db);
|
|
1167
|
+
const verifier = verifierFactory();
|
|
1168
|
+
const customersCRUD = new crud.CRUD({
|
|
1169
|
+
app,
|
|
1170
|
+
db,
|
|
1171
|
+
model: db.customer,
|
|
1172
|
+
modelName: "customer",
|
|
1173
|
+
basePath: "/api/customers",
|
|
1174
|
+
auth: true,
|
|
1175
|
+
verifiers: {
|
|
1176
|
+
create: verifier.createVerifier,
|
|
1177
|
+
read: verifier.readVerifier,
|
|
1178
|
+
update: verifier.updateVerifier,
|
|
1179
|
+
delete: verifier.deleteVerifier
|
|
1180
|
+
},
|
|
1181
|
+
abac: abac2,
|
|
1182
|
+
cache: {
|
|
1183
|
+
enabled: true,
|
|
1184
|
+
ttl: 300,
|
|
1185
|
+
tags: ["customer", "orders"]
|
|
1186
|
+
},
|
|
1187
|
+
events: {
|
|
1188
|
+
enabled: true,
|
|
1189
|
+
logReads: false
|
|
1190
|
+
}
|
|
1191
|
+
});
|
|
1192
|
+
return customersCRUD;
|
|
1193
|
+
}
|
|
937
1194
|
function initializeOrders(app, db, origins, publicPath) {
|
|
938
1195
|
db.order = ModelOrder(db);
|
|
939
1196
|
db.customer = ModelCustomer(db);
|
|
@@ -941,8 +1198,8 @@ function initializeOrders(app, db, origins, publicPath) {
|
|
|
941
1198
|
db.application = ModelApplication(db);
|
|
942
1199
|
if (app) {
|
|
943
1200
|
RoutesOrder(app, db);
|
|
944
|
-
|
|
945
|
-
|
|
1201
|
+
setupApplicationsRoutes(app, db);
|
|
1202
|
+
setupCustomersRoutes(app, db);
|
|
946
1203
|
}
|
|
947
1204
|
}
|
|
948
1205
|
const models = {
|
|
@@ -950,7 +1207,8 @@ const models = {
|
|
|
950
1207
|
ModelCustomer
|
|
951
1208
|
};
|
|
952
1209
|
const routes = {
|
|
953
|
-
RoutesOrder
|
|
1210
|
+
RoutesOrder,
|
|
1211
|
+
RoutesCustomers: setupCustomersRoutes
|
|
954
1212
|
};
|
|
955
1213
|
const controllers = {
|
|
956
1214
|
FactoryOrder: controllerFactory
|