@mohasinac/appkit 4.59.0 → 4.60.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 (532) hide show
  1. package/dist/.build-stamp.json +3 -3
  2. package/dist/_internal/client/features/layout/DashboardLayoutClient.js +62 -5
  3. package/dist/_internal/client/features/maintenance/views/MaintenanceDashboardView.js +2 -2
  4. package/dist/_internal/server/features/brands/actions.js +78 -4
  5. package/dist/_internal/server/features/checkout/actions.d.ts +36 -13
  6. package/dist/_internal/server/features/checkout/actions.js +668 -183
  7. package/dist/_internal/server/features/checkout/supplier-identity.js +18 -1
  8. package/dist/_internal/server/features/gateway-events/index.d.ts +10 -0
  9. package/dist/_internal/server/features/gateway-events/index.js +10 -0
  10. package/dist/_internal/server/features/gateway-events/ingest.d.ts +127 -0
  11. package/dist/_internal/server/features/gateway-events/ingest.js +188 -0
  12. package/dist/_internal/server/features/gateway-events/redact.d.ts +66 -0
  13. package/dist/_internal/server/features/gateway-events/redact.js +151 -0
  14. package/dist/_internal/server/features/grievance/actions.d.ts +63 -0
  15. package/dist/_internal/server/features/grievance/actions.js +173 -0
  16. package/dist/_internal/server/features/grievance/index.d.ts +8 -0
  17. package/dist/_internal/server/features/grievance/index.js +8 -0
  18. package/dist/_internal/server/features/grouped/data.js +28 -3
  19. package/dist/_internal/server/features/lottery/actions.js +99 -4
  20. package/dist/_internal/server/features/order-completion/actions.d.ts +92 -0
  21. package/dist/_internal/server/features/order-completion/actions.js +336 -0
  22. package/dist/_internal/server/features/order-completion/index.d.ts +7 -0
  23. package/dist/_internal/server/features/order-completion/index.js +7 -0
  24. package/dist/_internal/server/features/orders/actions.d.ts +13 -0
  25. package/dist/_internal/server/features/orders/actions.js +56 -2
  26. package/dist/_internal/server/features/orders/adapters.d.ts +20 -2
  27. package/dist/_internal/server/features/orders/adapters.js +44 -0
  28. package/dist/_internal/server/features/orders/cancellation-refund.d.ts +116 -0
  29. package/dist/_internal/server/features/orders/cancellation-refund.js +466 -0
  30. package/dist/_internal/server/features/orders/index.d.ts +2 -1
  31. package/dist/_internal/server/features/orders/index.js +1 -1
  32. package/dist/_internal/server/features/orders/service.d.ts +60 -0
  33. package/dist/_internal/server/features/orders/service.js +74 -0
  34. package/dist/_internal/server/features/payment-cases/disputes.d.ts +76 -0
  35. package/dist/_internal/server/features/payment-cases/disputes.js +241 -0
  36. package/dist/_internal/server/features/payment-cases/index.d.ts +9 -0
  37. package/dist/_internal/server/features/payment-cases/index.js +9 -0
  38. package/dist/_internal/server/features/payouts/actions.d.ts +28 -3
  39. package/dist/_internal/server/features/payouts/actions.js +84 -10
  40. package/dist/_internal/server/features/points/adjust.d.ts +61 -0
  41. package/dist/_internal/server/features/points/adjust.js +121 -0
  42. package/dist/_internal/server/features/points/award.d.ts +65 -0
  43. package/dist/_internal/server/features/points/award.js +145 -0
  44. package/dist/_internal/server/features/price-index/market.d.ts +33 -0
  45. package/dist/_internal/server/features/price-index/market.js +54 -1
  46. package/dist/_internal/server/features/products/data.js +40 -22
  47. package/dist/_internal/server/features/protection-claims/actions.d.ts +72 -0
  48. package/dist/_internal/server/features/protection-claims/actions.js +228 -0
  49. package/dist/_internal/server/features/protection-claims/index.d.ts +8 -0
  50. package/dist/_internal/server/features/protection-claims/index.js +8 -0
  51. package/dist/_internal/server/features/refunds/actions.d.ts +20 -0
  52. package/dist/_internal/server/features/refunds/actions.js +259 -17
  53. package/dist/_internal/server/features/refunds/capacity.d.ts +29 -0
  54. package/dist/_internal/server/features/refunds/capacity.js +37 -0
  55. package/dist/_internal/server/features/reviews/actions.js +3 -2
  56. package/dist/_internal/server/features/search/index-build/sources.js +20 -1
  57. package/dist/_internal/server/features/shipping/reconcile.d.ts +10 -1
  58. package/dist/_internal/server/features/shipping/reconcile.js +34 -3
  59. package/dist/_internal/server/features/shipping/reimbursement.d.ts +117 -0
  60. package/dist/_internal/server/features/shipping/reimbursement.js +223 -0
  61. package/dist/_internal/server/features/stores/tabs.d.ts +19 -4
  62. package/dist/_internal/server/features/stores/tabs.js +24 -4
  63. package/dist/_internal/server/functions/https.d.ts +31 -1
  64. package/dist/_internal/server/functions/https.js +52 -1
  65. package/dist/_internal/server/functions/scheduled.d.ts +72 -1
  66. package/dist/_internal/server/functions/scheduled.js +124 -1
  67. package/dist/_internal/server/jobs/core/autoPayoutEligibility.js +62 -16
  68. package/dist/_internal/server/jobs/core/boxRollupReconcile.d.ts +46 -0
  69. package/dist/_internal/server/jobs/core/boxRollupReconcile.js +142 -0
  70. package/dist/_internal/server/jobs/core/dailyDataCleanup.js +149 -1
  71. package/dist/_internal/server/jobs/core/dailyStatusDigest.d.ts +14 -0
  72. package/dist/_internal/server/jobs/core/dailyStatusDigest.js +79 -1
  73. package/dist/_internal/server/jobs/core/index.d.ts +2 -0
  74. package/dist/_internal/server/jobs/core/index.js +2 -0
  75. package/dist/_internal/server/jobs/core/marketPriceRollup.d.ts +64 -0
  76. package/dist/_internal/server/jobs/core/marketPriceRollup.js +153 -0
  77. package/dist/_internal/server/jobs/core/obligationSweep.d.ts +36 -0
  78. package/dist/_internal/server/jobs/core/obligationSweep.js +503 -0
  79. package/dist/_internal/server/jobs/core/paymentReconcile.d.ts +79 -0
  80. package/dist/_internal/server/jobs/core/paymentReconcile.js +614 -0
  81. package/dist/_internal/server/jobs/core/paymentWindowTimeout.js +34 -0
  82. package/dist/_internal/server/jobs/core/weeklyPayoutEligibility.js +35 -4
  83. package/dist/_internal/server/jobs/handlers/boxRollupReconcile.d.ts +2 -0
  84. package/dist/_internal/server/jobs/handlers/boxRollupReconcile.js +15 -0
  85. package/dist/_internal/server/jobs/handlers/countersReconcileNow.d.ts +65 -0
  86. package/dist/_internal/server/jobs/handlers/countersReconcileNow.js +89 -0
  87. package/dist/_internal/server/jobs/handlers/index.d.ts +5 -0
  88. package/dist/_internal/server/jobs/handlers/index.js +5 -0
  89. package/dist/_internal/server/jobs/handlers/marketPriceRollup.d.ts +2 -0
  90. package/dist/_internal/server/jobs/handlers/marketPriceRollup.js +2 -0
  91. package/dist/_internal/server/jobs/handlers/obligationSweep.d.ts +2 -0
  92. package/dist/_internal/server/jobs/handlers/obligationSweep.js +15 -0
  93. package/dist/_internal/server/jobs/handlers/onShipmentAllocationSync.js +30 -1
  94. package/dist/_internal/server/jobs/handlers/paymentReconcile.d.ts +2 -0
  95. package/dist/_internal/server/jobs/handlers/paymentReconcile.js +6 -0
  96. package/dist/_internal/shared/actions/action-registry.d.ts +1 -1
  97. package/dist/_internal/shared/actions/action-registry.js +71 -0
  98. package/dist/_internal/shared/checkout/coupon-discount.d.ts +73 -0
  99. package/dist/_internal/shared/checkout/coupon-discount.js +103 -0
  100. package/dist/_internal/shared/checkout/lanes.d.ts +42 -0
  101. package/dist/_internal/shared/checkout/lanes.js +46 -0
  102. package/dist/_internal/shared/checkout/order-math.d.ts +149 -1
  103. package/dist/_internal/shared/checkout/order-math.js +251 -3
  104. package/dist/_internal/shared/checkout/refundable-base.d.ts +116 -0
  105. package/dist/_internal/shared/checkout/refundable-base.js +122 -0
  106. package/dist/_internal/shared/features/auctions/config.d.ts +14 -1
  107. package/dist/_internal/shared/features/auctions/config.js +30 -1
  108. package/dist/_internal/shared/features/brands/schema.d.ts +42 -0
  109. package/dist/_internal/shared/features/brands/schema.js +18 -0
  110. package/dist/_internal/shared/features/orders/refund-copy.d.ts +22 -0
  111. package/dist/_internal/shared/features/orders/refund-copy.js +34 -0
  112. package/dist/_internal/shared/features/print/label-profiles.d.ts +198 -0
  113. package/dist/_internal/shared/features/print/label-profiles.js +350 -0
  114. package/dist/_internal/shared/features/products/to-product-item.js +33 -5
  115. package/dist/_internal/shared/fees/calculator.d.ts +31 -2
  116. package/dist/_internal/shared/fees/calculator.js +103 -5
  117. package/dist/_internal/shared/fees/india-states.d.ts +195 -0
  118. package/dist/_internal/shared/fees/india-states.js +190 -0
  119. package/dist/_internal/shared/fees/payout-hold.d.ts +80 -0
  120. package/dist/_internal/shared/fees/payout-hold.js +74 -0
  121. package/dist/_internal/shared/obligations/deadlines.d.ts +94 -0
  122. package/dist/_internal/shared/obligations/deadlines.js +155 -0
  123. package/dist/_internal/shared/shipping/quote.d.ts +96 -0
  124. package/dist/_internal/shared/shipping/quote.js +67 -0
  125. package/dist/_internal/shared/time/business-days.d.ts +91 -0
  126. package/dist/_internal/shared/time/business-days.js +185 -0
  127. package/dist/cli/index.js +0 -2
  128. package/dist/client.d.ts +10 -4
  129. package/dist/client.js +29 -3
  130. package/dist/configs/tailwind.d.ts +0 -12
  131. package/dist/configs/tailwind.js +28 -15
  132. package/dist/constants/api-endpoints.d.ts +51 -9
  133. package/dist/constants/api-endpoints.js +23 -7
  134. package/dist/constants/index.d.ts +1 -1
  135. package/dist/constants/index.js +1 -1
  136. package/dist/contracts/index.d.ts +1 -1
  137. package/dist/contracts/payment.d.ts +131 -0
  138. package/dist/features/about/components/AboutView.js +1 -1
  139. package/dist/features/about/components/DeveloperView.js +5 -2
  140. package/dist/features/about/components/FAQPageView.js +2 -1
  141. package/dist/features/about/components/FeesView.js +2 -1
  142. package/dist/features/about/components/HelpPageView.js +2 -1
  143. package/dist/features/about/components/HowAuctionsWorkView.js +2 -1
  144. package/dist/features/about/components/HowCheckoutWorksView.js +2 -1
  145. package/dist/features/about/components/HowEmiWorksView.js +2 -1
  146. package/dist/features/about/components/HowOffersWorkView.js +2 -1
  147. package/dist/features/about/components/HowOrdersWorkView.js +2 -1
  148. package/dist/features/about/components/HowPayoutsWorkView.js +2 -1
  149. package/dist/features/about/components/HowPreOrdersWorkView.js +2 -1
  150. package/dist/features/about/components/HowReviewsWorkView.js +2 -1
  151. package/dist/features/about/components/PolicyPageView.js +2 -1
  152. package/dist/features/about/components/ProseHero.d.ts +73 -0
  153. package/dist/features/about/components/ProseHero.js +18 -0
  154. package/dist/features/about/components/SecurityPrivacyView.js +2 -1
  155. package/dist/features/about/components/ShippingPolicyView.js +2 -1
  156. package/dist/features/about/components/TrackOrderView.js +2 -1
  157. package/dist/features/about/components/UnauthorizedView.js +1 -1
  158. package/dist/features/about/index.d.ts +2 -0
  159. package/dist/features/about/index.js +5 -0
  160. package/dist/features/account/actions/address-actions.d.ts +26 -2
  161. package/dist/features/account/actions/address-actions.js +25 -1
  162. package/dist/features/account/components/BuyerShoppingGuideView.js +1 -1
  163. package/dist/features/account/components/NotificationPreferencesPanel.js +1 -1
  164. package/dist/features/account/components/UserOrdersView.js +17 -0
  165. package/dist/features/account/components/UserSidebar.js +1 -1
  166. package/dist/features/account/hooks/useNotifications.js +29 -0
  167. package/dist/features/admin/actions/admin-coupon-actions.js +36 -0
  168. package/dist/features/admin/components/AdminBeysView.js +2 -2
  169. package/dist/features/admin/components/AdminBlogEditorView.js +2 -2
  170. package/dist/features/admin/components/AdminBrandEditorView.js +32 -2
  171. package/dist/features/admin/components/AdminBundleEditorView.js +1 -1
  172. package/dist/features/admin/components/AdminCarouselEditorView.js +1 -1
  173. package/dist/features/admin/components/AdminCategoriesView.js +1 -1
  174. package/dist/features/admin/components/AdminCategoryEditorView.js +73 -17
  175. package/dist/features/admin/components/AdminContactEditorView.js +1 -1
  176. package/dist/features/admin/components/AdminCouponEditorView.js +26 -1
  177. package/dist/features/admin/components/AdminFaqEditorView.js +1 -1
  178. package/dist/features/admin/components/AdminFaqsView.js +2 -2
  179. package/dist/features/admin/components/AdminGatewayEventsView.d.ts +54 -0
  180. package/dist/features/admin/components/AdminGatewayEventsView.js +209 -0
  181. package/dist/features/admin/components/AdminGuideHubView.js +1 -1
  182. package/dist/features/admin/components/AdminMoneyCasesView.d.ts +60 -0
  183. package/dist/features/admin/components/AdminMoneyCasesView.js +287 -0
  184. package/dist/features/admin/components/AdminPartsView.js +2 -2
  185. package/dist/features/admin/components/AdminProductsView.js +75 -4
  186. package/dist/features/admin/components/AdminSidebar.js +2 -2
  187. package/dist/features/admin/components/AdminSiteSettingsView.js +65 -7
  188. package/dist/features/admin/components/AdminSublistingCategoriesView.js +2 -0
  189. package/dist/features/admin/components/AdminSupportTicketDetailView.js +1 -1
  190. package/dist/features/admin/components/AdminSupportTicketsView.js +2 -2
  191. package/dist/features/admin/components/AdminTesterChecklistView.js +2 -2
  192. package/dist/features/admin/components/AdminUsersView.js +72 -1
  193. package/dist/features/admin/components/AdminViewCards.d.ts +3 -1
  194. package/dist/features/admin/components/AdminViewCards.js +4 -4
  195. package/dist/features/admin/components/DataListingView.d.ts +28 -0
  196. package/dist/features/admin/components/DataListingView.js +175 -14
  197. package/dist/features/admin/components/DataTable.d.ts +12 -1
  198. package/dist/features/admin/components/DataTable.js +3 -3
  199. package/dist/features/admin/components/OwnerQuickActions.d.ts +1 -1
  200. package/dist/features/admin/components/OwnerQuickActions.js +60 -2
  201. package/dist/features/admin/components/RecordOwnerQuickActions.d.ts +1 -1
  202. package/dist/features/admin/components/RecordOwnerQuickActions.js +61 -14
  203. package/dist/features/admin/components/analytics/AdminStatCard.d.ts +35 -1
  204. package/dist/features/admin/components/analytics/AdminStatCard.js +77 -2
  205. package/dist/features/admin/components/index.d.ts +4 -0
  206. package/dist/features/admin/components/index.js +6 -0
  207. package/dist/features/admin/constants/filter-tabs.d.ts +156 -0
  208. package/dist/features/admin/constants/filter-tabs.js +106 -0
  209. package/dist/features/admin/repository/site-settings.repository.d.ts +22 -0
  210. package/dist/features/admin/repository/site-settings.repository.js +82 -1
  211. package/dist/features/admin/schemas/admin-editor-forms.d.ts +21 -0
  212. package/dist/features/admin/schemas/admin-editor-forms.js +44 -0
  213. package/dist/features/admin/schemas/firestore.js +5 -1
  214. package/dist/features/admin/schemas/site-settings-form.js +30 -1
  215. package/dist/features/auctions/actions/bid-actions.js +13 -1
  216. package/dist/features/auctions/components/AuctionBottomActions.js +2 -2
  217. package/dist/features/auctions/components/AuctionDetailPageView.js +3 -1
  218. package/dist/features/auctions/components/MarketplaceAuctionCard.d.ts +11 -0
  219. package/dist/features/auctions/components/MarketplaceAuctionCard.js +5 -3
  220. package/dist/features/auctions/components/PlaceBidFormClient.d.ts +8 -1
  221. package/dist/features/auctions/components/PlaceBidFormClient.js +2 -2
  222. package/dist/features/audit-log/schemas/firestore.d.ts +28 -0
  223. package/dist/features/audit-log/schemas/firestore.js +14 -0
  224. package/dist/features/auth/permissions/constants.d.ts +17 -1
  225. package/dist/features/auth/permissions/constants.js +18 -0
  226. package/dist/features/blog/components/BlogPostView.js +1 -1
  227. package/dist/features/catalogue/components/AdminCatalogueApprovalsView.js +1 -1
  228. package/dist/features/categories/api/[id]/description-template/route.js +107 -1
  229. package/dist/features/categories/components/BrandDetailPageView.js +2 -2
  230. package/dist/features/categories/components/BreadcrumbTrail.js +7 -1
  231. package/dist/features/categories/components/BundleDetailView.js +1 -1
  232. package/dist/features/categories/components/CategoryDetailPageView.js +2 -2
  233. package/dist/features/categories/components/CategoryForm.js +12 -1
  234. package/dist/features/categories/components/CategoryTemplatePicker.js +38 -5
  235. package/dist/features/categories/repository/market-price-index.repository.d.ts +123 -0
  236. package/dist/features/categories/repository/market-price-index.repository.js +105 -0
  237. package/dist/features/categories/repository/price-observation.repository.d.ts +166 -0
  238. package/dist/features/categories/repository/price-observation.repository.js +132 -0
  239. package/dist/features/events/components/EventSaleBanner.js +1 -1
  240. package/dist/features/events/components/EventStatusBadge.js +1 -1
  241. package/dist/features/faq/components/FAQAccordion.js +2 -1
  242. package/dist/features/faq/components/FAQCategorySidebar.js +2 -2
  243. package/dist/features/faq/components/FAQHelpfulButtons.js +4 -4
  244. package/dist/features/faq/components/RelatedFAQs.js +1 -1
  245. package/dist/features/filters/FilterFacetSection.js +1 -1
  246. package/dist/features/filters/SwitchFilter.js +1 -1
  247. package/dist/features/gateway-events/repository/gateway-events.repository.d.ts +117 -0
  248. package/dist/features/gateway-events/repository/gateway-events.repository.js +274 -0
  249. package/dist/features/gateway-events/schemas/firestore.d.ts +217 -0
  250. package/dist/features/gateway-events/schemas/firestore.js +125 -0
  251. package/dist/features/gateway-events/schemas/index.d.ts +81 -0
  252. package/dist/features/gateway-events/schemas/index.js +79 -0
  253. package/dist/features/grouped/components/GroupedListingDetailView.js +1 -1
  254. package/dist/features/homepage/components/AnnouncementBar.js +37 -1
  255. package/dist/features/homepage/components/AnnouncementBar.style.css +30 -0
  256. package/dist/features/homepage/components/BrandsSection.js +1 -1
  257. package/dist/features/homepage/components/CTABannerSection.js +1 -1
  258. package/dist/features/homepage/components/FeaturedBundlesSection.js +14 -24
  259. package/dist/features/homepage/components/HeroCarousel.js +2 -2
  260. package/dist/features/homepage/components/SocialPostCard.js +1 -1
  261. package/dist/features/inventory/components/AdminMoveLedgerView.d.ts +7 -0
  262. package/dist/features/inventory/components/AdminMoveLedgerView.js +157 -0
  263. package/dist/features/inventory/components/AdminStorageBoxesView.d.ts +11 -0
  264. package/dist/features/inventory/components/AdminStorageBoxesView.js +168 -0
  265. package/dist/features/inventory/components/ReceiveStationView.d.ts +39 -0
  266. package/dist/features/inventory/components/ReceiveStationView.js +413 -0
  267. package/dist/features/inventory/components/operator-message.d.ts +29 -0
  268. package/dist/features/inventory/components/operator-message.js +41 -0
  269. package/dist/features/inventory/index.d.ts +13 -0
  270. package/dist/features/inventory/index.js +28 -0
  271. package/dist/features/inventory/repository/inventory-movements.repository.d.ts +97 -0
  272. package/dist/features/inventory/repository/inventory-movements.repository.js +186 -0
  273. package/dist/features/inventory/repository/inventory-placements.repository.d.ts +179 -0
  274. package/dist/features/inventory/repository/inventory-placements.repository.js +345 -0
  275. package/dist/features/inventory/repository/storage-boxes.repository.d.ts +83 -0
  276. package/dist/features/inventory/repository/storage-boxes.repository.js +127 -0
  277. package/dist/features/inventory/schemas/firestore.d.ts +197 -0
  278. package/dist/features/inventory/schemas/firestore.js +159 -0
  279. package/dist/features/layout/AppLayoutShell.d.ts +12 -1
  280. package/dist/features/layout/AppLayoutShell.js +25 -12
  281. package/dist/features/layout/AutoBreadcrumbs.js +162 -3
  282. package/dist/features/layout/AutoBreadcrumbs.style.css +45 -0
  283. package/dist/features/layout/BottomNavbar.d.ts +1 -1
  284. package/dist/features/layout/BottomNavbar.js +2 -2
  285. package/dist/features/media/MediaAvatar.js +1 -1
  286. package/dist/features/media/MediaImage.d.ts +24 -4
  287. package/dist/features/media/MediaImage.js +44 -4
  288. package/dist/features/media/MediaLightbox.js +1 -1
  289. package/dist/features/media/modals/ImageCropModal.js +1 -1
  290. package/dist/features/media/modals/ImageEditor.js +1 -1
  291. package/dist/features/media/upload/MediaUploadField.js +91 -3
  292. package/dist/features/obligations/constants/policies.d.ts +92 -0
  293. package/dist/features/obligations/constants/policies.js +378 -0
  294. package/dist/features/obligations/repository/obligations.repository.d.ts +68 -0
  295. package/dist/features/obligations/repository/obligations.repository.js +158 -0
  296. package/dist/features/obligations/schemas/firestore.d.ts +160 -0
  297. package/dist/features/obligations/schemas/firestore.js +87 -0
  298. package/dist/features/orders/actions/order-actions.d.ts +43 -4
  299. package/dist/features/orders/actions/order-actions.js +60 -3
  300. package/dist/features/orders/actions/refund-actions.js +70 -10
  301. package/dist/features/orders/components/OrderCompletionPanel.d.ts +27 -0
  302. package/dist/features/orders/components/OrderCompletionPanel.js +192 -0
  303. package/dist/features/orders/components/OrdersList.js +2 -2
  304. package/dist/features/orders/components/RefundHistoryTable.js +3 -1
  305. package/dist/features/orders/components/index.d.ts +2 -0
  306. package/dist/features/orders/components/index.js +6 -0
  307. package/dist/features/orders/constants/transitions.d.ts +59 -0
  308. package/dist/features/orders/constants/transitions.js +104 -0
  309. package/dist/features/orders/repository/orders.repository.d.ts +109 -6
  310. package/dist/features/orders/repository/orders.repository.js +464 -21
  311. package/dist/features/orders/schemas/firestore.d.ts +270 -0
  312. package/dist/features/orders/schemas/firestore.js +24 -0
  313. package/dist/features/orders/schemas/index.d.ts +61 -0
  314. package/dist/features/orders/schemas/index.js +22 -0
  315. package/dist/features/orders/types/index.d.ts +79 -0
  316. package/dist/features/parts/components/PartsIndexPageView.js +8 -1
  317. package/dist/features/payment-cases/repository/payment-cases.repository.d.ts +170 -0
  318. package/dist/features/payment-cases/repository/payment-cases.repository.js +342 -0
  319. package/dist/features/payment-cases/schemas/firestore.d.ts +229 -0
  320. package/dist/features/payment-cases/schemas/firestore.js +105 -0
  321. package/dist/features/payment-cases/schemas/resolve-form.d.ts +97 -0
  322. package/dist/features/payment-cases/schemas/resolve-form.js +114 -0
  323. package/dist/features/payments/repository/payout.repository.d.ts +0 -1
  324. package/dist/features/payments/repository/payout.repository.js +0 -1
  325. package/dist/features/points/repository/points.repository.d.ts +122 -0
  326. package/dist/features/points/repository/points.repository.js +304 -1
  327. package/dist/features/points/schemas/adjust-form.d.ts +58 -0
  328. package/dist/features/points/schemas/adjust-form.js +63 -0
  329. package/dist/features/points/schemas/firestore.d.ts +108 -1
  330. package/dist/features/points/schemas/firestore.js +84 -0
  331. package/dist/features/pre-orders/components/MarketplacePreorderCard.js +3 -3
  332. package/dist/features/pre-orders/components/PreOrderBadge.js +1 -1
  333. package/dist/features/pre-orders/components/PreOrderDetailPageView.js +1 -1
  334. package/dist/features/price-index/components/PriceIndexToolView.d.ts +23 -4
  335. package/dist/features/price-index/components/PriceIndexToolView.js +71 -6
  336. package/dist/features/price-index/market-stats.d.ts +82 -0
  337. package/dist/features/price-index/market-stats.js +230 -0
  338. package/dist/features/print/components/BoxLabelPrintView.d.ts +25 -0
  339. package/dist/features/print/components/BoxLabelPrintView.js +66 -0
  340. package/dist/features/print/components/LabelProfilePicker.d.ts +13 -0
  341. package/dist/features/print/components/LabelProfilePicker.js +38 -0
  342. package/dist/features/print/components/labels.d.ts +117 -0
  343. package/dist/features/print/components/labels.js +258 -0
  344. package/dist/features/print/components/labels.style.css +46 -0
  345. package/dist/features/print/index.d.ts +6 -0
  346. package/dist/features/print/index.js +16 -0
  347. package/dist/features/products/columns/productTableColumns.js +5 -4
  348. package/dist/features/products/components/MarketplaceBundleCard.js +2 -2
  349. package/dist/features/products/components/MarketplacePrizeDrawCard.js +6 -6
  350. package/dist/features/products/components/PrizeDrawCollage.js +1 -1
  351. package/dist/features/products/components/PrizeDrawItemsEditor.js +1 -1
  352. package/dist/features/products/components/PrizeRevealModal.js +2 -2
  353. package/dist/features/products/components/ProductDetailPageView.js +18 -4
  354. package/dist/features/products/components/ProductForm.js +34 -23
  355. package/dist/features/products/components/ProductGrid.js +86 -62
  356. package/dist/features/products/constants/card-badges.d.ts +97 -0
  357. package/dist/features/products/constants/card-badges.js +100 -0
  358. package/dist/features/products/repository/products.repository.js +34 -1
  359. package/dist/features/products/schemas/firestore.d.ts +46 -3
  360. package/dist/features/products/schemas/firestore.js +21 -0
  361. package/dist/features/promotions/components/PromotionsView.js +1 -1
  362. package/dist/features/promotions/repository/claimed-coupons.repository.d.ts +32 -0
  363. package/dist/features/promotions/repository/claimed-coupons.repository.js +58 -0
  364. package/dist/features/promotions/schemas/firestore.js +30 -3
  365. package/dist/features/promotions/schemas/index.d.ts +6 -6
  366. package/dist/features/protection-claims/repository/protection-claims.repository.d.ts +54 -0
  367. package/dist/features/protection-claims/repository/protection-claims.repository.js +174 -0
  368. package/dist/features/protection-claims/schemas/firestore.d.ts +168 -0
  369. package/dist/features/protection-claims/schemas/firestore.js +130 -0
  370. package/dist/features/reviews/actions/review-actions.js +3 -2
  371. package/dist/features/reviews/components/ReviewModal.js +1 -1
  372. package/dist/features/reviews/components/ReviewsList.js +1 -1
  373. package/dist/features/reviews/schemas/firestore.d.ts +20 -1
  374. package/dist/features/scams/constants/scam-types.d.ts +2 -0
  375. package/dist/features/scams/constants/scam-types.js +18 -0
  376. package/dist/features/scams/schemas/report-form.d.ts +3 -3
  377. package/dist/features/scams/schemas/report-form.js +26 -1
  378. package/dist/features/search/components/Search.js +9 -9
  379. package/dist/features/search/components/SearchResultsClient.js +18 -3
  380. package/dist/features/search/components/SearchResultsPageView.d.ts +1 -6
  381. package/dist/features/search/components/SearchResultsPageView.js +2 -2
  382. package/dist/features/seller/actions/offer-actions.js +16 -1
  383. package/dist/features/seller/actions/seller-actions.js +14 -3
  384. package/dist/features/seller/components/CategoryInlineSelect.js +75 -11
  385. package/dist/features/seller/components/PrintCenterView.d.ts +5 -0
  386. package/dist/features/seller/components/PrintCenterView.js +41 -30
  387. package/dist/features/seller/components/SellerOrdersView.js +1 -1
  388. package/dist/features/seller/components/SellerPayoutRequestView.js +16 -5
  389. package/dist/features/seller/components/SellerPayoutSettingsView.js +1 -1
  390. package/dist/features/seller/components/SellerProductShell.d.ts +16 -0
  391. package/dist/features/seller/components/SellerProductShell.js +123 -13
  392. package/dist/features/seller/components/SellerReviewsView.js +4 -2
  393. package/dist/features/seller/components/SellerSidebar.js +1 -1
  394. package/dist/features/seller/schemas/coupon-form.d.ts +26 -0
  395. package/dist/features/seller/schemas/coupon-form.js +27 -0
  396. package/dist/features/seller/schemas/product-form.d.ts +3 -0
  397. package/dist/features/seller/schemas/product-form.js +5 -0
  398. package/dist/features/shell/FormShell.js +2 -2
  399. package/dist/features/shell/QuickFormDrawer.js +14 -0
  400. package/dist/features/shell/SectionForm.d.ts +19 -0
  401. package/dist/features/shell/SectionForm.js +133 -9
  402. package/dist/features/shell/SectionForm.style.css +54 -0
  403. package/dist/features/shipments/components/AdminShipmentsView.js +16 -1
  404. package/dist/features/shipments/repository/shipment-items.repository.d.ts +9 -0
  405. package/dist/features/shipments/repository/shipment-items.repository.js +14 -0
  406. package/dist/features/site-settings/components/ActionPermissionsManager.js +1 -1
  407. package/dist/features/sticker-trace/components/StickerCommitPanel.js +1 -1
  408. package/dist/features/store-extensions/schemas/report-review-form.d.ts +8 -8
  409. package/dist/features/stores/components/StoreGuideHubView.js +1 -1
  410. package/dist/features/stores/components/StoreHeader.js +1 -1
  411. package/dist/features/support/schemas/firestore.d.ts +73 -2
  412. package/dist/features/support/schemas/firestore.js +59 -0
  413. package/dist/index.d.ts +16 -24
  414. package/dist/index.js +38 -47
  415. package/dist/next/ErrorBoundary.js +1 -1
  416. package/dist/next/routing/route-map.d.ts +24 -0
  417. package/dist/next/routing/route-map.js +40 -0
  418. package/dist/providers/payment-manual/index.d.ts +15 -1
  419. package/dist/providers/payment-manual/index.js +37 -0
  420. package/dist/providers/payment-phonepe/index.d.ts +14 -1
  421. package/dist/providers/payment-phonepe/index.js +36 -0
  422. package/dist/providers/payment-razorpay/index.d.ts +44 -1
  423. package/dist/providers/payment-razorpay/index.js +99 -0
  424. package/dist/providers/shipping-shiprocket/index.d.ts +18 -0
  425. package/dist/providers/shipping-shiprocket/index.js +18 -0
  426. package/dist/schemas/registry.d.ts +44 -11
  427. package/dist/server-entry.d.ts +2 -0
  428. package/dist/server-entry.js +27 -0
  429. package/dist/server.d.ts +43 -0
  430. package/dist/server.js +98 -0
  431. package/dist/styles.css +418 -149
  432. package/dist/tailwind-utilities.css +1 -1
  433. package/dist/tokens/themes/default-dark.js +15 -12
  434. package/dist/tokens/themes/default-light.js +14 -11
  435. package/dist/tokens/tokens.css +106 -23
  436. package/dist/ui/DataTable.style.css +4 -4
  437. package/dist/ui/columns/cell-renderers.d.ts +20 -0
  438. package/dist/ui/columns/cell-renderers.js +26 -1
  439. package/dist/ui/columns/index.d.ts +1 -1
  440. package/dist/ui/columns/index.js +4 -1
  441. package/dist/ui/components/Badge.style.css +1 -1
  442. package/dist/ui/components/Breadcrumb.js +19 -1
  443. package/dist/ui/components/BulkActionBar.style.css +4 -4
  444. package/dist/ui/components/Button.style.css +1 -1
  445. package/dist/ui/components/Checkbox.style.css +1 -1
  446. package/dist/ui/components/FallbackShell.js +1 -1
  447. package/dist/ui/components/Form.d.ts +14 -1
  448. package/dist/ui/components/Form.js +2 -2
  449. package/dist/ui/components/FormField.js +18 -4
  450. package/dist/ui/components/FormField.style.css +43 -3
  451. package/dist/ui/components/GatedPrice.style.css +1 -1
  452. package/dist/ui/components/IconButton.style.css +1 -1
  453. package/dist/ui/components/Input.js +22 -1
  454. package/dist/ui/components/Input.style.css +38 -22
  455. package/dist/ui/components/ListingFilterDrawer.js +1 -1
  456. package/dist/ui/components/ListingToolbar.js +1 -1
  457. package/dist/ui/components/PaginatedSelect.js +0 -0
  458. package/dist/ui/components/Radio.style.css +1 -1
  459. package/dist/ui/components/Repeater.d.ts +53 -0
  460. package/dist/ui/components/Repeater.js +7 -0
  461. package/dist/ui/components/RichTextEditor.d.ts +20 -1
  462. package/dist/ui/components/RichTextEditor.js +23 -2
  463. package/dist/ui/components/Select.style.css +7 -21
  464. package/dist/ui/components/Semantic.js +27 -3
  465. package/dist/ui/components/TagInput.style.css +4 -9
  466. package/dist/ui/components/Textarea.style.css +4 -18
  467. package/dist/ui/components/Toggle.style.css +1 -1
  468. package/dist/ui/components/Typography.d.ts +3 -3
  469. package/dist/ui/components/Typography.js +15 -15
  470. package/dist/ui/components/ViewToggle.style.css +4 -4
  471. package/dist/ui/forms/AddAnotherToggle.d.ts +16 -0
  472. package/dist/ui/forms/AddAnotherToggle.js +56 -0
  473. package/dist/ui/forms/ColorPickerField.js +15 -2
  474. package/dist/ui/forms/FieldCheckbox.js +15 -2
  475. package/dist/ui/forms/FieldInput.d.ts +22 -1
  476. package/dist/ui/forms/FieldInput.js +19 -5
  477. package/dist/ui/forms/FieldLabel.d.ts +35 -0
  478. package/dist/ui/forms/FieldLabel.js +70 -0
  479. package/dist/ui/forms/FieldSelect.d.ts +4 -1
  480. package/dist/ui/forms/FieldSelect.js +27 -5
  481. package/dist/ui/forms/FieldTextarea.d.ts +4 -1
  482. package/dist/ui/forms/FieldTextarea.js +22 -5
  483. package/dist/ui/forms/FormShell.d.ts +17 -1
  484. package/dist/ui/forms/FormShell.js +36 -2
  485. package/dist/ui/forms/FormShell.style.css +41 -33
  486. package/dist/ui/forms/index.d.ts +5 -1
  487. package/dist/ui/forms/index.js +2 -0
  488. package/dist/ui/icons/icon-registry.d.ts +1 -0
  489. package/dist/ui/icons/icon-registry.js +17 -1
  490. package/dist/utils/id-generators.d.ts +80 -0
  491. package/dist/utils/id-generators.js +93 -0
  492. package/dist/utils/search-txt-builders.d.ts +12 -0
  493. package/dist/utils/search-txt-builders.js +17 -0
  494. package/package.json +1 -1
  495. package/scripts/seed-cli.mjs +106 -5
  496. package/dist/features/loyalty/api/admin/loyalty/grant/route.d.ts +0 -12
  497. package/dist/features/loyalty/api/admin/loyalty/grant/route.js +0 -38
  498. package/dist/features/loyalty/api/balance/route.d.ts +0 -12
  499. package/dist/features/loyalty/api/balance/route.js +0 -41
  500. package/dist/features/loyalty/api/earn/route.d.ts +0 -12
  501. package/dist/features/loyalty/api/earn/route.js +0 -38
  502. package/dist/features/loyalty/api/history/route.d.ts +0 -12
  503. package/dist/features/loyalty/api/history/route.js +0 -58
  504. package/dist/features/loyalty/api/redeem/route.d.ts +0 -12
  505. package/dist/features/loyalty/api/redeem/route.js +0 -38
  506. package/dist/features/loyalty/columns/index.d.ts +0 -17
  507. package/dist/features/loyalty/columns/index.js +0 -40
  508. package/dist/features/loyalty/components/CoinsDisplay.d.ts +0 -12
  509. package/dist/features/loyalty/components/CoinsDisplay.js +0 -10
  510. package/dist/features/loyalty/components/index.d.ts +0 -1
  511. package/dist/features/loyalty/components/index.js +0 -1
  512. package/dist/features/loyalty/hooks/useLoyaltyBalance.d.ts +0 -4
  513. package/dist/features/loyalty/hooks/useLoyaltyBalance.js +0 -25
  514. package/dist/features/loyalty/index.d.ts +0 -6
  515. package/dist/features/loyalty/index.js +0 -6
  516. package/dist/features/loyalty/manifest.d.ts +0 -2
  517. package/dist/features/loyalty/manifest.js +0 -16
  518. package/dist/features/loyalty/messages/en.json +0 -19
  519. package/dist/features/loyalty/repository/loyalty.repository.d.ts +0 -8
  520. package/dist/features/loyalty/repository/loyalty.repository.js +0 -22
  521. package/dist/features/loyalty/schemas/index.d.ts +0 -85
  522. package/dist/features/loyalty/schemas/index.js +0 -40
  523. package/dist/features/loyalty/server.d.ts +0 -6
  524. package/dist/features/loyalty/server.js +0 -6
  525. package/dist/features/loyalty/types/index.d.ts +0 -31
  526. package/dist/features/loyalty/types/index.js +0 -1
  527. package/dist/features/loyalty/types/loyalty-config.d.ts +0 -7
  528. package/dist/features/loyalty/types/loyalty-config.js +0 -1
  529. package/dist/features/loyalty/types/loyalty-math.d.ts +0 -9
  530. package/dist/features/loyalty/types/loyalty-math.js +0 -27
  531. package/dist/features/products/components/ProductOwnerQuickActions.d.ts +0 -11
  532. package/dist/features/products/components/ProductOwnerQuickActions.js +0 -120
