@mohasinac/appkit 3.0.3 → 3.0.6
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/filters/filter-load-options.js +11 -1
- package/dist/_internal/client/features/layout/filterNavItems.js +0 -1
- package/dist/_internal/client/features/layout/index.js +0 -1
- package/dist/_internal/client/features/maintenance/views/MaintenanceDashboardView.js +0 -1
- package/dist/_internal/client/features/maintenance/views/ServerErrorDetailView.js +0 -1
- package/dist/_internal/server/features/auctions/data.d.ts +2 -4
- package/dist/_internal/server/features/auctions/data.js +3 -9
- package/dist/_internal/server/features/checkout/actions.js +9 -9
- package/dist/_internal/server/features/classified/adapters.d.ts +2 -15
- package/dist/_internal/server/features/classified/adapters.js +2 -17
- package/dist/_internal/server/features/classified/data.d.ts +1 -6
- package/dist/_internal/server/features/classified/data.js +2 -10
- package/dist/_internal/server/features/digital-code/adapters.d.ts +2 -15
- package/dist/_internal/server/features/digital-code/adapters.js +2 -17
- package/dist/_internal/server/features/digital-code/data.d.ts +1 -6
- package/dist/_internal/server/features/digital-code/data.js +2 -10
- package/dist/_internal/server/features/live/adapters.d.ts +2 -15
- package/dist/_internal/server/features/live/adapters.js +2 -17
- package/dist/_internal/server/features/live/data.d.ts +1 -6
- package/dist/_internal/server/features/live/data.js +2 -10
- package/dist/_internal/server/features/pre-orders/data.d.ts +2 -4
- package/dist/_internal/server/features/pre-orders/data.js +3 -9
- package/dist/_internal/server/features/prize-draws/actions.d.ts +2 -0
- package/dist/_internal/server/features/prize-draws/actions.js +22 -0
- package/dist/_internal/server/features/prize-draws/data.d.ts +1 -17
- package/dist/_internal/server/features/prize-draws/data.js +2 -20
- package/dist/_internal/server/features/prize-draws/index.d.ts +3 -1
- package/dist/_internal/server/features/prize-draws/index.js +2 -0
- package/dist/_internal/server/features/prize-draws/service.d.ts +3 -0
- package/dist/_internal/server/features/prize-draws/service.js +19 -0
- package/dist/_internal/server/features/shared/listing-adapters.d.ts +19 -0
- package/dist/_internal/server/features/shared/listing-adapters.js +20 -0
- package/dist/_internal/server/features/shared/listing-data-factory.d.ts +9 -0
- package/dist/_internal/server/features/shared/listing-data-factory.js +33 -0
- package/dist/_internal/server/features/stores/data.d.ts +3 -14
- package/dist/_internal/server/features/stores/data.js +6 -44
- package/dist/_internal/server/jobs/core/cleanupRtdbEvents.js +1 -1
- package/dist/_internal/shared/features/cart/schema.d.ts +8 -8
- package/dist/_internal/shared/features/cart/schema.js +3 -0
- package/dist/_internal/shared/listing-types/_registry.js +2 -0
- package/dist/_internal/shared/listing-types/action-tracker.js +1 -1
- package/dist/_internal/shared/listing-types/auction/schema.d.ts +3 -1
- package/dist/_internal/shared/listing-types/auction/schema.js +7 -1
- package/dist/_internal/shared/listing-types/classified/schema.d.ts +2 -1
- package/dist/_internal/shared/listing-types/classified/schema.js +3 -1
- package/dist/_internal/shared/listing-types/digital-code/schema.d.ts +3 -1
- package/dist/_internal/shared/listing-types/digital-code/schema.js +7 -1
- package/dist/_internal/shared/listing-types/live/schema.d.ts +2 -1
- package/dist/_internal/shared/listing-types/live/schema.js +3 -1
- package/dist/_internal/shared/listing-types/pre-order/schema.d.ts +3 -1
- package/dist/_internal/shared/listing-types/pre-order/schema.js +7 -1
- package/dist/_internal/shared/listing-types/prize-draw/schema.d.ts +3 -1
- package/dist/_internal/shared/listing-types/prize-draw/schema.js +13 -1
- package/dist/_internal/shared/listing-types/standard/schema.d.ts +2 -1
- package/dist/_internal/shared/listing-types/standard/schema.js +4 -1
- package/dist/_internal/shared/types/base-document.d.ts +15 -0
- package/dist/_internal/shared/types/base-document.js +1 -0
- package/dist/_internal/shared/types/index.d.ts +2 -0
- package/dist/_internal/shared/types/index.js +1 -0
- package/dist/client/api/ApiError.d.ts +10 -4
- package/dist/client/api/surface-error.js +0 -1
- package/dist/client.d.ts +8 -4
- package/dist/client.js +4 -2
- package/dist/constants/api-endpoints.d.ts +12 -0
- package/dist/constants/api-endpoints.js +4 -0
- package/dist/core/hooks/useSyncManager.js +4 -4
- package/dist/features/_guide-cls.d.ts +1 -1
- package/dist/features/_guide-cls.js +1 -1
- package/dist/features/about/components/AboutView.js +1 -4
- package/dist/features/about/components/FAQPageView.js +1 -1
- package/dist/features/about/components/FeesView.js +1 -1
- package/dist/features/about/components/HelpPageView.js +1 -1
- package/dist/features/about/components/HowOrdersWorkView.js +1 -1
- package/dist/features/about/components/PublicProfileView.js +6 -6
- package/dist/features/about/components/TrackOrderView.js +1 -1
- package/dist/features/account/components/AddressBook.js +1 -1
- package/dist/features/account/components/AddressForm.js +10 -2
- package/dist/features/account/components/AddressesIndexListing.js +1 -1
- package/dist/features/account/components/BuyerAccountGuideView.js +1 -1
- package/dist/features/account/components/BuyerAuctionsGuideView.js +1 -1
- package/dist/features/account/components/BuyerOrdersGuideView.js +1 -1
- package/dist/features/account/components/BuyerShoppingGuideView.js +1 -1
- package/dist/features/account/components/ChatWindow.js +1 -1
- package/dist/features/account/components/MessagesView.js +1 -1
- package/dist/features/account/components/NotificationBell.js +25 -10
- package/dist/features/account/components/NotificationPreferencesPanel.js +2 -2
- package/dist/features/account/components/UserOffersPanel.js +1 -0
- package/dist/features/account/components/UserSidebar.js +1 -6
- package/dist/features/account/components/UserSupportView.js +1 -1
- package/dist/features/addresses/schemas/firestore.d.ts +2 -4
- package/dist/features/admin/components/AdminAnalyticsGuideView.js +2 -2
- package/dist/features/admin/components/AdminBlogEditorView.js +1 -1
- package/dist/features/admin/components/AdminBundlesView.js +1 -1
- package/dist/features/admin/components/AdminCarouselEditorView.js +1 -1
- package/dist/features/admin/components/AdminCatalogGuideView.js +2 -2
- package/dist/features/admin/components/AdminContentGuideView.js +2 -2
- package/dist/features/admin/components/AdminEmployeeEditorView.js +2 -2
- package/dist/features/admin/components/AdminFulfillmentView.d.ts +6 -0
- package/dist/features/admin/components/AdminFulfillmentView.js +107 -0
- package/dist/features/admin/components/AdminGuideHubView.js +1 -5
- package/dist/features/admin/components/AdminMediaView.js +1 -1
- package/dist/features/admin/components/AdminNavigationView.js +1 -1
- package/dist/features/admin/components/AdminOrdersGuideView.js +3 -3
- package/dist/features/admin/components/AdminPayoutsView.js +1 -4
- package/dist/features/admin/components/AdminProductEditorView.js +21 -9
- package/dist/features/admin/components/AdminProductsView.js +3 -0
- package/dist/features/admin/components/AdminSidebar.js +1 -6
- package/dist/features/admin/components/AdminSiteConfigGuideView.js +1 -1
- package/dist/features/admin/components/AdminSiteSettingsView.js +9 -1
- package/dist/features/admin/components/AdminStoreEditorView.js +1 -1
- package/dist/features/admin/components/AdminStoresGuideView.js +2 -2
- package/dist/features/admin/components/AdminSupportTicketDetailView.js +7 -7
- package/dist/features/admin/components/AdminTeamGuideView.js +2 -2
- package/dist/features/admin/components/AdminTrustGuideView.js +3 -3
- package/dist/features/admin/components/AdminUsersGuideView.js +3 -3
- package/dist/features/admin/components/DashboardStats.js +6 -5
- package/dist/features/admin/components/DataListingView.d.ts +1 -0
- package/dist/features/admin/components/DataTable.js +2 -2
- package/dist/features/admin/components/analytics/AdminAnalyticsCharts.js +4 -6
- package/dist/features/admin/components/analytics/AdminStatCard.js +4 -3
- package/dist/features/admin/components/analytics/AdminTopProductsTable.js +1 -1
- package/dist/features/admin/components/index.d.ts +2 -0
- package/dist/features/admin/components/index.js +1 -0
- package/dist/features/admin/schemas/firestore.d.ts +3 -8
- package/dist/features/auctions/components/AuctionBidsTable.js +1 -1
- package/dist/features/auctions/components/AuctionDetailPageView.js +1 -1
- package/dist/features/auctions/components/MarketplaceAuctionCard.js +3 -3
- package/dist/features/auctions/schemas/firestore.d.ts +2 -4
- package/dist/features/auctions/schemas/index.d.ts +2 -2
- package/dist/features/auth/components/ForgotPasswordView.js +19 -8
- package/dist/features/auth/components/LoginForm.js +10 -2
- package/dist/features/auth/components/RegisterForm.js +10 -2
- package/dist/features/auth/components/ResetPasswordView.js +19 -8
- package/dist/features/auth/components/SocialAuthButtons.js +1 -1
- package/dist/features/before-after/components/BeforeAfterSlider.js +1 -1
- package/dist/features/before-after/schemas/index.d.ts +2 -2
- package/dist/features/blog/api/[slug]/route.js +1 -1
- package/dist/features/blog/components/BlogFeaturedCard.js +1 -1
- package/dist/features/blog/components/BlogListView.js +1 -1
- package/dist/features/blog/components/BlogPostView.js +1 -1
- package/dist/features/blog/schemas/firestore.d.ts +2 -4
- package/dist/features/blog/schemas/index.d.ts +6 -6
- package/dist/features/cart/components/CartDrawer.js +2 -2
- package/dist/features/cart/components/CartView.js +1 -1
- package/dist/features/cart/components/CheckoutView.js +1 -1
- package/dist/features/cart/schemas/firestore.d.ts +2 -4
- package/dist/features/categories/components/BrandDetailPageView.js +2 -1
- package/dist/features/categories/components/BundleDetailView.js +1 -1
- package/dist/features/categories/components/BundleItemsPicker.js +1 -1
- package/dist/features/categories/components/CategoryBundlesListing.js +3 -1
- package/dist/features/categories/components/CategoryDetailPageView.js +1 -1
- package/dist/features/categories/components/CategoryGrid.js +2 -1
- package/dist/features/categories/components/CategoryTableColumns.js +5 -2
- package/dist/features/categories/components/CategoryTree.js +3 -2
- package/dist/features/categories/components/ConcernCard.js +1 -1
- package/dist/features/categories/schemas/firestore.d.ts +2 -4
- package/dist/features/categories/schemas/index.d.ts +6 -6
- package/dist/features/checkout/components/CheckoutStepper.js +1 -1
- package/dist/features/collections/components/CollectionCard.js +1 -1
- package/dist/features/contact/components/ContactPageView.js +27 -27
- package/dist/features/contact/email.js +4 -4
- package/dist/features/copilot/components/AdminCopilotView.js +3 -3
- package/dist/features/email/primitives.d.ts +4 -0
- package/dist/features/email/primitives.js +4 -0
- package/dist/features/events/components/EventCard.js +2 -2
- package/dist/features/events/components/EventOfferCard.js +1 -1
- package/dist/features/events/components/EventRaffleEntryForm.js +1 -1
- package/dist/features/events/components/EventRaffleWinnerView.js +2 -2
- package/dist/features/events/components/EventSaleBanner.js +0 -1
- package/dist/features/events/schemas/firestore.d.ts +2 -4
- package/dist/features/events/schemas/index.d.ts +4 -4
- package/dist/features/faq/components/ContactCTA.js +1 -1
- package/dist/features/faq/components/FAQAccordion.js +2 -2
- package/dist/features/faq/components/FAQCategorySidebar.js +2 -2
- package/dist/features/faq/components/FAQHelpfulButtons.js +2 -2
- package/dist/features/faq/components/RelatedFAQs.js +1 -1
- package/dist/features/faq/schemas/firestore.d.ts +2 -4
- package/dist/features/faq/schemas/index.d.ts +4 -4
- package/dist/features/filters/AsyncFacetSection.js +3 -3
- package/dist/features/filters/FilterFacetSection.js +6 -6
- package/dist/features/filters/RangeFilter.js +2 -2
- package/dist/features/filters/SwitchFilter.js +1 -1
- package/dist/features/forms/Checkbox.js +1 -1
- package/dist/features/forms/Slider.js +7 -2
- package/dist/features/forms/utils.d.ts +2 -2
- package/dist/features/forms/utils.js +2 -2
- package/dist/features/grouped/schemas/index.d.ts +2 -2
- package/dist/features/history/hooks/useHistory.js +1 -1
- package/dist/features/homepage/components/AdSlot.js +3 -3
- package/dist/features/homepage/components/AdvertisementBanner.js +5 -4
- package/dist/features/homepage/components/BeforeAfterCard.js +9 -1
- package/dist/features/homepage/components/CharacterHotspot.js +42 -49
- package/dist/features/homepage/components/CharacterHotspotForm.js +18 -20
- package/dist/features/homepage/components/CollectionCardsSection.js +2 -2
- package/dist/features/homepage/components/CustomCardsSection.js +3 -6
- package/dist/features/homepage/components/CustomerReviewsSection.js +1 -1
- package/dist/features/homepage/components/FAQSection.js +2 -2
- package/dist/features/homepage/components/FeaturedResultsSection.js +1 -1
- package/dist/features/homepage/components/GoogleReviewsSection.js +4 -4
- package/dist/features/homepage/components/HeroBanner.js +12 -63
- package/dist/features/homepage/components/HeroCarousel.js +6 -6
- package/dist/features/homepage/components/HeroSection.js +1 -1
- package/dist/features/homepage/components/HowItWorksInfoView.js +1 -1
- package/dist/features/homepage/components/HowItWorksSection.js +5 -3
- package/dist/features/homepage/components/NewsletterBanner.js +3 -7
- package/dist/features/homepage/components/PromoGrid.js +2 -26
- package/dist/features/homepage/components/SectionCarousel.js +1 -1
- package/dist/features/homepage/components/SecurityHighlightsSection.js +6 -3
- package/dist/features/homepage/components/ShopByCategorySection.js +3 -3
- package/dist/features/homepage/components/SiteFeaturesSection.js +1 -1
- package/dist/features/homepage/components/SocialPostCard.js +2 -3
- package/dist/features/homepage/components/StatsCounterSection.js +6 -3
- package/dist/features/homepage/components/TestimonialsCarousel.js +2 -25
- package/dist/features/homepage/components/TrustBadges.js +1 -9
- package/dist/features/homepage/components/TrustFeaturesSection.js +6 -3
- package/dist/features/homepage/components/TrustIndicatorsSection.js +1 -1
- package/dist/features/homepage/components/WelcomeSection.js +2 -2
- package/dist/features/homepage/components/WhatsAppCommunitySection.js +1 -1
- package/dist/features/homepage/lib/franchise-colors.d.ts +7 -0
- package/dist/features/homepage/lib/franchise-colors.js +7 -0
- package/dist/features/homepage/lib/live-stats.js +5 -5
- package/dist/features/homepage/schemas/firestore.d.ts +4 -12
- package/dist/features/homepage/schemas/index.d.ts +2 -2
- package/dist/features/layout/AppLayoutShell.js +7 -9
- package/dist/features/layout/BottomNavbar.js +1 -2
- package/dist/features/messages/hooks/useConversation.js +2 -1
- package/dist/features/messages/hooks/useConversations.js +1 -0
- package/dist/features/messages/schemas/firestore.d.ts +2 -4
- package/dist/features/messages/schemas/index.d.ts +2 -2
- package/dist/features/orders/components/OrdersList.js +1 -1
- package/dist/features/orders/components/RefundHistoryTable.d.ts +6 -0
- package/dist/features/orders/components/RefundHistoryTable.js +3 -2
- package/dist/features/orders/repository/orders.repository.d.ts +5 -0
- package/dist/features/orders/repository/orders.repository.js +26 -0
- package/dist/features/orders/schemas/firestore.d.ts +9 -5
- package/dist/features/orders/schemas/firestore.js +3 -0
- package/dist/features/payments/schemas/firestore.d.ts +2 -4
- package/dist/features/pre-orders/components/MarketplacePreorderCard.js +2 -2
- package/dist/features/pre-orders/components/PreOrderBadge.js +1 -1
- package/dist/features/pre-orders/components/PreOrderDetailPageView.js +2 -1
- package/dist/features/pre-orders/schemas/index.d.ts +2 -2
- package/dist/features/products/components/CompareOverlay.js +11 -8
- package/dist/features/products/components/CustomSectionTabContent.js +1 -1
- package/dist/features/products/components/FeatureBadge.js +11 -1
- package/dist/features/products/components/GroupSettingsPanel.js +2 -2
- package/dist/features/products/components/MarketplaceBundleCard.js +1 -1
- package/dist/features/products/components/MarketplacePrizeDrawCard.js +2 -2
- package/dist/features/products/components/PrizeDrawItemsEditor.js +1 -1
- package/dist/features/products/components/PrizeDrawsIndexListing.js +1 -1
- package/dist/features/products/components/ProductCardMetadataSection.js +0 -1
- package/dist/features/products/components/ProductDetailPageView.js +1 -1
- package/dist/features/products/components/ProductFeatureBadges.js +1 -1
- package/dist/features/products/components/ProductGalleryClient.js +1 -1
- package/dist/features/products/components/ProductGrid.js +7 -7
- package/dist/features/products/components/ShareButton.js +1 -1
- package/dist/features/products/components/ShowGroupSection.js +7 -5
- package/dist/features/products/components/SublistingCarouselSection.js +2 -2
- package/dist/features/products/constants/action-defs.d.ts +16 -0
- package/dist/features/products/constants/action-defs.js +16 -0
- package/dist/features/products/constants/listing-tabs.d.ts +48 -0
- package/dist/features/products/constants/listing-tabs.js +12 -0
- package/dist/features/products/repository/products.repository.d.ts +37 -0
- package/dist/features/products/repository/products.repository.js +28 -1
- package/dist/features/products/schemas/firestore.d.ts +8 -6
- package/dist/features/products/schemas/firestore.js +2 -0
- package/dist/features/products/schemas/index.d.ts +8 -8
- package/dist/features/products/types/index.d.ts +2 -0
- package/dist/features/promotions/components/CouponCard.js +2 -2
- package/dist/features/promotions/schemas/firestore.d.ts +2 -4
- package/dist/features/promotions/schemas/index.d.ts +6 -6
- package/dist/features/reviews/components/ReviewDetailShell.js +3 -3
- package/dist/features/reviews/components/ReviewModal.js +2 -4
- package/dist/features/reviews/components/ReviewSummary.js +3 -2
- package/dist/features/reviews/components/ReviewsList.js +1 -1
- package/dist/features/reviews/schemas/firestore.d.ts +2 -4
- package/dist/features/reviews/schemas/index.d.ts +2 -2
- package/dist/features/scams/actions/scam-actions.js +1 -1
- package/dist/features/scams/components/ScamProfileView.js +1 -1
- package/dist/features/scams/schemas/firestore.d.ts +2 -4
- package/dist/features/scams/schemas/index.d.ts +4 -4
- package/dist/features/search/components/Search.js +2 -2
- package/dist/features/search/components/SearchFiltersRow.js +1 -1
- package/dist/features/search/schemas/index.d.ts +3 -3
- package/dist/features/seller/components/BarcodeField.d.ts +17 -0
- package/dist/features/seller/components/BarcodeField.js +30 -0
- package/dist/features/seller/components/FulfillmentView.d.ts +5 -0
- package/dist/features/seller/components/FulfillmentView.js +120 -0
- package/dist/features/seller/components/PhysicalLocationModal.js +2 -3
- package/dist/features/seller/components/PrintCenterView.d.ts +3 -1
- package/dist/features/seller/components/PrintCenterView.js +52 -4
- package/dist/features/seller/components/SellerAddressesView.js +2 -1
- package/dist/features/seller/components/SellerAnalyticsAlertsView.js +1 -1
- package/dist/features/seller/components/SellerBidsView.js +1 -1
- package/dist/features/seller/components/SellerCouponEditorView.js +1 -1
- package/dist/features/seller/components/SellerGoogleReviewsView.js +1 -1
- package/dist/features/seller/components/SellerLiveView.js +1 -1
- package/dist/features/seller/components/SellerOffersPanel.js +1 -0
- package/dist/features/seller/components/SellerOrdersView.js +1 -1
- package/dist/features/seller/components/SellerPayoutMethodsView.js +8 -2
- package/dist/features/seller/components/SellerPayoutRequestView.js +1 -1
- package/dist/features/seller/components/SellerPayoutSettingsView.js +1 -1
- package/dist/features/seller/components/SellerProductShell.d.ts +2 -0
- package/dist/features/seller/components/SellerProductShell.js +4 -3
- package/dist/features/seller/components/SellerProductsCards.js +1 -1
- package/dist/features/seller/components/SellerProductsView.js +1 -1
- package/dist/features/seller/components/SellerReviewsView.js +2 -1
- package/dist/features/seller/components/SellerShippingConfigsView.js +9 -3
- package/dist/features/seller/components/SellerShippingView.js +1 -1
- package/dist/features/seller/components/SellerSidebar.js +3 -8
- package/dist/features/seller/components/SellerStoreCategoriesView.js +11 -3
- package/dist/features/seller/components/SellerTemplatesView.js +8 -2
- package/dist/features/seller/components/analytics/SellerRevenueChart.js +1 -1
- package/dist/features/seller/components/analytics/SellerTopProducts.js +1 -1
- package/dist/features/seller/components/index.d.ts +4 -0
- package/dist/features/seller/components/index.js +2 -0
- package/dist/features/seller/schemas/index.d.ts +4 -4
- package/dist/features/shell/FormShell.js +2 -2
- package/dist/features/shell/QuickFormDrawer.js +1 -1
- package/dist/features/site-settings/components/NavPermissionsManager.js +1 -1
- package/dist/features/store-extensions/schemas/firestore.d.ts +12 -44
- package/dist/features/stores/components/StoreCapabilitiesGuideView.js +1 -1
- package/dist/features/stores/components/StoreClassifiedsListing.d.ts +5 -0
- package/dist/features/stores/components/StoreClassifiedsListing.js +48 -0
- package/dist/features/stores/components/StoreClassifiedsPageView.d.ts +4 -0
- package/dist/features/stores/components/StoreClassifiedsPageView.js +20 -0
- package/dist/features/stores/components/StoreDetailLayoutView.js +23 -2
- package/dist/features/stores/components/StoreDigitalCodesListing.d.ts +5 -0
- package/dist/features/stores/components/StoreDigitalCodesListing.js +48 -0
- package/dist/features/stores/components/StoreDigitalCodesPageView.d.ts +4 -0
- package/dist/features/stores/components/StoreDigitalCodesPageView.js +20 -0
- package/dist/features/stores/components/StoreGuideHubView.js +2 -9
- package/dist/features/stores/components/StoreHeader.js +1 -1
- package/dist/features/stores/components/StoreListingsGuideView.js +4 -4
- package/dist/features/stores/components/StoreLiveItemsListing.d.ts +5 -0
- package/dist/features/stores/components/StoreLiveItemsListing.js +48 -0
- package/dist/features/stores/components/StoreLiveItemsPageView.d.ts +4 -0
- package/dist/features/stores/components/StoreLiveItemsPageView.js +20 -0
- package/dist/features/stores/components/StoreOrdersGuideView.js +2 -2
- package/dist/features/stores/components/StoresIndexListing.js +1 -1
- package/dist/features/stores/components/index.d.ts +9 -0
- package/dist/features/stores/components/index.js +3 -0
- package/dist/features/stores/schemas/firestore.d.ts +2 -4
- package/dist/features/stores/schemas/index.d.ts +4 -4
- package/dist/features/support/schemas/firestore.d.ts +2 -4
- package/dist/features/support/schemas/index.d.ts +2 -2
- package/dist/features/whatsapp-bot/components/SellerWhatsAppSettingsView.js +2 -2
- package/dist/features/wishlist/components/WishlistPage.js +1 -1
- package/dist/features/wishlist/components/WishlistToggleButton.js +3 -3
- package/dist/features/wishlist/hooks/useWishlistCount.js +1 -1
- package/dist/http/ApiClient.d.ts +1 -0
- package/dist/http/ApiClient.js +20 -0
- package/dist/monitoring/error-tracking.d.ts +0 -3
- package/dist/monitoring/error-tracking.js +1 -1
- package/dist/monitoring/server-logger.js +3 -3
- package/dist/next/components/GlobalError.js +1 -1
- package/dist/next/routing/route-map.d.ts +11 -0
- package/dist/next/routing/route-map.js +5 -0
- package/dist/react/ErrorBoundary.js +1 -1
- package/dist/schemas/registry.d.ts +24 -24
- package/dist/seed/grouped-listings-seed-data.d.ts +2 -1
- package/dist/seed/products-preorders-seed-data.d.ts +2 -1
- package/dist/seed/products-standard-seed-data.js +8 -0
- package/dist/server-entry.d.ts +3 -0
- package/dist/server-entry.js +3 -0
- package/dist/server.d.ts +4 -4
- package/dist/styles.css +45 -7
- package/dist/tailwind-utilities.css +1 -1
- package/dist/tokens/themes/default-light.js +3 -0
- package/dist/tokens/tokens.css +43 -6
- package/dist/ui/components/Anchor.d.ts +8 -1
- package/dist/ui/components/Anchor.js +16 -2
- package/dist/ui/components/Button.d.ts +5 -2
- package/dist/ui/components/Button.js +5 -2
- package/dist/ui/components/Details.d.ts +33 -2
- package/dist/ui/components/Details.js +73 -4
- package/dist/ui/components/Div.d.ts +3 -0
- package/dist/ui/components/Div.js +12 -1
- package/dist/ui/components/DynamicBgDiv.d.ts +13 -0
- package/dist/ui/components/DynamicBgDiv.js +18 -0
- package/dist/ui/components/Form.d.ts +3 -19
- package/dist/ui/components/Form.js +8 -1
- package/dist/ui/components/Layout.d.ts +12 -1
- package/dist/ui/components/Layout.js +9 -1
- package/dist/ui/components/Progress.d.ts +1 -1
- package/dist/ui/components/Progress.js +1 -0
- package/dist/ui/components/Progress.style.css +1 -0
- package/dist/ui/components/ProgressBarFill.d.ts +6 -0
- package/dist/ui/components/ProgressBarFill.js +11 -0
- package/dist/ui/components/Semantic.d.ts +26 -7
- package/dist/ui/components/Semantic.js +33 -8
- package/dist/ui/components/TextLink.d.ts +36 -1
- package/dist/ui/components/TextLink.js +30 -2
- package/dist/ui/components/Typography.d.ts +26 -6
- package/dist/ui/components/Typography.js +37 -13
- package/dist/ui/components/VacationBanner.js +0 -1
- package/dist/ui/components/surface-tokens.d.ts +12 -2
- package/dist/ui/components/surface-tokens.js +19 -1
- package/dist/ui/rich-text/RichText.js +1 -1
- package/dist/utils/id-generators.d.ts +8 -0
- package/dist/utils/id-generators.js +14 -0
- package/dist/validation/schemas.d.ts +1 -1
- package/package.json +2 -1
|
@@ -1,4 +1,14 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* filter-load-options.ts
|
|
3
|
+
*
|
|
4
|
+
* Factory functions that return `loadOptions(query, page)` callbacks for use
|
|
5
|
+
* with AsyncFacetSection and PaginatedSelect. Each factory hits a paginated API
|
|
6
|
+
* endpoint and maps the response to { items: PaginatedSelectOption[], hasMore: boolean }.
|
|
7
|
+
*
|
|
8
|
+
* Usage:
|
|
9
|
+
* const load = makeCategoryLoadOptions();
|
|
10
|
+
* <AsyncFacetSection loadOptions={load} ... />
|
|
11
|
+
*/
|
|
2
12
|
const PAGE_SIZE = 25;
|
|
3
13
|
function buildUrl(base, q, page, extra) {
|
|
4
14
|
const params = new URLSearchParams({
|
|
@@ -1,4 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export declare const getAuctionForDetail: (slugOrId: string) => Promise<ProductDocument | null>;
|
|
4
|
-
export declare const getProductFeaturesForAuction: (storeId: string | null) => Promise<ProductFeatureDocument[]>;
|
|
1
|
+
export declare const getAuctionForDetail: (slugOrId: string) => Promise<import("../../../..").ProductDocument | null>;
|
|
2
|
+
export declare const getProductFeaturesForAuction: (storeId: string | null) => Promise<import("../../../..").ProductFeatureDocument[]>;
|
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export const getAuctionForDetail = cache(async (slugOrId) => {
|
|
5
|
-
return (await productRepository.findByIdOrSlug(slugOrId).catch(() => undefined)) ?? null;
|
|
6
|
-
});
|
|
7
|
-
export const getProductFeaturesForAuction = cache(async (storeId) => {
|
|
8
|
-
return loadProductFeaturesForStore(storeId).catch(() => []);
|
|
9
|
-
});
|
|
1
|
+
import { makeGetListingForDetail, getProductFeaturesForStore } from "../shared/listing-data-factory";
|
|
2
|
+
export const getAuctionForDetail = makeGetListingForDetail("auction");
|
|
3
|
+
export const getProductFeaturesForAuction = getProductFeaturesForStore;
|
|
@@ -258,7 +258,7 @@ export async function createCheckoutOrderAction(input) {
|
|
|
258
258
|
if (!addressId) {
|
|
259
259
|
failedCheckoutRepository
|
|
260
260
|
.logCheckout(uid, "address_not_found", "Address required for physical cart", { addressId: "", paymentMethod })
|
|
261
|
-
.catch(
|
|
261
|
+
.catch(console.error);
|
|
262
262
|
throw new NotFoundError(ERROR_MESSAGES.CHECKOUT.ADDRESS_REQUIRED);
|
|
263
263
|
}
|
|
264
264
|
const addressDoc = await unitOfWork.addresses.findById(addressId);
|
|
@@ -269,7 +269,7 @@ export async function createCheckoutOrderAction(input) {
|
|
|
269
269
|
if (!resolvedAddress) {
|
|
270
270
|
failedCheckoutRepository
|
|
271
271
|
.logCheckout(uid, "address_not_found", "Address not found", { addressId, paymentMethod })
|
|
272
|
-
.catch(
|
|
272
|
+
.catch(console.error);
|
|
273
273
|
throw new NotFoundError(ERROR_MESSAGES.CHECKOUT.ADDRESS_REQUIRED);
|
|
274
274
|
}
|
|
275
275
|
shippingAddress = formatShippingAddress(resolvedAddress);
|
|
@@ -408,7 +408,7 @@ export async function createCheckoutOrderAction(input) {
|
|
|
408
408
|
addressId,
|
|
409
409
|
paymentMethod,
|
|
410
410
|
})
|
|
411
|
-
.catch(
|
|
411
|
+
.catch(console.error);
|
|
412
412
|
throw err;
|
|
413
413
|
}
|
|
414
414
|
const { available, unavailable, emailOtpUsed } = stockResult;
|
|
@@ -419,7 +419,7 @@ export async function createCheckoutOrderAction(input) {
|
|
|
419
419
|
paymentMethod,
|
|
420
420
|
cartItemCount: cartItems.length,
|
|
421
421
|
})
|
|
422
|
-
.catch(
|
|
422
|
+
.catch(console.error);
|
|
423
423
|
throw new ValidationError(ERROR_MESSAGES.CHECKOUT.INSUFFICIENT_STOCK);
|
|
424
424
|
}
|
|
425
425
|
const appliedCoupons = cart.appliedCoupons ?? [];
|
|
@@ -663,7 +663,7 @@ export async function verifyAndPlaceRazorpayOrderAction(input) {
|
|
|
663
663
|
gatewayPaymentId: razorpay_payment_id,
|
|
664
664
|
addressId,
|
|
665
665
|
})
|
|
666
|
-
.catch(
|
|
666
|
+
.catch(console.error);
|
|
667
667
|
throw new ValidationError(ERROR_MESSAGES.CHECKOUT.PAYMENT_FAILED);
|
|
668
668
|
}
|
|
669
669
|
const cart = await unitOfWork.carts.getOrCreate(uid);
|
|
@@ -705,7 +705,7 @@ export async function verifyAndPlaceRazorpayOrderAction(input) {
|
|
|
705
705
|
gatewayPaymentId: razorpay_payment_id,
|
|
706
706
|
addressId,
|
|
707
707
|
})
|
|
708
|
-
.catch(
|
|
708
|
+
.catch(console.error);
|
|
709
709
|
throw new ApiError(403, "Order verification required. Please complete OTP verification and retry.");
|
|
710
710
|
}
|
|
711
711
|
}
|
|
@@ -756,7 +756,7 @@ export async function verifyAndPlaceRazorpayOrderAction(input) {
|
|
|
756
756
|
gatewayPaymentId: razorpay_payment_id,
|
|
757
757
|
addressId,
|
|
758
758
|
})
|
|
759
|
-
.catch(
|
|
759
|
+
.catch(console.error);
|
|
760
760
|
throw new ValidationError(exists
|
|
761
761
|
? ERROR_MESSAGES.CHECKOUT.INSUFFICIENT_STOCK
|
|
762
762
|
: ERROR_MESSAGES.CHECKOUT.PRODUCT_UNAVAILABLE);
|
|
@@ -784,7 +784,7 @@ export async function verifyAndPlaceRazorpayOrderAction(input) {
|
|
|
784
784
|
amountRs: paidAmountRs,
|
|
785
785
|
addressId,
|
|
786
786
|
})
|
|
787
|
-
.catch(
|
|
787
|
+
.catch(console.error);
|
|
788
788
|
throw new ValidationError(ERROR_MESSAGES.CHECKOUT.PAYMENT_FAILED);
|
|
789
789
|
}
|
|
790
790
|
}
|
|
@@ -990,7 +990,7 @@ export async function verifyAndPlaceRazorpayOrderAction(input) {
|
|
|
990
990
|
});
|
|
991
991
|
if (!isDigitalCartRazorpay && addressId) {
|
|
992
992
|
const otpRefForDelete = consentOtpRef(db, uid, addressId);
|
|
993
|
-
otpRefForDelete.delete().catch(
|
|
993
|
+
otpRefForDelete.delete().catch(console.error);
|
|
994
994
|
}
|
|
995
995
|
if (emailsToSend.length > 0) {
|
|
996
996
|
Promise.all(emailsToSend.map((e) => sendOrderConfirmationEmail(e))).catch((err) => serverLogger.error("Order confirmation email error:", err));
|
|
@@ -1,21 +1,8 @@
|
|
|
1
1
|
import type { ProductDocument, ProductClassifiedMeta } from "../../../../features/products/schemas/firestore";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
title: string;
|
|
5
|
-
description: string;
|
|
6
|
-
price: number;
|
|
7
|
-
priceLabel: string;
|
|
8
|
-
currency: string;
|
|
9
|
-
mainImage: string | null;
|
|
10
|
-
images: string[];
|
|
11
|
-
storeId: string;
|
|
12
|
-
storeName: string | null;
|
|
13
|
-
category: string;
|
|
2
|
+
import { type BaseListingClientShape } from "../shared/listing-adapters";
|
|
3
|
+
export interface ClassifiedClientShape extends BaseListingClientShape {
|
|
14
4
|
condition: ProductDocument["condition"] | null;
|
|
15
|
-
tags: string[];
|
|
16
5
|
classified: ProductClassifiedMeta | null;
|
|
17
|
-
status: ProductDocument["status"];
|
|
18
|
-
createdAt: string;
|
|
19
6
|
}
|
|
20
7
|
/** Maps a raw `ProductDocument` to the client-safe classified shape. */
|
|
21
8
|
export declare function toClientClassified(doc: ProductDocument): ClassifiedClientShape;
|
|
@@ -1,24 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { mapBaseListingFields } from "../shared/listing-adapters";
|
|
2
2
|
/** Maps a raw `ProductDocument` to the client-safe classified shape. */
|
|
3
3
|
export function toClientClassified(doc) {
|
|
4
4
|
return {
|
|
5
|
-
|
|
6
|
-
title: doc.title,
|
|
7
|
-
description: doc.description,
|
|
8
|
-
price: doc.price,
|
|
9
|
-
priceLabel: formatCurrency(doc.price, doc.currency ?? "INR"),
|
|
10
|
-
currency: doc.currency ?? "INR",
|
|
11
|
-
mainImage: doc.mainImage || doc.images?.[0] || null,
|
|
12
|
-
images: doc.images ?? [],
|
|
13
|
-
storeId: doc.storeId,
|
|
14
|
-
storeName: doc.storeName ?? null,
|
|
15
|
-
category: doc.categorySlugs?.[0] ?? doc.category ?? "",
|
|
5
|
+
...mapBaseListingFields(doc),
|
|
16
6
|
condition: doc.condition ?? null,
|
|
17
|
-
tags: doc.tags ?? [],
|
|
18
7
|
classified: doc.classified ?? null,
|
|
19
|
-
status: doc.status,
|
|
20
|
-
createdAt: doc.createdAt instanceof Date
|
|
21
|
-
? doc.createdAt.toISOString()
|
|
22
|
-
: String(doc.createdAt),
|
|
23
8
|
};
|
|
24
9
|
}
|
|
@@ -1,6 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export interface ClassifiedDataOptions {
|
|
3
|
-
_reserved?: never;
|
|
4
|
-
}
|
|
5
|
-
/** Fetch a single classified listing by slug, deduped per RSC render. */
|
|
6
|
-
export declare const getClassifiedForDetail: (slug: string, _opts?: ClassifiedDataOptions) => Promise<ProductDocument | null>;
|
|
1
|
+
export declare const getClassifiedForDetail: (slugOrId: string) => Promise<import("../../../..").ProductDocument | null>;
|
|
@@ -1,10 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
/** Fetch a single classified listing by slug, deduped per RSC render. */
|
|
4
|
-
export const getClassifiedForDetail = cache(async (slug, _opts) => {
|
|
5
|
-
void _opts;
|
|
6
|
-
const product = await productRepository.findByIdOrSlug(slug).catch(() => undefined);
|
|
7
|
-
if (!product || product.listingType !== "classified")
|
|
8
|
-
return null;
|
|
9
|
-
return product;
|
|
10
|
-
});
|
|
1
|
+
import { makeGetListingForDetail } from "../shared/listing-data-factory";
|
|
2
|
+
export const getClassifiedForDetail = makeGetListingForDetail("classified");
|
|
@@ -1,21 +1,8 @@
|
|
|
1
1
|
import type { ProductDocument, ProductDigitalCodeMeta } from "../../../../features/products/schemas/firestore";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
title: string;
|
|
5
|
-
description: string;
|
|
6
|
-
price: number;
|
|
7
|
-
priceLabel: string;
|
|
8
|
-
currency: string;
|
|
9
|
-
mainImage: string | null;
|
|
10
|
-
images: string[];
|
|
11
|
-
storeId: string;
|
|
12
|
-
storeName: string | null;
|
|
13
|
-
category: string;
|
|
14
|
-
tags: string[];
|
|
2
|
+
import { type BaseListingClientShape } from "../shared/listing-adapters";
|
|
3
|
+
export interface DigitalCodeClientShape extends BaseListingClientShape {
|
|
15
4
|
/** Delivery method and redemption instructions — codesAvailable intentionally omitted (operational). */
|
|
16
5
|
digitalCode: Pick<ProductDigitalCodeMeta, "codeDeliveryMethod" | "redemptionInstructions"> | null;
|
|
17
|
-
status: ProductDocument["status"];
|
|
18
|
-
createdAt: string;
|
|
19
6
|
}
|
|
20
7
|
/** Maps a raw `ProductDocument` to the client-safe digital-code shape. Strips codesAvailable/codePoolSize (operational counters). */
|
|
21
8
|
export declare function toClientDigitalCode(doc: ProductDocument): DigitalCodeClientShape;
|
|
@@ -1,29 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { mapBaseListingFields } from "../shared/listing-adapters";
|
|
2
2
|
/** Maps a raw `ProductDocument` to the client-safe digital-code shape. Strips codesAvailable/codePoolSize (operational counters). */
|
|
3
3
|
export function toClientDigitalCode(doc) {
|
|
4
4
|
const dc = doc.digitalCode ?? null;
|
|
5
5
|
return {
|
|
6
|
-
|
|
7
|
-
title: doc.title,
|
|
8
|
-
description: doc.description,
|
|
9
|
-
price: doc.price,
|
|
10
|
-
priceLabel: formatCurrency(doc.price, doc.currency ?? "INR"),
|
|
11
|
-
currency: doc.currency ?? "INR",
|
|
12
|
-
mainImage: doc.mainImage || doc.images?.[0] || null,
|
|
13
|
-
images: doc.images ?? [],
|
|
14
|
-
storeId: doc.storeId,
|
|
15
|
-
storeName: doc.storeName ?? null,
|
|
16
|
-
category: doc.categorySlugs?.[0] ?? doc.category ?? "",
|
|
17
|
-
tags: doc.tags ?? [],
|
|
6
|
+
...mapBaseListingFields(doc),
|
|
18
7
|
digitalCode: dc
|
|
19
8
|
? {
|
|
20
9
|
codeDeliveryMethod: dc.codeDeliveryMethod,
|
|
21
10
|
redemptionInstructions: dc.redemptionInstructions,
|
|
22
11
|
}
|
|
23
12
|
: null,
|
|
24
|
-
status: doc.status,
|
|
25
|
-
createdAt: doc.createdAt instanceof Date
|
|
26
|
-
? doc.createdAt.toISOString()
|
|
27
|
-
: String(doc.createdAt),
|
|
28
13
|
};
|
|
29
14
|
}
|
|
@@ -1,6 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export interface DigitalCodeDataOptions {
|
|
3
|
-
_reserved?: never;
|
|
4
|
-
}
|
|
5
|
-
/** Fetch a single digital-code listing by slug, deduped per RSC render. */
|
|
6
|
-
export declare const getDigitalCodeForDetail: (slug: string, _opts?: DigitalCodeDataOptions) => Promise<ProductDocument | null>;
|
|
1
|
+
export declare const getDigitalCodeForDetail: (slugOrId: string) => Promise<import("../../../..").ProductDocument | null>;
|
|
@@ -1,10 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
/** Fetch a single digital-code listing by slug, deduped per RSC render. */
|
|
4
|
-
export const getDigitalCodeForDetail = cache(async (slug, _opts) => {
|
|
5
|
-
void _opts;
|
|
6
|
-
const product = await productRepository.findByIdOrSlug(slug).catch(() => undefined);
|
|
7
|
-
if (!product || product.listingType !== "digital-code")
|
|
8
|
-
return null;
|
|
9
|
-
return product;
|
|
10
|
-
});
|
|
1
|
+
import { makeGetListingForDetail } from "../shared/listing-data-factory";
|
|
2
|
+
export const getDigitalCodeForDetail = makeGetListingForDetail("digital-code");
|
|
@@ -1,21 +1,8 @@
|
|
|
1
1
|
import type { ProductDocument, ProductLiveItemMeta } from "../../../../features/products/schemas/firestore";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
title: string;
|
|
5
|
-
description: string;
|
|
6
|
-
price: number;
|
|
7
|
-
priceLabel: string;
|
|
8
|
-
currency: string;
|
|
9
|
-
mainImage: string | null;
|
|
10
|
-
images: string[];
|
|
11
|
-
storeId: string;
|
|
12
|
-
storeName: string | null;
|
|
13
|
-
category: string;
|
|
14
|
-
tags: string[];
|
|
2
|
+
import { type BaseListingClientShape } from "../shared/listing-adapters";
|
|
3
|
+
export interface LiveItemClientShape extends BaseListingClientShape {
|
|
15
4
|
/** Live-item meta — vendorVerified is intentionally omitted (admin-only). */
|
|
16
5
|
liveItem: Omit<ProductLiveItemMeta, "vendorVerified"> | null;
|
|
17
|
-
status: ProductDocument["status"];
|
|
18
|
-
createdAt: string;
|
|
19
6
|
}
|
|
20
7
|
/** Maps a raw `ProductDocument` to the client-safe live-item shape. Strips vendorVerified (admin-only). */
|
|
21
8
|
export declare function toClientLiveItem(doc: ProductDocument): LiveItemClientShape;
|
|
@@ -1,20 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { mapBaseListingFields } from "../shared/listing-adapters";
|
|
2
2
|
/** Maps a raw `ProductDocument` to the client-safe live-item shape. Strips vendorVerified (admin-only). */
|
|
3
3
|
export function toClientLiveItem(doc) {
|
|
4
4
|
const li = doc.liveItem ?? null;
|
|
5
5
|
return {
|
|
6
|
-
|
|
7
|
-
title: doc.title,
|
|
8
|
-
description: doc.description,
|
|
9
|
-
price: doc.price,
|
|
10
|
-
priceLabel: formatCurrency(doc.price, doc.currency ?? "INR"),
|
|
11
|
-
currency: doc.currency ?? "INR",
|
|
12
|
-
mainImage: doc.mainImage || doc.images?.[0] || null,
|
|
13
|
-
images: doc.images ?? [],
|
|
14
|
-
storeId: doc.storeId,
|
|
15
|
-
storeName: doc.storeName ?? null,
|
|
16
|
-
category: doc.categorySlugs?.[0] ?? doc.category ?? "",
|
|
17
|
-
tags: doc.tags ?? [],
|
|
6
|
+
...mapBaseListingFields(doc),
|
|
18
7
|
liveItem: li
|
|
19
8
|
? {
|
|
20
9
|
species: li.species,
|
|
@@ -26,9 +15,5 @@ export function toClientLiveItem(doc) {
|
|
|
26
15
|
cites: li.cites,
|
|
27
16
|
}
|
|
28
17
|
: null,
|
|
29
|
-
status: doc.status,
|
|
30
|
-
createdAt: doc.createdAt instanceof Date
|
|
31
|
-
? doc.createdAt.toISOString()
|
|
32
|
-
: String(doc.createdAt),
|
|
33
18
|
};
|
|
34
19
|
}
|
|
@@ -1,6 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export interface LiveDataOptions {
|
|
3
|
-
_reserved?: never;
|
|
4
|
-
}
|
|
5
|
-
/** Fetch a single live-item listing by slug, deduped per RSC render. */
|
|
6
|
-
export declare const getLiveItemForDetail: (slug: string, _opts?: LiveDataOptions) => Promise<ProductDocument | null>;
|
|
1
|
+
export declare const getLiveItemForDetail: (slugOrId: string) => Promise<import("../../../..").ProductDocument | null>;
|
|
@@ -1,10 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
/** Fetch a single live-item listing by slug, deduped per RSC render. */
|
|
4
|
-
export const getLiveItemForDetail = cache(async (slug, _opts) => {
|
|
5
|
-
void _opts;
|
|
6
|
-
const product = await productRepository.findByIdOrSlug(slug).catch(() => undefined);
|
|
7
|
-
if (!product || product.listingType !== "live")
|
|
8
|
-
return null;
|
|
9
|
-
return product;
|
|
10
|
-
});
|
|
1
|
+
import { makeGetListingForDetail } from "../shared/listing-data-factory";
|
|
2
|
+
export const getLiveItemForDetail = makeGetListingForDetail("live");
|
|
@@ -1,4 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export declare const getPreOrderForDetail: (slugOrId: string) => Promise<ProductDocument | null>;
|
|
4
|
-
export declare const getProductFeaturesForPreOrder: (storeId: string | null) => Promise<ProductFeatureDocument[]>;
|
|
1
|
+
export declare const getPreOrderForDetail: (slugOrId: string) => Promise<import("../../../..").ProductDocument | null>;
|
|
2
|
+
export declare const getProductFeaturesForPreOrder: (storeId: string | null) => Promise<import("../../../..").ProductFeatureDocument[]>;
|
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export const getPreOrderForDetail = cache(async (slugOrId) => {
|
|
5
|
-
return (await productRepository.findByIdOrSlug(slugOrId).catch(() => undefined)) ?? null;
|
|
6
|
-
});
|
|
7
|
-
export const getProductFeaturesForPreOrder = cache(async (storeId) => {
|
|
8
|
-
return loadProductFeaturesForStore(storeId).catch(() => []);
|
|
9
|
-
});
|
|
1
|
+
import { makeGetListingForDetail, getProductFeaturesForStore } from "../shared/listing-data-factory";
|
|
2
|
+
export const getPreOrderForDetail = makeGetListingForDetail("pre-order");
|
|
3
|
+
export const getProductFeaturesForPreOrder = getProductFeaturesForStore;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use server";
|
|
2
|
+
import { wrapAction } from "@mohasinac/appkit/server";
|
|
3
|
+
import { productRepository } from "../../../../repositories";
|
|
4
|
+
import { requireRoleUser } from "../../../../providers/auth-firebase/helpers";
|
|
5
|
+
import { assertPrizeDrawOpen } from "./service";
|
|
6
|
+
export async function enterPrizeDrawAction(input) {
|
|
7
|
+
return wrapAction(async () => {
|
|
8
|
+
const user = await requireRoleUser(["user", "buyer", "seller", "admin"]);
|
|
9
|
+
const { prizeDrawId } = input;
|
|
10
|
+
if (!prizeDrawId)
|
|
11
|
+
throw new Error("prizeDrawId is required.");
|
|
12
|
+
const product = await productRepository.findByIdOrSlug(prizeDrawId).catch(() => null);
|
|
13
|
+
if (!product)
|
|
14
|
+
throw new Error("Prize draw not found.");
|
|
15
|
+
assertPrizeDrawOpen(product);
|
|
16
|
+
// Increment the entry count — server-side only, not exposed to the client adapter.
|
|
17
|
+
await productRepository.update(prizeDrawId, {
|
|
18
|
+
prizeCurrentEntries: (product.prizeCurrentEntries ?? 0) + 1,
|
|
19
|
+
});
|
|
20
|
+
return { entryRecorded: true, userId: user.uid };
|
|
21
|
+
});
|
|
22
|
+
}
|
|
@@ -1,17 +1 @@
|
|
|
1
|
-
|
|
2
|
-
* Prize Draw data layer — OG-coverage-followup 2026-05-23.
|
|
3
|
-
*
|
|
4
|
-
* Prize draws live as products with `listingType:"prize-draw"`. This file
|
|
5
|
-
* wraps the repo call in `React.cache` so the OG renderer and any future
|
|
6
|
-
* page/generateMetadata pair share one Firestore read per request.
|
|
7
|
-
*/
|
|
8
|
-
import type { ProductDocument } from "../../../../features/products/schemas/firestore";
|
|
9
|
-
export interface PrizeDrawDataOptions {
|
|
10
|
-
_reserved?: never;
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* Fetch a single prize-draw product by slug or id. Returns null when the
|
|
14
|
-
* slug is empty or no matching product exists. The caller is responsible
|
|
15
|
-
* for asserting `listingType === "prize-draw"` if a strict gate is required.
|
|
16
|
-
*/
|
|
17
|
-
export declare const getPrizeDrawForDetail: (slugOrId: string, _opts?: PrizeDrawDataOptions) => Promise<ProductDocument | null>;
|
|
1
|
+
export declare const getPrizeDrawForDetail: (slugOrId: string) => Promise<import("../../../..").ProductDocument | null>;
|
|
@@ -1,20 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
*
|
|
4
|
-
* Prize draws live as products with `listingType:"prize-draw"`. This file
|
|
5
|
-
* wraps the repo call in `React.cache` so the OG renderer and any future
|
|
6
|
-
* page/generateMetadata pair share one Firestore read per request.
|
|
7
|
-
*/
|
|
8
|
-
import { cache } from "react";
|
|
9
|
-
import { productRepository } from "../../../../repositories";
|
|
10
|
-
/**
|
|
11
|
-
* Fetch a single prize-draw product by slug or id. Returns null when the
|
|
12
|
-
* slug is empty or no matching product exists. The caller is responsible
|
|
13
|
-
* for asserting `listingType === "prize-draw"` if a strict gate is required.
|
|
14
|
-
*/
|
|
15
|
-
export const getPrizeDrawForDetail = cache(async (slugOrId, _opts) => {
|
|
16
|
-
void _opts;
|
|
17
|
-
if (!slugOrId)
|
|
18
|
-
return null;
|
|
19
|
-
return (await productRepository.findByIdOrSlug(slugOrId).catch(() => null)) ?? null;
|
|
20
|
-
});
|
|
1
|
+
import { makeGetListingForDetail } from "../shared/listing-data-factory";
|
|
2
|
+
export const getPrizeDrawForDetail = makeGetListingForDetail("prize-draw");
|
|
@@ -1,2 +1,4 @@
|
|
|
1
|
-
export { getPrizeDrawForDetail
|
|
1
|
+
export { getPrizeDrawForDetail } from "./data";
|
|
2
|
+
export { enterPrizeDrawAction } from "./actions";
|
|
3
|
+
export { assertPrizeDrawOpen } from "./service";
|
|
2
4
|
export { renderPrizeDrawOg, renderPrizeDrawOgImage, type PrizeDrawOgData, } from "./og";
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ValidationError, CapacityError, ExpiredError } from "../../../shared/errors/index";
|
|
2
|
+
/** Assert the prize draw is accepting entries (published, reveal not started, slots not exhausted). */
|
|
3
|
+
export function assertPrizeDrawOpen(product) {
|
|
4
|
+
if (product.listingType !== "prize-draw") {
|
|
5
|
+
throw new ValidationError("Not a prize draw listing.");
|
|
6
|
+
}
|
|
7
|
+
if (product.status !== "published") {
|
|
8
|
+
throw new ValidationError("Prize draw is not active.");
|
|
9
|
+
}
|
|
10
|
+
const max = product.prizeMaxEntries ?? null;
|
|
11
|
+
const current = product.prizeCurrentEntries ?? 0;
|
|
12
|
+
if (typeof max === "number" && current >= max) {
|
|
13
|
+
throw new CapacityError("Prize draw is fully subscribed.");
|
|
14
|
+
}
|
|
15
|
+
const reveal = product.prizeRevealWindowStart;
|
|
16
|
+
if (reveal && new Date(reveal) <= new Date()) {
|
|
17
|
+
throw new ExpiredError("Prize draw entry window");
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { ProductDocument } from "../../../../features/products/schemas/firestore";
|
|
2
|
+
export interface BaseListingClientShape {
|
|
3
|
+
id: string;
|
|
4
|
+
title: string;
|
|
5
|
+
description: string;
|
|
6
|
+
price: number;
|
|
7
|
+
priceLabel: string;
|
|
8
|
+
currency: string;
|
|
9
|
+
mainImage: string | null;
|
|
10
|
+
images: string[];
|
|
11
|
+
storeId: string;
|
|
12
|
+
storeName: string | null;
|
|
13
|
+
category: string;
|
|
14
|
+
tags: string[];
|
|
15
|
+
status: ProductDocument["status"];
|
|
16
|
+
createdAt: string;
|
|
17
|
+
}
|
|
18
|
+
/** Maps the 11 shared fields from a raw Firestore ProductDocument. */
|
|
19
|
+
export declare function mapBaseListingFields(doc: ProductDocument): BaseListingClientShape;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { formatCurrency } from "../../../../utils/number.formatter";
|
|
2
|
+
/** Maps the 11 shared fields from a raw Firestore ProductDocument. */
|
|
3
|
+
export function mapBaseListingFields(doc) {
|
|
4
|
+
return {
|
|
5
|
+
id: doc.id,
|
|
6
|
+
title: doc.title,
|
|
7
|
+
description: doc.description,
|
|
8
|
+
price: doc.price,
|
|
9
|
+
priceLabel: formatCurrency(doc.price, doc.currency ?? "INR"),
|
|
10
|
+
currency: doc.currency ?? "INR",
|
|
11
|
+
mainImage: doc.mainImage || doc.images?.[0] || null,
|
|
12
|
+
images: doc.images ?? [],
|
|
13
|
+
storeId: doc.storeId,
|
|
14
|
+
storeName: doc.storeName ?? null,
|
|
15
|
+
category: doc.categorySlugs?.[0] ?? doc.category ?? "",
|
|
16
|
+
tags: doc.tags ?? [],
|
|
17
|
+
status: doc.status,
|
|
18
|
+
createdAt: doc.createdAt instanceof Date ? doc.createdAt.toISOString() : String(doc.createdAt),
|
|
19
|
+
};
|
|
20
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ListingType } from "../../../../features/products/types";
|
|
2
|
+
import type { ProductDocument } from "../../../../features/products/schemas/firestore";
|
|
3
|
+
import type { ProductFeatureDocument } from "../../../../features/products/schemas/product-features";
|
|
4
|
+
export declare function makeGetListingForDetail(type: ListingType): (slugOrId: string) => Promise<ProductDocument | null>;
|
|
5
|
+
export declare const getProductFeaturesForStore: (storeId: string | null) => Promise<ProductFeatureDocument[]>;
|
|
6
|
+
export declare function makeGetStoreListingsInitial(type: ListingType, pageSize: number): (storeId: string, page?: number) => Promise<{
|
|
7
|
+
items: ProductDocument[];
|
|
8
|
+
total: number;
|
|
9
|
+
}>;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { cache } from "react";
|
|
2
|
+
import { productRepository } from "../../../../repositories";
|
|
3
|
+
import { loadProductFeaturesForStore } from "../../../../features/products/repository/loadProductFeatures";
|
|
4
|
+
// Returns a React.cache()-wrapped fetch gated on one listing type.
|
|
5
|
+
// The guard prevents cross-type URL collisions (e.g. /auctions/classified-slug returning wrong product).
|
|
6
|
+
export function makeGetListingForDetail(type) {
|
|
7
|
+
return cache(async (slugOrId) => {
|
|
8
|
+
if (!slugOrId)
|
|
9
|
+
return null;
|
|
10
|
+
const product = await productRepository.findByIdOrSlug(slugOrId).catch(() => undefined);
|
|
11
|
+
if (!product || product.listingType !== type)
|
|
12
|
+
return null;
|
|
13
|
+
return product;
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
// Product-feature badges are keyed by store, not listing type.
|
|
17
|
+
// Per-type data.ts files re-export this under a type-specific name.
|
|
18
|
+
export const getProductFeaturesForStore = cache(async (storeId) => loadProductFeaturesForStore(storeId).catch(() => []));
|
|
19
|
+
// Returns a React.cache()-wrapped function for store SSR first-page data.
|
|
20
|
+
// Export names in stores/data.ts stay identical so consumers need no changes.
|
|
21
|
+
export function makeGetStoreListingsInitial(type, pageSize) {
|
|
22
|
+
return cache(async (storeId, page = 1) => {
|
|
23
|
+
const result = await productRepository
|
|
24
|
+
.list({
|
|
25
|
+
filters: `storeId==${storeId},status==published,listingType==${type}`,
|
|
26
|
+
sorts: "-createdAt",
|
|
27
|
+
page,
|
|
28
|
+
pageSize,
|
|
29
|
+
})
|
|
30
|
+
.catch(() => null);
|
|
31
|
+
return { items: result?.items ?? [], total: result?.total ?? 0 };
|
|
32
|
+
});
|
|
33
|
+
}
|