@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.
Files changed (402) hide show
  1. package/dist/_internal/client/features/filters/filter-load-options.js +11 -1
  2. package/dist/_internal/client/features/layout/filterNavItems.js +0 -1
  3. package/dist/_internal/client/features/layout/index.js +0 -1
  4. package/dist/_internal/client/features/maintenance/views/MaintenanceDashboardView.js +0 -1
  5. package/dist/_internal/client/features/maintenance/views/ServerErrorDetailView.js +0 -1
  6. package/dist/_internal/server/features/auctions/data.d.ts +2 -4
  7. package/dist/_internal/server/features/auctions/data.js +3 -9
  8. package/dist/_internal/server/features/checkout/actions.js +9 -9
  9. package/dist/_internal/server/features/classified/adapters.d.ts +2 -15
  10. package/dist/_internal/server/features/classified/adapters.js +2 -17
  11. package/dist/_internal/server/features/classified/data.d.ts +1 -6
  12. package/dist/_internal/server/features/classified/data.js +2 -10
  13. package/dist/_internal/server/features/digital-code/adapters.d.ts +2 -15
  14. package/dist/_internal/server/features/digital-code/adapters.js +2 -17
  15. package/dist/_internal/server/features/digital-code/data.d.ts +1 -6
  16. package/dist/_internal/server/features/digital-code/data.js +2 -10
  17. package/dist/_internal/server/features/live/adapters.d.ts +2 -15
  18. package/dist/_internal/server/features/live/adapters.js +2 -17
  19. package/dist/_internal/server/features/live/data.d.ts +1 -6
  20. package/dist/_internal/server/features/live/data.js +2 -10
  21. package/dist/_internal/server/features/pre-orders/data.d.ts +2 -4
  22. package/dist/_internal/server/features/pre-orders/data.js +3 -9
  23. package/dist/_internal/server/features/prize-draws/actions.d.ts +2 -0
  24. package/dist/_internal/server/features/prize-draws/actions.js +22 -0
  25. package/dist/_internal/server/features/prize-draws/data.d.ts +1 -17
  26. package/dist/_internal/server/features/prize-draws/data.js +2 -20
  27. package/dist/_internal/server/features/prize-draws/index.d.ts +3 -1
  28. package/dist/_internal/server/features/prize-draws/index.js +2 -0
  29. package/dist/_internal/server/features/prize-draws/service.d.ts +3 -0
  30. package/dist/_internal/server/features/prize-draws/service.js +19 -0
  31. package/dist/_internal/server/features/shared/listing-adapters.d.ts +19 -0
  32. package/dist/_internal/server/features/shared/listing-adapters.js +20 -0
  33. package/dist/_internal/server/features/shared/listing-data-factory.d.ts +9 -0
  34. package/dist/_internal/server/features/shared/listing-data-factory.js +33 -0
  35. package/dist/_internal/server/features/stores/data.d.ts +3 -14
  36. package/dist/_internal/server/features/stores/data.js +6 -44
  37. package/dist/_internal/server/jobs/core/cleanupRtdbEvents.js +1 -1
  38. package/dist/_internal/shared/features/cart/schema.d.ts +8 -8
  39. package/dist/_internal/shared/features/cart/schema.js +3 -0
  40. package/dist/_internal/shared/listing-types/_registry.js +2 -0
  41. package/dist/_internal/shared/listing-types/action-tracker.js +1 -1
  42. package/dist/_internal/shared/listing-types/auction/schema.d.ts +3 -1
  43. package/dist/_internal/shared/listing-types/auction/schema.js +7 -1
  44. package/dist/_internal/shared/listing-types/classified/schema.d.ts +2 -1
  45. package/dist/_internal/shared/listing-types/classified/schema.js +3 -1
  46. package/dist/_internal/shared/listing-types/digital-code/schema.d.ts +3 -1
  47. package/dist/_internal/shared/listing-types/digital-code/schema.js +7 -1
  48. package/dist/_internal/shared/listing-types/live/schema.d.ts +2 -1
  49. package/dist/_internal/shared/listing-types/live/schema.js +3 -1
  50. package/dist/_internal/shared/listing-types/pre-order/schema.d.ts +3 -1
  51. package/dist/_internal/shared/listing-types/pre-order/schema.js +7 -1
  52. package/dist/_internal/shared/listing-types/prize-draw/schema.d.ts +3 -1
  53. package/dist/_internal/shared/listing-types/prize-draw/schema.js +13 -1
  54. package/dist/_internal/shared/listing-types/standard/schema.d.ts +2 -1
  55. package/dist/_internal/shared/listing-types/standard/schema.js +4 -1
  56. package/dist/_internal/shared/types/base-document.d.ts +15 -0
  57. package/dist/_internal/shared/types/base-document.js +1 -0
  58. package/dist/_internal/shared/types/index.d.ts +2 -0
  59. package/dist/_internal/shared/types/index.js +1 -0
  60. package/dist/client/api/ApiError.d.ts +10 -4
  61. package/dist/client/api/surface-error.js +0 -1
  62. package/dist/client.d.ts +8 -4
  63. package/dist/client.js +4 -2
  64. package/dist/constants/api-endpoints.d.ts +12 -0
  65. package/dist/constants/api-endpoints.js +4 -0
  66. package/dist/core/hooks/useSyncManager.js +4 -4
  67. package/dist/features/_guide-cls.d.ts +1 -1
  68. package/dist/features/_guide-cls.js +1 -1
  69. package/dist/features/about/components/AboutView.js +1 -4
  70. package/dist/features/about/components/FAQPageView.js +1 -1
  71. package/dist/features/about/components/FeesView.js +1 -1
  72. package/dist/features/about/components/HelpPageView.js +1 -1
  73. package/dist/features/about/components/HowOrdersWorkView.js +1 -1
  74. package/dist/features/about/components/PublicProfileView.js +6 -6
  75. package/dist/features/about/components/TrackOrderView.js +1 -1
  76. package/dist/features/account/components/AddressBook.js +1 -1
  77. package/dist/features/account/components/AddressForm.js +10 -2
  78. package/dist/features/account/components/AddressesIndexListing.js +1 -1
  79. package/dist/features/account/components/BuyerAccountGuideView.js +1 -1
  80. package/dist/features/account/components/BuyerAuctionsGuideView.js +1 -1
  81. package/dist/features/account/components/BuyerOrdersGuideView.js +1 -1
  82. package/dist/features/account/components/BuyerShoppingGuideView.js +1 -1
  83. package/dist/features/account/components/ChatWindow.js +1 -1
  84. package/dist/features/account/components/MessagesView.js +1 -1
  85. package/dist/features/account/components/NotificationBell.js +25 -10
  86. package/dist/features/account/components/NotificationPreferencesPanel.js +2 -2
  87. package/dist/features/account/components/UserOffersPanel.js +1 -0
  88. package/dist/features/account/components/UserSidebar.js +1 -6
  89. package/dist/features/account/components/UserSupportView.js +1 -1
  90. package/dist/features/addresses/schemas/firestore.d.ts +2 -4
  91. package/dist/features/admin/components/AdminAnalyticsGuideView.js +2 -2
  92. package/dist/features/admin/components/AdminBlogEditorView.js +1 -1
  93. package/dist/features/admin/components/AdminBundlesView.js +1 -1
  94. package/dist/features/admin/components/AdminCarouselEditorView.js +1 -1
  95. package/dist/features/admin/components/AdminCatalogGuideView.js +2 -2
  96. package/dist/features/admin/components/AdminContentGuideView.js +2 -2
  97. package/dist/features/admin/components/AdminEmployeeEditorView.js +2 -2
  98. package/dist/features/admin/components/AdminFulfillmentView.d.ts +6 -0
  99. package/dist/features/admin/components/AdminFulfillmentView.js +107 -0
  100. package/dist/features/admin/components/AdminGuideHubView.js +1 -5
  101. package/dist/features/admin/components/AdminMediaView.js +1 -1
  102. package/dist/features/admin/components/AdminNavigationView.js +1 -1
  103. package/dist/features/admin/components/AdminOrdersGuideView.js +3 -3
  104. package/dist/features/admin/components/AdminPayoutsView.js +1 -4
  105. package/dist/features/admin/components/AdminProductEditorView.js +21 -9
  106. package/dist/features/admin/components/AdminProductsView.js +3 -0
  107. package/dist/features/admin/components/AdminSidebar.js +1 -6
  108. package/dist/features/admin/components/AdminSiteConfigGuideView.js +1 -1
  109. package/dist/features/admin/components/AdminSiteSettingsView.js +9 -1
  110. package/dist/features/admin/components/AdminStoreEditorView.js +1 -1
  111. package/dist/features/admin/components/AdminStoresGuideView.js +2 -2
  112. package/dist/features/admin/components/AdminSupportTicketDetailView.js +7 -7
  113. package/dist/features/admin/components/AdminTeamGuideView.js +2 -2
  114. package/dist/features/admin/components/AdminTrustGuideView.js +3 -3
  115. package/dist/features/admin/components/AdminUsersGuideView.js +3 -3
  116. package/dist/features/admin/components/DashboardStats.js +6 -5
  117. package/dist/features/admin/components/DataListingView.d.ts +1 -0
  118. package/dist/features/admin/components/DataTable.js +2 -2
  119. package/dist/features/admin/components/analytics/AdminAnalyticsCharts.js +4 -6
  120. package/dist/features/admin/components/analytics/AdminStatCard.js +4 -3
  121. package/dist/features/admin/components/analytics/AdminTopProductsTable.js +1 -1
  122. package/dist/features/admin/components/index.d.ts +2 -0
  123. package/dist/features/admin/components/index.js +1 -0
  124. package/dist/features/admin/schemas/firestore.d.ts +3 -8
  125. package/dist/features/auctions/components/AuctionBidsTable.js +1 -1
  126. package/dist/features/auctions/components/AuctionDetailPageView.js +1 -1
  127. package/dist/features/auctions/components/MarketplaceAuctionCard.js +3 -3
  128. package/dist/features/auctions/schemas/firestore.d.ts +2 -4
  129. package/dist/features/auctions/schemas/index.d.ts +2 -2
  130. package/dist/features/auth/components/ForgotPasswordView.js +19 -8
  131. package/dist/features/auth/components/LoginForm.js +10 -2
  132. package/dist/features/auth/components/RegisterForm.js +10 -2
  133. package/dist/features/auth/components/ResetPasswordView.js +19 -8
  134. package/dist/features/auth/components/SocialAuthButtons.js +1 -1
  135. package/dist/features/before-after/components/BeforeAfterSlider.js +1 -1
  136. package/dist/features/before-after/schemas/index.d.ts +2 -2
  137. package/dist/features/blog/api/[slug]/route.js +1 -1
  138. package/dist/features/blog/components/BlogFeaturedCard.js +1 -1
  139. package/dist/features/blog/components/BlogListView.js +1 -1
  140. package/dist/features/blog/components/BlogPostView.js +1 -1
  141. package/dist/features/blog/schemas/firestore.d.ts +2 -4
  142. package/dist/features/blog/schemas/index.d.ts +6 -6
  143. package/dist/features/cart/components/CartDrawer.js +2 -2
  144. package/dist/features/cart/components/CartView.js +1 -1
  145. package/dist/features/cart/components/CheckoutView.js +1 -1
  146. package/dist/features/cart/schemas/firestore.d.ts +2 -4
  147. package/dist/features/categories/components/BrandDetailPageView.js +2 -1
  148. package/dist/features/categories/components/BundleDetailView.js +1 -1
  149. package/dist/features/categories/components/BundleItemsPicker.js +1 -1
  150. package/dist/features/categories/components/CategoryBundlesListing.js +3 -1
  151. package/dist/features/categories/components/CategoryDetailPageView.js +1 -1
  152. package/dist/features/categories/components/CategoryGrid.js +2 -1
  153. package/dist/features/categories/components/CategoryTableColumns.js +5 -2
  154. package/dist/features/categories/components/CategoryTree.js +3 -2
  155. package/dist/features/categories/components/ConcernCard.js +1 -1
  156. package/dist/features/categories/schemas/firestore.d.ts +2 -4
  157. package/dist/features/categories/schemas/index.d.ts +6 -6
  158. package/dist/features/checkout/components/CheckoutStepper.js +1 -1
  159. package/dist/features/collections/components/CollectionCard.js +1 -1
  160. package/dist/features/contact/components/ContactPageView.js +27 -27
  161. package/dist/features/contact/email.js +4 -4
  162. package/dist/features/copilot/components/AdminCopilotView.js +3 -3
  163. package/dist/features/email/primitives.d.ts +4 -0
  164. package/dist/features/email/primitives.js +4 -0
  165. package/dist/features/events/components/EventCard.js +2 -2
  166. package/dist/features/events/components/EventOfferCard.js +1 -1
  167. package/dist/features/events/components/EventRaffleEntryForm.js +1 -1
  168. package/dist/features/events/components/EventRaffleWinnerView.js +2 -2
  169. package/dist/features/events/components/EventSaleBanner.js +0 -1
  170. package/dist/features/events/schemas/firestore.d.ts +2 -4
  171. package/dist/features/events/schemas/index.d.ts +4 -4
  172. package/dist/features/faq/components/ContactCTA.js +1 -1
  173. package/dist/features/faq/components/FAQAccordion.js +2 -2
  174. package/dist/features/faq/components/FAQCategorySidebar.js +2 -2
  175. package/dist/features/faq/components/FAQHelpfulButtons.js +2 -2
  176. package/dist/features/faq/components/RelatedFAQs.js +1 -1
  177. package/dist/features/faq/schemas/firestore.d.ts +2 -4
  178. package/dist/features/faq/schemas/index.d.ts +4 -4
  179. package/dist/features/filters/AsyncFacetSection.js +3 -3
  180. package/dist/features/filters/FilterFacetSection.js +6 -6
  181. package/dist/features/filters/RangeFilter.js +2 -2
  182. package/dist/features/filters/SwitchFilter.js +1 -1
  183. package/dist/features/forms/Checkbox.js +1 -1
  184. package/dist/features/forms/Slider.js +7 -2
  185. package/dist/features/forms/utils.d.ts +2 -2
  186. package/dist/features/forms/utils.js +2 -2
  187. package/dist/features/grouped/schemas/index.d.ts +2 -2
  188. package/dist/features/history/hooks/useHistory.js +1 -1
  189. package/dist/features/homepage/components/AdSlot.js +3 -3
  190. package/dist/features/homepage/components/AdvertisementBanner.js +5 -4
  191. package/dist/features/homepage/components/BeforeAfterCard.js +9 -1
  192. package/dist/features/homepage/components/CharacterHotspot.js +42 -49
  193. package/dist/features/homepage/components/CharacterHotspotForm.js +18 -20
  194. package/dist/features/homepage/components/CollectionCardsSection.js +2 -2
  195. package/dist/features/homepage/components/CustomCardsSection.js +3 -6
  196. package/dist/features/homepage/components/CustomerReviewsSection.js +1 -1
  197. package/dist/features/homepage/components/FAQSection.js +2 -2
  198. package/dist/features/homepage/components/FeaturedResultsSection.js +1 -1
  199. package/dist/features/homepage/components/GoogleReviewsSection.js +4 -4
  200. package/dist/features/homepage/components/HeroBanner.js +12 -63
  201. package/dist/features/homepage/components/HeroCarousel.js +6 -6
  202. package/dist/features/homepage/components/HeroSection.js +1 -1
  203. package/dist/features/homepage/components/HowItWorksInfoView.js +1 -1
  204. package/dist/features/homepage/components/HowItWorksSection.js +5 -3
  205. package/dist/features/homepage/components/NewsletterBanner.js +3 -7
  206. package/dist/features/homepage/components/PromoGrid.js +2 -26
  207. package/dist/features/homepage/components/SectionCarousel.js +1 -1
  208. package/dist/features/homepage/components/SecurityHighlightsSection.js +6 -3
  209. package/dist/features/homepage/components/ShopByCategorySection.js +3 -3
  210. package/dist/features/homepage/components/SiteFeaturesSection.js +1 -1
  211. package/dist/features/homepage/components/SocialPostCard.js +2 -3
  212. package/dist/features/homepage/components/StatsCounterSection.js +6 -3
  213. package/dist/features/homepage/components/TestimonialsCarousel.js +2 -25
  214. package/dist/features/homepage/components/TrustBadges.js +1 -9
  215. package/dist/features/homepage/components/TrustFeaturesSection.js +6 -3
  216. package/dist/features/homepage/components/TrustIndicatorsSection.js +1 -1
  217. package/dist/features/homepage/components/WelcomeSection.js +2 -2
  218. package/dist/features/homepage/components/WhatsAppCommunitySection.js +1 -1
  219. package/dist/features/homepage/lib/franchise-colors.d.ts +7 -0
  220. package/dist/features/homepage/lib/franchise-colors.js +7 -0
  221. package/dist/features/homepage/lib/live-stats.js +5 -5
  222. package/dist/features/homepage/schemas/firestore.d.ts +4 -12
  223. package/dist/features/homepage/schemas/index.d.ts +2 -2
  224. package/dist/features/layout/AppLayoutShell.js +7 -9
  225. package/dist/features/layout/BottomNavbar.js +1 -2
  226. package/dist/features/messages/hooks/useConversation.js +2 -1
  227. package/dist/features/messages/hooks/useConversations.js +1 -0
  228. package/dist/features/messages/schemas/firestore.d.ts +2 -4
  229. package/dist/features/messages/schemas/index.d.ts +2 -2
  230. package/dist/features/orders/components/OrdersList.js +1 -1
  231. package/dist/features/orders/components/RefundHistoryTable.d.ts +6 -0
  232. package/dist/features/orders/components/RefundHistoryTable.js +3 -2
  233. package/dist/features/orders/repository/orders.repository.d.ts +5 -0
  234. package/dist/features/orders/repository/orders.repository.js +26 -0
  235. package/dist/features/orders/schemas/firestore.d.ts +9 -5
  236. package/dist/features/orders/schemas/firestore.js +3 -0
  237. package/dist/features/payments/schemas/firestore.d.ts +2 -4
  238. package/dist/features/pre-orders/components/MarketplacePreorderCard.js +2 -2
  239. package/dist/features/pre-orders/components/PreOrderBadge.js +1 -1
  240. package/dist/features/pre-orders/components/PreOrderDetailPageView.js +2 -1
  241. package/dist/features/pre-orders/schemas/index.d.ts +2 -2
  242. package/dist/features/products/components/CompareOverlay.js +11 -8
  243. package/dist/features/products/components/CustomSectionTabContent.js +1 -1
  244. package/dist/features/products/components/FeatureBadge.js +11 -1
  245. package/dist/features/products/components/GroupSettingsPanel.js +2 -2
  246. package/dist/features/products/components/MarketplaceBundleCard.js +1 -1
  247. package/dist/features/products/components/MarketplacePrizeDrawCard.js +2 -2
  248. package/dist/features/products/components/PrizeDrawItemsEditor.js +1 -1
  249. package/dist/features/products/components/PrizeDrawsIndexListing.js +1 -1
  250. package/dist/features/products/components/ProductCardMetadataSection.js +0 -1
  251. package/dist/features/products/components/ProductDetailPageView.js +1 -1
  252. package/dist/features/products/components/ProductFeatureBadges.js +1 -1
  253. package/dist/features/products/components/ProductGalleryClient.js +1 -1
  254. package/dist/features/products/components/ProductGrid.js +7 -7
  255. package/dist/features/products/components/ShareButton.js +1 -1
  256. package/dist/features/products/components/ShowGroupSection.js +7 -5
  257. package/dist/features/products/components/SublistingCarouselSection.js +2 -2
  258. package/dist/features/products/constants/action-defs.d.ts +16 -0
  259. package/dist/features/products/constants/action-defs.js +16 -0
  260. package/dist/features/products/constants/listing-tabs.d.ts +48 -0
  261. package/dist/features/products/constants/listing-tabs.js +12 -0
  262. package/dist/features/products/repository/products.repository.d.ts +37 -0
  263. package/dist/features/products/repository/products.repository.js +28 -1
  264. package/dist/features/products/schemas/firestore.d.ts +8 -6
  265. package/dist/features/products/schemas/firestore.js +2 -0
  266. package/dist/features/products/schemas/index.d.ts +8 -8
  267. package/dist/features/products/types/index.d.ts +2 -0
  268. package/dist/features/promotions/components/CouponCard.js +2 -2
  269. package/dist/features/promotions/schemas/firestore.d.ts +2 -4
  270. package/dist/features/promotions/schemas/index.d.ts +6 -6
  271. package/dist/features/reviews/components/ReviewDetailShell.js +3 -3
  272. package/dist/features/reviews/components/ReviewModal.js +2 -4
  273. package/dist/features/reviews/components/ReviewSummary.js +3 -2
  274. package/dist/features/reviews/components/ReviewsList.js +1 -1
  275. package/dist/features/reviews/schemas/firestore.d.ts +2 -4
  276. package/dist/features/reviews/schemas/index.d.ts +2 -2
  277. package/dist/features/scams/actions/scam-actions.js +1 -1
  278. package/dist/features/scams/components/ScamProfileView.js +1 -1
  279. package/dist/features/scams/schemas/firestore.d.ts +2 -4
  280. package/dist/features/scams/schemas/index.d.ts +4 -4
  281. package/dist/features/search/components/Search.js +2 -2
  282. package/dist/features/search/components/SearchFiltersRow.js +1 -1
  283. package/dist/features/search/schemas/index.d.ts +3 -3
  284. package/dist/features/seller/components/BarcodeField.d.ts +17 -0
  285. package/dist/features/seller/components/BarcodeField.js +30 -0
  286. package/dist/features/seller/components/FulfillmentView.d.ts +5 -0
  287. package/dist/features/seller/components/FulfillmentView.js +120 -0
  288. package/dist/features/seller/components/PhysicalLocationModal.js +2 -3
  289. package/dist/features/seller/components/PrintCenterView.d.ts +3 -1
  290. package/dist/features/seller/components/PrintCenterView.js +52 -4
  291. package/dist/features/seller/components/SellerAddressesView.js +2 -1
  292. package/dist/features/seller/components/SellerAnalyticsAlertsView.js +1 -1
  293. package/dist/features/seller/components/SellerBidsView.js +1 -1
  294. package/dist/features/seller/components/SellerCouponEditorView.js +1 -1
  295. package/dist/features/seller/components/SellerGoogleReviewsView.js +1 -1
  296. package/dist/features/seller/components/SellerLiveView.js +1 -1
  297. package/dist/features/seller/components/SellerOffersPanel.js +1 -0
  298. package/dist/features/seller/components/SellerOrdersView.js +1 -1
  299. package/dist/features/seller/components/SellerPayoutMethodsView.js +8 -2
  300. package/dist/features/seller/components/SellerPayoutRequestView.js +1 -1
  301. package/dist/features/seller/components/SellerPayoutSettingsView.js +1 -1
  302. package/dist/features/seller/components/SellerProductShell.d.ts +2 -0
  303. package/dist/features/seller/components/SellerProductShell.js +4 -3
  304. package/dist/features/seller/components/SellerProductsCards.js +1 -1
  305. package/dist/features/seller/components/SellerProductsView.js +1 -1
  306. package/dist/features/seller/components/SellerReviewsView.js +2 -1
  307. package/dist/features/seller/components/SellerShippingConfigsView.js +9 -3
  308. package/dist/features/seller/components/SellerShippingView.js +1 -1
  309. package/dist/features/seller/components/SellerSidebar.js +3 -8
  310. package/dist/features/seller/components/SellerStoreCategoriesView.js +11 -3
  311. package/dist/features/seller/components/SellerTemplatesView.js +8 -2
  312. package/dist/features/seller/components/analytics/SellerRevenueChart.js +1 -1
  313. package/dist/features/seller/components/analytics/SellerTopProducts.js +1 -1
  314. package/dist/features/seller/components/index.d.ts +4 -0
  315. package/dist/features/seller/components/index.js +2 -0
  316. package/dist/features/seller/schemas/index.d.ts +4 -4
  317. package/dist/features/shell/FormShell.js +2 -2
  318. package/dist/features/shell/QuickFormDrawer.js +1 -1
  319. package/dist/features/site-settings/components/NavPermissionsManager.js +1 -1
  320. package/dist/features/store-extensions/schemas/firestore.d.ts +12 -44
  321. package/dist/features/stores/components/StoreCapabilitiesGuideView.js +1 -1
  322. package/dist/features/stores/components/StoreClassifiedsListing.d.ts +5 -0
  323. package/dist/features/stores/components/StoreClassifiedsListing.js +48 -0
  324. package/dist/features/stores/components/StoreClassifiedsPageView.d.ts +4 -0
  325. package/dist/features/stores/components/StoreClassifiedsPageView.js +20 -0
  326. package/dist/features/stores/components/StoreDetailLayoutView.js +23 -2
  327. package/dist/features/stores/components/StoreDigitalCodesListing.d.ts +5 -0
  328. package/dist/features/stores/components/StoreDigitalCodesListing.js +48 -0
  329. package/dist/features/stores/components/StoreDigitalCodesPageView.d.ts +4 -0
  330. package/dist/features/stores/components/StoreDigitalCodesPageView.js +20 -0
  331. package/dist/features/stores/components/StoreGuideHubView.js +2 -9
  332. package/dist/features/stores/components/StoreHeader.js +1 -1
  333. package/dist/features/stores/components/StoreListingsGuideView.js +4 -4
  334. package/dist/features/stores/components/StoreLiveItemsListing.d.ts +5 -0
  335. package/dist/features/stores/components/StoreLiveItemsListing.js +48 -0
  336. package/dist/features/stores/components/StoreLiveItemsPageView.d.ts +4 -0
  337. package/dist/features/stores/components/StoreLiveItemsPageView.js +20 -0
  338. package/dist/features/stores/components/StoreOrdersGuideView.js +2 -2
  339. package/dist/features/stores/components/StoresIndexListing.js +1 -1
  340. package/dist/features/stores/components/index.d.ts +9 -0
  341. package/dist/features/stores/components/index.js +3 -0
  342. package/dist/features/stores/schemas/firestore.d.ts +2 -4
  343. package/dist/features/stores/schemas/index.d.ts +4 -4
  344. package/dist/features/support/schemas/firestore.d.ts +2 -4
  345. package/dist/features/support/schemas/index.d.ts +2 -2
  346. package/dist/features/whatsapp-bot/components/SellerWhatsAppSettingsView.js +2 -2
  347. package/dist/features/wishlist/components/WishlistPage.js +1 -1
  348. package/dist/features/wishlist/components/WishlistToggleButton.js +3 -3
  349. package/dist/features/wishlist/hooks/useWishlistCount.js +1 -1
  350. package/dist/http/ApiClient.d.ts +1 -0
  351. package/dist/http/ApiClient.js +20 -0
  352. package/dist/monitoring/error-tracking.d.ts +0 -3
  353. package/dist/monitoring/error-tracking.js +1 -1
  354. package/dist/monitoring/server-logger.js +3 -3
  355. package/dist/next/components/GlobalError.js +1 -1
  356. package/dist/next/routing/route-map.d.ts +11 -0
  357. package/dist/next/routing/route-map.js +5 -0
  358. package/dist/react/ErrorBoundary.js +1 -1
  359. package/dist/schemas/registry.d.ts +24 -24
  360. package/dist/seed/grouped-listings-seed-data.d.ts +2 -1
  361. package/dist/seed/products-preorders-seed-data.d.ts +2 -1
  362. package/dist/seed/products-standard-seed-data.js +8 -0
  363. package/dist/server-entry.d.ts +3 -0
  364. package/dist/server-entry.js +3 -0
  365. package/dist/server.d.ts +4 -4
  366. package/dist/styles.css +45 -7
  367. package/dist/tailwind-utilities.css +1 -1
  368. package/dist/tokens/themes/default-light.js +3 -0
  369. package/dist/tokens/tokens.css +43 -6
  370. package/dist/ui/components/Anchor.d.ts +8 -1
  371. package/dist/ui/components/Anchor.js +16 -2
  372. package/dist/ui/components/Button.d.ts +5 -2
  373. package/dist/ui/components/Button.js +5 -2
  374. package/dist/ui/components/Details.d.ts +33 -2
  375. package/dist/ui/components/Details.js +73 -4
  376. package/dist/ui/components/Div.d.ts +3 -0
  377. package/dist/ui/components/Div.js +12 -1
  378. package/dist/ui/components/DynamicBgDiv.d.ts +13 -0
  379. package/dist/ui/components/DynamicBgDiv.js +18 -0
  380. package/dist/ui/components/Form.d.ts +3 -19
  381. package/dist/ui/components/Form.js +8 -1
  382. package/dist/ui/components/Layout.d.ts +12 -1
  383. package/dist/ui/components/Layout.js +9 -1
  384. package/dist/ui/components/Progress.d.ts +1 -1
  385. package/dist/ui/components/Progress.js +1 -0
  386. package/dist/ui/components/Progress.style.css +1 -0
  387. package/dist/ui/components/ProgressBarFill.d.ts +6 -0
  388. package/dist/ui/components/ProgressBarFill.js +11 -0
  389. package/dist/ui/components/Semantic.d.ts +26 -7
  390. package/dist/ui/components/Semantic.js +33 -8
  391. package/dist/ui/components/TextLink.d.ts +36 -1
  392. package/dist/ui/components/TextLink.js +30 -2
  393. package/dist/ui/components/Typography.d.ts +26 -6
  394. package/dist/ui/components/Typography.js +37 -13
  395. package/dist/ui/components/VacationBanner.js +0 -1
  396. package/dist/ui/components/surface-tokens.d.ts +12 -2
  397. package/dist/ui/components/surface-tokens.js +19 -1
  398. package/dist/ui/rich-text/RichText.js +1 -1
  399. package/dist/utils/id-generators.d.ts +8 -0
  400. package/dist/utils/id-generators.js +14 -0
  401. package/dist/validation/schemas.d.ts +1 -1
  402. package/package.json +2 -1
