@mohasinac/appkit 3.4.8 → 3.5.0
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/_internal/client/features/classified/ClassifiedDetailView.js +1 -1
- package/dist/_internal/client/features/digital-code/CodeRevealPanel.js +1 -1
- package/dist/_internal/client/features/digital-code/DigitalCodeDetailView.js +1 -1
- package/dist/_internal/client/features/filters/filter-load-options.js +10 -9
- package/dist/_internal/client/features/layout/DashboardLayoutClient.d.ts +6 -1
- package/dist/_internal/client/features/layout/DashboardLayoutClient.js +11 -4
- package/dist/_internal/client/features/live/LiveItemDetailView.js +2 -2
- package/dist/_internal/client/features/maintenance/views/AnalysisRunnerView.js +10 -3
- package/dist/_internal/client/features/maintenance/views/ServerErrorsListView.js +2 -2
- package/dist/_internal/client/scaffolds/DashboardScaffold.js +3 -1
- package/dist/_internal/server/features/checkout/actions.d.ts +16 -0
- package/dist/_internal/server/features/checkout/actions.js +149 -35
- package/dist/_internal/server/features/checkout/bundle-expansion.d.ts +31 -0
- package/dist/_internal/server/features/checkout/bundle-expansion.js +41 -0
- package/dist/_internal/server/features/lottery/actions.js +14 -4
- package/dist/_internal/server/features/maintenance/analyze.js +4 -2
- package/dist/_internal/server/features/orders/actions.js +9 -0
- package/dist/_internal/server/features/orders/adapters.js +19 -0
- package/dist/_internal/server/features/seo/robots.js +1 -1
- package/dist/_internal/server/functions/firestore.d.ts +47 -1
- package/dist/_internal/server/functions/firestore.js +56 -1
- package/dist/_internal/server/functions/scheduled.d.ts +2 -1
- package/dist/_internal/server/functions/scheduled.js +9 -1
- package/dist/_internal/server/jobs/core/catalogueImageStalenessReminder.d.ts +10 -0
- package/dist/_internal/server/jobs/core/catalogueImageStalenessReminder.js +49 -0
- package/dist/_internal/server/jobs/core/cleanupRtdbEvents.js +32 -0
- package/dist/_internal/server/jobs/core/hardBanCascade.d.ts +26 -0
- package/dist/_internal/server/jobs/core/hardBanCascade.js +179 -0
- package/dist/_internal/server/jobs/core/index.d.ts +4 -1
- package/dist/_internal/server/jobs/core/index.js +4 -1
- package/dist/_internal/server/jobs/core/jobRunners.d.ts +28 -0
- package/dist/_internal/server/jobs/core/jobRunners.js +37 -0
- package/dist/_internal/server/jobs/core/onCatalogueSubmittedForApproval.d.ts +15 -0
- package/dist/_internal/server/jobs/core/onCatalogueSubmittedForApproval.js +38 -0
- package/dist/_internal/server/jobs/core/onJobCreated.d.ts +22 -0
- package/dist/_internal/server/jobs/core/onJobCreated.js +59 -0
- package/dist/_internal/server/jobs/core/weeklyPayoutEligibility.d.ts +6 -1
- package/dist/_internal/server/jobs/core/weeklyPayoutEligibility.js +5 -2
- package/dist/_internal/server/jobs/handlers/catalogueImageStalenessReminder.d.ts +2 -0
- package/dist/_internal/server/jobs/handlers/catalogueImageStalenessReminder.js +2 -0
- package/dist/_internal/server/jobs/handlers/index.d.ts +6 -0
- package/dist/_internal/server/jobs/handlers/index.js +8 -0
- package/dist/_internal/server/jobs/handlers/onCatalogueSubmittedForApproval.d.ts +12 -0
- package/dist/_internal/server/jobs/handlers/onCatalogueSubmittedForApproval.js +20 -0
- package/dist/_internal/server/jobs/handlers/onJobCreated.d.ts +3 -0
- package/dist/_internal/server/jobs/handlers/onJobCreated.js +9 -0
- package/dist/_internal/server/jobs/handlers/onShipmentAllocationSync.d.ts +25 -0
- package/dist/_internal/server/jobs/handlers/onShipmentAllocationSync.js +71 -0
- package/dist/_internal/server/jobs/handlers/onShipmentDeleted.d.ts +14 -0
- package/dist/_internal/server/jobs/handlers/onShipmentDeleted.js +23 -0
- package/dist/_internal/server/jobs/handlers/onShipmentItemWrite.d.ts +17 -0
- package/dist/_internal/server/jobs/handlers/onShipmentItemWrite.js +26 -0
- package/dist/_internal/server/jobs/handlers/weeklyPayoutEligibility.js +3 -1
- package/dist/_internal/shared/actions/action-registry.d.ts +1 -1
- package/dist/_internal/shared/actions/action-registry.js +136 -0
- package/dist/_internal/shared/features/blog/schema.d.ts +8 -8
- package/dist/_internal/shared/features/brands/schema.d.ts +4 -4
- package/dist/_internal/shared/features/categories/bundle-schemas.d.ts +8 -8
- package/dist/_internal/shared/features/events/schema.d.ts +4 -4
- package/dist/_internal/shared/features/products/schema.d.ts +8 -8
- package/dist/_internal/shared/features/promotions/schema.d.ts +4 -4
- package/dist/_internal/shared/features/reviews/schema.d.ts +4 -4
- package/dist/client/api/useFeatureFlags.d.ts +22 -0
- package/dist/client/api/useFeatureFlags.js +27 -0
- package/dist/client/observability/reportClientError.js +3 -2
- package/dist/client.d.ts +4 -2
- package/dist/client.js +2 -1
- package/dist/configs/next.js +1 -0
- package/dist/constants/api-endpoints.d.ts +279 -3
- package/dist/constants/api-endpoints.js +130 -2
- package/dist/core/hooks/useSyncManager.js +5 -4
- package/dist/errors/conflict-error.d.ts +4 -0
- package/dist/errors/conflict-error.js +6 -0
- package/dist/errors/index.d.ts +1 -0
- package/dist/errors/index.js +1 -0
- package/dist/features/about/components/FeesView.js +2 -2
- package/dist/features/about/components/HelpPageView.js +2 -2
- package/dist/features/about/components/HowAuctionsWorkView.js +2 -2
- package/dist/features/about/components/HowCheckoutWorksView.js +2 -2
- package/dist/features/about/components/HowEmiWorksView.js +2 -2
- package/dist/features/about/components/HowOffersWorkView.js +3 -3
- package/dist/features/about/components/HowOrdersWorkView.js +3 -3
- package/dist/features/about/components/HowPayoutsWorkView.js +2 -2
- package/dist/features/about/components/HowPreOrdersWorkView.js +2 -2
- package/dist/features/about/components/HowReviewsWorkView.js +2 -2
- package/dist/features/about/components/PublicProfileView.d.ts +8 -1
- package/dist/features/about/components/PublicProfileView.js +11 -9
- package/dist/features/about/components/SecurityPrivacyView.js +2 -2
- package/dist/features/about/components/UnauthorizedView.js +2 -2
- package/dist/features/account/components/AddressBook.js +1 -1
- package/dist/features/account/components/AddressesIndexListing.js +1 -1
- package/dist/features/account/components/NotificationBell.js +5 -5
- package/dist/features/account/components/NotificationPreferencesPanel.js +5 -2
- package/dist/features/account/components/UserOffersPanel.js +5 -4
- package/dist/features/account/components/UserSidebar.js +2 -2
- package/dist/features/account/components/UserSupportView.js +3 -3
- package/dist/features/account/schemas/index.d.ts +12 -12
- package/dist/features/addresses/schemas/index.d.ts +6 -6
- package/dist/features/admin/components/AdminAdEditorView.js +3 -3
- package/dist/features/admin/components/AdminAddressEditorView.js +3 -3
- package/dist/features/admin/components/AdminAdsView.js +3 -3
- package/dist/features/admin/components/AdminBlogEditorView.js +1 -1
- package/dist/features/admin/components/AdminBlogView.js +12 -15
- package/dist/features/admin/components/AdminBrandEditorView.js +1 -1
- package/dist/features/admin/components/AdminBrandsView.js +12 -13
- package/dist/features/admin/components/AdminBundleEditorView.js +5 -4
- package/dist/features/admin/components/AdminBundlesView.js +32 -23
- package/dist/features/admin/components/AdminCarouselEditorView.js +5 -5
- package/dist/features/admin/components/AdminCarouselView.js +2 -2
- package/dist/features/admin/components/AdminCatalogGuideView.js +1 -1
- package/dist/features/admin/components/AdminCategoriesView.js +12 -13
- package/dist/features/admin/components/AdminCategoryEditorView.js +2 -2
- package/dist/features/admin/components/AdminContactEditorView.js +2 -2
- package/dist/features/admin/components/AdminCouponEditorView.d.ts +10 -1
- package/dist/features/admin/components/AdminCouponEditorView.js +7 -2
- package/dist/features/admin/components/AdminCouponsView.js +32 -27
- package/dist/features/admin/components/AdminEmployeeEditorView.js +3 -3
- package/dist/features/admin/components/AdminFaqEditorView.js +1 -1
- package/dist/features/admin/components/AdminFaqsView.js +20 -20
- package/dist/features/admin/components/AdminFeatureEditorView.js +5 -5
- package/dist/features/admin/components/AdminFeaturesView.js +9 -10
- package/dist/features/admin/components/AdminFilterBar.js +1 -1
- package/dist/features/admin/components/AdminFulfillmentView.js +4 -4
- package/dist/features/admin/components/AdminGuideHubView.js +2 -2
- package/dist/features/admin/components/AdminMediaView.js +3 -2
- package/dist/features/admin/components/AdminNavigationView.js +1 -1
- package/dist/features/admin/components/AdminOrderEditorView.js +3 -3
- package/dist/features/admin/components/AdminOrdersView.js +21 -30
- package/dist/features/admin/components/AdminPageHeader.js +3 -3
- package/dist/features/admin/components/AdminPayoutsView.js +8 -8
- package/dist/features/admin/components/AdminPrizeDrawsView.js +8 -9
- package/dist/features/admin/components/AdminProductEditorView.d.ts +9 -1
- package/dist/features/admin/components/AdminProductEditorView.js +7 -4
- package/dist/features/admin/components/AdminProductsView.js +30 -41
- package/dist/features/admin/components/AdminReviewsView.js +14 -17
- package/dist/features/admin/components/AdminScammerEditorView.js +5 -5
- package/dist/features/admin/components/AdminSectionsView.js +3 -3
- package/dist/features/admin/components/AdminSessionsView.js +8 -10
- package/dist/features/admin/components/AdminSidebar.js +2 -2
- package/dist/features/admin/components/AdminSiteSettingsView.js +10 -3
- package/dist/features/admin/components/AdminStoreEditorView.js +4 -5
- package/dist/features/admin/components/AdminStoresView.js +18 -13
- package/dist/features/admin/components/AdminSupportTicketDetailView.js +7 -7
- package/dist/features/admin/components/AdminTeamView.js +9 -5
- package/dist/features/admin/components/AdminUsersView.js +19 -15
- package/dist/features/admin/components/AdminViewCards.js +5 -5
- package/dist/features/admin/components/DashboardStats.js +1 -1
- package/dist/features/admin/components/DataListingView.js +2 -2
- package/dist/features/admin/components/DataTable.js +2 -2
- package/dist/features/admin/components/DrawerFormFooter.js +1 -1
- package/dist/features/admin/components/analytics/AdminAnalyticsCharts.js +2 -2
- package/dist/features/admin/components/analytics/AdminStatCard.js +1 -1
- package/dist/features/admin/hooks/useAdminListing.d.ts +3 -2
- package/dist/features/admin/hooks/useAdminListing.js +8 -2
- package/dist/features/admin/permission-map.js +2 -0
- package/dist/features/admin/schemas/firestore.d.ts +7 -0
- package/dist/features/admin/schemas/firestore.js +4 -0
- package/dist/features/auctions/components/AuctionBidsTable.js +1 -1
- package/dist/features/auctions/components/AuctionDetailPageView.js +7 -7
- package/dist/features/auctions/components/MarketplaceAuctionCard.js +3 -3
- package/dist/features/auctions/components/MarketplaceAuctionGrid.js +4 -4
- package/dist/features/auctions/components/PlaceBidFormClient.js +1 -1
- package/dist/features/auctions/schemas/index.d.ts +16 -16
- package/dist/features/auth/permissions/constants.d.ts +1 -1
- package/dist/features/auth/permissions/constants.js +2 -0
- package/dist/features/auth/schemas/index.d.ts +6 -6
- package/dist/features/before-after/schemas/index.d.ts +3 -3
- package/dist/features/blog/actions/blog-actions.d.ts +32 -32
- package/dist/features/blog/components/BlogFeaturedCard.js +2 -2
- package/dist/features/blog/components/BlogIndexListing.js +2 -2
- package/dist/features/blog/components/BlogListView.js +4 -4
- package/dist/features/blog/components/BlogPostView.js +4 -4
- package/dist/features/blog/schemas/index.d.ts +77 -77
- package/dist/features/cart/components/CartDrawer.js +2 -2
- package/dist/features/catalogue/actions/approve-catalogue-listing.d.ts +12 -0
- package/dist/features/catalogue/actions/approve-catalogue-listing.js +50 -0
- package/dist/features/catalogue/actions/list-from-catalogue.d.ts +17 -0
- package/dist/features/catalogue/actions/list-from-catalogue.js +50 -0
- package/dist/features/catalogue/actions/submit-for-approval.d.ts +8 -0
- package/dist/features/catalogue/actions/submit-for-approval.js +30 -0
- package/dist/features/catalogue/components/AdminCatalogueApprovalsView.d.ts +2 -0
- package/dist/features/catalogue/components/AdminCatalogueApprovalsView.js +53 -0
- package/dist/features/catalogue/components/CatalogueItemEditorView.d.ts +7 -0
- package/dist/features/catalogue/components/CatalogueItemEditorView.js +79 -0
- package/dist/features/catalogue/components/PublicCatalogueView.d.ts +5 -0
- package/dist/features/catalogue/components/PublicCatalogueView.js +22 -0
- package/dist/features/catalogue/components/UserCatalogueView.d.ts +12 -0
- package/dist/features/catalogue/components/UserCatalogueView.js +51 -0
- package/dist/features/catalogue/index.d.ts +12 -0
- package/dist/features/catalogue/index.js +9 -0
- package/dist/features/catalogue/repository/catalogue.repository.d.ts +39 -0
- package/dist/features/catalogue/repository/catalogue.repository.js +68 -0
- package/dist/features/catalogue/schemas/firestore.d.ts +47 -0
- package/dist/features/catalogue/schemas/firestore.js +22 -0
- package/dist/features/catalogue/schemas/index.d.ts +2 -0
- package/dist/features/catalogue/schemas/index.js +2 -0
- package/dist/features/catalogue/schemas/validation.d.ts +71 -0
- package/dist/features/catalogue/schemas/validation.js +25 -0
- package/dist/features/catalogue/utils/freshness.d.ts +10 -0
- package/dist/features/catalogue/utils/freshness.js +15 -0
- package/dist/features/catalogue/utils/product-from-item.d.ts +15 -0
- package/dist/features/catalogue/utils/product-from-item.js +34 -0
- package/dist/features/categories/components/BrandDetailPageView.js +1 -1
- package/dist/features/categories/components/BrandDetailTabs.js +2 -2
- package/dist/features/categories/components/BundleCollage.js +2 -2
- package/dist/features/categories/components/BundleItemsPicker.js +3 -2
- package/dist/features/categories/components/CategoriesIndexListing.js +8 -6
- package/dist/features/categories/components/CategoryBundlesListing.js +10 -4
- package/dist/features/categories/components/CategoryDetailPageView.js +1 -1
- package/dist/features/categories/components/CategoryDetailTabs.js +2 -2
- package/dist/features/categories/components/CategoryGrid.js +3 -3
- package/dist/features/categories/components/CategoryProductsListing.js +1 -1
- package/dist/features/categories/components/CategorySortSelect.js +1 -1
- package/dist/features/categories/components/CategoryStoresListing.js +1 -1
- package/dist/features/categories/components/CategoryTableColumns.js +1 -1
- package/dist/features/categories/components/CategoryTree.js +2 -2
- package/dist/features/categories/components/ConcernCard.js +1 -1
- package/dist/features/categories/hooks/useCategories.js +1 -1
- package/dist/features/categories/schemas/index.d.ts +32 -32
- package/dist/features/classified/components/ClassifiedFilters.js +2 -2
- package/dist/features/classified/components/ClassifiedIndexListing.js +9 -3
- package/dist/features/collections/schemas/index.d.ts +2 -2
- package/dist/features/consultation/components/ConsultationForm.js +1 -1
- package/dist/features/consultation/schemas/index.d.ts +10 -10
- package/dist/features/contact/components/ContactForm.js +4 -4
- package/dist/features/contact/components/ContactInfoSidebar.js +1 -1
- package/dist/features/contact/components/ContactPageView.js +2 -1
- package/dist/features/copilot/components/AdminCopilotView.js +5 -4
- package/dist/features/corporate/schemas/index.d.ts +2 -2
- package/dist/features/digital-codes/components/DigitalCodesIndexListing.js +3 -3
- package/dist/features/events/components/AdminEventEditorView.js +4 -4
- package/dist/features/events/components/AdminEventEntriesView.js +2 -2
- package/dist/features/events/components/AdminEventsView.js +8 -8
- package/dist/features/events/components/EventBanner.js +1 -1
- package/dist/features/events/components/EventCard.js +3 -3
- package/dist/features/events/components/EventLeaderboard.js +1 -1
- package/dist/features/events/components/EventOfferCard.js +1 -1
- package/dist/features/events/components/EventPollWidget.js +6 -5
- package/dist/features/events/components/EventRaffleEntryForm.js +1 -1
- package/dist/features/events/components/EventRaffleWinnerView.js +5 -5
- package/dist/features/events/components/EventRafflesSection.js +1 -1
- package/dist/features/events/components/EventSaleBanner.js +1 -1
- package/dist/features/events/components/EventsIndexListing.js +4 -2
- package/dist/features/events/components/EventsListView.js +2 -2
- package/dist/features/events/components/SpinWheelView.js +11 -5
- package/dist/features/events/schemas/index.d.ts +100 -100
- package/dist/features/faq/actions/faq-actions.d.ts +6 -6
- package/dist/features/faq/components/ContactCTA.js +3 -3
- package/dist/features/faq/components/FAQCategorySidebar.js +2 -2
- package/dist/features/faq/components/FAQHelpfulButtons.js +3 -3
- package/dist/features/faq/schemas/index.d.ts +12 -12
- package/dist/features/filters/AsyncFacetSection.js +4 -4
- package/dist/features/filters/FilterFacetSection.js +8 -8
- package/dist/features/filters/RangeFilter.js +2 -2
- package/dist/features/filters/SwitchFilter.js +1 -1
- package/dist/features/forms/Checkbox.js +2 -8
- package/dist/features/forms/Input.js +2 -1
- package/dist/features/forms/Radio.js +3 -3
- package/dist/features/forms/Select.d.ts +1 -1
- package/dist/features/forms/Select.js +3 -2
- package/dist/features/forms/Slider.js +5 -11
- package/dist/features/forms/Textarea.js +2 -1
- package/dist/features/grouped/schemas/index.d.ts +6 -6
- package/dist/features/homepage/actions/homepage-section-actions.d.ts +4 -4
- package/dist/features/homepage/components/AdvertisementBanner.js +4 -4
- package/dist/features/homepage/components/AnnouncementBar.js +3 -3
- package/dist/features/homepage/components/BeforeAfterCard.js +1 -1
- package/dist/features/homepage/components/BrandsSection.js +9 -9
- package/dist/features/homepage/components/CTABannerSection.js +1 -1
- package/dist/features/homepage/components/CharacterHotspot.js +4 -4
- package/dist/features/homepage/components/CharacterHotspotForm.js +15 -13
- package/dist/features/homepage/components/CollectionCardsSection.js +1 -1
- package/dist/features/homepage/components/CustomCardsSection.js +6 -6
- package/dist/features/homepage/components/CustomerReviewsSection.js +2 -2
- package/dist/features/homepage/components/FAQSection.js +2 -2
- package/dist/features/homepage/components/FeaturedBundlesSection.js +3 -3
- package/dist/features/homepage/components/FeaturedResultsSection.js +2 -2
- package/dist/features/homepage/components/GoogleReviewsSection.js +6 -6
- package/dist/features/homepage/components/HeroBanner.js +1 -1
- package/dist/features/homepage/components/HeroCarousel.js +5 -4
- package/dist/features/homepage/components/HeroSection.js +1 -7
- package/dist/features/homepage/components/HomepageSkeleton.js +1 -1
- package/dist/features/homepage/components/HowItWorksInfoView.js +1 -1
- package/dist/features/homepage/components/HowItWorksSection.js +2 -2
- package/dist/features/homepage/components/NewsletterBanner.js +2 -2
- package/dist/features/homepage/components/NewsletterSection.js +1 -1
- package/dist/features/homepage/components/PromoGrid.js +1 -1
- package/dist/features/homepage/components/SectionCarousel.js +6 -6
- package/dist/features/homepage/components/SecurityHighlightsSection.js +2 -2
- package/dist/features/homepage/components/ShopByCategorySection.js +10 -10
- package/dist/features/homepage/components/SiteFeaturesSection.js +2 -2
- package/dist/features/homepage/components/SocialFeedSection.js +5 -5
- package/dist/features/homepage/components/SocialPostCard.js +1 -1
- package/dist/features/homepage/components/StatsCounterSection.js +1 -1
- package/dist/features/homepage/components/TestimonialsCarousel.js +1 -1
- package/dist/features/homepage/components/TrustBadges.js +1 -1
- package/dist/features/homepage/components/TrustFeaturesSection.js +2 -2
- package/dist/features/homepage/components/TrustIndicatorsSection.js +2 -2
- package/dist/features/homepage/components/WelcomeSection.js +2 -2
- package/dist/features/homepage/components/WhatsAppCommunitySection.js +1 -1
- package/dist/features/homepage/hooks/useActiveAd.js +2 -1
- package/dist/features/homepage/schemas/firestore.d.ts +10 -0
- package/dist/features/homepage/schemas/index.d.ts +116 -116
- package/dist/features/jobs/actions/enqueue-job.d.ts +24 -0
- package/dist/features/jobs/actions/enqueue-job.js +44 -0
- package/dist/features/jobs/repository/jobs.repository.d.ts +21 -0
- package/dist/features/jobs/repository/jobs.repository.js +48 -0
- package/dist/features/jobs/schemas/firestore.d.ts +54 -0
- package/dist/features/jobs/schemas/firestore.js +24 -0
- package/dist/features/layout/AppLayoutShell.js +17 -11
- package/dist/features/layout/AutoBreadcrumbs.js +1 -1
- package/dist/features/layout/BackToTop.js +2 -2
- package/dist/features/layout/BottomActions.js +7 -7
- package/dist/features/layout/BottomNavItem.js +2 -2
- package/dist/features/layout/BottomNavLayout.js +13 -4
- package/dist/features/layout/BottomNavbar.d.ts +9 -1
- package/dist/features/layout/BottomNavbar.js +12 -5
- package/dist/features/layout/BottomSheet.js +1 -1
- package/dist/features/layout/Breadcrumbs.js +1 -1
- package/dist/features/layout/FooterLayout.js +2 -2
- package/dist/features/layout/NavItem.js +3 -3
- package/dist/features/layout/NavbarLayout.js +6 -6
- package/dist/features/layout/SidebarLayout.d.ts +3 -0
- package/dist/features/layout/SidebarLayout.js +3 -3
- package/dist/features/layout/TitleBarLayout.js +4 -4
- package/dist/features/live/components/LiveItemFilters.js +2 -2
- package/dist/features/live/components/LiveItemsIndexListing.js +3 -3
- package/dist/features/lottery/types/index.d.ts +3 -1
- package/dist/features/lottery/types/index.js +16 -3
- package/dist/features/loyalty/components/CoinsDisplay.js +2 -2
- package/dist/features/media/MediaImage.d.ts +6 -1
- package/dist/features/media/MediaImage.js +10 -4
- package/dist/features/media/MediaLightbox.js +1 -1
- package/dist/features/media/MediaPickerModal.js +4 -3
- package/dist/features/media/MediaVideo.js +1 -1
- package/dist/features/media/modals/ImageCropModal.js +1 -1
- package/dist/features/media/modals/ImageEditor.js +1 -1
- package/dist/features/media/repository/media-assets.repository.d.ts +9 -0
- package/dist/features/media/types/index.d.ts +4 -4
- package/dist/features/media/upload/MediaUploadField.js +3 -3
- package/dist/features/media/upload/MediaUploadList.js +1 -1
- package/dist/features/messages/hooks/useConversation.js +4 -3
- package/dist/features/messages/hooks/useConversations.js +2 -1
- package/dist/features/messages/schemas/index.d.ts +6 -6
- package/dist/features/orders/components/MarketplaceOrderCard.js +1 -1
- package/dist/features/orders/components/OrderPaymentSummary.d.ts +16 -0
- package/dist/features/orders/components/OrderPaymentSummary.js +32 -0
- package/dist/features/orders/components/OrderSiblingPayments.js +1 -1
- package/dist/features/orders/components/OrdersList.d.ts +7 -2
- package/dist/features/orders/components/OrdersList.js +5 -5
- package/dist/features/orders/components/RefundHistoryTable.js +1 -1
- package/dist/features/orders/components/RefundRequestView.js +1 -1
- package/dist/features/orders/components/index.d.ts +2 -0
- package/dist/features/orders/components/index.js +1 -0
- package/dist/features/orders/repository/orders.repository.d.ts +8 -0
- package/dist/features/orders/repository/orders.repository.js +24 -0
- package/dist/features/orders/schemas/firestore.d.ts +59 -0
- package/dist/features/orders/schemas/firestore.js +5 -0
- package/dist/features/orders/schemas/index.d.ts +91 -40
- package/dist/features/orders/schemas/index.js +10 -0
- package/dist/features/orders/types/index.d.ts +15 -0
- package/dist/features/payments/schemas/index.d.ts +12 -12
- package/dist/features/pre-orders/components/MarketplacePreorderCard.js +5 -5
- package/dist/features/pre-orders/components/PreOrderActionsClient.js +1 -1
- package/dist/features/pre-orders/components/PreOrderBadge.js +1 -1
- package/dist/features/pre-orders/components/PreOrderDetailPageView.js +7 -7
- package/dist/features/pre-orders/components/PreOrdersIndexListing.js +3 -3
- package/dist/features/pre-orders/schemas/index.d.ts +12 -12
- package/dist/features/products/columns/productTableColumns.js +2 -2
- package/dist/features/products/components/AuctionsIndexListing.js +3 -3
- package/dist/features/products/components/CompareOverlay.js +15 -10
- package/dist/features/products/components/CustomFieldsEditor.js +2 -2
- package/dist/features/products/components/CustomSectionsEditor.js +3 -3
- package/dist/features/products/components/FeatureBadge.js +2 -2
- package/dist/features/products/components/GroupSettingsPanel.js +5 -4
- package/dist/features/products/components/MakeOfferButton.js +4 -4
- package/dist/features/products/components/MarketplaceBundleCard.js +3 -2
- package/dist/features/products/components/MarketplacePrizeDrawCard.js +1 -1
- package/dist/features/products/components/PrizeDrawCollage.js +6 -6
- package/dist/features/products/components/PrizeDrawDetailPageView.js +5 -5
- package/dist/features/products/components/PrizeDrawEntryActions.js +1 -1
- package/dist/features/products/components/PrizeDrawItemsEditor.js +4 -4
- package/dist/features/products/components/PrizeDrawsIndexListing.js +11 -4
- package/dist/features/products/components/PrizeDrawsSection.js +1 -1
- package/dist/features/products/components/PrizeRevealModal.js +9 -4
- package/dist/features/products/components/ProductDetailActions.js +2 -1
- package/dist/features/products/components/ProductDetailPageView.js +16 -16
- package/dist/features/products/components/ProductFeaturesSelector.js +5 -5
- package/dist/features/products/components/ProductForm.js +1 -1
- package/dist/features/products/components/ProductGalleryClient.js +5 -3
- package/dist/features/products/components/ProductGrid.js +11 -11
- package/dist/features/products/components/ProductTabs.js +2 -2
- package/dist/features/products/components/ProductTabsShell.js +2 -1
- package/dist/features/products/components/ProductsIndexListing.js +6 -1
- package/dist/features/products/components/ShareButton.js +2 -1
- package/dist/features/products/components/ShowGroupSection.js +9 -5
- package/dist/features/products/components/SublistingCarouselSection.js +8 -4
- package/dist/features/products/constants/action-defs.d.ts +10 -2
- package/dist/features/products/constants/action-defs.js +20 -2
- package/dist/features/products/schemas/firestore.d.ts +5 -0
- package/dist/features/products/schemas/index.d.ts +40 -40
- package/dist/features/products/schemas/product-features.validators.d.ts +14 -14
- package/dist/features/promotions/components/CouponCard.js +13 -7
- package/dist/features/promotions/components/CouponsIndexListing.js +4 -6
- package/dist/features/promotions/components/PromotionsView.js +2 -2
- package/dist/features/promotions/schemas/index.d.ts +26 -26
- package/dist/features/reviews/components/ReviewDetailPageView.js +1 -1
- package/dist/features/reviews/components/ReviewDetailShell.js +11 -11
- package/dist/features/reviews/components/ReviewModal.js +1 -1
- package/dist/features/reviews/components/ReviewsIndexListing.js +2 -2
- package/dist/features/reviews/components/ReviewsList.js +2 -2
- package/dist/features/reviews/schemas/index.d.ts +22 -22
- package/dist/features/scams/components/ScamAwarenessModal.js +2 -2
- package/dist/features/scams/components/ScamProfileView.js +3 -3
- package/dist/features/scams/components/ScamRegistryView.js +2 -2
- package/dist/features/scams/schemas/index.d.ts +20 -20
- package/dist/features/search/components/Search.js +9 -9
- package/dist/features/search/components/SearchFiltersRow.js +1 -1
- package/dist/features/search/components/SearchResultsSection.js +3 -3
- package/dist/features/search/components/SearchView.js +1 -1
- package/dist/features/search/hooks/useNavSuggestions.js +2 -1
- package/dist/features/search/hooks/useSearch.js +2 -2
- package/dist/features/search/schemas/index.d.ts +3 -3
- package/dist/features/seller/components/BrandInlineSelect.js +2 -2
- package/dist/features/seller/components/CategoryInlineSelect.js +2 -2
- package/dist/features/seller/components/QuickProductForm.js +1 -1
- package/dist/features/seller/components/SellerAddressesView.js +4 -4
- package/dist/features/seller/components/SellerAnalyticsAlertsView.js +3 -3
- package/dist/features/seller/components/SellerAnalyticsView.js +2 -2
- package/dist/features/seller/components/SellerArtView.js +11 -11
- package/dist/features/seller/components/SellerAuctionsView.js +11 -11
- package/dist/features/seller/components/SellerBidsView.js +3 -3
- package/dist/features/seller/components/SellerBundlesView.js +12 -12
- package/dist/features/seller/components/SellerClassifiedView.js +11 -11
- package/dist/features/seller/components/SellerCouponEditorView.js +2 -2
- package/dist/features/seller/components/SellerDigitalCodesView.js +11 -11
- package/dist/features/seller/components/SellerFeaturesView.js +4 -4
- package/dist/features/seller/components/SellerLiveView.js +11 -11
- package/dist/features/seller/components/SellerOffersPanel.js +3 -2
- package/dist/features/seller/components/SellerOrdersView.js +2 -2
- package/dist/features/seller/components/SellerPayoutMethodsView.js +1 -1
- package/dist/features/seller/components/SellerPayoutRequestView.js +6 -5
- package/dist/features/seller/components/SellerPayoutSettingsView.js +5 -4
- package/dist/features/seller/components/SellerPreOrdersView.js +1 -1
- package/dist/features/seller/components/SellerPrizeDrawsView.js +1 -1
- package/dist/features/seller/components/SellerProductShell.js +20 -6
- package/dist/features/seller/components/SellerProductsCards.js +3 -3
- package/dist/features/seller/components/SellerProductsView.js +4 -4
- package/dist/features/seller/components/SellerReviewsView.js +7 -6
- package/dist/features/seller/components/SellerShippingView.js +2 -1
- package/dist/features/seller/components/SellerSidebar.js +5 -5
- package/dist/features/seller/components/SellerStickersView.js +11 -11
- package/dist/features/seller/components/SellerTemplatesView.js +1 -1
- package/dist/features/seller/schemas/index.d.ts +20 -20
- package/dist/features/server-errors/schemas/index.d.ts +6 -6
- package/dist/features/shell/CommandPalette.d.ts +27 -0
- package/dist/features/shell/CommandPalette.js +92 -0
- package/dist/features/shell/FormShell.js +4 -3
- package/dist/features/shell/QuickFormDrawer.js +3 -2
- package/dist/features/shell/StepForm.js +2 -2
- package/dist/features/shell/index.d.ts +2 -0
- package/dist/features/shell/index.js +1 -0
- package/dist/features/shipments/components/AdminShipmentEditorView.d.ts +7 -0
- package/dist/features/shipments/components/AdminShipmentEditorView.js +123 -0
- package/dist/features/shipments/components/AdminShipmentLotItemsView.d.ts +6 -0
- package/dist/features/shipments/components/AdminShipmentLotItemsView.js +96 -0
- package/dist/features/shipments/components/AdminShipmentProjectionsView.d.ts +9 -0
- package/dist/features/shipments/components/AdminShipmentProjectionsView.js +44 -0
- package/dist/features/shipments/components/AdminShipmentsView.d.ts +8 -0
- package/dist/features/shipments/components/AdminShipmentsView.js +82 -0
- package/dist/features/shipments/components/ShipmentItemLinkModal.d.ts +15 -0
- package/dist/features/shipments/components/ShipmentItemLinkModal.js +37 -0
- package/dist/features/shipments/hooks/useShipments.d.ts +69 -0
- package/dist/features/shipments/hooks/useShipments.js +96 -0
- package/dist/features/shipments/index.d.ts +10 -0
- package/dist/features/shipments/index.js +7 -0
- package/dist/features/shipments/manifest.d.ts +2 -0
- package/dist/features/shipments/manifest.js +26 -0
- package/dist/features/shipments/repository/shipment-items.repository.d.ts +56 -0
- package/dist/features/shipments/repository/shipment-items.repository.js +78 -0
- package/dist/features/shipments/repository/shipment-lots.repository.d.ts +48 -0
- package/dist/features/shipments/repository/shipment-lots.repository.js +55 -0
- package/dist/features/shipments/repository/shipments.repository.d.ts +50 -0
- package/dist/features/shipments/repository/shipments.repository.js +77 -0
- package/dist/features/shipments/schemas/firestore.d.ts +150 -0
- package/dist/features/shipments/schemas/firestore.js +76 -0
- package/dist/features/shipments/schemas/index.d.ts +2 -0
- package/dist/features/shipments/schemas/index.js +2 -0
- package/dist/features/shipments/schemas/validation.d.ts +350 -0
- package/dist/features/shipments/schemas/validation.js +96 -0
- package/dist/features/shipments/utils/cost-allocation.d.ts +25 -0
- package/dist/features/shipments/utils/cost-allocation.js +83 -0
- package/dist/features/site-settings/components/ActionPermissionsManager.js +2 -2
- package/dist/features/stores/components/InteractiveStoreCard.js +2 -2
- package/dist/features/stores/components/StoreAboutView.js +1 -1
- package/dist/features/stores/components/StoreAuctionsListing.js +3 -3
- package/dist/features/stores/components/StoreAuctionsView.js +1 -1
- package/dist/features/stores/components/StoreCapabilitiesGuideView.js +1 -1
- package/dist/features/stores/components/StoreClassifiedsListing.js +2 -2
- package/dist/features/stores/components/StoreDetailLayoutView.js +1 -1
- package/dist/features/stores/components/StoreDigitalCodesListing.js +2 -2
- package/dist/features/stores/components/StoreFinanceGuideView.js +2 -2
- package/dist/features/stores/components/StoreGuideHubView.js +2 -2
- package/dist/features/stores/components/StoreHeader.js +4 -4
- package/dist/features/stores/components/StoreLiveItemsListing.js +2 -2
- package/dist/features/stores/components/StoreNavTabs.js +2 -2
- package/dist/features/stores/components/StoreOrdersGuideView.js +1 -1
- package/dist/features/stores/components/StorePreOrdersListing.js +3 -3
- package/dist/features/stores/components/StoreProductsListing.js +1 -1
- package/dist/features/stores/components/StoreReviewsListing.js +2 -2
- package/dist/features/stores/components/StoreReviewsView.js +1 -1
- package/dist/features/stores/components/StoreSettingsGuideView.js +1 -1
- package/dist/features/stores/components/StoresIndexListing.js +9 -3
- package/dist/features/stores/schemas/index.d.ts +10 -10
- package/dist/features/support/schemas/index.d.ts +22 -22
- package/dist/features/whatsapp-bot/components/SellerWhatsAppSettingsView.js +3 -3
- package/dist/features/whatsapp-bot/components/WhatsAppChatButton.js +1 -1
- package/dist/features/wishlist/hooks/useWishlistCount.js +1 -2
- package/dist/index.d.ts +44 -1
- package/dist/index.js +37 -1
- package/dist/next/routing/route-map.d.ts +18 -0
- package/dist/next/routing/route-map.js +9 -0
- package/dist/react/hooks/useVisualViewportInset.d.ts +1 -0
- package/dist/react/hooks/useVisualViewportInset.js +59 -0
- package/dist/react/index.d.ts +1 -0
- package/dist/react/index.js +1 -0
- package/dist/repositories/index.d.ts +5 -0
- package/dist/repositories/index.js +5 -0
- package/dist/schemas/registry.d.ts +398 -364
- package/dist/schemas/sieve.d.ts +2 -2
- package/dist/schemas/webhooks/google-oauth.d.ts +2 -2
- package/dist/schemas/webhooks/razorpay.d.ts +100 -100
- package/dist/seed/_helpers/media.js +1 -0
- package/dist/seed/actions/demo-seed-actions.d.ts +1 -1
- package/dist/seed/catalogue-seed-data.d.ts +2 -0
- package/dist/seed/catalogue-seed-data.js +112 -0
- package/dist/seed/grouped-listings-seed-data.d.ts +5 -0
- package/dist/seed/homepage-sections-seed-data.js +0 -1
- package/dist/seed/index.d.ts +2 -0
- package/dist/seed/index.js +2 -0
- package/dist/seed/manifest.js +6 -0
- package/dist/seed/products-preorders-seed-data.d.ts +5 -0
- package/dist/seed/shipments-seed-data.d.ts +5 -0
- package/dist/seed/shipments-seed-data.js +185 -0
- package/dist/server.d.ts +4 -0
- package/dist/server.js +5 -0
- package/dist/styles.css +75 -19
- package/dist/tailwind-utilities.css +1 -1
- package/dist/tokens/index.d.ts +0 -2
- package/dist/tokens/index.js +0 -2
- package/dist/tokens/tokens.css +12 -2
- package/dist/ui/DataTable.js +4 -3
- package/dist/ui/components/Button.d.ts +4 -1
- package/dist/ui/components/Button.js +11 -5
- package/dist/ui/components/Checkbox.d.ts +9 -1
- package/dist/ui/components/Checkbox.js +5 -2
- package/dist/ui/components/ClaimCouponButton.js +2 -1
- package/dist/ui/components/ConfirmDeleteModal.style.css +1 -1
- package/dist/ui/components/Drawer.style.css +13 -1
- package/dist/ui/components/Dropdown.style.css +2 -2
- package/dist/ui/components/FilterDrawer.d.ts +4 -1
- package/dist/ui/components/FilterDrawer.js +8 -2
- package/dist/ui/components/Form.d.ts +1 -1
- package/dist/ui/components/Form.js +2 -2
- package/dist/ui/components/FormActionBar.style.css +6 -1
- package/dist/ui/components/IconButton.d.ts +6 -1
- package/dist/ui/components/IconButton.js +5 -2
- package/dist/ui/components/IconButton.style.css +11 -0
- package/dist/ui/components/ImageGallery.style.css +2 -0
- package/dist/ui/components/ImageLightbox.style.css +1 -0
- package/dist/ui/components/ListingFilterDrawer.d.ts +4 -1
- package/dist/ui/components/ListingFilterDrawer.js +4 -3
- package/dist/ui/components/ListingLayout.style.css +2 -2
- package/dist/ui/components/Modal.style.css +1 -1
- package/dist/ui/components/Pagination.d.ts +5 -1
- package/dist/ui/components/Pagination.js +4 -2
- package/dist/ui/components/RowActionMenu.js +1 -1
- package/dist/ui/components/RowActionMenu.style.css +1 -1
- package/dist/ui/components/Select.d.ts +6 -1
- package/dist/ui/components/Select.js +18 -13
- package/dist/ui/components/Select.style.css +1 -1
- package/dist/ui/components/Semantic.d.ts +13 -0
- package/dist/ui/components/Semantic.js +16 -3
- package/dist/ui/components/SideDrawer.style.css +16 -4
- package/dist/ui/components/SideModal.style.css +1 -1
- package/dist/ui/components/StickyToolbar.d.ts +3 -2
- package/dist/ui/components/StickyToolbar.js +1 -1
- package/dist/ui/components/Textarea.d.ts +5 -0
- package/dist/ui/components/Textarea.js +8 -4
- package/dist/ui/components/Toast.style.css +3 -0
- package/dist/ui/components/UnsavedChangesModal.style.css +1 -1
- package/dist/ui/components/surface-tokens.d.ts +121 -113
- package/dist/ui/components/surface-tokens.js +110 -104
- package/dist/ui/forms/FormShell.d.ts +8 -27
- package/dist/ui/forms/FormShell.js +1 -194
- package/dist/ui/forms/index.d.ts +2 -2
- package/dist/ui/forms/index.js +1 -1
- package/dist/ui/index.d.ts +8 -4
- package/dist/ui/index.js +4 -2
- package/dist/utils/id-generators.d.ts +27 -0
- package/dist/utils/id-generators.js +45 -0
- package/dist/utils/number.formatter.d.ts +7 -0
- package/dist/utils/number.formatter.js +9 -0
- package/dist/validation/schemas.d.ts +5 -5
- package/package.json +1 -1
|
@@ -29,18 +29,18 @@ export declare const blogPostFirestoreSchema: z.ZodObject<{
|
|
|
29
29
|
source: z.ZodOptional<z.ZodEnum<["upload", "youtube", "external"]>>;
|
|
30
30
|
youtubeId: z.ZodOptional<z.ZodString>;
|
|
31
31
|
}, "strip", z.ZodTypeAny, {
|
|
32
|
+
type: "video" | "image" | "file";
|
|
32
33
|
url: string;
|
|
33
|
-
|
|
34
|
+
source?: "upload" | "youtube" | "external" | undefined;
|
|
34
35
|
alt?: string | undefined;
|
|
35
36
|
thumbnailUrl?: string | undefined;
|
|
36
|
-
source?: "upload" | "youtube" | "external" | undefined;
|
|
37
37
|
youtubeId?: string | undefined;
|
|
38
38
|
}, {
|
|
39
|
+
type: "video" | "image" | "file";
|
|
39
40
|
url: string;
|
|
40
|
-
|
|
41
|
+
source?: "upload" | "youtube" | "external" | undefined;
|
|
41
42
|
alt?: string | undefined;
|
|
42
43
|
thumbnailUrl?: string | undefined;
|
|
43
|
-
source?: "upload" | "youtube" | "external" | undefined;
|
|
44
44
|
youtubeId?: string | undefined;
|
|
45
45
|
}>>;
|
|
46
46
|
contentImages: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
@@ -51,18 +51,18 @@ export declare const blogPostFirestoreSchema: z.ZodObject<{
|
|
|
51
51
|
source: z.ZodOptional<z.ZodEnum<["upload", "youtube", "external"]>>;
|
|
52
52
|
youtubeId: z.ZodOptional<z.ZodString>;
|
|
53
53
|
}, "strip", z.ZodTypeAny, {
|
|
54
|
+
type: "video" | "image" | "file";
|
|
54
55
|
url: string;
|
|
55
|
-
|
|
56
|
+
source?: "upload" | "youtube" | "external" | undefined;
|
|
56
57
|
alt?: string | undefined;
|
|
57
58
|
thumbnailUrl?: string | undefined;
|
|
58
|
-
source?: "upload" | "youtube" | "external" | undefined;
|
|
59
59
|
youtubeId?: string | undefined;
|
|
60
60
|
}, {
|
|
61
|
+
type: "video" | "image" | "file";
|
|
61
62
|
url: string;
|
|
62
|
-
|
|
63
|
+
source?: "upload" | "youtube" | "external" | undefined;
|
|
63
64
|
alt?: string | undefined;
|
|
64
65
|
thumbnailUrl?: string | undefined;
|
|
65
|
-
source?: "upload" | "youtube" | "external" | undefined;
|
|
66
66
|
youtubeId?: string | undefined;
|
|
67
67
|
}>, "many">>;
|
|
68
68
|
additionalImages: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
@@ -73,18 +73,18 @@ export declare const blogPostFirestoreSchema: z.ZodObject<{
|
|
|
73
73
|
source: z.ZodOptional<z.ZodEnum<["upload", "youtube", "external"]>>;
|
|
74
74
|
youtubeId: z.ZodOptional<z.ZodString>;
|
|
75
75
|
}, "strip", z.ZodTypeAny, {
|
|
76
|
+
type: "video" | "image" | "file";
|
|
76
77
|
url: string;
|
|
77
|
-
|
|
78
|
+
source?: "upload" | "youtube" | "external" | undefined;
|
|
78
79
|
alt?: string | undefined;
|
|
79
80
|
thumbnailUrl?: string | undefined;
|
|
80
|
-
source?: "upload" | "youtube" | "external" | undefined;
|
|
81
81
|
youtubeId?: string | undefined;
|
|
82
82
|
}, {
|
|
83
|
+
type: "video" | "image" | "file";
|
|
83
84
|
url: string;
|
|
84
|
-
|
|
85
|
+
source?: "upload" | "youtube" | "external" | undefined;
|
|
85
86
|
alt?: string | undefined;
|
|
86
87
|
thumbnailUrl?: string | undefined;
|
|
87
|
-
source?: "upload" | "youtube" | "external" | undefined;
|
|
88
88
|
youtubeId?: string | undefined;
|
|
89
89
|
}>, "many">>;
|
|
90
90
|
category: z.ZodString;
|
|
@@ -107,18 +107,18 @@ export declare const blogPostFirestoreSchema: z.ZodObject<{
|
|
|
107
107
|
metaDescription: z.ZodOptional<z.ZodString>;
|
|
108
108
|
}, "strip", z.ZodTypeAny, {
|
|
109
109
|
status: "draft" | "published" | "archived";
|
|
110
|
-
|
|
110
|
+
id: string;
|
|
111
|
+
title: string;
|
|
112
|
+
content: string;
|
|
111
113
|
createdAt: string | Date | z.objectOutputType<{
|
|
112
114
|
toDate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodDate>;
|
|
113
115
|
}, z.ZodTypeAny, "passthrough">;
|
|
114
|
-
title: string;
|
|
115
|
-
slug: string;
|
|
116
|
-
tags: string[];
|
|
117
|
-
id: string;
|
|
118
116
|
updatedAt: string | Date | z.objectOutputType<{
|
|
119
117
|
toDate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodDate>;
|
|
120
118
|
}, z.ZodTypeAny, "passthrough">;
|
|
121
|
-
|
|
119
|
+
category: string;
|
|
120
|
+
slug: string;
|
|
121
|
+
tags: string[];
|
|
122
122
|
isFeatured: boolean;
|
|
123
123
|
excerpt: string;
|
|
124
124
|
authorId: string;
|
|
@@ -129,46 +129,46 @@ export declare const blogPostFirestoreSchema: z.ZodObject<{
|
|
|
129
129
|
toDate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodDate>;
|
|
130
130
|
}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
131
131
|
coverImage?: {
|
|
132
|
+
type: "video" | "image" | "file";
|
|
132
133
|
url: string;
|
|
133
|
-
|
|
134
|
+
source?: "upload" | "youtube" | "external" | undefined;
|
|
134
135
|
alt?: string | undefined;
|
|
135
136
|
thumbnailUrl?: string | undefined;
|
|
136
|
-
source?: "upload" | "youtube" | "external" | undefined;
|
|
137
137
|
youtubeId?: string | undefined;
|
|
138
138
|
} | undefined;
|
|
139
139
|
metaTitle?: string | undefined;
|
|
140
140
|
metaDescription?: string | undefined;
|
|
141
141
|
contentImages?: {
|
|
142
|
+
type: "video" | "image" | "file";
|
|
142
143
|
url: string;
|
|
143
|
-
|
|
144
|
+
source?: "upload" | "youtube" | "external" | undefined;
|
|
144
145
|
alt?: string | undefined;
|
|
145
146
|
thumbnailUrl?: string | undefined;
|
|
146
|
-
source?: "upload" | "youtube" | "external" | undefined;
|
|
147
147
|
youtubeId?: string | undefined;
|
|
148
148
|
}[] | undefined;
|
|
149
149
|
additionalImages?: {
|
|
150
|
+
type: "video" | "image" | "file";
|
|
150
151
|
url: string;
|
|
151
|
-
|
|
152
|
+
source?: "upload" | "youtube" | "external" | undefined;
|
|
152
153
|
alt?: string | undefined;
|
|
153
154
|
thumbnailUrl?: string | undefined;
|
|
154
|
-
source?: "upload" | "youtube" | "external" | undefined;
|
|
155
155
|
youtubeId?: string | undefined;
|
|
156
156
|
}[] | undefined;
|
|
157
157
|
authorAvatar?: string | undefined;
|
|
158
158
|
}, {
|
|
159
159
|
status: "draft" | "published" | "archived";
|
|
160
|
-
|
|
160
|
+
id: string;
|
|
161
|
+
title: string;
|
|
162
|
+
content: string;
|
|
161
163
|
createdAt: string | Date | z.objectInputType<{
|
|
162
164
|
toDate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodDate>;
|
|
163
165
|
}, z.ZodTypeAny, "passthrough">;
|
|
164
|
-
title: string;
|
|
165
|
-
slug: string;
|
|
166
|
-
tags: string[];
|
|
167
|
-
id: string;
|
|
168
166
|
updatedAt: string | Date | z.objectInputType<{
|
|
169
167
|
toDate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodDate>;
|
|
170
168
|
}, z.ZodTypeAny, "passthrough">;
|
|
171
|
-
|
|
169
|
+
category: string;
|
|
170
|
+
slug: string;
|
|
171
|
+
tags: string[];
|
|
172
172
|
isFeatured: boolean;
|
|
173
173
|
excerpt: string;
|
|
174
174
|
authorId: string;
|
|
@@ -179,29 +179,29 @@ export declare const blogPostFirestoreSchema: z.ZodObject<{
|
|
|
179
179
|
toDate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodDate>;
|
|
180
180
|
}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
181
181
|
coverImage?: {
|
|
182
|
+
type: "video" | "image" | "file";
|
|
182
183
|
url: string;
|
|
183
|
-
|
|
184
|
+
source?: "upload" | "youtube" | "external" | undefined;
|
|
184
185
|
alt?: string | undefined;
|
|
185
186
|
thumbnailUrl?: string | undefined;
|
|
186
|
-
source?: "upload" | "youtube" | "external" | undefined;
|
|
187
187
|
youtubeId?: string | undefined;
|
|
188
188
|
} | undefined;
|
|
189
189
|
metaTitle?: string | undefined;
|
|
190
190
|
metaDescription?: string | undefined;
|
|
191
191
|
contentImages?: {
|
|
192
|
+
type: "video" | "image" | "file";
|
|
192
193
|
url: string;
|
|
193
|
-
|
|
194
|
+
source?: "upload" | "youtube" | "external" | undefined;
|
|
194
195
|
alt?: string | undefined;
|
|
195
196
|
thumbnailUrl?: string | undefined;
|
|
196
|
-
source?: "upload" | "youtube" | "external" | undefined;
|
|
197
197
|
youtubeId?: string | undefined;
|
|
198
198
|
}[] | undefined;
|
|
199
199
|
additionalImages?: {
|
|
200
|
+
type: "video" | "image" | "file";
|
|
200
201
|
url: string;
|
|
201
|
-
|
|
202
|
+
source?: "upload" | "youtube" | "external" | undefined;
|
|
202
203
|
alt?: string | undefined;
|
|
203
204
|
thumbnailUrl?: string | undefined;
|
|
204
|
-
source?: "upload" | "youtube" | "external" | undefined;
|
|
205
205
|
youtubeId?: string | undefined;
|
|
206
206
|
}[] | undefined;
|
|
207
207
|
authorAvatar?: string | undefined;
|
|
@@ -236,38 +236,38 @@ export declare const blogPostSchema: z.ZodObject<{
|
|
|
236
236
|
source: z.ZodOptional<z.ZodEnum<["upload", "youtube", "external"]>>;
|
|
237
237
|
youtubeId: z.ZodOptional<z.ZodString>;
|
|
238
238
|
}, "strip", z.ZodTypeAny, {
|
|
239
|
+
type: "video" | "image" | "file";
|
|
239
240
|
url: string;
|
|
240
|
-
|
|
241
|
+
source?: "upload" | "youtube" | "external" | undefined;
|
|
241
242
|
alt?: string | undefined;
|
|
242
243
|
thumbnailUrl?: string | undefined;
|
|
243
|
-
source?: "upload" | "youtube" | "external" | undefined;
|
|
244
244
|
youtubeId?: string | undefined;
|
|
245
245
|
}, {
|
|
246
|
+
type: "video" | "image" | "file";
|
|
246
247
|
url: string;
|
|
247
|
-
|
|
248
|
+
source?: "upload" | "youtube" | "external" | undefined;
|
|
248
249
|
alt?: string | undefined;
|
|
249
250
|
thumbnailUrl?: string | undefined;
|
|
250
|
-
source?: "upload" | "youtube" | "external" | undefined;
|
|
251
251
|
youtubeId?: string | undefined;
|
|
252
252
|
}>, z.ZodEffects<z.ZodString, {
|
|
253
253
|
url: string;
|
|
254
254
|
type: "image";
|
|
255
255
|
}, string>]>>>, {
|
|
256
|
+
type: "video" | "image" | "file";
|
|
256
257
|
url: string;
|
|
257
|
-
|
|
258
|
+
source?: "upload" | "youtube" | "external" | undefined;
|
|
258
259
|
alt?: string | undefined;
|
|
259
260
|
thumbnailUrl?: string | undefined;
|
|
260
|
-
source?: "upload" | "youtube" | "external" | undefined;
|
|
261
261
|
youtubeId?: string | undefined;
|
|
262
262
|
} | {
|
|
263
263
|
url: string;
|
|
264
264
|
type: "image";
|
|
265
265
|
} | null, string | {
|
|
266
|
+
type: "video" | "image" | "file";
|
|
266
267
|
url: string;
|
|
267
|
-
|
|
268
|
+
source?: "upload" | "youtube" | "external" | undefined;
|
|
268
269
|
alt?: string | undefined;
|
|
269
270
|
thumbnailUrl?: string | undefined;
|
|
270
|
-
source?: "upload" | "youtube" | "external" | undefined;
|
|
271
271
|
youtubeId?: string | undefined;
|
|
272
272
|
} | null | undefined>;
|
|
273
273
|
contentImages: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
@@ -278,18 +278,18 @@ export declare const blogPostSchema: z.ZodObject<{
|
|
|
278
278
|
source: z.ZodOptional<z.ZodEnum<["upload", "youtube", "external"]>>;
|
|
279
279
|
youtubeId: z.ZodOptional<z.ZodString>;
|
|
280
280
|
}, "strip", z.ZodTypeAny, {
|
|
281
|
+
type: "video" | "image" | "file";
|
|
281
282
|
url: string;
|
|
282
|
-
|
|
283
|
+
source?: "upload" | "youtube" | "external" | undefined;
|
|
283
284
|
alt?: string | undefined;
|
|
284
285
|
thumbnailUrl?: string | undefined;
|
|
285
|
-
source?: "upload" | "youtube" | "external" | undefined;
|
|
286
286
|
youtubeId?: string | undefined;
|
|
287
287
|
}, {
|
|
288
|
+
type: "video" | "image" | "file";
|
|
288
289
|
url: string;
|
|
289
|
-
|
|
290
|
+
source?: "upload" | "youtube" | "external" | undefined;
|
|
290
291
|
alt?: string | undefined;
|
|
291
292
|
thumbnailUrl?: string | undefined;
|
|
292
|
-
source?: "upload" | "youtube" | "external" | undefined;
|
|
293
293
|
youtubeId?: string | undefined;
|
|
294
294
|
}>, "many">>>;
|
|
295
295
|
additionalImages: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
@@ -300,18 +300,18 @@ export declare const blogPostSchema: z.ZodObject<{
|
|
|
300
300
|
source: z.ZodOptional<z.ZodEnum<["upload", "youtube", "external"]>>;
|
|
301
301
|
youtubeId: z.ZodOptional<z.ZodString>;
|
|
302
302
|
}, "strip", z.ZodTypeAny, {
|
|
303
|
+
type: "video" | "image" | "file";
|
|
303
304
|
url: string;
|
|
304
|
-
|
|
305
|
+
source?: "upload" | "youtube" | "external" | undefined;
|
|
305
306
|
alt?: string | undefined;
|
|
306
307
|
thumbnailUrl?: string | undefined;
|
|
307
|
-
source?: "upload" | "youtube" | "external" | undefined;
|
|
308
308
|
youtubeId?: string | undefined;
|
|
309
309
|
}, {
|
|
310
|
+
type: "video" | "image" | "file";
|
|
310
311
|
url: string;
|
|
311
|
-
|
|
312
|
+
source?: "upload" | "youtube" | "external" | undefined;
|
|
312
313
|
alt?: string | undefined;
|
|
313
314
|
thumbnailUrl?: string | undefined;
|
|
314
|
-
source?: "upload" | "youtube" | "external" | undefined;
|
|
315
315
|
youtubeId?: string | undefined;
|
|
316
316
|
}>, "many">>>;
|
|
317
317
|
category: z.ZodEnum<["news", "tips", "guides", "updates", "community"]>;
|
|
@@ -330,41 +330,41 @@ export declare const blogPostSchema: z.ZodObject<{
|
|
|
330
330
|
updatedAt: z.ZodOptional<z.ZodString>;
|
|
331
331
|
}, "strip", z.ZodTypeAny, {
|
|
332
332
|
status: "draft" | "published" | "archived";
|
|
333
|
-
|
|
333
|
+
id: string;
|
|
334
334
|
title: string;
|
|
335
|
+
category: "news" | "tips" | "guides" | "updates" | "community";
|
|
335
336
|
slug: string;
|
|
336
|
-
id: string;
|
|
337
337
|
coverImage: {
|
|
338
|
+
type: "video" | "image" | "file";
|
|
338
339
|
url: string;
|
|
339
|
-
|
|
340
|
+
source?: "upload" | "youtube" | "external" | undefined;
|
|
340
341
|
alt?: string | undefined;
|
|
341
342
|
thumbnailUrl?: string | undefined;
|
|
342
|
-
source?: "upload" | "youtube" | "external" | undefined;
|
|
343
343
|
youtubeId?: string | undefined;
|
|
344
344
|
} | {
|
|
345
345
|
url: string;
|
|
346
346
|
type: "image";
|
|
347
347
|
} | null;
|
|
348
348
|
contentImages: {
|
|
349
|
+
type: "video" | "image" | "file";
|
|
349
350
|
url: string;
|
|
350
|
-
|
|
351
|
+
source?: "upload" | "youtube" | "external" | undefined;
|
|
351
352
|
alt?: string | undefined;
|
|
352
353
|
thumbnailUrl?: string | undefined;
|
|
353
|
-
source?: "upload" | "youtube" | "external" | undefined;
|
|
354
354
|
youtubeId?: string | undefined;
|
|
355
355
|
}[];
|
|
356
356
|
additionalImages: {
|
|
357
|
+
type: "video" | "image" | "file";
|
|
357
358
|
url: string;
|
|
358
|
-
|
|
359
|
+
source?: "upload" | "youtube" | "external" | undefined;
|
|
359
360
|
alt?: string | undefined;
|
|
360
361
|
thumbnailUrl?: string | undefined;
|
|
361
|
-
source?: "upload" | "youtube" | "external" | undefined;
|
|
362
362
|
youtubeId?: string | undefined;
|
|
363
363
|
}[];
|
|
364
|
+
content?: string | undefined;
|
|
364
365
|
createdAt?: string | undefined;
|
|
365
|
-
tags?: string[] | undefined;
|
|
366
366
|
updatedAt?: string | undefined;
|
|
367
|
-
|
|
367
|
+
tags?: string[] | undefined;
|
|
368
368
|
isFeatured?: boolean | undefined;
|
|
369
369
|
publishedAt?: string | undefined;
|
|
370
370
|
excerpt?: string | undefined;
|
|
@@ -377,23 +377,23 @@ export declare const blogPostSchema: z.ZodObject<{
|
|
|
377
377
|
authorAvatar?: string | undefined;
|
|
378
378
|
}, {
|
|
379
379
|
status: "draft" | "published" | "archived";
|
|
380
|
-
|
|
380
|
+
id: string;
|
|
381
381
|
title: string;
|
|
382
|
+
category: "news" | "tips" | "guides" | "updates" | "community";
|
|
382
383
|
slug: string;
|
|
383
|
-
|
|
384
|
+
content?: string | undefined;
|
|
384
385
|
createdAt?: string | undefined;
|
|
385
|
-
tags?: string[] | undefined;
|
|
386
386
|
updatedAt?: string | undefined;
|
|
387
|
-
|
|
387
|
+
tags?: string[] | undefined;
|
|
388
388
|
isFeatured?: boolean | undefined;
|
|
389
389
|
publishedAt?: string | undefined;
|
|
390
390
|
excerpt?: string | undefined;
|
|
391
391
|
coverImage?: string | {
|
|
392
|
+
type: "video" | "image" | "file";
|
|
392
393
|
url: string;
|
|
393
|
-
|
|
394
|
+
source?: "upload" | "youtube" | "external" | undefined;
|
|
394
395
|
alt?: string | undefined;
|
|
395
396
|
thumbnailUrl?: string | undefined;
|
|
396
|
-
source?: "upload" | "youtube" | "external" | undefined;
|
|
397
397
|
youtubeId?: string | undefined;
|
|
398
398
|
} | null | undefined;
|
|
399
399
|
authorId?: string | undefined;
|
|
@@ -403,19 +403,19 @@ export declare const blogPostSchema: z.ZodObject<{
|
|
|
403
403
|
metaTitle?: string | undefined;
|
|
404
404
|
metaDescription?: string | undefined;
|
|
405
405
|
contentImages?: {
|
|
406
|
+
type: "video" | "image" | "file";
|
|
406
407
|
url: string;
|
|
407
|
-
|
|
408
|
+
source?: "upload" | "youtube" | "external" | undefined;
|
|
408
409
|
alt?: string | undefined;
|
|
409
410
|
thumbnailUrl?: string | undefined;
|
|
410
|
-
source?: "upload" | "youtube" | "external" | undefined;
|
|
411
411
|
youtubeId?: string | undefined;
|
|
412
412
|
}[] | undefined;
|
|
413
413
|
additionalImages?: {
|
|
414
|
+
type: "video" | "image" | "file";
|
|
414
415
|
url: string;
|
|
415
|
-
|
|
416
|
+
source?: "upload" | "youtube" | "external" | undefined;
|
|
416
417
|
alt?: string | undefined;
|
|
417
418
|
thumbnailUrl?: string | undefined;
|
|
418
|
-
source?: "upload" | "youtube" | "external" | undefined;
|
|
419
419
|
youtubeId?: string | undefined;
|
|
420
420
|
}[] | undefined;
|
|
421
421
|
authorAvatar?: string | undefined;
|
|
@@ -431,18 +431,18 @@ export declare const blogListParamsSchema: z.ZodObject<{
|
|
|
431
431
|
featured: z.ZodOptional<z.ZodBoolean>;
|
|
432
432
|
}, "strip", z.ZodTypeAny, {
|
|
433
433
|
sort?: string | undefined;
|
|
434
|
-
category?: "news" | "tips" | "guides" | "updates" | "community" | undefined;
|
|
435
|
-
featured?: boolean | undefined;
|
|
436
|
-
tags?: string | undefined;
|
|
437
434
|
page?: number | undefined;
|
|
438
435
|
q?: string | undefined;
|
|
439
436
|
perPage?: number | undefined;
|
|
440
|
-
}, {
|
|
441
|
-
sort?: string | undefined;
|
|
442
437
|
category?: "news" | "tips" | "guides" | "updates" | "community" | undefined;
|
|
443
438
|
featured?: boolean | undefined;
|
|
444
439
|
tags?: string | undefined;
|
|
440
|
+
}, {
|
|
441
|
+
sort?: string | undefined;
|
|
445
442
|
page?: number | undefined;
|
|
446
443
|
q?: string | undefined;
|
|
447
444
|
perPage?: number | undefined;
|
|
445
|
+
category?: "news" | "tips" | "guides" | "updates" | "community" | undefined;
|
|
446
|
+
featured?: boolean | undefined;
|
|
447
|
+
tags?: string | undefined;
|
|
448
448
|
}>;
|
|
@@ -4,7 +4,7 @@ import { MediaImage } from "../../media/MediaImage";
|
|
|
4
4
|
import { formatCurrency } from "../../../utils/number.formatter";
|
|
5
5
|
import { ACTIONS } from "../../../_internal/shared/actions/action-registry";
|
|
6
6
|
const __P = {
|
|
7
|
-
p4: "p-4",
|
|
7
|
+
p4: "p-[var(--appkit-space-4)]",
|
|
8
8
|
};
|
|
9
9
|
const __O = {
|
|
10
10
|
hidden: "overflow-hidden",
|
|
@@ -15,7 +15,7 @@ export function CartItemRow({ item, onQtyChange, onRemove, href, isOutOfStock =
|
|
|
15
15
|
return (_jsxs(Div, { layout: "flex", gap: "4", surface: "card", padding: "sm", className: `transition-opacity ${isOutOfStock ? "opacity-60" : ""}`, children: [_jsx(Div, { surface: "muted", className: `relative h-20 w-20 flex-shrink-0 ${__O.hidden}`, rounded: "lg", children: item.meta.image && (_jsx(MediaImage, { src: item.meta.image, alt: item.meta.title, size: "thumbnail" })) }), _jsxs(Stack, { justify: "between", className: "flex-1", children: [_jsxs(Row, { gap: "xs", className: "", align: "start", children: [href ? (_jsx(TextLink, { href: href, target: "_blank", rel: "noopener noreferrer", weight: "medium", className: "text-[var(--appkit-color-text)] hover:underline underline-offset-2 line-clamp-2", children: item.meta.title })) : (_jsx(Text, { truncate: 2, weight: "medium", color: "primary", children: item.meta.title })), isOutOfStock && (_jsx(Span, { padding: "pill-2xs", color: "error", surface: "danger-surface", weight: "semibold", className: "flex-shrink-0 text-[10px] tracking-wide", rounded: "default", transform: "uppercase", children: "Out of Stock" }))] }), item.meta.attributes &&
|
|
16
16
|
Object.keys(item.meta.attributes).length > 0 && (_jsx(Text, { className: "text-[var(--appkit-color-text-muted)]", size: "xs", children: Object.entries(item.meta.attributes)
|
|
17
17
|
.map(([k, v]) => `${k}: ${v}`)
|
|
18
|
-
.join(", ") })), _jsxs(Row, { justify: "between", children: [_jsx(Text, { className: "text-[var(--appkit-color-text)]", weight: "semibold", children: formatCurrency(item.meta.price * item.quantity, item.meta.currency) }), onQtyChange && !isOutOfStock && (_jsxs(Row, { gap: "sm", children: [_jsx(Button, { rounded: "full", onClick: () => onQtyChange(item.id, item.quantity - 1), disabled: item.quantity <= 1, variant: "outline", size: "sm", className: "h-7 w-7 justify-center border border-neutral-200 border-[var(--appkit-color-border)] text-sm disabled:opacity-40", children: "\u2212" }), _jsx(Span, { size: "sm", className: "min-w-[1.5rem]", align: "center", children: item.quantity }), _jsx(Button, { rounded: "full", onClick: () => onQtyChange(item.id, item.quantity + 1), variant: "outline", size: "sm", className: "h-7 w-7 justify-center border border-neutral-200 border-[var(--appkit-color-border)] text-sm", children: "+" })] })), isOutOfStock && (_jsxs(Span, { size: "xs", color: "muted", children: ["Qty: ", item.quantity] }))] })] }), onRemove && (_jsx(Button, { onClick: () => onRemove(item.id), variant: "ghost", size: "sm", "aria-label": ACTIONS.CART["remove-item"].ariaLabel, className: CLS_REMOVE_BTN, children: "\u2715" }))] }));
|
|
18
|
+
.join(", ") })), _jsxs(Row, { justify: "between", children: [_jsx(Text, { className: "text-[var(--appkit-color-text)]", weight: "semibold", children: formatCurrency(item.meta.price * item.quantity, item.meta.currency) }), onQtyChange && !isOutOfStock && (_jsxs(Row, { gap: "sm", children: [_jsx(Button, { rounded: "full", onClick: () => onQtyChange(item.id, item.quantity - 1), disabled: item.quantity <= 1, variant: "outline", size: "sm", className: "h-7 w-7 justify-center border border-neutral-200 border-[var(--appkit-color-border)] text-[length:var(--appkit-text-sm)] disabled:opacity-40", children: "\u2212" }), _jsx(Span, { size: "sm", className: "min-w-[1.5rem]", align: "center", children: item.quantity }), _jsx(Button, { rounded: "full", onClick: () => onQtyChange(item.id, item.quantity + 1), variant: "outline", size: "sm", className: "h-7 w-7 justify-center border border-neutral-200 border-[var(--appkit-color-border)] text-[length:var(--appkit-text-sm)]", children: "+" })] })), isOutOfStock && (_jsxs(Span, { size: "xs", color: "muted", children: ["Qty: ", item.quantity] }))] })] }), onRemove && (_jsx(Button, { onClick: () => onRemove(item.id), variant: "ghost", size: "sm", "aria-label": ACTIONS.CART["remove-item"].ariaLabel, className: CLS_REMOVE_BTN, children: "\u2715" }))] }));
|
|
19
19
|
}
|
|
20
20
|
export function CartDrawer({ isOpen, onClose, items, subtotal = 0, currency, isLoading, onQtyChange, onRemove, onCheckout, labels = {}, }) {
|
|
21
21
|
if (!isOpen)
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type ActionResult } from "@mohasinac/appkit/server";
|
|
2
|
+
/**
|
|
3
|
+
* Admin path — approves a buyer's "Request to sell", creating the product
|
|
4
|
+
* under the platform's own consignment store (not the buyer's, since a
|
|
5
|
+
* buyer has none) and preserving `sourceCatalogueOwnerId` for future
|
|
6
|
+
* consignment/payout traceability.
|
|
7
|
+
*/
|
|
8
|
+
export declare function approveCatalogueListingAction(itemId: string): Promise<ActionResult<{
|
|
9
|
+
productId: string;
|
|
10
|
+
productSlug: string;
|
|
11
|
+
}>>;
|
|
12
|
+
export declare function rejectCatalogueListingAction(itemId: string, reason: string): Promise<ActionResult<void>>;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use server";
|
|
2
|
+
import { wrapAction } from "@mohasinac/appkit/server";
|
|
3
|
+
import { catalogueRepository } from "../../../repositories";
|
|
4
|
+
import { requireRoleUser } from "../../../providers/auth-firebase/helpers";
|
|
5
|
+
import { isAdminUser } from "../../../features/auth/role-predicates";
|
|
6
|
+
import { ValidationError, AuthorizationError } from "../../../errors";
|
|
7
|
+
import { createProductFromCatalogueItem, CONSIGNMENT_STORE_ID } from "../utils/product-from-item";
|
|
8
|
+
/**
|
|
9
|
+
* Admin path — approves a buyer's "Request to sell", creating the product
|
|
10
|
+
* under the platform's own consignment store (not the buyer's, since a
|
|
11
|
+
* buyer has none) and preserving `sourceCatalogueOwnerId` for future
|
|
12
|
+
* consignment/payout traceability.
|
|
13
|
+
*/
|
|
14
|
+
export async function approveCatalogueListingAction(itemId) {
|
|
15
|
+
return wrapAction(async () => {
|
|
16
|
+
const user = await requireRoleUser(["admin"]);
|
|
17
|
+
if (!isAdminUser(user))
|
|
18
|
+
throw new AuthorizationError("Only admin can approve catalogue listings");
|
|
19
|
+
const item = await catalogueRepository.findById(itemId);
|
|
20
|
+
if (!item)
|
|
21
|
+
throw new ValidationError("Catalogue item not found");
|
|
22
|
+
if (item.listingStatus !== "pending_admin_approval") {
|
|
23
|
+
throw new ValidationError("Only items pending approval can be approved");
|
|
24
|
+
}
|
|
25
|
+
const product = await createProductFromCatalogueItem(item, CONSIGNMENT_STORE_ID);
|
|
26
|
+
await catalogueRepository.update(itemId, {
|
|
27
|
+
listingStatus: "listed",
|
|
28
|
+
linkedProductId: product.id,
|
|
29
|
+
linkedProductSlug: product.slug ?? product.id,
|
|
30
|
+
});
|
|
31
|
+
return { productId: product.id, productSlug: product.slug ?? product.id };
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
export async function rejectCatalogueListingAction(itemId, reason) {
|
|
35
|
+
return wrapAction(async () => {
|
|
36
|
+
const user = await requireRoleUser(["admin"]);
|
|
37
|
+
if (!isAdminUser(user))
|
|
38
|
+
throw new AuthorizationError("Only admin can reject catalogue listings");
|
|
39
|
+
const item = await catalogueRepository.findById(itemId);
|
|
40
|
+
if (!item)
|
|
41
|
+
throw new ValidationError("Catalogue item not found");
|
|
42
|
+
if (item.listingStatus !== "pending_admin_approval") {
|
|
43
|
+
throw new ValidationError("Only items pending approval can be rejected");
|
|
44
|
+
}
|
|
45
|
+
await catalogueRepository.update(itemId, {
|
|
46
|
+
listingStatus: "rejected",
|
|
47
|
+
rejectionReason: reason,
|
|
48
|
+
});
|
|
49
|
+
});
|
|
50
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type ActionResult } from "@mohasinac/appkit/server";
|
|
2
|
+
/**
|
|
3
|
+
* Direct-listing path — turns a catalogue item straight into a real listing,
|
|
4
|
+
* no approval queue. Two callers:
|
|
5
|
+
* - **Seller**: listed under their own store.
|
|
6
|
+
* - **Admin**: admins are buyers too and have no personal seller store of
|
|
7
|
+
* their own, so their catalogue lists under the platform's consignment
|
|
8
|
+
* store (`store-letitrip-official`) — the same store the buyer-approval
|
|
9
|
+
* path uses. An admin approving their own "Request to sell" would be a
|
|
10
|
+
* pointless round trip, so admins get the direct path instead.
|
|
11
|
+
* Freshness-gated (req: photos must be < 30 days old) — see
|
|
12
|
+
* `assertCatalogueImagesFresh`.
|
|
13
|
+
*/
|
|
14
|
+
export declare function listFromCatalogueAction(itemId: string): Promise<ActionResult<{
|
|
15
|
+
productId: string;
|
|
16
|
+
productSlug: string;
|
|
17
|
+
}>>;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use server";
|
|
2
|
+
import { wrapAction } from "@mohasinac/appkit/server";
|
|
3
|
+
import { catalogueRepository, storeRepository } from "../../../repositories";
|
|
4
|
+
import { requireRoleUser } from "../../../providers/auth-firebase/helpers";
|
|
5
|
+
import { isAdminUser } from "../../../features/auth/role-predicates";
|
|
6
|
+
import { ValidationError, AuthorizationError } from "../../../errors";
|
|
7
|
+
import { assertCatalogueImagesFresh } from "../utils/freshness";
|
|
8
|
+
import { createProductFromCatalogueItem, CONSIGNMENT_STORE_ID } from "../utils/product-from-item";
|
|
9
|
+
/**
|
|
10
|
+
* Direct-listing path — turns a catalogue item straight into a real listing,
|
|
11
|
+
* no approval queue. Two callers:
|
|
12
|
+
* - **Seller**: listed under their own store.
|
|
13
|
+
* - **Admin**: admins are buyers too and have no personal seller store of
|
|
14
|
+
* their own, so their catalogue lists under the platform's consignment
|
|
15
|
+
* store (`store-letitrip-official`) — the same store the buyer-approval
|
|
16
|
+
* path uses. An admin approving their own "Request to sell" would be a
|
|
17
|
+
* pointless round trip, so admins get the direct path instead.
|
|
18
|
+
* Freshness-gated (req: photos must be < 30 days old) — see
|
|
19
|
+
* `assertCatalogueImagesFresh`.
|
|
20
|
+
*/
|
|
21
|
+
export async function listFromCatalogueAction(itemId) {
|
|
22
|
+
return wrapAction(async () => {
|
|
23
|
+
const user = await requireRoleUser(["seller", "admin"]);
|
|
24
|
+
const item = await catalogueRepository.findById(itemId);
|
|
25
|
+
if (!item)
|
|
26
|
+
throw new ValidationError("Catalogue item not found");
|
|
27
|
+
if (item.ownerId !== user.uid)
|
|
28
|
+
throw new AuthorizationError("You do not own this catalogue item");
|
|
29
|
+
if (item.listingStatus === "listed")
|
|
30
|
+
throw new ValidationError("This item is already listed");
|
|
31
|
+
assertCatalogueImagesFresh(item);
|
|
32
|
+
let storeId;
|
|
33
|
+
if (isAdminUser(user)) {
|
|
34
|
+
storeId = CONSIGNMENT_STORE_ID;
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
const store = await storeRepository.findByOwnerId(user.uid);
|
|
38
|
+
if (!store)
|
|
39
|
+
throw new ValidationError("You need a store before listing from your catalogue");
|
|
40
|
+
storeId = store.id;
|
|
41
|
+
}
|
|
42
|
+
const product = await createProductFromCatalogueItem(item, storeId);
|
|
43
|
+
await catalogueRepository.update(itemId, {
|
|
44
|
+
listingStatus: "listed",
|
|
45
|
+
linkedProductId: product.id,
|
|
46
|
+
linkedProductSlug: product.slug ?? product.id,
|
|
47
|
+
});
|
|
48
|
+
return { productId: product.id, productSlug: product.slug ?? product.id };
|
|
49
|
+
});
|
|
50
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type ActionResult } from "@mohasinac/appkit/server";
|
|
2
|
+
/**
|
|
3
|
+
* Buyer path — requests admin list the item on their behalf. Flips
|
|
4
|
+
* listingStatus to "pending_admin_approval"; the admin-notification fan-out
|
|
5
|
+
* happens in the onCatalogueSubmittedForApproval Firestore trigger, keeping
|
|
6
|
+
* this action fast (Rule #6) regardless of how many admins exist.
|
|
7
|
+
*/
|
|
8
|
+
export declare function submitCatalogueItemForApprovalAction(itemId: string): Promise<ActionResult<void>>;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use server";
|
|
2
|
+
import { wrapAction } from "@mohasinac/appkit/server";
|
|
3
|
+
import { catalogueRepository } from "../../../repositories";
|
|
4
|
+
import { requireRoleUser } from "../../../providers/auth-firebase/helpers";
|
|
5
|
+
import { ValidationError, AuthorizationError } from "../../../errors";
|
|
6
|
+
import { assertCatalogueImagesFresh } from "../utils/freshness";
|
|
7
|
+
/**
|
|
8
|
+
* Buyer path — requests admin list the item on their behalf. Flips
|
|
9
|
+
* listingStatus to "pending_admin_approval"; the admin-notification fan-out
|
|
10
|
+
* happens in the onCatalogueSubmittedForApproval Firestore trigger, keeping
|
|
11
|
+
* this action fast (Rule #6) regardless of how many admins exist.
|
|
12
|
+
*/
|
|
13
|
+
export async function submitCatalogueItemForApprovalAction(itemId) {
|
|
14
|
+
return wrapAction(async () => {
|
|
15
|
+
const user = await requireRoleUser(["user", "seller", "admin"]);
|
|
16
|
+
const item = await catalogueRepository.findById(itemId);
|
|
17
|
+
if (!item)
|
|
18
|
+
throw new ValidationError("Catalogue item not found");
|
|
19
|
+
if (item.ownerId !== user.uid)
|
|
20
|
+
throw new AuthorizationError("You do not own this catalogue item");
|
|
21
|
+
if (item.listingStatus !== "not_listed") {
|
|
22
|
+
throw new ValidationError("Only items not yet submitted can be requested for listing");
|
|
23
|
+
}
|
|
24
|
+
assertCatalogueImagesFresh(item);
|
|
25
|
+
await catalogueRepository.update(itemId, {
|
|
26
|
+
listingStatus: "pending_admin_approval",
|
|
27
|
+
submittedForApprovalAt: new Date(),
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
}
|