@@ -53,6 +53,7 @@
53
53
  import Razorpay from "razorpay";
54
54
  import { IPaymentProvider } from "../../contracts/index.js";
55
55
  import { getDefaultCurrency } from "../../core/baseline-resolver.js";
56
+ import { paiseToRupees } from "../../core/money.js";
56
57
  import { verifyWebhookSignature } from "./signature.js";
57
58
  export { verifyPaymentSignature, verifyWebhookSignature, } from "./signature.js";
58
59
  /** Razorpay's own order status vocabulary → the contract's. */
@@ -229,4 +230,102 @@ export class RazorpayProvider extends IPaymentProvider {
229
230
  metadata: order.notes,
230
231
  };
231
232
  }
233
+ /*
234
+ * ── DISPUTES ──────────────────────────────────────────────────────────────
235
+ *
236
+ * Razorpay is the only registered provider that HAS disputes, so this is the
237
+ * only real implementation of the three.
238
+ *
239
+ * 🛑 Two unit conversions, both easy to get wrong and both silent when wrong:
240
+ *
241
+ * amount / amount_deducted — currency SUBUNITS → decimal rupees.
242
+ * respond_by / created_at — Unix timestamp in SECONDS → Date.
243
+ *
244
+ * The second is the nastier one. `new Date(1761000000)` is 21 January 1970,
245
+ * so a missed `* 1000` does not throw and does not look like a unit bug — it
246
+ * looks like corrupt data, and on a dispute it would make a live `respondBy`
247
+ * deadline sort as 55 years overdue, which an escalation query would then
248
+ * either flood on or ignore. The existing `refund`/`getOrder` methods above
249
+ * already multiply, which is the precedent to copy.
250
+ */
251
+ /**
252
+ * Typed STRUCTURALLY rather than against the SDK's `Disputes.RazorpayDispute`
253
+ * namespace type.
254
+ *
255
+ * Two reasons: the namespace is declared inside `types/disputes.d.ts` and is
256
+ * not part of the package's documented export surface, so importing it couples
257
+ * us to an internal; and naming only the fields we read makes the mapping
258
+ * auditable against the SDK by eye. Every field below was checked against the
259
+ * installed 2.9.8 declaration — `id`, `payment_id`, `amount`, `currency`,
260
+ * `amount_deducted`, `reason_code`, `respond_by`, `status`, `phase`,
261
+ * `created_at` — rather than recalled.
262
+ *
263
+ * `status` and `phase` are `string` in the SDK too, so nothing is lost by not
264
+ * importing it.
265
+ */
266
+ toDispute(d) {
267
+ return {
268
+ id: String(d.id),
269
+ paymentId: String(d.payment_id),
270
+ amount: paiseToRupees(Number(d.amount)),
271
+ currency: String(d.currency),
272
+ amountDeducted: paiseToRupees(Number(d.amount_deducted ?? 0)),
273
+ reasonCode: String(d.reason_code ?? ""),
274
+ respondBy: new Date(Number(d.respond_by) * 1000),
275
+ status: String(d.status ?? ""),
276
+ phase: String(d.phase ?? ""),
277
+ createdAt: new Date(Number(d.created_at) * 1000),
278
+ gateway: this.name,
279
+ };
280
+ }
281
+ /**
282
+ * Payments in a window, for reconciliation.
283
+ *
284
+ * 🛑 `from`/`to` are Unix timestamps in **SECONDS** and `count` is capped at
285
+ * **100 by the API** (verified in `RazorpayPaginationOptions`). The cap is
286
+ * NOT raised by asking: a caller wanting more must page with `skip`, and this
287
+ * method deliberately does not, because an unbounded page loop inside a 540 s
288
+ * function is how a reconciler turns into a timeout. At this project's volume
289
+ * one page is several days of payments; the count is logged so the day that
290
+ * stops being true is visible rather than silently truncating.
291
+ */
292
+ async listPayments(opts) {
293
+ const result = await this.razorpay.payments.all({
294
+ from: Math.floor(opts.from.getTime() / 1000),
295
+ to: Math.ceil(opts.to.getTime() / 1000),
296
+ count: Math.min(opts.limit ?? 100, 100),
297
+ });
298
+ return (result.items ?? []).map((p) => {
299
+ const captured = Number(p.created_at);
300
+ return {
301
+ id: String(p.id),
302
+ ...(p.order_id ? { orderId: String(p.order_id) } : {}),
303
+ amount: paiseToRupees(Number(p.amount)),
304
+ currency: String(p.currency),
305
+ status: String(p.status),
306
+ amountRefunded: paiseToRupees(Number(p.amount_refunded ?? 0)),
307
+ ...(p.refund_status ? { refundStatus: String(p.refund_status) } : {}),
308
+ ...(Number.isFinite(captured) ? { capturedAt: new Date(captured * 1000) } : {}),
309
+ gateway: this.name,
310
+ };
311
+ });
312
+ }
313
+ async getDispute(disputeId) {
314
+ return this.toDispute(await this.razorpay.disputes.fetch(disputeId));
315
+ }
316
+ async listDisputes() {
317
+ const result = await this.razorpay.disputes.all();
318
+ return (result.items ?? []).map((d) => this.toDispute(d));
319
+ }
320
+ /**
321
+ * Accept liability — irreversible.
322
+ *
323
+ * `confirmIrrevocable` is required by the contract and is not read here, and
324
+ * that is the point: its job is to make the CALLER state intent at the call
325
+ * site. A runtime check would be theatre, since the type already makes
326
+ * `false` uncompilable.
327
+ */
328
+ async acceptDispute(disputeId, _confirmIrrevocable) {
329
+ return this.toDispute(await this.razorpay.disputes.accept(disputeId));
330
+ }
232
331
  }
