@mohasinac/appkit 3.4.8 → 3.5.1

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 (605) hide show
  1. package/dist/_internal/client/features/classified/ClassifiedDetailView.js +1 -1
  2. package/dist/_internal/client/features/digital-code/CodeRevealPanel.js +1 -1
  3. package/dist/_internal/client/features/digital-code/DigitalCodeDetailView.js +1 -1
  4. package/dist/_internal/client/features/filters/filter-load-options.js +10 -9
  5. package/dist/_internal/client/features/layout/DashboardLayoutClient.d.ts +6 -1
  6. package/dist/_internal/client/features/layout/DashboardLayoutClient.js +11 -4
  7. package/dist/_internal/client/features/live/LiveItemDetailView.js +2 -2
  8. package/dist/_internal/client/features/maintenance/views/AnalysisRunnerView.js +10 -3
  9. package/dist/_internal/client/features/maintenance/views/ServerErrorsListView.js +2 -2
  10. package/dist/_internal/client/scaffolds/DashboardScaffold.js +3 -1
  11. package/dist/_internal/server/features/checkout/actions.d.ts +16 -0
  12. package/dist/_internal/server/features/checkout/actions.js +149 -35
  13. package/dist/_internal/server/features/checkout/bundle-expansion.d.ts +31 -0
  14. package/dist/_internal/server/features/checkout/bundle-expansion.js +41 -0
  15. package/dist/_internal/server/features/lottery/actions.js +14 -4
  16. package/dist/_internal/server/features/maintenance/analyze.js +4 -2
  17. package/dist/_internal/server/features/orders/actions.js +9 -0
  18. package/dist/_internal/server/features/orders/adapters.js +19 -0
  19. package/dist/_internal/server/features/seo/robots.js +1 -1
  20. package/dist/_internal/server/functions/firestore.d.ts +47 -1
  21. package/dist/_internal/server/functions/firestore.js +56 -1
  22. package/dist/_internal/server/functions/scheduled.d.ts +2 -1
  23. package/dist/_internal/server/functions/scheduled.js +9 -1
  24. package/dist/_internal/server/jobs/core/catalogueImageStalenessReminder.d.ts +10 -0
  25. package/dist/_internal/server/jobs/core/catalogueImageStalenessReminder.js +49 -0
  26. package/dist/_internal/server/jobs/core/cleanupRtdbEvents.js +32 -0
  27. package/dist/_internal/server/jobs/core/hardBanCascade.d.ts +26 -0
  28. package/dist/_internal/server/jobs/core/hardBanCascade.js +181 -0
  29. package/dist/_internal/server/jobs/core/index.d.ts +4 -1
  30. package/dist/_internal/server/jobs/core/index.js +4 -1
  31. package/dist/_internal/server/jobs/core/jobRunners.d.ts +28 -0
  32. package/dist/_internal/server/jobs/core/jobRunners.js +37 -0
  33. package/dist/_internal/server/jobs/core/onCatalogueSubmittedForApproval.d.ts +15 -0
  34. package/dist/_internal/server/jobs/core/onCatalogueSubmittedForApproval.js +38 -0
  35. package/dist/_internal/server/jobs/core/onJobCreated.d.ts +22 -0
  36. package/dist/_internal/server/jobs/core/onJobCreated.js +59 -0
  37. package/dist/_internal/server/jobs/core/weeklyPayoutEligibility.d.ts +6 -1
  38. package/dist/_internal/server/jobs/core/weeklyPayoutEligibility.js +5 -2
  39. package/dist/_internal/server/jobs/handlers/catalogueImageStalenessReminder.d.ts +2 -0
  40. package/dist/_internal/server/jobs/handlers/catalogueImageStalenessReminder.js +2 -0
  41. package/dist/_internal/server/jobs/handlers/index.d.ts +6 -0
  42. package/dist/_internal/server/jobs/handlers/index.js +8 -0
  43. package/dist/_internal/server/jobs/handlers/onCatalogueSubmittedForApproval.d.ts +12 -0
  44. package/dist/_internal/server/jobs/handlers/onCatalogueSubmittedForApproval.js +20 -0
  45. package/dist/_internal/server/jobs/handlers/onJobCreated.d.ts +3 -0
  46. package/dist/_internal/server/jobs/handlers/onJobCreated.js +9 -0
  47. package/dist/_internal/server/jobs/handlers/onShipmentAllocationSync.d.ts +25 -0
  48. package/dist/_internal/server/jobs/handlers/onShipmentAllocationSync.js +71 -0
  49. package/dist/_internal/server/jobs/handlers/onShipmentDeleted.d.ts +14 -0
  50. package/dist/_internal/server/jobs/handlers/onShipmentDeleted.js +23 -0
  51. package/dist/_internal/server/jobs/handlers/onShipmentItemWrite.d.ts +17 -0
  52. package/dist/_internal/server/jobs/handlers/onShipmentItemWrite.js +26 -0
  53. package/dist/_internal/server/jobs/handlers/weeklyPayoutEligibility.js +3 -1
  54. package/dist/_internal/shared/actions/action-registry.d.ts +1 -1
  55. package/dist/_internal/shared/actions/action-registry.js +136 -0
  56. package/dist/_internal/shared/features/blog/schema.d.ts +8 -8
  57. package/dist/_internal/shared/features/brands/schema.d.ts +4 -4
  58. package/dist/_internal/shared/features/categories/bundle-schemas.d.ts +8 -8
  59. package/dist/_internal/shared/features/events/schema.d.ts +4 -4
  60. package/dist/_internal/shared/features/products/schema.d.ts +8 -8
  61. package/dist/_internal/shared/features/promotions/schema.d.ts +4 -4
  62. package/dist/_internal/shared/features/reviews/schema.d.ts +4 -4
  63. package/dist/client/api/useFeatureFlags.d.ts +22 -0
  64. package/dist/client/api/useFeatureFlags.js +27 -0
  65. package/dist/client/observability/reportClientError.js +3 -2
  66. package/dist/client.d.ts +4 -2
  67. package/dist/client.js +2 -1
  68. package/dist/configs/next.js +1 -0
  69. package/dist/constants/api-endpoints.d.ts +279 -3
  70. package/dist/constants/api-endpoints.js +130 -2
  71. package/dist/core/hooks/useSyncManager.js +5 -4
  72. package/dist/errors/conflict-error.d.ts +4 -0
  73. package/dist/errors/conflict-error.js +6 -0
  74. package/dist/errors/index.d.ts +1 -0
  75. package/dist/errors/index.js +1 -0
  76. package/dist/features/about/components/FeesView.js +2 -2
  77. package/dist/features/about/components/HelpPageView.js +2 -2
  78. package/dist/features/about/components/HowAuctionsWorkView.js +2 -2
  79. package/dist/features/about/components/HowCheckoutWorksView.js +2 -2
  80. package/dist/features/about/components/HowEmiWorksView.js +2 -2
  81. package/dist/features/about/components/HowOffersWorkView.js +3 -3
  82. package/dist/features/about/components/HowOrdersWorkView.js +3 -3
  83. package/dist/features/about/components/HowPayoutsWorkView.js +2 -2
  84. package/dist/features/about/components/HowPreOrdersWorkView.js +2 -2
  85. package/dist/features/about/components/HowReviewsWorkView.js +2 -2
  86. package/dist/features/about/components/PublicProfileView.d.ts +8 -1
  87. package/dist/features/about/components/PublicProfileView.js +11 -9
  88. package/dist/features/about/components/SecurityPrivacyView.js +2 -2
  89. package/dist/features/about/components/UnauthorizedView.js +2 -2
  90. package/dist/features/account/components/AddressBook.js +1 -1
  91. package/dist/features/account/components/AddressesIndexListing.js +1 -1
  92. package/dist/features/account/components/NotificationBell.js +5 -5
  93. package/dist/features/account/components/NotificationPreferencesPanel.js +5 -2
  94. package/dist/features/account/components/UserOffersPanel.js +5 -4
  95. package/dist/features/account/components/UserSidebar.js +2 -2
  96. package/dist/features/account/components/UserSupportView.js +3 -3
  97. package/dist/features/account/schemas/index.d.ts +12 -12
  98. package/dist/features/addresses/schemas/index.d.ts +6 -6
  99. package/dist/features/admin/components/AdminAdEditorView.js +3 -3
  100. package/dist/features/admin/components/AdminAddressEditorView.js +3 -3
  101. package/dist/features/admin/components/AdminAdsView.js +3 -3
  102. package/dist/features/admin/components/AdminBlogEditorView.js +1 -1
  103. package/dist/features/admin/components/AdminBlogView.js +12 -15
  104. package/dist/features/admin/components/AdminBrandEditorView.js +1 -1
  105. package/dist/features/admin/components/AdminBrandsView.js +12 -13
  106. package/dist/features/admin/components/AdminBundleEditorView.js +5 -4
  107. package/dist/features/admin/components/AdminBundlesView.js +32 -23
  108. package/dist/features/admin/components/AdminCarouselEditorView.js +5 -5
  109. package/dist/features/admin/components/AdminCarouselView.js +2 -2
  110. package/dist/features/admin/components/AdminCatalogGuideView.js +1 -1
  111. package/dist/features/admin/components/AdminCategoriesView.js +12 -13
  112. package/dist/features/admin/components/AdminCategoryEditorView.js +2 -2
  113. package/dist/features/admin/components/AdminContactEditorView.js +2 -2
  114. package/dist/features/admin/components/AdminCouponEditorView.d.ts +10 -1
  115. package/dist/features/admin/components/AdminCouponEditorView.js +7 -2
  116. package/dist/features/admin/components/AdminCouponsView.js +32 -27
  117. package/dist/features/admin/components/AdminEmployeeEditorView.js +3 -3
  118. package/dist/features/admin/components/AdminFaqEditorView.js +1 -1
  119. package/dist/features/admin/components/AdminFaqsView.js +20 -20
  120. package/dist/features/admin/components/AdminFeatureEditorView.js +5 -5
  121. package/dist/features/admin/components/AdminFeaturesView.js +9 -10
  122. package/dist/features/admin/components/AdminFilterBar.js +1 -1
  123. package/dist/features/admin/components/AdminFulfillmentView.js +4 -4
  124. package/dist/features/admin/components/AdminGuideHubView.js +2 -2
  125. package/dist/features/admin/components/AdminMediaView.js +3 -2
  126. package/dist/features/admin/components/AdminNavigationView.js +1 -1
  127. package/dist/features/admin/components/AdminOrderEditorView.js +3 -3
  128. package/dist/features/admin/components/AdminOrdersView.js +21 -30
  129. package/dist/features/admin/components/AdminPageHeader.js +3 -3
  130. package/dist/features/admin/components/AdminPayoutsView.js +8 -8
  131. package/dist/features/admin/components/AdminPrizeDrawsView.js +8 -9
  132. package/dist/features/admin/components/AdminProductEditorView.d.ts +9 -1
  133. package/dist/features/admin/components/AdminProductEditorView.js +7 -4
  134. package/dist/features/admin/components/AdminProductsView.js +30 -41
  135. package/dist/features/admin/components/AdminReviewsView.js +14 -17
  136. package/dist/features/admin/components/AdminScammerEditorView.js +5 -5
  137. package/dist/features/admin/components/AdminSectionsView.js +3 -3
  138. package/dist/features/admin/components/AdminSessionsView.js +8 -10
  139. package/dist/features/admin/components/AdminSidebar.js +2 -2
  140. package/dist/features/admin/components/AdminSiteSettingsView.js +10 -3
  141. package/dist/features/admin/components/AdminStoreEditorView.js +4 -5
  142. package/dist/features/admin/components/AdminStoresView.js +18 -13
  143. package/dist/features/admin/components/AdminSupportTicketDetailView.js +7 -7
  144. package/dist/features/admin/components/AdminTeamView.js +9 -5
  145. package/dist/features/admin/components/AdminUsersView.js +19 -15
  146. package/dist/features/admin/components/AdminViewCards.js +5 -5
  147. package/dist/features/admin/components/DashboardStats.js +1 -1
  148. package/dist/features/admin/components/DataListingView.js +2 -2
  149. package/dist/features/admin/components/DataTable.js +2 -2
  150. package/dist/features/admin/components/DrawerFormFooter.js +1 -1
  151. package/dist/features/admin/components/analytics/AdminAnalyticsCharts.js +2 -2
  152. package/dist/features/admin/components/analytics/AdminStatCard.js +1 -1
  153. package/dist/features/admin/hooks/useAdminListing.d.ts +3 -2
  154. package/dist/features/admin/hooks/useAdminListing.js +8 -2
  155. package/dist/features/admin/permission-map.js +2 -0
  156. package/dist/features/admin/schemas/firestore.d.ts +7 -0
  157. package/dist/features/admin/schemas/firestore.js +4 -0
  158. package/dist/features/auctions/components/AuctionBidsTable.js +1 -1
  159. package/dist/features/auctions/components/AuctionDetailPageView.js +7 -7
  160. package/dist/features/auctions/components/MarketplaceAuctionCard.js +3 -3
  161. package/dist/features/auctions/components/MarketplaceAuctionGrid.js +4 -4
  162. package/dist/features/auctions/components/PlaceBidFormClient.js +1 -1
  163. package/dist/features/auctions/schemas/index.d.ts +16 -16
  164. package/dist/features/auth/permissions/constants.d.ts +1 -1
  165. package/dist/features/auth/permissions/constants.js +2 -0
  166. package/dist/features/auth/schemas/index.d.ts +6 -6
  167. package/dist/features/before-after/schemas/index.d.ts +3 -3
  168. package/dist/features/blog/actions/blog-actions.d.ts +32 -32
  169. package/dist/features/blog/components/BlogFeaturedCard.js +2 -2
  170. package/dist/features/blog/components/BlogIndexListing.js +2 -2
  171. package/dist/features/blog/components/BlogListView.js +4 -4
  172. package/dist/features/blog/components/BlogPostView.js +4 -4
  173. package/dist/features/blog/schemas/index.d.ts +77 -77
  174. package/dist/features/cart/components/CartDrawer.js +2 -2
  175. package/dist/features/catalogue/actions/approve-catalogue-listing.d.ts +12 -0
  176. package/dist/features/catalogue/actions/approve-catalogue-listing.js +50 -0
  177. package/dist/features/catalogue/actions/list-from-catalogue.d.ts +17 -0
  178. package/dist/features/catalogue/actions/list-from-catalogue.js +50 -0
  179. package/dist/features/catalogue/actions/submit-for-approval.d.ts +8 -0
  180. package/dist/features/catalogue/actions/submit-for-approval.js +30 -0
  181. package/dist/features/catalogue/components/AdminCatalogueApprovalsView.d.ts +2 -0
  182. package/dist/features/catalogue/components/AdminCatalogueApprovalsView.js +53 -0
  183. package/dist/features/catalogue/components/CatalogueItemEditorView.d.ts +7 -0
  184. package/dist/features/catalogue/components/CatalogueItemEditorView.js +79 -0
  185. package/dist/features/catalogue/components/PublicCatalogueView.d.ts +5 -0
  186. package/dist/features/catalogue/components/PublicCatalogueView.js +22 -0
  187. package/dist/features/catalogue/components/UserCatalogueView.d.ts +12 -0
  188. package/dist/features/catalogue/components/UserCatalogueView.js +51 -0
  189. package/dist/features/catalogue/index.d.ts +12 -0
  190. package/dist/features/catalogue/index.js +9 -0
  191. package/dist/features/catalogue/repository/catalogue.repository.d.ts +39 -0
  192. package/dist/features/catalogue/repository/catalogue.repository.js +68 -0
  193. package/dist/features/catalogue/schemas/firestore.d.ts +47 -0
  194. package/dist/features/catalogue/schemas/firestore.js +22 -0
  195. package/dist/features/catalogue/schemas/index.d.ts +2 -0
  196. package/dist/features/catalogue/schemas/index.js +2 -0
  197. package/dist/features/catalogue/schemas/validation.d.ts +71 -0
  198. package/dist/features/catalogue/schemas/validation.js +25 -0
  199. package/dist/features/catalogue/utils/freshness.d.ts +10 -0
  200. package/dist/features/catalogue/utils/freshness.js +15 -0
  201. package/dist/features/catalogue/utils/product-from-item.d.ts +15 -0
  202. package/dist/features/catalogue/utils/product-from-item.js +34 -0
  203. package/dist/features/categories/components/BrandDetailPageView.js +1 -1
  204. package/dist/features/categories/components/BrandDetailTabs.js +2 -2
  205. package/dist/features/categories/components/BundleCollage.js +2 -2
  206. package/dist/features/categories/components/BundleItemsPicker.js +3 -2
  207. package/dist/features/categories/components/CategoriesIndexListing.js +8 -6
  208. package/dist/features/categories/components/CategoryBundlesListing.js +10 -4
  209. package/dist/features/categories/components/CategoryDetailPageView.js +1 -1
  210. package/dist/features/categories/components/CategoryDetailTabs.js +2 -2
  211. package/dist/features/categories/components/CategoryGrid.js +3 -3
  212. package/dist/features/categories/components/CategoryProductsListing.js +1 -1
  213. package/dist/features/categories/components/CategorySortSelect.js +1 -1
  214. package/dist/features/categories/components/CategoryStoresListing.js +1 -1
  215. package/dist/features/categories/components/CategoryTableColumns.js +1 -1
  216. package/dist/features/categories/components/CategoryTree.js +2 -2
  217. package/dist/features/categories/components/ConcernCard.js +1 -1
  218. package/dist/features/categories/hooks/useCategories.js +1 -1
  219. package/dist/features/categories/schemas/index.d.ts +32 -32
  220. package/dist/features/classified/components/ClassifiedFilters.js +2 -2
  221. package/dist/features/classified/components/ClassifiedIndexListing.js +9 -3
  222. package/dist/features/collections/schemas/index.d.ts +2 -2
  223. package/dist/features/consultation/components/ConsultationForm.js +1 -1
  224. package/dist/features/consultation/schemas/index.d.ts +10 -10
  225. package/dist/features/contact/components/ContactForm.js +4 -4
  226. package/dist/features/contact/components/ContactInfoSidebar.js +1 -1
  227. package/dist/features/contact/components/ContactPageView.js +2 -1
  228. package/dist/features/copilot/components/AdminCopilotView.js +5 -4
  229. package/dist/features/corporate/schemas/index.d.ts +2 -2
  230. package/dist/features/digital-codes/components/DigitalCodesIndexListing.js +3 -3
  231. package/dist/features/events/components/AdminEventEditorView.js +4 -4
  232. package/dist/features/events/components/AdminEventEntriesView.js +2 -2
  233. package/dist/features/events/components/AdminEventsView.js +8 -8
  234. package/dist/features/events/components/EventBanner.js +1 -1
  235. package/dist/features/events/components/EventCard.js +3 -3
  236. package/dist/features/events/components/EventLeaderboard.js +1 -1
  237. package/dist/features/events/components/EventOfferCard.js +1 -1
  238. package/dist/features/events/components/EventPollWidget.js +6 -5
  239. package/dist/features/events/components/EventRaffleEntryForm.js +1 -1
  240. package/dist/features/events/components/EventRaffleWinnerView.js +5 -5
  241. package/dist/features/events/components/EventRafflesSection.js +1 -1
  242. package/dist/features/events/components/EventSaleBanner.js +1 -1
  243. package/dist/features/events/components/EventsIndexListing.js +4 -2
  244. package/dist/features/events/components/EventsListView.js +2 -2
  245. package/dist/features/events/components/SpinWheelView.js +11 -5
  246. package/dist/features/events/schemas/index.d.ts +100 -100
  247. package/dist/features/faq/actions/faq-actions.d.ts +6 -6
  248. package/dist/features/faq/components/ContactCTA.js +3 -3
  249. package/dist/features/faq/components/FAQCategorySidebar.js +2 -2
  250. package/dist/features/faq/components/FAQHelpfulButtons.js +3 -3
  251. package/dist/features/faq/schemas/index.d.ts +12 -12
  252. package/dist/features/filters/AsyncFacetSection.js +4 -4
  253. package/dist/features/filters/FilterFacetSection.js +8 -8
  254. package/dist/features/filters/RangeFilter.js +2 -2
  255. package/dist/features/filters/SwitchFilter.js +1 -1
  256. package/dist/features/forms/Checkbox.js +2 -8
  257. package/dist/features/forms/Input.js +2 -1
  258. package/dist/features/forms/Radio.js +3 -3
  259. package/dist/features/forms/Select.d.ts +1 -1
  260. package/dist/features/forms/Select.js +3 -2
  261. package/dist/features/forms/Slider.js +5 -11
  262. package/dist/features/forms/Textarea.js +2 -1
  263. package/dist/features/grouped/schemas/index.d.ts +6 -6
  264. package/dist/features/homepage/actions/homepage-section-actions.d.ts +4 -4
  265. package/dist/features/homepage/components/AdvertisementBanner.js +4 -4
  266. package/dist/features/homepage/components/AnnouncementBar.js +3 -3
  267. package/dist/features/homepage/components/BeforeAfterCard.js +1 -1
  268. package/dist/features/homepage/components/BrandsSection.js +9 -9
  269. package/dist/features/homepage/components/CTABannerSection.js +1 -1
  270. package/dist/features/homepage/components/CharacterHotspot.js +4 -4
  271. package/dist/features/homepage/components/CharacterHotspotForm.js +15 -13
  272. package/dist/features/homepage/components/CollectionCardsSection.js +1 -1
  273. package/dist/features/homepage/components/CustomCardsSection.js +6 -6
  274. package/dist/features/homepage/components/CustomerReviewsSection.js +2 -2
  275. package/dist/features/homepage/components/FAQSection.js +2 -2
  276. package/dist/features/homepage/components/FeaturedBundlesSection.js +3 -3
  277. package/dist/features/homepage/components/FeaturedResultsSection.js +2 -2
  278. package/dist/features/homepage/components/GoogleReviewsSection.js +6 -6
  279. package/dist/features/homepage/components/HeroBanner.js +1 -1
  280. package/dist/features/homepage/components/HeroCarousel.js +5 -4
  281. package/dist/features/homepage/components/HeroSection.js +1 -7
  282. package/dist/features/homepage/components/HomepageSkeleton.js +1 -1
  283. package/dist/features/homepage/components/HowItWorksInfoView.js +1 -1
  284. package/dist/features/homepage/components/HowItWorksSection.js +2 -2
  285. package/dist/features/homepage/components/NewsletterBanner.js +2 -2
  286. package/dist/features/homepage/components/NewsletterSection.js +1 -1
  287. package/dist/features/homepage/components/PromoGrid.js +1 -1
  288. package/dist/features/homepage/components/SectionCarousel.js +6 -6
  289. package/dist/features/homepage/components/SecurityHighlightsSection.js +2 -2
  290. package/dist/features/homepage/components/ShopByCategorySection.js +10 -10
  291. package/dist/features/homepage/components/SiteFeaturesSection.js +2 -2
  292. package/dist/features/homepage/components/SocialFeedSection.js +5 -5
  293. package/dist/features/homepage/components/SocialPostCard.js +1 -1
  294. package/dist/features/homepage/components/StatsCounterSection.js +1 -1
  295. package/dist/features/homepage/components/TestimonialsCarousel.js +1 -1
  296. package/dist/features/homepage/components/TrustBadges.js +1 -1
  297. package/dist/features/homepage/components/TrustFeaturesSection.js +2 -2
  298. package/dist/features/homepage/components/TrustIndicatorsSection.js +2 -2
  299. package/dist/features/homepage/components/WelcomeSection.js +2 -2
  300. package/dist/features/homepage/components/WhatsAppCommunitySection.js +1 -1
  301. package/dist/features/homepage/hooks/useActiveAd.js +2 -1
  302. package/dist/features/homepage/schemas/firestore.d.ts +10 -0
  303. package/dist/features/homepage/schemas/index.d.ts +116 -116
  304. package/dist/features/jobs/actions/enqueue-job.d.ts +24 -0
  305. package/dist/features/jobs/actions/enqueue-job.js +44 -0
  306. package/dist/features/jobs/repository/jobs.repository.d.ts +21 -0
  307. package/dist/features/jobs/repository/jobs.repository.js +48 -0
  308. package/dist/features/jobs/schemas/firestore.d.ts +54 -0
  309. package/dist/features/jobs/schemas/firestore.js +24 -0
  310. package/dist/features/layout/AppLayoutShell.js +17 -11
  311. package/dist/features/layout/AutoBreadcrumbs.js +1 -1
  312. package/dist/features/layout/BackToTop.js +2 -2
  313. package/dist/features/layout/BottomActions.js +7 -7
  314. package/dist/features/layout/BottomNavItem.js +2 -2
  315. package/dist/features/layout/BottomNavLayout.js +13 -4
  316. package/dist/features/layout/BottomNavbar.d.ts +9 -1
  317. package/dist/features/layout/BottomNavbar.js +12 -5
  318. package/dist/features/layout/BottomSheet.js +1 -1
  319. package/dist/features/layout/Breadcrumbs.js +1 -1
  320. package/dist/features/layout/FooterLayout.js +2 -2
  321. package/dist/features/layout/NavItem.js +3 -3
  322. package/dist/features/layout/NavbarLayout.js +6 -6
  323. package/dist/features/layout/SidebarLayout.d.ts +3 -0
  324. package/dist/features/layout/SidebarLayout.js +3 -3
  325. package/dist/features/layout/TitleBarLayout.js +4 -4
  326. package/dist/features/live/components/LiveItemFilters.js +2 -2
  327. package/dist/features/live/components/LiveItemsIndexListing.js +3 -3
  328. package/dist/features/lottery/types/index.d.ts +3 -1
  329. package/dist/features/lottery/types/index.js +16 -3
  330. package/dist/features/loyalty/components/CoinsDisplay.js +2 -2
  331. package/dist/features/media/MediaImage.d.ts +6 -1
  332. package/dist/features/media/MediaImage.js +10 -4
  333. package/dist/features/media/MediaLightbox.js +1 -1
  334. package/dist/features/media/MediaPickerModal.js +4 -3
  335. package/dist/features/media/MediaVideo.js +1 -1
  336. package/dist/features/media/modals/ImageCropModal.js +1 -1
  337. package/dist/features/media/modals/ImageEditor.js +1 -1
  338. package/dist/features/media/repository/media-assets.repository.d.ts +9 -0
  339. package/dist/features/media/types/index.d.ts +4 -4
  340. package/dist/features/media/upload/MediaUploadField.js +3 -3
  341. package/dist/features/media/upload/MediaUploadList.js +1 -1
  342. package/dist/features/messages/hooks/useConversation.js +4 -3
  343. package/dist/features/messages/hooks/useConversations.js +2 -1
  344. package/dist/features/messages/schemas/index.d.ts +6 -6
  345. package/dist/features/orders/components/MarketplaceOrderCard.js +1 -1
  346. package/dist/features/orders/components/OrderPaymentSummary.d.ts +16 -0
  347. package/dist/features/orders/components/OrderPaymentSummary.js +32 -0
  348. package/dist/features/orders/components/OrderSiblingPayments.js +1 -1
  349. package/dist/features/orders/components/OrdersList.d.ts +7 -2
  350. package/dist/features/orders/components/OrdersList.js +5 -5
  351. package/dist/features/orders/components/RefundHistoryTable.js +1 -1
  352. package/dist/features/orders/components/RefundRequestView.js +1 -1
  353. package/dist/features/orders/components/index.d.ts +2 -0
  354. package/dist/features/orders/components/index.js +1 -0
  355. package/dist/features/orders/repository/orders.repository.d.ts +8 -0
  356. package/dist/features/orders/repository/orders.repository.js +24 -0
  357. package/dist/features/orders/schemas/firestore.d.ts +59 -0
  358. package/dist/features/orders/schemas/firestore.js +5 -0
  359. package/dist/features/orders/schemas/index.d.ts +91 -40
  360. package/dist/features/orders/schemas/index.js +10 -0
  361. package/dist/features/orders/types/index.d.ts +15 -0
  362. package/dist/features/payments/schemas/index.d.ts +12 -12
  363. package/dist/features/pre-orders/components/MarketplacePreorderCard.js +5 -5
  364. package/dist/features/pre-orders/components/PreOrderActionsClient.js +1 -1
  365. package/dist/features/pre-orders/components/PreOrderBadge.js +1 -1
  366. package/dist/features/pre-orders/components/PreOrderDetailPageView.js +7 -7
  367. package/dist/features/pre-orders/components/PreOrdersIndexListing.js +3 -3
  368. package/dist/features/pre-orders/schemas/index.d.ts +12 -12
  369. package/dist/features/products/columns/productTableColumns.js +2 -2
  370. package/dist/features/products/components/AuctionsIndexListing.js +3 -3
  371. package/dist/features/products/components/CompareOverlay.js +15 -10
  372. package/dist/features/products/components/CustomFieldsEditor.js +2 -2
  373. package/dist/features/products/components/CustomSectionsEditor.js +3 -3
  374. package/dist/features/products/components/FeatureBadge.js +2 -2
  375. package/dist/features/products/components/GroupSettingsPanel.js +5 -4
  376. package/dist/features/products/components/MakeOfferButton.js +4 -4
  377. package/dist/features/products/components/MarketplaceBundleCard.js +3 -2
  378. package/dist/features/products/components/MarketplacePrizeDrawCard.js +1 -1
  379. package/dist/features/products/components/PrizeDrawCollage.js +6 -6
  380. package/dist/features/products/components/PrizeDrawDetailPageView.js +5 -5
  381. package/dist/features/products/components/PrizeDrawEntryActions.js +1 -1
  382. package/dist/features/products/components/PrizeDrawItemsEditor.js +4 -4
  383. package/dist/features/products/components/PrizeDrawsIndexListing.js +11 -4
  384. package/dist/features/products/components/PrizeDrawsSection.js +1 -1
  385. package/dist/features/products/components/PrizeRevealModal.js +9 -4
  386. package/dist/features/products/components/ProductDetailActions.js +2 -1
  387. package/dist/features/products/components/ProductDetailPageView.js +16 -16
  388. package/dist/features/products/components/ProductFeaturesSelector.js +5 -5
  389. package/dist/features/products/components/ProductForm.js +1 -1
  390. package/dist/features/products/components/ProductGalleryClient.js +5 -3
  391. package/dist/features/products/components/ProductGrid.js +11 -11
  392. package/dist/features/products/components/ProductTabs.js +2 -2
  393. package/dist/features/products/components/ProductTabsShell.js +2 -1
  394. package/dist/features/products/components/ProductsIndexListing.js +6 -1
  395. package/dist/features/products/components/ShareButton.js +2 -1
  396. package/dist/features/products/components/ShowGroupSection.js +9 -5
  397. package/dist/features/products/components/SublistingCarouselSection.js +8 -4
  398. package/dist/features/products/constants/action-defs.d.ts +10 -2
  399. package/dist/features/products/constants/action-defs.js +20 -2
  400. package/dist/features/products/schemas/firestore.d.ts +5 -0
  401. package/dist/features/products/schemas/index.d.ts +40 -40
  402. package/dist/features/products/schemas/product-features.validators.d.ts +14 -14
  403. package/dist/features/promotions/components/CouponCard.js +13 -7
  404. package/dist/features/promotions/components/CouponsIndexListing.js +4 -6
  405. package/dist/features/promotions/components/PromotionsView.js +2 -2
  406. package/dist/features/promotions/schemas/index.d.ts +26 -26
  407. package/dist/features/reviews/components/ReviewDetailPageView.js +1 -1
  408. package/dist/features/reviews/components/ReviewDetailShell.js +11 -11
  409. package/dist/features/reviews/components/ReviewModal.js +1 -1
  410. package/dist/features/reviews/components/ReviewsIndexListing.js +2 -2
  411. package/dist/features/reviews/components/ReviewsList.js +2 -2
  412. package/dist/features/reviews/schemas/index.d.ts +22 -22
  413. package/dist/features/scams/components/ScamAwarenessModal.js +2 -2
  414. package/dist/features/scams/components/ScamProfileView.js +3 -3
  415. package/dist/features/scams/components/ScamRegistryView.js +2 -2
  416. package/dist/features/scams/schemas/index.d.ts +20 -20
  417. package/dist/features/search/components/Search.js +9 -9
  418. package/dist/features/search/components/SearchFiltersRow.js +1 -1
  419. package/dist/features/search/components/SearchResultsSection.js +3 -3
  420. package/dist/features/search/components/SearchView.js +1 -1
  421. package/dist/features/search/hooks/useNavSuggestions.js +2 -1
  422. package/dist/features/search/hooks/useSearch.js +2 -2
  423. package/dist/features/search/schemas/index.d.ts +3 -3
  424. package/dist/features/seller/components/BrandInlineSelect.js +2 -2
  425. package/dist/features/seller/components/CategoryInlineSelect.js +2 -2
  426. package/dist/features/seller/components/QuickProductForm.js +1 -1
  427. package/dist/features/seller/components/SellerAddressesView.js +4 -4
  428. package/dist/features/seller/components/SellerAnalyticsAlertsView.js +3 -3
  429. package/dist/features/seller/components/SellerAnalyticsView.js +2 -2
  430. package/dist/features/seller/components/SellerArtView.js +11 -11
  431. package/dist/features/seller/components/SellerAuctionsView.js +11 -11
  432. package/dist/features/seller/components/SellerBidsView.js +3 -3
  433. package/dist/features/seller/components/SellerBundlesView.js +12 -12
  434. package/dist/features/seller/components/SellerClassifiedView.js +11 -11
  435. package/dist/features/seller/components/SellerCouponEditorView.js +2 -2
  436. package/dist/features/seller/components/SellerDigitalCodesView.js +11 -11
  437. package/dist/features/seller/components/SellerFeaturesView.js +4 -4
  438. package/dist/features/seller/components/SellerLiveView.js +11 -11
  439. package/dist/features/seller/components/SellerOffersPanel.js +3 -2
  440. package/dist/features/seller/components/SellerOrdersView.js +2 -2
  441. package/dist/features/seller/components/SellerPayoutMethodsView.js +1 -1
  442. package/dist/features/seller/components/SellerPayoutRequestView.js +6 -5
  443. package/dist/features/seller/components/SellerPayoutSettingsView.js +5 -4
  444. package/dist/features/seller/components/SellerPreOrdersView.js +1 -1
  445. package/dist/features/seller/components/SellerPrizeDrawsView.js +1 -1
  446. package/dist/features/seller/components/SellerProductShell.js +20 -6
  447. package/dist/features/seller/components/SellerProductsCards.js +3 -3
  448. package/dist/features/seller/components/SellerProductsView.js +4 -4
  449. package/dist/features/seller/components/SellerReviewsView.js +7 -6
  450. package/dist/features/seller/components/SellerShippingView.js +2 -1
  451. package/dist/features/seller/components/SellerSidebar.js +5 -5
  452. package/dist/features/seller/components/SellerStickersView.js +11 -11
  453. package/dist/features/seller/components/SellerTemplatesView.js +1 -1
  454. package/dist/features/seller/schemas/index.d.ts +20 -20
  455. package/dist/features/server-errors/schemas/index.d.ts +6 -6
  456. package/dist/features/shell/CommandPalette.d.ts +27 -0
  457. package/dist/features/shell/CommandPalette.js +92 -0
  458. package/dist/features/shell/FormShell.js +4 -3
  459. package/dist/features/shell/QuickFormDrawer.js +3 -2
  460. package/dist/features/shell/StepForm.js +2 -2
  461. package/dist/features/shell/index.d.ts +2 -0
  462. package/dist/features/shell/index.js +1 -0
  463. package/dist/features/shipments/components/AdminShipmentEditorView.d.ts +7 -0
  464. package/dist/features/shipments/components/AdminShipmentEditorView.js +123 -0
  465. package/dist/features/shipments/components/AdminShipmentLotItemsView.d.ts +6 -0
  466. package/dist/features/shipments/components/AdminShipmentLotItemsView.js +96 -0
  467. package/dist/features/shipments/components/AdminShipmentProjectionsView.d.ts +9 -0
  468. package/dist/features/shipments/components/AdminShipmentProjectionsView.js +44 -0
  469. package/dist/features/shipments/components/AdminShipmentsView.d.ts +8 -0
  470. package/dist/features/shipments/components/AdminShipmentsView.js +82 -0
  471. package/dist/features/shipments/components/ShipmentItemLinkModal.d.ts +15 -0
  472. package/dist/features/shipments/components/ShipmentItemLinkModal.js +37 -0
  473. package/dist/features/shipments/hooks/useShipments.d.ts +69 -0
  474. package/dist/features/shipments/hooks/useShipments.js +96 -0
  475. package/dist/features/shipments/index.d.ts +10 -0
  476. package/dist/features/shipments/index.js +7 -0
  477. package/dist/features/shipments/manifest.d.ts +2 -0
  478. package/dist/features/shipments/manifest.js +26 -0
  479. package/dist/features/shipments/repository/shipment-items.repository.d.ts +56 -0
  480. package/dist/features/shipments/repository/shipment-items.repository.js +78 -0
  481. package/dist/features/shipments/repository/shipment-lots.repository.d.ts +48 -0
  482. package/dist/features/shipments/repository/shipment-lots.repository.js +55 -0
  483. package/dist/features/shipments/repository/shipments.repository.d.ts +50 -0
  484. package/dist/features/shipments/repository/shipments.repository.js +77 -0
  485. package/dist/features/shipments/schemas/firestore.d.ts +150 -0
  486. package/dist/features/shipments/schemas/firestore.js +76 -0
  487. package/dist/features/shipments/schemas/index.d.ts +2 -0
  488. package/dist/features/shipments/schemas/index.js +2 -0
  489. package/dist/features/shipments/schemas/validation.d.ts +350 -0
  490. package/dist/features/shipments/schemas/validation.js +96 -0
  491. package/dist/features/shipments/utils/cost-allocation.d.ts +25 -0
  492. package/dist/features/shipments/utils/cost-allocation.js +83 -0
  493. package/dist/features/site-settings/components/ActionPermissionsManager.js +2 -2
  494. package/dist/features/stores/components/InteractiveStoreCard.js +2 -2
  495. package/dist/features/stores/components/StoreAboutView.js +1 -1
  496. package/dist/features/stores/components/StoreAuctionsListing.js +3 -3
  497. package/dist/features/stores/components/StoreAuctionsView.js +1 -1
  498. package/dist/features/stores/components/StoreCapabilitiesGuideView.js +1 -1
  499. package/dist/features/stores/components/StoreClassifiedsListing.js +2 -2
  500. package/dist/features/stores/components/StoreDetailLayoutView.js +1 -1
  501. package/dist/features/stores/components/StoreDigitalCodesListing.js +2 -2
  502. package/dist/features/stores/components/StoreFinanceGuideView.js +2 -2
  503. package/dist/features/stores/components/StoreGuideHubView.js +2 -2
  504. package/dist/features/stores/components/StoreHeader.js +4 -4
  505. package/dist/features/stores/components/StoreLiveItemsListing.js +2 -2
  506. package/dist/features/stores/components/StoreNavTabs.js +2 -2
  507. package/dist/features/stores/components/StoreOrdersGuideView.js +1 -1
  508. package/dist/features/stores/components/StorePreOrdersListing.js +3 -3
  509. package/dist/features/stores/components/StoreProductsListing.js +1 -1
  510. package/dist/features/stores/components/StoreReviewsListing.js +2 -2
  511. package/dist/features/stores/components/StoreReviewsView.js +1 -1
  512. package/dist/features/stores/components/StoreSettingsGuideView.js +1 -1
  513. package/dist/features/stores/components/StoresIndexListing.js +9 -3
  514. package/dist/features/stores/schemas/index.d.ts +10 -10
  515. package/dist/features/support/schemas/index.d.ts +22 -22
  516. package/dist/features/whatsapp-bot/components/SellerWhatsAppSettingsView.js +3 -3
  517. package/dist/features/whatsapp-bot/components/WhatsAppChatButton.js +1 -1
  518. package/dist/features/wishlist/hooks/useWishlistCount.js +1 -2
  519. package/dist/index.d.ts +44 -1
  520. package/dist/index.js +37 -1
  521. package/dist/next/routing/route-map.d.ts +18 -0
  522. package/dist/next/routing/route-map.js +9 -0
  523. package/dist/react/hooks/useVisualViewportInset.d.ts +1 -0
  524. package/dist/react/hooks/useVisualViewportInset.js +59 -0
  525. package/dist/react/index.d.ts +1 -0
  526. package/dist/react/index.js +1 -0
  527. package/dist/repositories/index.d.ts +5 -0
  528. package/dist/repositories/index.js +5 -0
  529. package/dist/schemas/registry.d.ts +398 -364
  530. package/dist/schemas/sieve.d.ts +2 -2
  531. package/dist/schemas/webhooks/google-oauth.d.ts +2 -2
  532. package/dist/schemas/webhooks/razorpay.d.ts +100 -100
  533. package/dist/seed/_helpers/media.js +1 -0
  534. package/dist/seed/actions/demo-seed-actions.d.ts +1 -1
  535. package/dist/seed/catalogue-seed-data.d.ts +2 -0
  536. package/dist/seed/catalogue-seed-data.js +112 -0
  537. package/dist/seed/grouped-listings-seed-data.d.ts +5 -0
  538. package/dist/seed/homepage-sections-seed-data.js +0 -1
  539. package/dist/seed/index.d.ts +2 -0
  540. package/dist/seed/index.js +2 -0
  541. package/dist/seed/manifest.js +6 -0
  542. package/dist/seed/products-preorders-seed-data.d.ts +5 -0
  543. package/dist/seed/shipments-seed-data.d.ts +5 -0
  544. package/dist/seed/shipments-seed-data.js +185 -0
  545. package/dist/server.d.ts +4 -0
  546. package/dist/server.js +5 -0
  547. package/dist/styles.css +75 -19
  548. package/dist/tailwind-utilities.css +1 -1
  549. package/dist/tokens/index.d.ts +0 -2
  550. package/dist/tokens/index.js +0 -2
  551. package/dist/tokens/tokens.css +12 -2
  552. package/dist/ui/DataTable.js +4 -3
  553. package/dist/ui/components/Button.d.ts +4 -1
  554. package/dist/ui/components/Button.js +11 -5
  555. package/dist/ui/components/Checkbox.d.ts +9 -1
  556. package/dist/ui/components/Checkbox.js +5 -2
  557. package/dist/ui/components/ClaimCouponButton.js +2 -1
  558. package/dist/ui/components/ConfirmDeleteModal.style.css +1 -1
  559. package/dist/ui/components/Drawer.style.css +13 -1
  560. package/dist/ui/components/Dropdown.style.css +2 -2
  561. package/dist/ui/components/FilterDrawer.d.ts +4 -1
  562. package/dist/ui/components/FilterDrawer.js +8 -2
  563. package/dist/ui/components/Form.d.ts +1 -1
  564. package/dist/ui/components/Form.js +2 -2
  565. package/dist/ui/components/FormActionBar.style.css +6 -1
  566. package/dist/ui/components/IconButton.d.ts +6 -1
  567. package/dist/ui/components/IconButton.js +5 -2
  568. package/dist/ui/components/IconButton.style.css +11 -0
  569. package/dist/ui/components/ImageGallery.style.css +2 -0
  570. package/dist/ui/components/ImageLightbox.style.css +1 -0
  571. package/dist/ui/components/ListingFilterDrawer.d.ts +4 -1
  572. package/dist/ui/components/ListingFilterDrawer.js +4 -3
  573. package/dist/ui/components/ListingLayout.style.css +2 -2
  574. package/dist/ui/components/Modal.style.css +1 -1
  575. package/dist/ui/components/Pagination.d.ts +5 -1
  576. package/dist/ui/components/Pagination.js +4 -2
  577. package/dist/ui/components/RowActionMenu.js +1 -1
  578. package/dist/ui/components/RowActionMenu.style.css +1 -1
  579. package/dist/ui/components/Select.d.ts +6 -1
  580. package/dist/ui/components/Select.js +18 -13
  581. package/dist/ui/components/Select.style.css +1 -1
  582. package/dist/ui/components/Semantic.d.ts +13 -0
  583. package/dist/ui/components/Semantic.js +16 -3
  584. package/dist/ui/components/SideDrawer.style.css +16 -4
  585. package/dist/ui/components/SideModal.style.css +1 -1
  586. package/dist/ui/components/StickyToolbar.d.ts +3 -2
  587. package/dist/ui/components/StickyToolbar.js +1 -1
  588. package/dist/ui/components/Textarea.d.ts +5 -0
  589. package/dist/ui/components/Textarea.js +8 -4
  590. package/dist/ui/components/Toast.style.css +3 -0
  591. package/dist/ui/components/UnsavedChangesModal.style.css +1 -1
  592. package/dist/ui/components/surface-tokens.d.ts +121 -113
  593. package/dist/ui/components/surface-tokens.js +110 -104
  594. package/dist/ui/forms/FormShell.d.ts +8 -27
  595. package/dist/ui/forms/FormShell.js +1 -194
  596. package/dist/ui/forms/index.d.ts +2 -2
  597. package/dist/ui/forms/index.js +1 -1
  598. package/dist/ui/index.d.ts +8 -4
  599. package/dist/ui/index.js +4 -2
  600. package/dist/utils/id-generators.d.ts +27 -0
  601. package/dist/utils/id-generators.js +45 -0
  602. package/dist/utils/number.formatter.d.ts +7 -0
  603. package/dist/utils/number.formatter.js +9 -0
  604. package/dist/validation/schemas.d.ts +5 -5
  605. package/package.json +1 -1