@@ -1,4 +1,14 @@
1
- "use client";
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,3 @@
1
- "use client";
2
1
  /**
3
2
  * Filters nav items by:
4
3
  * 1. siteSettings.navConfig[item.id].enabled (admin toggle)
@@ -1,4 +1,3 @@
1
- "use client";
2
1
  /** Layout feature — client islands barrel. */
3
2
  export { DashboardLayoutClient } from "./DashboardLayoutClient";
4
3
  export { RoleGuard } from "./RoleGuard";
@@ -1,4 +1,3 @@
1
- "use client";
2
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
2
  import { Anchor, Div, Heading, Li, Nav, Section, Span, Text, Ul } from "@mohasinac/appkit";
4
3
  const card = {
@@ -1,4 +1,3 @@
1
- "use client";
2
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
2
  import { Anchor, Div, Heading, Li, Pre, Section, Text, Ul } from "@mohasinac/appkit";
4
3
  function fmt(t) {
@@ -1,4 +1,2 @@
1
- import type { ProductDocument } from "../../../../features/products/schemas/firestore";
2
- import type { ProductFeatureDocument } from "../../../../features/products/schemas/product-features";
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 { cache } from "react";
2
- import { productRepository } from "../../../../repositories";
3
- import { loadProductFeaturesForStore } from "../../../../features/products/repository/loadProductFeatures";
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
- export interface ClassifiedClientShape {
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;
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 { formatCurrency } from "../../../../utils/number.formatter";
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
- 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 ?? "",
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
- import type { ProductDocument } from "../../../../features/products/schemas/firestore";
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 { cache } from "react";
2
- import { productRepository } from "../../../../repositories";
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
- export interface DigitalCodeClientShape {
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[];
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 { formatCurrency } from "../../../../utils/number.formatter";
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
- id: doc.id,
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
- import type { ProductDocument } from "../../../../features/products/schemas/firestore";
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 { cache } from "react";
2
- import { productRepository } from "../../../../repositories";
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
- export interface LiveItemClientShape {
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[];
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 { formatCurrency } from "../../../../utils/number.formatter";
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
- id: doc.id,
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
- import type { ProductDocument } from "../../../../features/products/schemas/firestore";
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 { cache } from "react";
2
- import { productRepository } from "../../../../repositories";
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
- import type { ProductDocument } from "../../../../features/products/schemas/firestore";
2
- import type { ProductFeatureDocument } from "../../../../features/products/schemas/product-features";
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 { cache } from "react";
2
- import { productRepository } from "../../../../repositories";
3
- import { loadProductFeaturesForStore } from "../../../../features/products/repository/loadProductFeatures";
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,2 @@
1
+ import { type ActionResult } from "@mohasinac/appkit/server";
2
+ export declare function enterPrizeDrawAction(input: unknown): Promise<ActionResult<unknown>>;
@@ -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
- * 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 { 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, type PrizeDrawDataOptions } from "./data";
1
+ export { getPrizeDrawForDetail } from "./data";
2
+ export { enterPrizeDrawAction } from "./actions";
3
+ export { assertPrizeDrawOpen } from "./service";
2
4
  export { renderPrizeDrawOg, renderPrizeDrawOgImage, type PrizeDrawOgData, } from "./og";
@@ -1,2 +1,4 @@
1
1
  export { getPrizeDrawForDetail } from "./data";
2
+ export { enterPrizeDrawAction } from "./actions";
3
+ export { assertPrizeDrawOpen } from "./service";
2
4
  export { renderPrizeDrawOg, renderPrizeDrawOgImage, } from "./og";
@@ -0,0 +1,3 @@
1
+ import type { ProductDocument } from "../../../../features/products/schemas/firestore";
2
+ /** Assert the prize draw is accepting entries (published, reveal not started, slots not exhausted). */
3
+ export declare function assertPrizeDrawOpen(product: ProductDocument): void;
@@ -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
+ }