@@ -99,6 +99,24 @@ export declare class ShiprocketShippingProvider extends IShippingProvider {
99
99
  private call;
100
100
  /** Their order payload wants the address flattened across many keys. */
101
101
  private addressFields;
102
+ /**
103
+ * 🛑 WIRING A CALLER FOR THIS OWES ONE EXTRA WRITE: set
104
+ * `order.platformBookedShipment = true` in the same commit.
105
+ *
106
+ * That flag is the gate `isReimbursableShipment()`
107
+ * (`_internal/shared/shipping/quote.ts`) uses to decide whether a seller may
108
+ * be reimbursed for postage. It FAILS OPEN — absent means "the seller shipped
109
+ * it themselves", which is correct and deliberate, because a self-shipped
110
+ * parcel has no flag to set and a fail-closed gate would refuse every
111
+ * legitimate claim.
112
+ *
113
+ * Measured 2026-10-21: this method has **no callers**, and the flag has
114
+ * **no writers**. Those two facts cancel out — there are no platform-booked
115
+ * parcels, so nothing is wrongly reimbursed. Wire this without the flag and
116
+ * they stop cancelling out: the platform pays the courier here, then
117
+ * reimburses the seller for that same spend on approval. Postage paid twice,
118
+ * silently, because the gate has no way to know we booked it.
119
+ */
102
120
  createShipment(data: CreateShipmentInput): Promise<Shipment>;
103
121
  trackShipment(trackingId: string): Promise<TrackingInfo>;
104
122
  cancelShipment(shipmentId: string): Promise<void>;
@@ -249,6 +249,24 @@ export class ShiprocketShippingProvider extends IShippingProvider {
249
249
  [`${p}_phone`]: a.phone,
250
250
  };
251
251
  }