@@ -0,0 +1,71 @@
1
+ import { allocateShipmentCosts } from "../../../../features/shipments/utils/cost-allocation";
2
+ const DEFAULT_MAX_HOURS_PER_DAY = 4;
3
+ async function recomputeShipmentAllocation(shipmentId, ctx) {
4
+ const shipmentRef = ctx.db.collection("procurementShipments").doc(shipmentId);
5
+ const shipmentSnap = await shipmentRef.get();
6
+ if (!shipmentSnap.exists)
7
+ return;
8
+ const shipment = shipmentSnap.data() ?? {};
9
+ const lotsSnap = await ctx.db.collection("shipmentLots").where("shipmentId", "==", shipmentId).get();
10
+ const lots = lotsSnap.docs.map((doc) => ({ id: doc.id, ...doc.data() }));
11
+ const allocationInputs = lots.map((lot) => ({
12
+ id: lot.id,
13
+ purchaseCostPaise: lot.purchaseCostPaise ?? 0,
14
+ weightGrams: lot.weightGrams ?? 0,
15
+ mainItemsProjectedRevenuePaise: lot.mainItemsProjectedRevenuePaise ?? 0,
16
+ remainderEstimatedValuePaise: lot.remainderEstimatedValuePaise,
17
+ itemCount: lot.itemCount ?? 0,
18
+ }));
19
+ // Site-settings labor rate could be read here; falls back to the
20
+ // shipment's own snapshot rate + a fixed max-hours-per-day default,
21
+ // matching what the admin editor's preview also uses.
22
+ const laborRatePaisePerHour = shipment.laborRatePaisePerHour ?? 0;
23
+ const laborHoursSpent = shipment.laborHoursSpent ?? 0;
24
+ const { perLot, totals } = allocateShipmentCosts({
25
+ lots: allocationInputs,
26
+ customsTotalPaise: shipment.customsTotalPaise ?? 0,
27
+ shippingTotalPaise: shipment.shippingTotalPaise ?? 0,
28
+ laborHoursSpent,
29
+ laborRatePaisePerHour,
30
+ maxHoursPerDay: DEFAULT_MAX_HOURS_PER_DAY,
31
+ });
32
+ const batch = ctx.db.batch();
33
+ let anyLotChanged = false;
34
+ for (const lot of lots) {
35
+ const computed = perLot[lot.id];
36
+ const statusChanged = lot.shipmentStatus !== shipment.status;
37
+ const valuesChanged = lot.customsAllocatedPaise !== computed.customsAllocatedPaise ||
38
+ lot.shippingAllocatedPaise !== computed.shippingAllocatedPaise ||
39
+ lot.totalLandedCostPaise !== computed.totalLandedCostPaise ||
40
+ lot.projectedRevenuePaise !== computed.projectedRevenuePaise ||
41
+ lot.projectedProfitPaise !== computed.projectedProfitPaise;
42
+ if (statusChanged || valuesChanged) {
43
+ anyLotChanged = true;
44
+ batch.update(ctx.db.collection("shipmentLots").doc(lot.id), {
45
+ ...computed,
46
+ shipmentStatus: shipment.status,
47
+ updatedAt: ctx.now,
48
+ });
49
+ }
50
+ }
51
+ const totalsUnchanged = JSON.stringify(shipment.totals ?? {}) === JSON.stringify(totals);
52
+ if (!totalsUnchanged) {
53
+ batch.update(shipmentRef, { totals, totalsComputedAt: ctx.now, updatedAt: ctx.now });
54
+ }
55
+ if (anyLotChanged || !totalsUnchanged) {
56
+ await batch.commit();
57
+ ctx.logger.info("Recomputed shipment allocation", { shipmentId, lotCount: lots.length });
58
+ }
59
+ }
60
+ export const onShipmentLotWriteHandler = async (event, ctx) => {
61
+ const shipmentId = (event.after?.shipmentId ?? event.before?.shipmentId);
62
+ if (!shipmentId)
63
+ return;
64
+ await recomputeShipmentAllocation(shipmentId, ctx);
65
+ };
66
+ export const onShipmentHeaderWriteHandler = async (event, ctx) => {
67
+ const shipmentId = event.params.shipmentId;
68
+ if (!shipmentId)
69
+ return;
70
+ await recomputeShipmentAllocation(shipmentId, ctx);
71
+ };
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Function #3 of the procurement-shipments cascade.
3
+ *
4
+ * Fires when a procurementShipments/{shipmentId} doc is deleted. Cascades
5
+ * the batch-delete of that shipment's lots + items (looping in batches of
6
+ * 500) so the Vercel DELETE route itself never has to touch more than the
7
+ * shipment header doc — it stays fast regardless of how many thousands of
8
+ * items the shipment had.
9
+ */
10
+ import type { FirestoreTriggerHandler } from "../runtime/types";
11
+ import type { JsonValue } from "@mohasinac/appkit";
12
+ type Doc = Record<string, JsonValue>;
13
+ export declare const onShipmentDeletedHandler: FirestoreTriggerHandler<Doc, Doc>;
14
+ export {};
@@ -0,0 +1,23 @@
1
+ const BATCH_LIMIT = 500;
2
+ async function purgeWhere(db, collection, field, value) {
3
+ for (;;) {
4
+ const snap = await db.collection(collection).where(field, "==", value).limit(BATCH_LIMIT).get();
5
+ if (snap.empty)
6
+ return;
7
+ const batch = db.batch();
8
+ snap.docs.forEach((doc) => batch.delete(doc.ref));
9
+ await batch.commit();
10
+ if (snap.size < BATCH_LIMIT)
11
+ return;
12
+ }
13
+ }
14
+ export const onShipmentDeletedHandler = async (event, ctx) => {
15
+ if (event.after)
16
+ return; // only act on deletion — this is bound as documentWritten (no documentDeleted trigger kind exists)
17
+ const shipmentId = event.params.shipmentId;
18
+ if (!shipmentId)
19
+ return;
20
+ await purgeWhere(ctx.db, "shipmentItems", "shipmentId", shipmentId);
21
+ await purgeWhere(ctx.db, "shipmentLots", "shipmentId", shipmentId);
22
+ ctx.logger.info("Cascade-deleted shipment lots + items", { shipmentId });
23
+ };
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Function #1 of the procurement-shipments cascade.
3
+ *
4
+ * Fires on any write to shipmentItems/{itemId}. Recomputes the owning lot's
5
+ * item-derived aggregates (itemCount, mainItemsProjectedRevenuePaise) by
6
+ * summing all of that lot's items (bounded ≤500 — Firestore's own batch cap).
7
+ * Writing those aggregates onto shipmentLots/{lotId} is what triggers
8
+ * Function #2 (onShipmentLotWrite) to redo the cross-lot cost allocation.
9
+ *
10
+ * Skips the Firestore write entirely when nothing actually changed, so a
11
+ * settled cascade doesn't loop forever re-triggering itself.
12
+ */
13
+ import type { FirestoreTriggerHandler } from "../runtime/types";
14
+ import type { JsonValue } from "@mohasinac/appkit";
15
+ type ItemDoc = Record<string, JsonValue>;
16
+ export declare const onShipmentItemWriteHandler: FirestoreTriggerHandler<ItemDoc, ItemDoc>;
17
+ export {};
@@ -0,0 +1,26 @@
1
+ export const onShipmentItemWriteHandler = async (event, ctx) => {
2
+ const lotId = (event.after?.lotId ?? event.before?.lotId);
3
+ if (!lotId)
4
+ return;
5
+ const itemsSnap = await ctx.db.collection("shipmentItems").where("lotId", "==", lotId).get();
6
+ let mainItemsProjectedRevenuePaise = 0;
7
+ itemsSnap.docs.forEach((doc) => {
8
+ const item = doc.data();
9
+ if (item.isForSelfUse)
10
+ return;
11
+ const price = item.price ?? 0;
12
+ const quantity = item.quantity ?? 0;
13
+ mainItemsProjectedRevenuePaise += price * quantity;
14
+ });
15
+ const itemCount = itemsSnap.size;
16
+ const lotRef = ctx.db.collection("shipmentLots").doc(lotId);
17
+ const lotSnap = await lotRef.get();
18
+ if (!lotSnap.exists)
19
+ return;
20
+ const lot = lotSnap.data() ?? {};
21
+ if (lot.itemCount === itemCount && lot.mainItemsProjectedRevenuePaise === mainItemsProjectedRevenuePaise) {
22
+ return; // no-op — breaks the write→trigger→write cycle once settled
23
+ }
24
+ await lotRef.update({ itemCount, mainItemsProjectedRevenuePaise, updatedAt: ctx.now });
25
+ ctx.logger.info("Recomputed lot item aggregates", { lotId, itemCount, mainItemsProjectedRevenuePaise });
26
+ };
@@ -1,2 +1,4 @@
1
1
  import { runWeeklyPayoutEligibility } from "../core/weeklyPayoutEligibility";