252
+ /**
253
+ * 🛑 WIRING A CALLER FOR THIS OWES ONE EXTRA WRITE: set
254
+ * `order.platformBookedShipment = true` in the same commit.
255
+ *
256
+ * That flag is the gate `isReimbursableShipment()`
257
+ * (`_internal/shared/shipping/quote.ts`) uses to decide whether a seller may
258
+ * be reimbursed for postage. It FAILS OPEN — absent means "the seller shipped
259
+ * it themselves", which is correct and deliberate, because a self-shipped
260
+ * parcel has no flag to set and a fail-closed gate would refuse every
261
+ * legitimate claim.
262
+ *
263
+ * Measured 2026-10-21: this method has **no callers**, and the flag has
264
+ * **no writers**. Those two facts cancel out — there are no platform-booked
265
+ * parcels, so nothing is wrongly reimbursed. Wire this without the flag and
266
+ * they stop cancelling out: the platform pays the courier here, then
267
+ * reimburses the seller for that same spend on approval. Postage paid twice,
268
+ * silently, because the gate has no way to know we booked it.
269
+ */
252
270
  async createShipment(data) {
253
271
  const body = {
254
272
  order_id: data.orderId,
@@ -2122,11 +2122,11 @@ export declare const SCHEMAS: {
2122
2122
  minAmount: import("zod").ZodEffects<import("zod").ZodNumber, number, number>;
2123
2123
  discountValue: import("zod").ZodNumber;
2124
2124
  }, "strip", import("zod").ZodTypeAny, {
2125
- discountValue: number;
2126
2125
  minAmount: number;
2127
- }, {
2128
2126
  discountValue: number;
2127
+ }, {
2129
2128
  minAmount: number;
2129
+ discountValue: number;
2130
2130
  }>, "many">>;
2131
2131
  usage: import("zod").ZodObject<{
2132
2132
  totalLimit: import("zod").ZodOptional<import("zod").ZodNumber>;
@@ -2265,8 +2265,8 @@ export declare const SCHEMAS: {
2265
2265
  applicableCategories?: string[] | undefined;
2266
2266
  } | undefined;
2267
2267
  tiers?: {
2268
- discountValue: number;
2269
2268
  minAmount: number;
2269
+ discountValue: number;
2270
2270
  }[] | undefined;
2271
2271
  }, {
2272
2272
  code: string;
@@ -2323,8 +2323,8 @@ export declare const SCHEMAS: {
2323
2323
  applicableCategories?: string[] | undefined;
2324
2324
  } | undefined;
2325
2325
  tiers?: {
2326
- discountValue: number;
2327
2326
  minAmount: number;
2327
+ discountValue: number;
2328
2328
  }[] | undefined;
2329
2329
  }>;
2330
2330
  readonly couponUsage: import("zod").ZodObject<{
@@ -2871,6 +2871,7 @@ export declare const SCHEMAS: {
2871
2871
  amount: import("zod").ZodEffects<import("zod").ZodNumber, number, number>;
2872
2872
  itemIds: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString, "many">>;
2873
2873
  reason: import("zod").ZodString;
2874
+ reasonCode: import("zod").ZodOptional<import("zod").ZodString>;
2874
2875
  refundedAt: import("zod").ZodUnion<[import("zod").ZodDate, import("zod").ZodString, import("zod").ZodObject<{
2875
2876
  toDate: import("zod").ZodFunction<import("zod").ZodTuple<[], import("zod").ZodUnknown>, import("zod").ZodDate>;
2876
2877
  }, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{
@@ -2879,7 +2880,12 @@ export declare const SCHEMAS: {
2879
2880
  toDate: import("zod").ZodFunction<import("zod").ZodTuple<[], import("zod").ZodUnknown>, import("zod").ZodDate>;
2880
2881
  }, import("zod").ZodTypeAny, "passthrough">>]>;
2881
2882
  refundedBy: import("zod").ZodString;
2883
+ status: import("zod").ZodOptional<import("zod").ZodEnum<["reserved", "processed", "failed"]>>;
2884
+ failureReason: import("zod").ZodOptional<import("zod").ZodString>;
2885
+ gatewayRefundId: import("zod").ZodOptional<import("zod").ZodString>;
2886
+ gateway: import("zod").ZodOptional<import("zod").ZodString>;
2882
2887
  phonepeRefundId: import("zod").ZodOptional<import("zod").ZodString>;
2888
+ razorpayRefundId: import("zod").ZodOptional<import("zod").ZodString>;
2883
2889
  manualTransactionId: import("zod").ZodOptional<import("zod").ZodString>;
2884
2890
  proofDocumentUrl: import("zod").ZodOptional<import("zod").ZodString>;
2885
2891
  proofDocumentMimeType: import("zod").ZodOptional<import("zod").ZodString>;
@@ -2893,8 +2899,14 @@ export declare const SCHEMAS: {
2893
2899
  toDate: import("zod").ZodFunction<import("zod").ZodTuple<[], import("zod").ZodUnknown>, import("zod").ZodDate>;
2894
2900
  }, import("zod").ZodTypeAny, "passthrough">;
2895
2901
  refundedBy: string;
2902
+ status?: "failed" | "processed" | "reserved" | undefined;
2903
+ failureReason?: string | undefined;
2904
+ gateway?: string | undefined;
2896
2905
  itemIds?: string[] | undefined;
2906
+ reasonCode?: string | undefined;
2907
+ gatewayRefundId?: string | undefined;
2897
2908
  phonepeRefundId?: string | undefined;
2909
+ razorpayRefundId?: string | undefined;
2898
2910
  manualTransactionId?: string | undefined;
2899
2911
  proofDocumentUrl?: string | undefined;
2900
2912
  proofDocumentMimeType?: string | undefined;
@@ -2908,8 +2920,14 @@ export declare const SCHEMAS: {
2908
2920
  toDate: import("zod").ZodFunction<import("zod").ZodTuple<[], import("zod").ZodUnknown>, import("zod").ZodDate>;
2909
2921
  }, import("zod").ZodTypeAny, "passthrough">;
2910
2922
  refundedBy: string;
2923
+ status?: "failed" | "processed" | "reserved" | undefined;
2924
+ failureReason?: string | undefined;
2925
+ gateway?: string | undefined;
2911
2926
  itemIds?: string[] | undefined;
2927
+ reasonCode?: string | undefined;
2928
+ gatewayRefundId?: string | undefined;
2912
2929
  phonepeRefundId?: string | undefined;
2930
+ razorpayRefundId?: string | undefined;
2913
2931
  manualTransactionId?: string | undefined;
2914
2932
  proofDocumentUrl?: string | undefined;
2915
2933
  proofDocumentMimeType?: string | undefined;
@@ -3083,8 +3101,14 @@ export declare const SCHEMAS: {
3083
3101
  toDate: import("zod").ZodFunction<import("zod").ZodTuple<[], import("zod").ZodUnknown>, import("zod").ZodDate>;
3084
3102
  }, import("zod").ZodTypeAny, "passthrough">;
3085
3103
  refundedBy: string;
3104
+ status?: "failed" | "processed" | "reserved" | undefined;
3105
+ failureReason?: string | undefined;
3106
+ gateway?: string | undefined;
3086
3107
  itemIds?: string[] | undefined;
3108
+ reasonCode?: string | undefined;
3109
+ gatewayRefundId?: string | undefined;
3087
3110
  phonepeRefundId?: string | undefined;
3111
+ razorpayRefundId?: string | undefined;
3088
3112
  manualTransactionId?: string | undefined;
3089
3113
  proofDocumentUrl?: string | undefined;
3090
3114
  proofDocumentMimeType?: string | undefined;
@@ -3231,8 +3255,14 @@ export declare const SCHEMAS: {
3231
3255
  toDate: import("zod").ZodFunction<import("zod").ZodTuple<[], import("zod").ZodUnknown>, import("zod").ZodDate>;
3232
3256
  }, import("zod").ZodTypeAny, "passthrough">;
3233
3257
  refundedBy: string;
3258
+ status?: "failed" | "processed" | "reserved" | undefined;
3259
+ failureReason?: string | undefined;
3260
+ gateway?: string | undefined;
3234
3261
  itemIds?: string[] | undefined;
3262
+ reasonCode?: string | undefined;
3263
+ gatewayRefundId?: string | undefined;
3235
3264
  phonepeRefundId?: string | undefined;
3265
+ razorpayRefundId?: string | undefined;
3236
3266
  manualTransactionId?: string | undefined;
3237
3267
  proofDocumentUrl?: string | undefined;
3238
3268
  proofDocumentMimeType?: string | undefined;
@@ -4593,6 +4623,7 @@ export declare const SCHEMAS: {
4593
4623
  seoTitle: import("zod").ZodOptional<import("zod").ZodString>;
4594
4624
  seoDescription: import("zod").ZodOptional<import("zod").ZodString>;
4595
4625
  barcodeId: import("zod").ZodOptional<import("zod").ZodString>;
4626
+ sku: import("zod").ZodOptional<import("zod").ZodString>;
4596
4627
  startingBid: import("zod").ZodOptional<import("zod").ZodNumber>;
4597
4628
  reservePrice: import("zod").ZodOptional<import("zod").ZodNumber>;
4598
4629
  buyNowPrice: import("zod").ZodOptional<import("zod").ZodNumber>;
@@ -4683,6 +4714,7 @@ export declare const SCHEMAS: {
4683
4714
  seoTitle: import("zod").ZodOptional<import("zod").ZodString>;
4684
4715
  seoDescription: import("zod").ZodOptional<import("zod").ZodString>;
4685
4716
  barcodeId: import("zod").ZodOptional<import("zod").ZodString>;
4717
+ sku: import("zod").ZodOptional<import("zod").ZodString>;
4686
4718
  startingBid: import("zod").ZodOptional<import("zod").ZodNumber>;
4687
4719
  reservePrice: import("zod").ZodOptional<import("zod").ZodNumber>;
4688
4720
  buyNowPrice: import("zod").ZodOptional<import("zod").ZodNumber>;
@@ -4773,6 +4805,7 @@ export declare const SCHEMAS: {
4773
4805
  seoTitle: import("zod").ZodOptional<import("zod").ZodString>;
4774
4806
  seoDescription: import("zod").ZodOptional<import("zod").ZodString>;
4775
4807
  barcodeId: import("zod").ZodOptional<import("zod").ZodString>;
4808
+ sku: import("zod").ZodOptional<import("zod").ZodString>;
4776
4809
  startingBid: import("zod").ZodOptional<import("zod").ZodNumber>;
4777
4810
  reservePrice: import("zod").ZodOptional<import("zod").ZodNumber>;
4778
4811
  buyNowPrice: import("zod").ZodOptional<import("zod").ZodNumber>;
@@ -5282,16 +5315,16 @@ export declare const SCHEMAS: {
5282
5315
  status: import("zod").ZodEnum<["under-review", "actioned", "dismissed"]>;
5283
5316
  resolution: import("zod").ZodOptional<import("zod").ZodString>;
5284
5317
  }, "strict", import("zod").ZodTypeAny, {
5285
- status: "dismissed" | "under-review" | "actioned";
5318
+ status: "under-review" | "actioned" | "dismissed";
5286
5319
  resolution?: string | undefined;
5287
5320
  }, {
5288
- status: "dismissed" | "under-review" | "actioned";
5321
+ status: "under-review" | "actioned" | "dismissed";
5289
5322
  resolution?: string | undefined;
5290
5323
  }>, {
5291
- status: "dismissed" | "under-review" | "actioned";
5324
+ status: "under-review" | "actioned" | "dismissed";
5292
5325
  resolution?: string | undefined;
5293
5326
  }, {
5294
- status: "dismissed" | "under-review" | "actioned";
5327
+ status: "under-review" | "actioned" | "dismissed";
5295
5328
  resolution?: string | undefined;
5296
5329
  }>;
5297
5330
  readonly reportCreate: import("zod").ZodObject<{
@@ -6044,7 +6077,7 @@ export declare const SCHEMAS: {
6044
6077
  phones: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString, "many">>;
6045
6078
  upiIds: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString, "many">>;
6046
6079
  emails: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString, "many">>;
6047
- scamType: import("zod").ZodString;
6080
+ scamType: import("zod").ZodEffects<import("zod").ZodString, import("..").ScamType, string>;
6048
6081
  scamPlatform: import("zod").ZodString;
6049
6082
  amountLost: import("zod").ZodOptional<import("zod").ZodNumber>;
6050
6083
  itemInvolved: import("zod").ZodOptional<import("zod").ZodString>;
@@ -6054,7 +6087,7 @@ export declare const SCHEMAS: {
6054
6087
  }, "strip", import("zod").ZodTypeAny, {
6055
6088
  displayName: string;
6056
6089
  description: string;
6057
- scamType: string;
6090
+ scamType: import("..").ScamType;
6058
6091
  scamPlatform: string;
6059
6092
  agreed: true;
6060
6093
  reportedByAnon?: boolean | undefined;
@@ -6078,7 +6111,7 @@ export declare const SCHEMAS: {
6078
6111
  }>, {
6079
6112
  displayName: string;
6080
6113
  description: string;
6081
- scamType: string;
6114
+ scamType: import("..").ScamType;
6082
6115
  scamPlatform: string;
6083
6116
  agreed: true;
6084
6117
  reportedByAnon?: boolean | undefined;
@@ -69,6 +69,8 @@ export { getCategoryForDetail, listRootCategories, listFeaturedCategories, listM
69
69
  export { getGroupedListingForDetail, getGroupedListingWithItems, listGroupedListings, listFeaturedGroupedListings, listSitemapGroupedListings, getGroupsForProduct, getGroupsWithItemsForProduct, GROUPED_LISTINGS_PAGE_SIZE, GROUPED_LISTINGS_FEATURED_LIMIT, GROUPED_LISTINGS_SITEMAP_LIMIT, buildGroupedListingMetadata, renderGroupedListingOg, type GroupedListingWithItems, type ListGroupedListingsParams, type SitemapGroupedListing, type GroupedListingMetadataOptions, } from "./_internal/server/features/grouped/index";
70
70
  export { createCheckoutOrderAction, attachPaymentAction, verifyAndPlaceGatewayOrderAction, previewCheckoutPricing, resolveShippingCost, formatShippingAddress, CHECKOUT_DEFAULT_COMMISSIONS, CHECKOUT_PAYMENT_METHODS, type CreateCheckoutOrderInput, type VerifyAndPlaceGatewayOrderInput, type CheckoutOrderResult, type CheckoutPaymentMethod, type CheckoutPricingPreviewInput, type CheckoutPricingPreview, } from "./_internal/server/features/checkout/index";
71
71
  export { unitPriceFor, lineTotalFor, sumGroupGst, computePreOrderDepositAmount, type GroupGstSummary, type GstRateSlice, } from "./_internal/shared/checkout/order-math";
72
+ export { computeGroupCouponDiscount, computeCartCouponDiscount, type GroupCouponDiscountResult, } from "./_internal/shared/checkout/coupon-discount";
73
+ export { refundCapacity, refundableBase, committedRefundTotal, platformFeeWithheld, wouldBeFullRefund, MONEY_EPSILON, type RefundCapacity, type RefundableOrderLike, } from "./_internal/shared/checkout/refundable-base";
72
74
  export { processRefundAction, type ProcessRefundInput, } from "./_internal/server/features/refunds/actions";
73
75
  export { getSublistingCategoryForDetail } from "./_internal/server/features/sublisting-categories/index";
74
76
  export { getStoreForDetail, listStoreProductsInitial, listStoreAuctionsInitial, listStorePreOrdersInitial, listSitemapStores, STORES_PAGE_SIZE, STORES_PRODUCTS_PAGE_SIZE, STORES_SITEMAP_LIMIT, STORES_FEATURED_LIMIT, } from "./_internal/server/features/stores/index";
@@ -107,6 +107,33 @@ export { createCheckoutOrderAction, attachPaymentAction, verifyAndPlaceGatewayOr
107
107
  // order recorded none — with the verify-side mismatch guard omitting it too, so
108
108
  // the three were consistently wrong and the undercharge was undetectable.
109
109
  export { unitPriceFor, lineTotalFor, sumGroupGst, computePreOrderDepositAmount, } from "./_internal/shared/checkout/order-math.js";
110
+ /*
111
+ * The coupon discount, exported for the SAME reason `sumGroupGst` above was —
112
+ * and it is the third defect of that exact shape in this one route.
113
+ *
114
+ * `/api/payment/create-order` decides what the gateway CAPTURES, and it had no
115
+ * coupon term anywhere in the file (measured: zero occurrences). So a buyer
116
+ * with a coupon was shown ₹X−discount, charged ₹X, and had ₹X−discount
117
+ * recorded against their order. The post-capture guard is one-sided
118
+ * (`paid < expected − 1`), so an OVER-capture never trips it — which is why
119
+ * this survived: every number inside our own system agreed, and only the
120
+ * buyer's card statement disagreed.
121
+ *
122
+ * Pure math, no Firestore, no server-only imports — same contract as the
123
+ * order-math block above.
124
+ */
125
+ export { computeGroupCouponDiscount, computeCartCouponDiscount, } from "./_internal/shared/checkout/coupon-discount.js";
126
+ /*
127
+ * Refund capacity. Exported because the admin refund ROUTE carried its own
128
+ * copy of the `amount >= totalPrice` test (D3) — a second answer to "is this
129
+ * refund full", already wrong, in a file that cannot deep-import
130
+ * `_internal/shared`. One implementation, or they drift again.
131
+ *
132
+ * `platformFeeWithheld` is the single worst money defect's fix (D32): it
133
+ * returns the fee ACTUALLY CHARGED, never a recomputed percentage, which is
134
+ * how a ₹5,000 order came to withhold ₹118 from a buyer who paid ₹11.80.
135
+ */
136
+ export { refundCapacity, refundableBase, committedRefundTotal, platformFeeWithheld, wouldBeFullRefund, MONEY_EPSILON, } from "./_internal/shared/checkout/refundable-base.js";
110
137
  // S-SBUNI-RULES: refund action
111
138
  export { processRefundAction, } from "./_internal/server/features/refunds/actions.js";
112
139
  // S3: sublisting categories data layer
package/dist/server.d.ts CHANGED
@@ -19,6 +19,26 @@ export type { DegradedReadReport } from "./errors/safe-read";
19
19
  export { ServerErrorsRepository, serverErrorsRepository, } from "./features/server-errors/repository/server-errors.repository";
20
20
  export { SERVER_ERRORS_COLLECTION, SERVER_ERROR_FIELDS, SERVER_ERROR_STACK_MAX_BYTES, SERVER_ERROR_RETENTION_DAYS, } from "./features/server-errors/schemas/firestore";
21
21
  export type { ServerErrorDocument, ServerErrorSource, } from "./features/server-errors/schemas/firestore";
22
+ export { GatewayEventsRepository, gatewayEventsRepository, } from "./features/gateway-events/repository/gateway-events.repository";
23
+ export type { GatewayEventClaimInput, GatewayEventClaimResult, GatewayEventSettleInput, } from "./features/gateway-events/repository/gateway-events.repository";
24
+ export { GATEWAY_EVENTS_COLLECTION, GATEWAY_EVENT_FIELDS, GATEWAY_EVENT_RETENTION_DAYS, GATEWAY_EVENT_LEASE_SECONDS, GATEWAY_EVENT_MAX_ATTEMPTS, GATEWAY_EVENT_PAYLOAD_MAX_BYTES, GATEWAY_EVENT_ERROR_MAX_BYTES, createGatewayEventId, } from "./features/gateway-events/schemas/firestore";
25
+ export type { GatewayEventDocument, GatewayEventKind, GatewayEventStatus, } from "./features/gateway-events/schemas/firestore";
26
+ export { ingestGatewayEvent, settleGatewayEvent, statusForDispatch, resolveDuplicateDelivery, redactGatewayPayload, } from "./_internal/server/features/gateway-events";
27
+ export type { IngestGatewayEventInput, SettleGatewayEventInput, DuplicateAction, DuplicateResolution, } from "./_internal/server/features/gateway-events";
28
+ export { PaymentCasesRepository, paymentCasesRepository, } from "./features/payment-cases/repository/payment-cases.repository";
29
+ export type { OpenCaseInput, OpenCaseResult, ResolveCaseInput, } from "./features/payment-cases/repository/payment-cases.repository";
30
+ export { PAYMENT_CASES_COLLECTION, PAYMENT_CASE_FIELDS, PAYMENT_CASE_KINDS, PAYMENT_CASE_STATUSES, PAYMENT_CASE_ACTIVE_STATUSES, PAYMENT_CASE_SEVERITY_RANK, PAYMENT_CASE_RESOLUTION_MIN, createPaymentCaseId, } from "./features/payment-cases/schemas/firestore";
31
+ export type { PaymentCaseDocument, PaymentCaseKind, PaymentCaseStatus, PaymentCaseSeverity, } from "./features/payment-cases/schemas/firestore";
32
+ export { ingestDispute, reconcileDisputes, DISPUTE_EVENT_PREFIX, } from "./_internal/server/features/payment-cases";
33
+ export type { DisputeWebhookEntity } from "./_internal/server/features/payment-cases";
34
+ export { ObligationsRepository, obligationsRepository, } from "./features/obligations/repository/obligations.repository";
35
+ export type { OpenObligationInput, CloseObligationInput, } from "./features/obligations/repository/obligations.repository";
36
+ export { ProtectionClaimsRepository, protectionClaimsRepository, } from "./features/protection-claims/repository/protection-claims.repository";
37
+ export type { FileClaimInput } from "./features/protection-claims/repository/protection-claims.repository";
38
+ export { PROTECTION_CLAIMS_COLLECTION, PROTECTION_CLAIM_FIELDS, PROTECTION_CLAIM_ACTIVE_STATUSES, PROTECTION_CLAIM_DETAIL_MIN, PROTECTION_CLAIM_DETAIL_MAX, ALL_PROTECTION_CLAIM_STATUSES, ALL_PROTECTION_CLAIM_REASONS, REASON_TO_KIND, createProtectionClaimId, } from "./features/protection-claims/schemas/firestore";
39
+ export type { ProtectionClaimDocument, ProtectionClaimStatus, ProtectionClaimReason, } from "./features/protection-claims/schemas/firestore";
40
+ export { fileProtectionClaimAction, adjudicateProtectionClaimAction, getMyProtectionClaimsAction, canClaimProtection, } from "./_internal/server/features/protection-claims";
41
+ export type { FileProtectionClaimInput } from "./_internal/server/features/protection-claims";
22
42
  export { wrapAction, isOk, unwrap, } from "./_internal/shared/types/action-result";
23
43
  export type { ActionResult } from "./_internal/shared/types/action-result";
24
44
  export { setActionErrorReporter, hasActionErrorReporter, } from "./_internal/shared/types/action-error-reporter";
@@ -192,6 +212,23 @@ export { updateCategory } from "./features/categories/server";
192
212
  export { sendCheckoutValueOtp, verifyCheckoutValueOtp, isCheckoutValueOtpVerified, } from "./features/checkout/server";
193
213
  export { FailedCheckoutRepository, failedCheckoutRepository } from "./features/checkout/server";
194
214
  export { reconcileOrderShipping } from "./_internal/server/features/shipping/reconcile";
215
+ export { submitShippingEvidence, approveShippingReimbursement, } from "./_internal/server/features/shipping/reimbursement";
216
+ export type { SubmitShippingEvidenceInput, ApproveShippingReimbursementInput, } from "./_internal/server/features/shipping/reimbursement";
217
+ export { cancelOrderWithRefund } from "./_internal/server/features/orders/cancellation-refund";
218
+ export type { CancelWithRefundOptions, CancelWithRefundResult, } from "./_internal/server/features/orders/cancellation-refund";
219
+ /**
220
+ * `admin_adjustment`'s first human writer (D48).
221
+ *
222
+ * Public for the same reason `cancelOrderWithRefund` above is: the consumer
223
+ * owns `POST /api/admin/points`, and **there is no `./_internal/*` subpath**, so
224
+ * a consumer route cannot reach it any other way.
225
+ *
226
+ * 🛑 Export the ACTION, not the repository's `append`. `append` would let a
227
+ * route write any kind with any actor; this function fixes the kind, applies
228
+ * the credit-only expiry, writes the `adminAuditLog` row and notifies the
229
+ * buyer. A route reaching past it would silently skip three of those.
230
+ */
231
+ export { adjustUserPoints } from "./_internal/server/features/points/adjust";
195
232
  export { pointsRepository, PointsRepository } from "./features/points/repository/points.repository";
196
233
  export type { FailedCheckoutMeta, FailedPaymentMeta } from "./features/checkout/server";
197
234
  export { EmailButton, EmailColumn, EmailContainer, EmailDivider, EmailDoc, EmailFooter, EmailHeader, EmailImage, EmailLink, EmailRow, } from "./features/email";
@@ -534,6 +571,7 @@ export type { ActionIndexValidationContext, ActionIndexValidationIssue, } from "
534
571
  export { ActionIndexRepository, actionIndexRepository, } from "./features/search/action-index/repository";
535
572
  export type { ActionIndexDocument } from "./features/search/action-index/repository";
536
573
  export { REFUND_COPY } from "./_internal/shared/features/orders/refund-copy";
574
+ export { wouldBeFullRefund } from "./_internal/shared/checkout/refundable-base";
537
575
  export { RETURN_REASON, FINAL_SALE_EXEMPT_REASONS, RETURN_REASON_LABEL, RETURN_REASON_GROUP_LABEL, isFinalSaleExempt, isReturnReason, selectableReturnReasons, } from "./_internal/shared/features/orders/return-reasons";
538
576
  export type { ReturnReason } from "./_internal/shared/features/orders/return-reasons";
539
577
  export { draftToProductInput, productToDraft, } from "./features/seller/utils/product-draft-mapping";
@@ -562,3 +600,8 @@ export { configurePlatformSupplier, getPlatformSupplier, resetPlatformSupplier,
562
600
  export type { PlatformSupplierIdentity } from "./_internal/shared/features/site-settings/supplier-of-record";
563
601
  export { ShiprocketShippingProvider } from "./providers/shipping-shiprocket/index";
564
602
  export type { ShiprocketConfig } from "./providers/shipping-shiprocket/index";
603
+ export { fileGrievanceAction, recordGrievanceFirstResponseAction, } from "./_internal/server/features/grievance";
604
+ export type { FileGrievanceInput } from "./_internal/server/features/grievance";
605
+ export { GRIEVANCE_PERIODS } from "./features/support/schemas/firestore";
606
+ export { getRateableItemsAction, rateOrderItemAction, markOrderCompleteAction, } from "./_internal/server/features/order-completion";
607
+ export type { RateableOrderItem, RateOrderItemInput, } from "./_internal/server/features/order-completion";
package/dist/server.js CHANGED
@@ -51,6 +51,44 @@ export { safeRead, installDegradedReadReporter, } from "./errors/safe-read.js";
51
51
  // Used by routeHandler, wrapJobHandler (workstream 14), and the safeRead reporter.
52
52
  export { ServerErrorsRepository, serverErrorsRepository, } from "./features/server-errors/repository/server-errors.repository.js";
53
53
  export { SERVER_ERRORS_COLLECTION, SERVER_ERROR_FIELDS, SERVER_ERROR_STACK_MAX_BYTES, SERVER_ERROR_RETENTION_DAYS, } from "./features/server-errors/schemas/firestore.js";
54
+ /*
55
+ * [SERVER-ONLY] gatewayEvents — the durable inbox for payment-gateway webhooks.
56
+ *
57
+ * Exported from `server.ts` ONLY, never `index.ts`. The repository's import
58
+ * chain reaches `firebase-admin` through `providers/db-firebase`, and a symbol
59
+ * reachable from the main barrel drags that into the CLIENT bundle — which
60
+ * fails the Turbopack production build on every page (Root Cause #6/#24), since
61
+ * `firebase-admin/app` is a static top-level import.
62
+ */
63
+ export { GatewayEventsRepository, gatewayEventsRepository, } from "./features/gateway-events/repository/gateway-events.repository.js";
64
+ export { GATEWAY_EVENTS_COLLECTION, GATEWAY_EVENT_FIELDS, GATEWAY_EVENT_RETENTION_DAYS, GATEWAY_EVENT_LEASE_SECONDS, GATEWAY_EVENT_MAX_ATTEMPTS, GATEWAY_EVENT_PAYLOAD_MAX_BYTES, GATEWAY_EVENT_ERROR_MAX_BYTES, createGatewayEventId, } from "./features/gateway-events/schemas/firestore.js";
65
+ export { ingestGatewayEvent, settleGatewayEvent, statusForDispatch, resolveDuplicateDelivery, redactGatewayPayload, } from "./_internal/server/features/gateway-events/index.js";
66
+ /*
67
+ * [SERVER-ONLY] paymentCases — the one operator queue for money at risk.
68
+ *
69
+ * Same reason as gatewayEvents above: the repository's chain reaches
70
+ * `firebase-admin`, so this must never appear in `index.ts`.
71
+ */
72
+ export { PaymentCasesRepository, paymentCasesRepository, } from "./features/payment-cases/repository/payment-cases.repository.js";
73
+ export { PAYMENT_CASES_COLLECTION, PAYMENT_CASE_FIELDS, PAYMENT_CASE_KINDS, PAYMENT_CASE_STATUSES, PAYMENT_CASE_ACTIVE_STATUSES, PAYMENT_CASE_SEVERITY_RANK, PAYMENT_CASE_RESOLUTION_MIN, createPaymentCaseId, } from "./features/payment-cases/schemas/firestore.js";
74
+ export { ingestDispute, reconcileDisputes, DISPUTE_EVENT_PREFIX, } from "./_internal/server/features/payment-cases/index.js";
75
+ /*
76
+ * [SERVER-ONLY] obligations — deadlines with money consequences.
77
+ *
78
+ * The REPOSITORY is server-only (its chain reaches firebase-admin). The pure
79
+ * `deadlinesFor` / `resolveDueAt` helpers and the policy registry go in the
80
+ * MAIN barrel instead, because a buyer page rendering "Dispatch by Thu 3 Nov"
81
+ * is exactly the point of them being pure — see `index.ts`.
82
+ */
83
+ export { ObligationsRepository, obligationsRepository, } from "./features/obligations/repository/obligations.repository.js";
84
+ /*
85
+ * [SERVER-ONLY] protectionClaims — Phase 6. The first callers
86
+ * `adjudicateClaim()` and `protectionAvailability()` have ever had: we charge
87
+ * 2% / 3% for cover whose entire decision layer sat uncalled (D11).
88
+ */
89
+ export { ProtectionClaimsRepository, protectionClaimsRepository, } from "./features/protection-claims/repository/protection-claims.repository.js";
90
+ export { PROTECTION_CLAIMS_COLLECTION, PROTECTION_CLAIM_FIELDS, PROTECTION_CLAIM_ACTIVE_STATUSES, PROTECTION_CLAIM_DETAIL_MIN, PROTECTION_CLAIM_DETAIL_MAX, ALL_PROTECTION_CLAIM_STATUSES, ALL_PROTECTION_CLAIM_REASONS, REASON_TO_KIND, createProtectionClaimId, } from "./features/protection-claims/schemas/firestore.js";
91
+ export { fileProtectionClaimAction, adjudicateProtectionClaimAction, getMyProtectionClaimsAction, canClaimProtection, } from "./_internal/server/features/protection-claims/index.js";
54
92
  // [SERVER-ONLY] ActionResult envelope + wrapAction helper for "use server" functions.
55
93
  // Mirrors the routeHandler envelope so client wrappers consume both surfaces uniformly.
56
94
  export { wrapAction, isOk, unwrap, } from "./_internal/shared/types/action-result.js";
@@ -687,6 +725,36 @@ export { FailedCheckoutRepository, failedCheckoutRepository } from "./features/c
687
725
  * place a parcel is marked shipped.
688
726
  */
689
727
  export { reconcileOrderShipping } from "./_internal/server/features/shipping/reconcile.js";
728
+ /*
729
+ * D45's self-shipped half. Server entry only: it writes an order, appends to
730
+ * the points ledger, and `approveShippingReimbursement` throws on a `"system"`
731
+ * approver — none of which belongs anywhere a client bundle can reach.
732
+ */
733
+ export { submitShippingEvidence, approveShippingReimbursement, } from "./_internal/server/features/shipping/reimbursement.js";
734
+ /*
735
+ * Cancel an order and settle the refund it owes (D14). SERVER ENTRY ONLY, for
736
+ * the same reason as its neighbour above: it calls the payment provider and
737
+ * writes to `orders` and `paymentCases`.
738
+ *
739
+ * Public because the consumer owns the seller/admin order PATCH route, which is
740
+ * the one cancel path that can reach a DISPATCHED order — the two buyer paths
741
+ * refuse that case before it gets here. There is no `./_internal/*` subpath, so
742
+ * a consumer route cannot reach it any other way.
743
+ */
744
+ export { cancelOrderWithRefund } from "./_internal/server/features/orders/cancellation-refund.js";
745
+ /**
746
+ * `admin_adjustment`'s first human writer (D48).
747
+ *
748
+ * Public for the same reason `cancelOrderWithRefund` above is: the consumer
749
+ * owns `POST /api/admin/points`, and **there is no `./_internal/*` subpath**, so
750
+ * a consumer route cannot reach it any other way.
751
+ *
752
+ * 🛑 Export the ACTION, not the repository's `append`. `append` would let a
753
+ * route write any kind with any actor; this function fixes the kind, applies
754
+ * the credit-only expiry, writes the `adminAuditLog` row and notifies the
755
+ * buyer. A route reaching past it would silently skip three of those.
756
+ */
757
+ export { adjustUserPoints } from "./_internal/server/features/points/adjust.js";
690
758
  export { pointsRepository, PointsRepository } from "./features/points/repository/points.repository.js";
691
759
  // [SERVER-ONLY] Email primitives — table-based, inline-styled components
692
760
  // that render email-client-compatible HTML via renderToStaticMarkup. Use
@@ -1460,6 +1528,11 @@ export { SUBDIVISIONS, subdivisionsFor } from "./constants/geo/subdivisions.js";
1460
1528
  export { validateActionIndexEntry, normaliseRoute, } from "./features/search/action-index/validate-entry.js";
1461
1529
  export { ActionIndexRepository, actionIndexRepository, } from "./features/search/action-index/repository.js";
1462
1530
  export { REFUND_COPY } from "./_internal/shared/features/orders/refund-copy.js";
1531
+ /*
1532
+ * `wouldBeFullRefund` — from refundable-base, NOT return-reasons. It was
1533
+ * never exported at all, so the admin refund route could not import it.
1534
+ */
1535
+ export { wouldBeFullRefund } from "./_internal/shared/checkout/refundable-base.js";
1463
1536
  // Return / refund reasons — the closed enum the final-sale gate branches on.
1464
1537
  // See the module docstring for why the exempt set is "seller or carrier fault"
1465
1538
  // rather than "serious reasons".
@@ -1538,3 +1611,28 @@ export { configurePlatformSupplier, getPlatformSupplier, resetPlatformSupplier,
1538
1611
  // credentials are empty — so it parses every response through Zod and refuses
1539
1612
  // at construction when unconfigured. See the module header.
1540
1613
  export { ShiprocketShippingProvider } from "./providers/shipping-shiprocket/index.js";
1614
+ /*
1615
+ * [SERVER-ONLY] grievance — Phase 10 intake and clock.
1616
+ *
1617
+ * 🛑 Intake and clock ONLY. Nothing is published: the Consumer Protection
1618
+ * (E-Commerce) Rules 2020 require a NAMED grievance officer and statutory
1619
+ * periods, and this project publishes the business name with designation
1620
+ * "Support" on the same generic support address (D17). The periods here are
1621
+ * internal defaults chosen SHORTER than any plausible statutory period, so the
1622
+ * clock fires early — a deadline we beat is harmless, one we miss is the thing
1623
+ * the regime punishes. The public page stays untouched until the owner supplies
1624
+ * the officer and the real numbers.
1625
+ */
1626
+ export { fileGrievanceAction, recordGrievanceFirstResponseAction, } from "./_internal/server/features/grievance/index.js";
1627
+ export { GRIEVANCE_PERIODS } from "./features/support/schemas/firestore.js";
1628
+ /*
1629
+ * [SERVER-ONLY] order-completion — per-item ratings and the fast completion
1630
+ * path (owner's rule, 2026-10-21).
1631
+ *
1632
+ * Completion has two writers: `obligationSweep`'s `order-complete` at 7 days,
1633
+ * and the buyer marking it complete after rating at least one item. The second
1634
+ * is the "immediate disburse" path — and it needs no extra mechanism, because
1635
+ * `payout-release` is already blocked on `order-complete`, so closing that
1636
+ * obligation early opens the payout gate early as a consequence.
1637
+ */
1638
+ export { getRateableItemsAction, rateOrderItemAction, markOrderCompleteAction, } from "./_internal/server/features/order-completion/index.js";