2
- export const weeklyPayoutEligibilityHandler = runWeeklyPayoutEligibility;
2
+ export const weeklyPayoutEligibilityHandler = async (ctx) => {
3
+ await runWeeklyPayoutEligibility(ctx);
4
+ };
@@ -28,7 +28,7 @@ import type { CategoryType } from "../../../features/categories/types/index";
28
28
  /** What KIND of action — drives default UI affordance (link vs button vs danger). */
29
29
  export type ActionKind = "primary" | "secondary" | "danger" | "ghost" | "link" | "chip";
30
30
  /** Resource bucket — keyed top-level in the ACTIONS tree. */
31
- export type ActionResource = "PRODUCT" | "AUCTION" | "PRE_ORDER" | "PRIZE_DRAW" | "CLASSIFIED" | "DIGITAL_CODE" | "LIVE" | "BUNDLE" | "GROUP" | "CATEGORY" | "BRAND" | "SUBLISTING" | "STORE" | "BLOG" | "EVENT" | "USER" | "SELLER" | "ADMIN" | "CART" | "CHECKOUT" | "NAV" | "MEDIA" | "SUPPORT" | "LOTTERY";
31
+ export type ActionResource = "PRODUCT" | "AUCTION" | "PRE_ORDER" | "PRIZE_DRAW" | "CLASSIFIED" | "DIGITAL_CODE" | "LIVE" | "BUNDLE" | "GROUP" | "CATEGORY" | "BRAND" | "SUBLISTING" | "STORE" | "BLOG" | "EVENT" | "SHIPMENT" | "CATALOGUE" | "USER" | "SELLER" | "ADMIN" | "CART" | "CHECKOUT" | "NAV" | "MEDIA" | "SUPPORT" | "LOTTERY";
32
32
  /** Confirmation modal config — when set, <Button action={...}> opens
33
33
  * a confirm dialog before firing the actual handler. */
34
34
  export interface ActionConfirmation {
@@ -802,6 +802,106 @@ export const ACTIONS = {
802
802
  },
803
803
  },
804
804
  },
805
+ SHIPMENT: {
806
+ "create": {
807
+ id: "shipment.create",
808
+ label: "New Shipment",
809
+ ariaLabel: "Create a new procurement shipment",
810
+ description: "Start tracking a new import shipment.",
811
+ kind: "primary",
812
+ permissions: ["admin"],
813
+ },
814
+ "mark-received": {
815
+ id: "shipment.mark-received",
816
+ label: "Mark Received",
817
+ ariaLabel: "Mark this shipment as received",
818
+ description: "Flags the shipment as physically received so processing can begin.",
819
+ kind: "secondary",
820
+ permissions: ["admin"],
821
+ },
822
+ "unlink-item": {
823
+ id: "shipment.unlink-item",
824
+ label: "Unlink",
825
+ ariaLabel: "Unlink this item from its product",
826
+ description: "Clears the product link on this shipment item without touching the product itself.",
827
+ kind: "ghost",
828
+ permissions: ["admin"],
829
+ },
830
+ "delete": {
831
+ id: "shipment.delete",
832
+ label: "Delete",
833
+ ariaLabel: "Delete this shipment",
834
+ description: "Permanently deletes the shipment and all its lots/items.",
835
+ kind: "danger",
836
+ permissions: ["admin"],
837
+ confirmation: {
838
+ title: "Delete this shipment?",
839
+ body: "This permanently removes the shipment and all its lots and items. This cannot be undone. Items still linked to a product must be unlinked first.",
840
+ confirmLabel: "Delete shipment",
841
+ confirmKind: "danger",
842
+ },
843
+ },
844
+ },
845
+ CATALOGUE: {
846
+ "list-item": {
847
+ id: "catalogue.list-item",
848
+ label: "List",
849
+ ariaLabel: "List this catalogue item directly",
850
+ description: "Seller-only — turns a catalogue item into a real listing under your own store immediately.",
851
+ kind: "primary",
852
+ permissions: ["seller", "admin"],
853
+ },
854
+ "submit-for-approval": {
855
+ id: "catalogue.submit-for-approval",
856
+ label: "Request to sell",
857
+ ariaLabel: "Request admin list this item on your behalf",
858
+ description: "Sends this item to admin for review before it's listed.",
859
+ kind: "secondary",
860
+ },
861
+ "unlink": {
862
+ id: "catalogue.unlink",
863
+ label: "Unlink",
864
+ ariaLabel: "Unlink this catalogue item from its product",
865
+ description: "Clears the product link on this catalogue item without touching the product itself.",
866
+ kind: "ghost",
867
+ permissions: ["admin"],
868
+ },
869
+ "delete": {
870
+ id: "catalogue.delete",
871
+ label: "Delete",
872
+ ariaLabel: "Remove this catalogue item",
873
+ description: "Permanently removes this item from your personal catalogue.",
874
+ kind: "danger",
875
+ confirmation: {
876
+ title: "Remove this item from your catalogue?",
877
+ body: "This cannot be undone. Items already listed cannot be deleted from here.",
878
+ confirmLabel: "Remove",
879
+ confirmKind: "danger",
880
+ },
881
+ },
882
+ "approve": {
883
+ id: "catalogue.approve",
884
+ label: "Approve",
885
+ ariaLabel: "Approve this catalogue listing request",
886
+ description: "Creates the product under the platform's consignment store and marks the item listed.",
887
+ kind: "primary",
888
+ permissions: ["admin"],
889
+ },
890
+ "reject": {
891
+ id: "catalogue.reject",
892
+ label: "Reject",
893
+ ariaLabel: "Reject this catalogue listing request",
894
+ description: "Declines the request and records a reason the owner can see.",
895
+ kind: "danger",
896
+ permissions: ["admin"],
897
+ confirmation: {
898
+ title: "Reject this listing request?",
899
+ body: "The owner will see your rejection reason.",
900
+ confirmLabel: "Reject",
901
+ confirmKind: "danger",
902
+ },
903
+ },
904
+ },
805
905
  ADMIN: {
806
906
  // ── Product moderation ─────────────────────────────────────────────────
807
907
  "approve-product": {
@@ -849,6 +949,42 @@ export const ACTIONS = {
849
949
  kind: "secondary",
850
950
  permissions: ["admin"],
851
951
  },
952
+ "bulk-suspend-users": {
953
+ id: "admin.bulk-suspend-users",
954
+ label: "Suspend selected",
955
+ ariaLabel: "Suspend selected users",
956
+ description: "Disable login for the selected accounts.",
957
+ kind: "danger",
958
+ permissions: ["admin"],
959
+ confirmation: {
960
+ title: "Suspend these users?",
961
+ body: "Selected accounts will be disabled from logging in. You can restore them later.",
962
+ confirmLabel: "Suspend",
963
+ confirmKind: "danger",
964
+ },
965
+ },
966
+ "bulk-restore-users": {
967
+ id: "admin.bulk-restore-users",
968
+ label: "Restore selected",
969
+ ariaLabel: "Restore selected users",
970
+ description: "Re-enable login for the selected accounts.",
971
+ kind: "secondary",
972
+ permissions: ["admin"],
973
+ },
974
+ "bulk-delete-users": {
975
+ id: "admin.bulk-delete-users",
976
+ label: "Delete selected",
977
+ ariaLabel: "Delete selected users",
978
+ description: "Disable the selected accounts.",
979
+ kind: "danger",
980
+ permissions: ["admin"],
981
+ confirmation: {
982
+ title: "Delete these users?",
983
+ body: "Selected accounts will be disabled. Their data (orders, reviews) is preserved — this does not permanently erase the account.",
984
+ confirmLabel: "Delete",
985
+ confirmKind: "danger",
986
+ },
987
+ },
852
988
  "verify-payment": {
853
989
  id: "admin.verify-payment",
854
990
  label: "Verify Payment",
@@ -14,11 +14,11 @@ export declare const blogPostInputSchema: z.ZodObject<{
14
14
  metaDescription: z.ZodOptional<z.ZodString>;
15
15
  }, "strip", z.ZodTypeAny, {
16
16
  status: "draft" | "published";
17
- category: string;
18
17
  title: string;
18
+ content: string;
19
+ category: string;
19
20
  slug: string;
20
21
  tags: string[];
21
- content: string;
22
22
  isFeatured: boolean;
23
23
  youtubeId?: string | undefined;
24
24
  excerpt?: string | undefined;
@@ -26,10 +26,10 @@ export declare const blogPostInputSchema: z.ZodObject<{
26
26
  metaTitle?: string | undefined;
27
27
  metaDescription?: string | undefined;
28
28
  }, {
29
- category: string;
30
29
  title: string;
31
- slug: string;
32
30
  content: string;
31
+ category: string;
32
+ slug: string;
33
33
  status?: "draft" | "published" | undefined;
34
34
  youtubeId?: string | undefined;
35
35
  tags?: string[] | undefined;
@@ -54,11 +54,11 @@ export declare const blogPostUpdateSchema: z.ZodObject<Omit<{
54
54
  metaDescription: z.ZodOptional<z.ZodOptional<z.ZodString>>;
55
55
  }, "slug">, "strip", z.ZodTypeAny, {
56
56
  status?: "draft" | "published" | undefined;
57
+ title?: string | undefined;
58
+ content?: string | undefined;
57
59
  youtubeId?: string | undefined;
58
60
  category?: string | undefined;
59
- title?: string | undefined;
60
61
  tags?: string[] | undefined;
61
- content?: string | undefined;
62
62
  isFeatured?: boolean | undefined;
63
63
  excerpt?: string | undefined;
64
64
  coverImage?: string | undefined;
@@ -66,11 +66,11 @@ export declare const blogPostUpdateSchema: z.ZodObject<Omit<{
66
66
  metaDescription?: string | undefined;
67
67
  }, {
68
68
  status?: "draft" | "published" | undefined;
69
+ title?: string | undefined;
70
+ content?: string | undefined;
69
71
  youtubeId?: string | undefined;
70
72
  category?: string | undefined;
71
- title?: string | undefined;
72
73
  tags?: string[] | undefined;
73
- content?: string | undefined;
74
74
  isFeatured?: boolean | undefined;
75
75
  excerpt?: string | undefined;
76
76
  coverImage?: string | undefined;
@@ -11,8 +11,8 @@ export declare const brandInputSchema: z.ZodObject<{
11
11
  isActive: z.ZodDefault<z.ZodBoolean>;
12
12
  displayOrder: z.ZodDefault<z.ZodNumber>;
13
13
  }, "strip", z.ZodTypeAny, {
14
- slug: string;
15
14
  name: string;
15
+ slug: string;
16
16
  isActive: boolean;
17
17
  displayOrder: number;
18
18
  country?: string | undefined;
@@ -22,8 +22,8 @@ export declare const brandInputSchema: z.ZodObject<{
22
22
  bannerURL?: string | undefined;
23
23
  founded?: number | undefined;
24
24
  }, {
25
- slug: string;
26
25
  name: string;
26
+ slug: string;
27
27
  country?: string | undefined;
28
28
  description?: string | undefined;
29
29
  isActive?: boolean | undefined;
@@ -46,8 +46,8 @@ export declare const brandUpdateSchema: z.ZodObject<Omit<{
46
46
  displayOrder: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
47
47
  }, "slug">, "strip", z.ZodTypeAny, {
48
48
  country?: string | undefined;
49
- description?: string | undefined;
50
49
  name?: string | undefined;
50
+ description?: string | undefined;
51
51
  isActive?: boolean | undefined;
52
52
  website?: string | undefined;
53
53
  displayOrder?: number | undefined;
@@ -56,8 +56,8 @@ export declare const brandUpdateSchema: z.ZodObject<Omit<{
56
56
  founded?: number | undefined;
57
57
  }, {
58
58
  country?: string | undefined;
59
- description?: string | undefined;
60
59
  name?: string | undefined;
60
+ description?: string | undefined;
61
61
  isActive?: boolean | undefined;
62
62
  website?: string | undefined;
63
63
  displayOrder?: number | undefined;
@@ -178,13 +178,13 @@ export declare const bundleCreateSchema: z.ZodObject<{
178
178
  limit: number;
179
179
  orderBy?: "price-asc" | "price-desc" | "createdAt-desc" | undefined;
180
180
  };
181
- description?: string | undefined;
182
- slug?: string | undefined;
183
181
  display?: {
184
182
  color?: string | undefined;
185
183
  icon?: string | undefined;
186
184
  coverImage?: string | undefined;
187
185
  } | undefined;
186
+ description?: string | undefined;
187
+ slug?: string | undefined;
188
188
  isActive?: boolean | undefined;
189
189
  bundleItemDetails?: {
190
190
  productId: string;
@@ -209,13 +209,13 @@ export declare const bundleCreateSchema: z.ZodObject<{
209
209
  limit: number;
210
210
  orderBy?: "price-asc" | "price-desc" | "createdAt-desc" | undefined;
211
211
  };
212
- description?: string | undefined;
213
- slug?: string | undefined;
214
212
  display?: {
215
213
  color?: string | undefined;
216
214
  icon?: string | undefined;
217
215
  coverImage?: string | undefined;
218
216
  } | undefined;
217
+ description?: string | undefined;
218
+ slug?: string | undefined;
219
219
  isActive?: boolean | undefined;
220
220
  bundleItemDetails?: {
221
221
  productId: string;
@@ -304,13 +304,13 @@ export declare const bundleUpdateSchema: z.ZodObject<{
304
304
  }>>;
305
305
  isActive: z.ZodOptional<z.ZodBoolean>;
306
306
  }, "strip", z.ZodTypeAny, {
307
- description?: string | undefined;
308
- name?: string | undefined;
309
307
  display?: {
310
308
  color?: string | undefined;
311
309
  icon?: string | undefined;
312
310
  coverImage?: string | undefined;
313
311
  } | undefined;
312
+ name?: string | undefined;
313
+ description?: string | undefined;
314
314
  isActive?: boolean | undefined;
315
315
  bundleProductIds?: string[] | undefined;
316
316
  bundleKind?: "brand" | "special" | undefined;
@@ -334,13 +334,13 @@ export declare const bundleUpdateSchema: z.ZodObject<{
334
334
  orderBy?: "price-asc" | "price-desc" | "createdAt-desc" | undefined;
335
335
  } | undefined;
336
336
  }, {
337
- description?: string | undefined;
338
- name?: string | undefined;
339
337
  display?: {
340
338
  color?: string | undefined;
341
339
  icon?: string | undefined;
342
340
  coverImage?: string | undefined;
343
341
  } | undefined;
342
+ name?: string | undefined;
343
+ description?: string | undefined;
344
344
  isActive?: boolean | undefined;
345
345
  bundleProductIds?: string[] | undefined;
346
346
  bundleKind?: "brand" | "special" | undefined;
@@ -21,8 +21,8 @@ export declare const eventInputSchema: z.ZodObject<{
21
21
  endsAt: string;
22
22
  entryFee: number;
23
23
  isOnline: boolean;
24
- description?: string | undefined;
25
24
  location?: string | undefined;
25
+ description?: string | undefined;
26
26
  maxEntries?: number | undefined;
27
27
  imageUrl?: string | undefined;
28
28
  }, {
@@ -31,9 +31,9 @@ export declare const eventInputSchema: z.ZodObject<{
31
31
  slug: string;
32
32
  startsAt: string;
33
33
  endsAt: string;
34
+ location?: string | undefined;
34
35
  description?: string | undefined;
35
36
  tags?: string[] | undefined;
36
- location?: string | undefined;
37
37
  maxEntries?: number | undefined;
38
38
  imageUrl?: string | undefined;
39
39
  entryFee?: number | undefined;
@@ -55,9 +55,9 @@ export declare const eventUpdateSchema: z.ZodObject<Omit<{
55
55
  }, "slug">, "strip", z.ZodTypeAny, {
56
56
  type?: "SALE" | "TOURNAMENT" | "CONVENTION" | "MEETUP" | undefined;
57
57
  title?: string | undefined;
58
+ location?: string | undefined;
58
59
  description?: string | undefined;
59
60
  tags?: string[] | undefined;
60
- location?: string | undefined;
61
61
  maxEntries?: number | undefined;
62
62
  imageUrl?: string | undefined;
63
63
  startsAt?: string | undefined;
@@ -67,9 +67,9 @@ export declare const eventUpdateSchema: z.ZodObject<Omit<{
67
67
  }, {
68
68
  type?: "SALE" | "TOURNAMENT" | "CONVENTION" | "MEETUP" | undefined;
69
69
  title?: string | undefined;
70
+ location?: string | undefined;
70
71
  description?: string | undefined;
71
72
  tags?: string[] | undefined;
72
- location?: string | undefined;
73
73
  maxEntries?: number | undefined;
74
74
  imageUrl?: string | undefined;
75
75
  startsAt?: string | undefined;
@@ -25,8 +25,8 @@ export declare const productInputSchema: z.ZodObject<{
25
25
  features: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
26
26
  }, "strip", z.ZodTypeAny, {
27
27
  currency: string;
28
- category: string;
29
28
  title: string;
29
+ category: string;
30
30
  price: number;
31
31
  stockQuantity: number;
32
32
  availableQuantity: number;
@@ -48,8 +48,8 @@ export declare const productInputSchema: z.ZodObject<{
48
48
  allowOffers?: boolean | undefined;
49
49
  minOfferPercent?: number | undefined;
50
50
  }, {
51
- category: string;
52
51
  title: string;
52
+ category: string;
53
53
  price: number;
54
54
  mainImage: string;
55
55
  currency?: string | undefined;
@@ -98,8 +98,8 @@ export declare const productUpdateSchema: z.ZodObject<{
98
98
  features: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
99
99
  }, "strip", z.ZodTypeAny, {
100
100
  currency?: string | undefined;
101
- category?: string | undefined;
102
101
  title?: string | undefined;
102
+ category?: string | undefined;
103
103
  description?: string | undefined;
104
104
  seoTitle?: string | undefined;
105
105
  seoDescription?: string | undefined;
@@ -122,8 +122,8 @@ export declare const productUpdateSchema: z.ZodObject<{
122
122
  minOfferPercent?: number | undefined;
123
123
  }, {
124
124
  currency?: string | undefined;
125
- category?: string | undefined;
126
125
  title?: string | undefined;
126
+ category?: string | undefined;
127
127
  description?: string | undefined;
128
128
  seoTitle?: string | undefined;
129
129
  seoDescription?: string | undefined;
@@ -181,9 +181,9 @@ export declare const auctionInputSchema: z.ZodObject<{
181
181
  auctionShippingPaidBy: z.ZodOptional<z.ZodEnum<["seller", "winner"]>>;
182
182
  }, "strip", z.ZodTypeAny, {
183
183
  currency: string;
184
+ title: string;
184
185
  category: string;
185
186
  listingType: "auction";
186
- title: string;
187
187
  price: number;
188
188
  stockQuantity: number;
189
189
  availableQuantity: number;
@@ -213,9 +213,9 @@ export declare const auctionInputSchema: z.ZodObject<{
213
213
  allowOffers?: boolean | undefined;
214
214
  minOfferPercent?: number | undefined;
215
215
  }, {
216
+ title: string;
216
217
  category: string;
217
218
  listingType: "auction";
218
- title: string;
219
219
  price: number;
220
220
  mainImage: string;
221
221
  auctionEndDate: string;
@@ -279,9 +279,9 @@ export declare const preOrderInputSchema: z.ZodObject<{
279
279
  preOrderCancellable: z.ZodDefault<z.ZodBoolean>;
280
280
  }, "strip", z.ZodTypeAny, {
281
281
  currency: string;
282
+ title: string;
282
283
  category: string;
283
284
  listingType: "pre-order";
284
- title: string;
285
285
  price: number;
286
286
  stockQuantity: number;
287
287
  availableQuantity: number;
@@ -308,9 +308,9 @@ export declare const preOrderInputSchema: z.ZodObject<{
308
308
  allowOffers?: boolean | undefined;
309
309
  minOfferPercent?: number | undefined;
310
310
  }, {
311
+ title: string;
311
312
  category: string;
312
313
  listingType: "pre-order";
313
- title: string;
314
314
  price: number;
315
315
  mainImage: string;
316
316
  preOrderDeliveryDate: string;
@@ -79,8 +79,8 @@ export declare const createCouponSchema: z.ZodObject<{
79
79
  }, "strip", z.ZodTypeAny, {
80
80
  code: string;
81
81
  type: "fixed" | "percentage" | "free_shipping" | "buy_x_get_y";
82
- name: string;
83
82
  scope: "seller" | "admin";
83
+ name: string;
84
84
  discount: {
85
85
  value: number;
86
86
  minPurchase: number;
@@ -105,8 +105,8 @@ export declare const createCouponSchema: z.ZodObject<{
105
105
  }, {
106
106
  code: string;
107
107
  type: "fixed" | "percentage" | "free_shipping" | "buy_x_get_y";
108
- name: string;
109
108
  scope: "seller" | "admin";
109
+ name: string;
110
110
  discount: {
111
111
  value: number;
112
112
  maxDiscount?: number | undefined;
@@ -189,8 +189,8 @@ export declare const updateCouponSchema: z.ZodObject<Omit<{
189
189
  }>>>;
190
190
  }, "code">, "strip", z.ZodTypeAny, {
191
191
  type?: "fixed" | "percentage" | "free_shipping" | "buy_x_get_y" | undefined;
192
- name?: string | undefined;
193
192
  scope?: "seller" | "admin" | undefined;
193
+ name?: string | undefined;
194
194
  sellerId?: string | undefined;
195
195
  discount?: {
196
196
  value: number;
@@ -214,8 +214,8 @@ export declare const updateCouponSchema: z.ZodObject<Omit<{
214
214
  } | undefined;
215
215
  }, {
216
216
  type?: "fixed" | "percentage" | "free_shipping" | "buy_x_get_y" | undefined;
217
- name?: string | undefined;
218
217
  scope?: "seller" | "admin" | undefined;
218
+ name?: string | undefined;
219
219
  sellerId?: string | undefined;
220
220
  discount?: {
221
221
  value: number;
@@ -8,21 +8,21 @@ export declare const createReviewSchema: z.ZodObject<{
8
8
  images: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
9
9
  orderId: z.ZodOptional<z.ZodString>;
10
10
  }, "strip", z.ZodTypeAny, {
11
- storeId: string;
12
11
  title: string;
13
- images: string[];
14
12
  body: string;
13
+ storeId: string;
14
+ images: string[];
15
15
  productId: string;
16
16
  rating: number;
17
17
  orderId?: string | undefined;
18
18
  }, {
19
- storeId: string;
20
19
  title: string;
21
20
  body: string;
21
+ storeId: string;
22
22
  productId: string;
23
23
  rating: number;
24
- images?: string[] | undefined;
25
24
  orderId?: string | undefined;
25
+ images?: string[] | undefined;
26
26
  }>;
27
27
  export declare const replyToReviewSchema: z.ZodObject<{
28
28
  reviewId: z.ZodString;