@mohasinac/appkit 3.8.2 → 3.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (479) hide show
  1. package/dist/_internal/client/features/live/LiveItemDetailView.js +2 -2
  2. package/dist/_internal/client/features/lottery/LotteryAdminEditView.d.ts +4 -4
  3. package/dist/_internal/client/features/lottery/LotteryAdminEditView.js +8 -8
  4. package/dist/_internal/client/features/lottery/LotteryAdminSlotView.d.ts +1 -1
  5. package/dist/_internal/client/features/lottery/LotteryAdminSlotView.js +2 -2
  6. package/dist/_internal/server/features/bundles/actions.js +2 -2
  7. package/dist/_internal/server/features/bundles/og.d.ts +1 -1
  8. package/dist/_internal/server/features/bundles/og.js +4 -5
  9. package/dist/_internal/server/features/checkout/actions.js +57 -21
  10. package/dist/_internal/server/features/checkout/stock-restore.d.ts +19 -0
  11. package/dist/_internal/server/features/checkout/stock-restore.js +80 -0
  12. package/dist/_internal/server/features/checkout/upi-resolution.d.ts +11 -0
  13. package/dist/_internal/server/features/checkout/upi-resolution.js +28 -0
  14. package/dist/_internal/server/features/classified/og.js +1 -1
  15. package/dist/_internal/server/features/digital-code/og.js +1 -1
  16. package/dist/_internal/server/features/item-requests/og.d.ts +2 -2
  17. package/dist/_internal/server/features/item-requests/og.js +4 -5
  18. package/dist/_internal/server/features/live/og.js +1 -1
  19. package/dist/_internal/server/features/lottery/adapters.d.ts +2 -2
  20. package/dist/_internal/server/features/lottery/adapters.js +1 -1
  21. package/dist/_internal/server/features/orders/actions.d.ts +28 -0
  22. package/dist/_internal/server/features/orders/actions.js +239 -4
  23. package/dist/_internal/server/features/orders/adapters.js +3 -0
  24. package/dist/_internal/server/features/payments/data.js +3 -2
  25. package/dist/_internal/server/features/payouts/actions.d.ts +2 -2
  26. package/dist/_internal/server/features/payouts/actions.js +4 -3
  27. package/dist/_internal/server/features/pre-orders/service.d.ts +1 -1
  28. package/dist/_internal/server/features/pre-orders/service.js +3 -2
  29. package/dist/_internal/server/features/prize-draws/og.js +5 -5
  30. package/dist/_internal/server/features/products/og.js +1 -1
  31. package/dist/_internal/server/features/promotions/service.js +3 -1
  32. package/dist/_internal/server/features/refunds/actions.d.ts +2 -2
  33. package/dist/_internal/server/features/refunds/actions.js +7 -6
  34. package/dist/_internal/server/functions/firestore.js +1 -1
  35. package/dist/_internal/server/functions/scheduled.d.ts +4 -1
  36. package/dist/_internal/server/functions/scheduled.js +26 -2
  37. package/dist/_internal/server/jobs/core/emiInstallmentReminder.js +1 -1
  38. package/dist/_internal/server/jobs/core/hardBanCascade.d.ts +4 -0
  39. package/dist/_internal/server/jobs/core/hardBanCascade.js +15 -4
  40. package/dist/_internal/server/jobs/core/hardBanReinstatement.d.ts +16 -0
  41. package/dist/_internal/server/jobs/core/hardBanReinstatement.js +63 -0
  42. package/dist/_internal/server/jobs/core/jobRunners.js +3 -1
  43. package/dist/_internal/server/jobs/core/onScamReportCreate.js +1 -1
  44. package/dist/_internal/server/jobs/core/paymentReviewAutoApprove.d.ts +10 -0
  45. package/dist/_internal/server/jobs/core/paymentReviewAutoApprove.js +60 -0
  46. package/dist/_internal/server/jobs/core/paymentWindowTimeout.d.ts +15 -0
  47. package/dist/_internal/server/jobs/core/paymentWindowTimeout.js +59 -0
  48. package/dist/_internal/server/jobs/core/pendingOrderTimeout.d.ts +7 -0
  49. package/dist/_internal/server/jobs/core/pendingOrderTimeout.js +32 -6
  50. package/dist/_internal/server/jobs/handlers/hardBanReinstatement.d.ts +2 -0
  51. package/dist/_internal/server/jobs/handlers/hardBanReinstatement.js +2 -0
  52. package/dist/_internal/server/jobs/handlers/index.d.ts +3 -0
  53. package/dist/_internal/server/jobs/handlers/index.js +3 -0
  54. package/dist/_internal/server/jobs/handlers/messages.d.ts +4 -0
  55. package/dist/_internal/server/jobs/handlers/messages.js +4 -0
  56. package/dist/_internal/server/jobs/handlers/onShipmentAllocationSync.d.ts +3 -3
  57. package/dist/_internal/server/jobs/handlers/onShipmentAllocationSync.js +12 -12
  58. package/dist/_internal/server/jobs/handlers/onShipmentItemWrite.d.ts +1 -1
  59. package/dist/_internal/server/jobs/handlers/onShipmentItemWrite.js +5 -5
  60. package/dist/_internal/server/jobs/handlers/paymentReviewAutoApprove.d.ts +2 -0
  61. package/dist/_internal/server/jobs/handlers/paymentReviewAutoApprove.js +2 -0
  62. package/dist/_internal/server/jobs/handlers/paymentWindowTimeout.d.ts +2 -0
  63. package/dist/_internal/server/jobs/handlers/paymentWindowTimeout.js +2 -0
  64. package/dist/_internal/shared/actions/action-registry.js +27 -0
  65. package/dist/_internal/shared/checkout/order-math.js +3 -2
  66. package/dist/_internal/shared/checkout/rules/_defaults.js +1 -0
  67. package/dist/_internal/shared/checkout/rules/preorder.rule.js +7 -0
  68. package/dist/_internal/shared/checkout/rules/prize-draw.rule.js +7 -0
  69. package/dist/_internal/shared/checkout/rules/types.d.ts +11 -0
  70. package/dist/_internal/shared/features/auctions/errors.js +1 -1
  71. package/dist/_internal/shared/features/categories/bundle-copy.d.ts +0 -1
  72. package/dist/_internal/shared/features/categories/bundle-copy.js +0 -1
  73. package/dist/_internal/shared/features/categories/bundle-schemas.d.ts +6 -6
  74. package/dist/_internal/shared/features/categories/bundle-schemas.js +2 -2
  75. package/dist/_internal/shared/features/checkout/config.d.ts +3 -3
  76. package/dist/_internal/shared/features/checkout/config.js +3 -3
  77. package/dist/_internal/shared/features/emi/schedule.d.ts +6 -6
  78. package/dist/_internal/shared/features/emi/schedule.js +10 -9
  79. package/dist/_internal/shared/features/promotions/errors.js +1 -1
  80. package/dist/_internal/shared/fees/calculator.d.ts +5 -5
  81. package/dist/_internal/shared/fees/calculator.js +19 -19
  82. package/dist/client.d.ts +1 -1
  83. package/dist/client.js +1 -1
  84. package/dist/constants/api-endpoints.d.ts +9 -0
  85. package/dist/constants/api-endpoints.js +3 -0
  86. package/dist/constants/field-names.d.ts +4 -0
  87. package/dist/constants/field-names.js +4 -0
  88. package/dist/features/admin/components/AdminArtView.js +2 -2
  89. package/dist/features/admin/components/AdminBidsView.js +2 -2
  90. package/dist/features/admin/components/AdminBundleEditorView.d.ts +1 -1
  91. package/dist/features/admin/components/AdminBundleEditorView.js +8 -8
  92. package/dist/features/admin/components/AdminBundlesView.js +6 -6
  93. package/dist/features/admin/components/AdminClassifiedView.js +2 -2
  94. package/dist/features/admin/components/AdminDigitalCodesView.js +2 -2
  95. package/dist/features/admin/components/AdminLiveView.js +2 -2
  96. package/dist/features/admin/components/AdminOrderEditorView.d.ts +6 -1
  97. package/dist/features/admin/components/AdminOrderEditorView.js +45 -5
  98. package/dist/features/admin/components/AdminOrdersView.js +8 -3
  99. package/dist/features/admin/components/AdminPayoutsView.js +2 -2
  100. package/dist/features/admin/components/AdminPrizeDrawsView.js +2 -2
  101. package/dist/features/admin/components/AdminReturnRequestsView.js +2 -2
  102. package/dist/features/admin/components/AdminSiteSettingsView.js +11 -11
  103. package/dist/features/admin/components/AdminStickersView.js +2 -2
  104. package/dist/features/admin/components/AdminSupportTicketDetailView.js +1 -1
  105. package/dist/features/admin/hooks/useAdminListingData.d.ts +1 -1
  106. package/dist/features/admin/hooks/useAdminListingData.js +3 -2
  107. package/dist/features/admin/schemas/firestore.d.ts +9 -7
  108. package/dist/features/admin/schemas/firestore.js +4 -3
  109. package/dist/features/auctions/components/AuctionBidsTable.js +3 -3
  110. package/dist/features/auth/checkout-value-otp.d.ts +46 -0
  111. package/dist/features/auth/checkout-value-otp.js +73 -0
  112. package/dist/features/auth/repository/user.repository.d.ts +6 -0
  113. package/dist/features/auth/repository/user.repository.js +19 -0
  114. package/dist/features/auth/schemas/firestore.d.ts +10 -0
  115. package/dist/features/auth/schemas/firestore.js +2 -0
  116. package/dist/features/cart/actions/cart-actions.d.ts +1 -1
  117. package/dist/features/cart/actions/cart-actions.js +4 -4
  118. package/dist/features/cart/components/CartView.d.ts +2 -2
  119. package/dist/features/cart/components/ShippingPicker.d.ts +4 -4
  120. package/dist/features/cart/components/ShippingPicker.js +11 -11
  121. package/dist/features/cart/repository/cart.repository.d.ts +1 -1
  122. package/dist/features/cart/repository/cart.repository.js +2 -2
  123. package/dist/features/cart/schemas/firestore.d.ts +2 -2
  124. package/dist/features/catalogue/components/CatalogueItemEditorView.js +3 -3
  125. package/dist/features/catalogue/components/PublicCatalogueView.js +2 -2
  126. package/dist/features/catalogue/schemas/validation.js +1 -1
  127. package/dist/features/categories/components/BundleCollage.js +2 -2
  128. package/dist/features/categories/components/BundleDetailView.js +2 -2
  129. package/dist/features/categories/components/BundleItemsPicker.d.ts +1 -1
  130. package/dist/features/categories/components/BundleItemsPicker.js +2 -2
  131. package/dist/features/categories/components/CategoryBundlesListing.js +2 -2
  132. package/dist/features/categories/schemas/firestore.d.ts +1 -1
  133. package/dist/features/categories/schemas/index.d.ts +3 -3
  134. package/dist/features/categories/schemas/index.js +2 -2
  135. package/dist/features/checkout/actions/checkout-value-otp-actions.d.ts +16 -0
  136. package/dist/features/checkout/actions/checkout-value-otp-actions.js +83 -0
  137. package/dist/features/checkout/actions/index.d.ts +1 -0
  138. package/dist/features/checkout/actions/index.js +1 -0
  139. package/dist/features/checkout/schemas/firestore.d.ts +1 -1
  140. package/dist/features/classified/components/index.d.ts +0 -4
  141. package/dist/features/classified/components/index.js +0 -2
  142. package/dist/features/digital-codes/components/index.d.ts +0 -4
  143. package/dist/features/digital-codes/components/index.js +0 -2
  144. package/dist/features/events/schemas/index.d.ts +1 -1
  145. package/dist/features/events/schemas/index.js +1 -1
  146. package/dist/features/homepage/components/FeaturedBundlesSection.js +2 -2
  147. package/dist/features/live/components/index.d.ts +0 -4
  148. package/dist/features/live/components/index.js +0 -2
  149. package/dist/features/lottery/types/index.d.ts +3 -3
  150. package/dist/features/lottery/types/index.js +5 -5
  151. package/dist/features/orders/components/OrderPaymentSummary.js +2 -2
  152. package/dist/features/orders/components/OrderSiblingPayments.js +1 -1
  153. package/dist/features/orders/components/RefundHistoryTable.js +1 -1
  154. package/dist/features/orders/components/RefundRequestView.js +1 -1
  155. package/dist/features/orders/constants/payment-window.d.ts +10 -0
  156. package/dist/features/orders/constants/payment-window.js +10 -0
  157. package/dist/features/orders/repository/orders.repository.d.ts +25 -0
  158. package/dist/features/orders/repository/orders.repository.js +50 -1
  159. package/dist/features/orders/schemas/firestore.d.ts +50 -2
  160. package/dist/features/orders/schemas/index.d.ts +24 -24
  161. package/dist/features/orders/schemas/index.js +20 -20
  162. package/dist/features/orders/types/index.d.ts +4 -0
  163. package/dist/features/orders/utils/bundle-grouping.d.ts +1 -1
  164. package/dist/features/orders/utils/bundle-grouping.js +1 -1
  165. package/dist/features/payments/schemas/index.d.ts +10 -10
  166. package/dist/features/payments/schemas/index.js +9 -9
  167. package/dist/features/pre-orders/components/PreOrderDetailPageView.js +2 -2
  168. package/dist/features/products/components/ArtStickersListView.d.ts +7 -0
  169. package/dist/features/products/components/ArtStickersListView.js +57 -0
  170. package/dist/features/products/components/GroupSettingsPanel.js +1 -1
  171. package/dist/features/products/components/MakeOfferButton.js +3 -3
  172. package/dist/features/products/components/MarketplaceBundleCard.d.ts +1 -1
  173. package/dist/features/products/components/MarketplaceBundleCard.js +2 -2
  174. package/dist/features/products/components/PrizeDrawCollage.js +2 -2
  175. package/dist/features/products/components/PrizeDrawItemsEditor.js +2 -2
  176. package/dist/features/products/components/PrizeRevealModal.js +1 -1
  177. package/dist/features/products/components/ProductDetailPageView.js +2 -9
  178. package/dist/features/products/components/ProductForm.js +2 -2
  179. package/dist/features/products/components/ProductGrid.js +2 -2
  180. package/dist/features/products/components/ProductsIndexListing.d.ts +13 -1
  181. package/dist/features/products/components/ProductsIndexListing.js +7 -5
  182. package/dist/features/products/components/ProductsIndexPageView.js +6 -1
  183. package/dist/features/products/constants/listing-tabs.d.ts +42 -17
  184. package/dist/features/products/constants/listing-tabs.js +25 -6
  185. package/dist/features/products/schemas/catalog-product.d.ts +5 -5
  186. package/dist/features/products/schemas/catalog-product.js +1 -1
  187. package/dist/features/products/schemas/firestore.d.ts +5 -5
  188. package/dist/features/products/schemas/firestore.js +2 -2
  189. package/dist/features/products/types/index.d.ts +5 -2
  190. package/dist/features/promotions/components/CouponCard.js +2 -2
  191. package/dist/features/promotions/schemas/firestore.d.ts +2 -0
  192. package/dist/features/promotions/schemas/firestore.js +1 -0
  193. package/dist/features/promotions/schemas/index.d.ts +14 -14
  194. package/dist/features/promotions/schemas/index.js +6 -6
  195. package/dist/features/scams/components/ScamProfileView.js +3 -7
  196. package/dist/features/scams/components/ScamRegistryView.js +2 -6
  197. package/dist/features/scams/schemas/firestore.d.ts +1 -1
  198. package/dist/features/search/components/Search.d.ts +1 -1
  199. package/dist/features/seller/actions/offer-actions.js +1 -1
  200. package/dist/features/seller/components/PrintCenterView.js +2 -2
  201. package/dist/features/seller/components/QuickProductForm.js +5 -5
  202. package/dist/features/seller/components/SellerArtView.js +2 -2
  203. package/dist/features/seller/components/SellerAuctionsView.js +2 -2
  204. package/dist/features/seller/components/SellerBidsView.js +2 -2
  205. package/dist/features/seller/components/SellerBundlesView.js +6 -6
  206. package/dist/features/seller/components/SellerClassifiedView.js +2 -2
  207. package/dist/features/seller/components/SellerDigitalCodesView.js +2 -2
  208. package/dist/features/seller/components/SellerLiveView.js +2 -2
  209. package/dist/features/seller/components/SellerOffersView.js +2 -2
  210. package/dist/features/seller/components/SellerOrdersView.js +3 -3
  211. package/dist/features/seller/components/SellerPayoutRequestView.js +2 -2
  212. package/dist/features/seller/components/SellerPayoutSettingsView.js +2 -2
  213. package/dist/features/seller/components/SellerPayoutsView.js +2 -2
  214. package/dist/features/seller/components/SellerPreOrdersView.js +2 -2
  215. package/dist/features/seller/components/SellerPrizeDrawsView.js +2 -2
  216. package/dist/features/seller/components/SellerProductShell.js +8 -8
  217. package/dist/features/seller/components/SellerProductsView.js +1 -1
  218. package/dist/features/seller/components/SellerShippingView.js +6 -6
  219. package/dist/features/seller/components/SellerStickersView.js +2 -2
  220. package/dist/features/seller/hooks/useSellerListingData.d.ts +1 -1
  221. package/dist/features/seller/hooks/useSellerListingData.js +3 -2
  222. package/dist/features/shipments/components/AdminShipmentEditorView.js +10 -10
  223. package/dist/features/shipments/components/AdminShipmentLotItemsView.js +4 -4
  224. package/dist/features/shipments/components/AdminShipmentProjectionsView.js +5 -5
  225. package/dist/features/shipments/components/AdminShipmentsView.js +4 -4
  226. package/dist/features/shipments/repository/shipment-lots.repository.d.ts +2 -2
  227. package/dist/features/shipments/repository/shipment-lots.repository.js +8 -8
  228. package/dist/features/shipments/schemas/firestore.d.ts +21 -21
  229. package/dist/features/shipments/schemas/firestore.js +9 -9
  230. package/dist/features/shipments/schemas/validation.d.ts +30 -30
  231. package/dist/features/shipments/schemas/validation.js +6 -6
  232. package/dist/features/shipments/utils/cost-allocation.d.ts +5 -5
  233. package/dist/features/shipments/utils/cost-allocation.js +39 -38
  234. package/dist/features/store-extensions/schemas/firestore.d.ts +5 -5
  235. package/dist/features/stores/components/StoreDetailLayoutView.js +9 -13
  236. package/dist/features/stores/schemas/firestore.d.ts +7 -7
  237. package/dist/features/stores/schemas/index.d.ts +84 -84
  238. package/dist/features/stores/schemas/index.js +5 -5
  239. package/dist/features/tester/seed-data/categories-tester-seed-data.js +1 -1
  240. package/dist/features/tester/seed-data/products-tester-seed-data.js +6 -6
  241. package/dist/features/tester/seed-data/tester-checklist-seed-data.js +9 -2
  242. package/dist/features/whatsapp-bot/helpers/whatsapp.d.ts +8 -1
  243. package/dist/features/whatsapp-bot/helpers/whatsapp.js +13 -2
  244. package/dist/features/whatsapp-bot/types/index.d.ts +9 -1
  245. package/dist/index.d.ts +3 -7
  246. package/dist/index.js +7 -5
  247. package/dist/next/routing/route-map.d.ts +2 -0
  248. package/dist/next/routing/route-map.js +6 -0
  249. package/dist/schemas/firestore-helpers.d.ts +2 -2
  250. package/dist/schemas/firestore-helpers.js +2 -2
  251. package/dist/schemas/registry.d.ts +73 -73
  252. package/dist/seed/bids-seed-data.js +6 -6
  253. package/dist/seed/blog-posts-seed-data.js +1 -0
  254. package/dist/seed/cart-seed-data.js +13 -13
  255. package/dist/seed/catalogue-seed-data.js +6 -6
  256. package/dist/seed/categories-seed-data.js +5 -5
  257. package/dist/seed/claimed-coupons-seed-data.js +3 -3
  258. package/dist/seed/coupons-seed-data.js +20 -20
  259. package/dist/seed/events-seed-data.js +27 -27
  260. package/dist/seed/factories/bid.factory.js +1 -1
  261. package/dist/seed/faq-seed-data.js +20 -1
  262. package/dist/seed/grouped-listings-seed-data.d.ts +2 -2
  263. package/dist/seed/grouped-listings-seed-data.js +3 -3
  264. package/dist/seed/offers-seed-data.js +19 -19
  265. package/dist/seed/orders-seed-data.js +29 -29
  266. package/dist/seed/payouts-seed-data.js +7 -7
  267. package/dist/seed/products-auctions-seed-data.js +6 -6
  268. package/dist/seed/products-preorders-seed-data.d.ts +2 -2
  269. package/dist/seed/products-preorders-seed-data.js +1 -1
  270. package/dist/seed/products-standard-seed-data.js +8 -8
  271. package/dist/seed/scammers-seed-data.js +2 -2
  272. package/dist/seed/shipments-seed-data.js +29 -29
  273. package/dist/seed/site-settings-seed-data.js +3 -2
  274. package/dist/seed/store-extensions-seed-data.js +8 -8
  275. package/dist/seed/stores-seed-data.js +37 -8
  276. package/dist/seed/users-seed-data.js +38 -1
  277. package/dist/server-entry.d.ts +1 -3
  278. package/dist/server-entry.js +1 -3
  279. package/dist/server.d.ts +2 -1
  280. package/dist/server.js +3 -1
  281. package/dist/ui/components/PriceDisplay.js +3 -12
  282. package/dist/utils/number.formatter.d.ts +2 -7
  283. package/dist/utils/number.formatter.js +3 -8
  284. package/package.json +1 -1
  285. package/scripts/seed-cli.mjs +8 -3
  286. package/dist/_internal/client/scaffolds/DashboardScaffold.d.ts +0 -34
  287. package/dist/_internal/client/scaffolds/DashboardScaffold.js +0 -26
  288. package/dist/_internal/client/theme/__tests__/ThemeProvider.test.d.ts +0 -1
  289. package/dist/_internal/client/theme/__tests__/ThemeProvider.test.js +0 -109
  290. package/dist/_internal/server/features/auctions/__tests__/service.test.d.ts +0 -1
  291. package/dist/_internal/server/features/auctions/__tests__/service.test.js +0 -140
  292. package/dist/_internal/server/features/checkout/__tests__/actions.test.d.ts +0 -1
  293. package/dist/_internal/server/features/checkout/__tests__/actions.test.js +0 -600
  294. package/dist/_internal/server/features/refunds/__tests__/actions.test.d.ts +0 -1
  295. package/dist/_internal/server/features/refunds/__tests__/actions.test.js +0 -263
  296. package/dist/_internal/server/jobs/core/__tests__/auctionSettlement.test.d.ts +0 -1
  297. package/dist/_internal/server/jobs/core/__tests__/auctionSettlement.test.js +0 -249
  298. package/dist/_internal/server/jobs/core/__tests__/couponExpiry.test.d.ts +0 -1
  299. package/dist/_internal/server/jobs/core/__tests__/couponExpiry.test.js +0 -65
  300. package/dist/_internal/server/jobs/core/__tests__/listingProcessor.test.d.ts +0 -1
  301. package/dist/_internal/server/jobs/core/__tests__/listingProcessor.test.js +0 -163
  302. package/dist/_internal/server/jobs/core/__tests__/mediaTmpCleanup.test.d.ts +0 -1
  303. package/dist/_internal/server/jobs/core/__tests__/mediaTmpCleanup.test.js +0 -115
  304. package/dist/_internal/server/jobs/core/__tests__/onBidPlaced.test.d.ts +0 -1
  305. package/dist/_internal/server/jobs/core/__tests__/onBidPlaced.test.js +0 -201
  306. package/dist/_internal/server/jobs/core/__tests__/onOrderCreate.test.d.ts +0 -1
  307. package/dist/_internal/server/jobs/core/__tests__/onOrderCreate.test.js +0 -169
  308. package/dist/_internal/server/jobs/core/__tests__/onOrderStatusChange.test.d.ts +0 -1
  309. package/dist/_internal/server/jobs/core/__tests__/onOrderStatusChange.test.js +0 -148
  310. package/dist/_internal/server/jobs/core/__tests__/onProductStockChange.test.d.ts +0 -1
  311. package/dist/_internal/server/jobs/core/__tests__/onProductStockChange.test.js +0 -210
  312. package/dist/_internal/server/jobs/core/__tests__/onReviewWrite.test.d.ts +0 -1
  313. package/dist/_internal/server/jobs/core/__tests__/onReviewWrite.test.js +0 -190
  314. package/dist/_internal/server/jobs/core/__tests__/onUserBanChange.test.d.ts +0 -1
  315. package/dist/_internal/server/jobs/core/__tests__/onUserBanChange.test.js +0 -161
  316. package/dist/_internal/server/jobs/core/__tests__/payoutBatch.test.d.ts +0 -1
  317. package/dist/_internal/server/jobs/core/__tests__/payoutBatch.test.js +0 -302
  318. package/dist/_internal/server/jobs/core/__tests__/pendingOrderTimeout.test.d.ts +0 -1
  319. package/dist/_internal/server/jobs/core/__tests__/pendingOrderTimeout.test.js +0 -96
  320. package/dist/_internal/server/jobs/core/__tests__/triggerEventRaffle.test.d.ts +0 -1
  321. package/dist/_internal/server/jobs/core/__tests__/triggerEventRaffle.test.js +0 -252
  322. package/dist/_internal/server/jobs/core/__tests__/wrapJobHandler.test.d.ts +0 -1
  323. package/dist/_internal/server/jobs/core/__tests__/wrapJobHandler.test.js +0 -129
  324. package/dist/_internal/server/jobs/core/onCatalogueSubmittedForApproval.d.ts +0 -15
  325. package/dist/_internal/server/jobs/core/onCatalogueSubmittedForApproval.js +0 -38
  326. package/dist/_internal/server/providers/index.d.ts +0 -11
  327. package/dist/_internal/server/providers/index.js +0 -11
  328. package/dist/_internal/server/providers/payment/razorpay-mock.d.ts +0 -52
  329. package/dist/_internal/server/providers/payment/razorpay-mock.js +0 -118
  330. package/dist/_internal/server/providers/resolve.d.ts +0 -36
  331. package/dist/_internal/server/providers/resolve.js +0 -31
  332. package/dist/_internal/server/providers/shipping/shiprocket-mock.d.ts +0 -29
  333. package/dist/_internal/server/providers/shipping/shiprocket-mock.js +0 -152
  334. package/dist/_internal/shared/types/__tests__/action-result.test.d.ts +0 -1
  335. package/dist/_internal/shared/types/__tests__/action-result.test.js +0 -65
  336. package/dist/errors/__tests__/error-mapping.test.d.ts +0 -1
  337. package/dist/errors/__tests__/error-mapping.test.js +0 -122
  338. package/dist/errors/__tests__/safe-read.test.d.ts +0 -1
  339. package/dist/errors/__tests__/safe-read.test.js +0 -39
  340. package/dist/features/addresses/repository/__tests__/addresses.repository.test.d.ts +0 -1
  341. package/dist/features/addresses/repository/__tests__/addresses.repository.test.js +0 -386
  342. package/dist/features/admin/components/AdminListingScaffold.d.ts +0 -41
  343. package/dist/features/admin/components/AdminListingScaffold.js +0 -68
  344. package/dist/features/admin/components/QuickActionsPanel.d.ts +0 -15
  345. package/dist/features/admin/components/QuickActionsPanel.js +0 -5
  346. package/dist/features/admin/repository/__tests__/notification.repository.test.d.ts +0 -1
  347. package/dist/features/admin/repository/__tests__/notification.repository.test.js +0 -356
  348. package/dist/features/admin/repository/__tests__/site-settings.repository.test.d.ts +0 -1
  349. package/dist/features/admin/repository/__tests__/site-settings.repository.test.js +0 -298
  350. package/dist/features/auctions/repository/__tests__/bid.repository.test.d.ts +0 -1
  351. package/dist/features/auctions/repository/__tests__/bid.repository.test.js +0 -290
  352. package/dist/features/auctions/repository/auctions.repository.d.ts +0 -12
  353. package/dist/features/auctions/repository/auctions.repository.js +0 -42
  354. package/dist/features/auth/repository/__tests__/session.repository.test.d.ts +0 -1
  355. package/dist/features/auth/repository/__tests__/session.repository.test.js +0 -310
  356. package/dist/features/auth/repository/__tests__/session.test.d.ts +0 -1
  357. package/dist/features/auth/repository/__tests__/session.test.js +0 -146
  358. package/dist/features/auth/repository/__tests__/sms-counter.repository.test.d.ts +0 -1
  359. package/dist/features/auth/repository/__tests__/sms-counter.repository.test.js +0 -171
  360. package/dist/features/auth/repository/__tests__/sms-counter.test.d.ts +0 -1
  361. package/dist/features/auth/repository/__tests__/sms-counter.test.js +0 -88
  362. package/dist/features/auth/repository/__tests__/token.repository.test.d.ts +0 -1
  363. package/dist/features/auth/repository/__tests__/token.repository.test.js +0 -260
  364. package/dist/features/auth/repository/__tests__/token.test.d.ts +0 -1
  365. package/dist/features/auth/repository/__tests__/token.test.js +0 -140
  366. package/dist/features/auth/repository/__tests__/user.repository.test.d.ts +0 -1
  367. package/dist/features/auth/repository/__tests__/user.repository.test.js +0 -352
  368. package/dist/features/auth/repository/__tests__/user.test.d.ts +0 -1
  369. package/dist/features/auth/repository/__tests__/user.test.js +0 -226
  370. package/dist/features/before-after/repository/before-after.repository.d.ts +0 -13
  371. package/dist/features/before-after/repository/before-after.repository.js +0 -36
  372. package/dist/features/before-after/server.d.ts +0 -6
  373. package/dist/features/before-after/server.js +0 -6
  374. package/dist/features/cart/repository/__tests__/cart.repository.test.d.ts +0 -1
  375. package/dist/features/cart/repository/__tests__/cart.repository.test.js +0 -371
  376. package/dist/features/categories/repository/__tests__/categories.repository.test.d.ts +0 -1
  377. package/dist/features/categories/repository/__tests__/categories.repository.test.js +0 -813
  378. package/dist/features/collections/repository/collections.repository.d.ts +0 -8
  379. package/dist/features/collections/repository/collections.repository.js +0 -16
  380. package/dist/features/collections/server.d.ts +0 -6
  381. package/dist/features/collections/server.js +0 -6
  382. package/dist/features/events/repository/__tests__/event.repository.test.d.ts +0 -1
  383. package/dist/features/events/repository/__tests__/event.repository.test.js +0 -299
  384. package/dist/features/faq/repository/__tests__/faqs.repository.test.d.ts +0 -1
  385. package/dist/features/faq/repository/__tests__/faqs.repository.test.js +0 -311
  386. package/dist/features/forms/Form.d.ts +0 -25
  387. package/dist/features/forms/Form.js +0 -37
  388. package/dist/features/history/repository/__tests__/user-history.repository.test.d.ts +0 -1
  389. package/dist/features/history/repository/__tests__/user-history.repository.test.js +0 -180
  390. package/dist/features/homepage/repository/__tests__/carousel.repository.test.d.ts +0 -1
  391. package/dist/features/homepage/repository/__tests__/carousel.repository.test.js +0 -182
  392. package/dist/features/homepage/repository/__tests__/homepage-sections.repository.test.d.ts +0 -1
  393. package/dist/features/homepage/repository/__tests__/homepage-sections.repository.test.js +0 -185
  394. package/dist/features/layout/ListingLayout.d.ts +0 -34
  395. package/dist/features/layout/ListingLayout.js +0 -103
  396. package/dist/features/messages/repository/__tests__/conversations.repository.test.d.ts +0 -1
  397. package/dist/features/messages/repository/__tests__/conversations.repository.test.js +0 -257
  398. package/dist/features/orders/repository/__tests__/orders.repository.test.d.ts +0 -1
  399. package/dist/features/orders/repository/__tests__/orders.repository.test.js +0 -211
  400. package/dist/features/payments/repository/__tests__/payout.repository.test.d.ts +0 -1
  401. package/dist/features/payments/repository/__tests__/payout.repository.test.js +0 -292
  402. package/dist/features/pre-orders/repository/preorders.repository.d.ts +0 -8
  403. package/dist/features/pre-orders/repository/preorders.repository.js +0 -25
  404. package/dist/features/products/repository/__tests__/product-features.repository.test.d.ts +0 -1
  405. package/dist/features/products/repository/__tests__/product-features.repository.test.js +0 -329
  406. package/dist/features/products/repository/__tests__/products.repository.test.d.ts +0 -1
  407. package/dist/features/products/repository/__tests__/products.repository.test.js +0 -607
  408. package/dist/features/promotions/repository/__tests__/claimed-coupons.repository.test.d.ts +0 -1
  409. package/dist/features/promotions/repository/__tests__/claimed-coupons.repository.test.js +0 -219
  410. package/dist/features/promotions/repository/__tests__/coupons.repository.test.d.ts +0 -1
  411. package/dist/features/promotions/repository/__tests__/coupons.repository.test.js +0 -480
  412. package/dist/features/promotions/repository/promotions.repository.d.ts +0 -14
  413. package/dist/features/promotions/repository/promotions.repository.js +0 -43
  414. package/dist/features/reviews/repository/__tests__/reviews.repository.test.d.ts +0 -1
  415. package/dist/features/reviews/repository/__tests__/reviews.repository.test.js +0 -327
  416. package/dist/features/scams/repository/__tests__/scammer.repository.test.d.ts +0 -1
  417. package/dist/features/scams/repository/__tests__/scammer.repository.test.js +0 -385
  418. package/dist/features/search/repository/__tests__/search.repository.test.d.ts +0 -1
  419. package/dist/features/search/repository/__tests__/search.repository.test.js +0 -369
  420. package/dist/features/seller/components/SellerStatCard.d.ts +0 -14
  421. package/dist/features/seller/components/SellerStatCard.js +0 -6
  422. package/dist/features/seller/components/seller-products-styles.d.ts +0 -7
  423. package/dist/features/seller/components/seller-products-styles.js +0 -14
  424. package/dist/features/seller/repository/__tests__/offer.repository.test.d.ts +0 -1
  425. package/dist/features/seller/repository/__tests__/offer.repository.test.js +0 -458
  426. package/dist/features/seller/repository/seller.repository.d.ts +0 -22
  427. package/dist/features/seller/repository/seller.repository.js +0 -72
  428. package/dist/features/site-settings/components/__tests__/ThemeManagerView.test.d.ts +0 -1
  429. package/dist/features/site-settings/components/__tests__/ThemeManagerView.test.js +0 -37
  430. package/dist/features/stores/repository/__tests__/store.repository.test.d.ts +0 -1
  431. package/dist/features/stores/repository/__tests__/store.repository.test.js +0 -261
  432. package/dist/features/stores/repository/stores.repository.d.ts +0 -11
  433. package/dist/features/stores/repository/stores.repository.js +0 -37
  434. package/dist/features/support/repository/__tests__/support.repository.test.d.ts +0 -1
  435. package/dist/features/support/repository/__tests__/support.repository.test.js +0 -312
  436. package/dist/features/wishlist/repository/__tests__/user-wishlist.repository.test.d.ts +0 -1
  437. package/dist/features/wishlist/repository/__tests__/user-wishlist.repository.test.js +0 -139
  438. package/dist/features/wishlist/repository/wishlist.repository.d.ts +0 -13
  439. package/dist/features/wishlist/repository/wishlist.repository.js +0 -31
  440. package/dist/providers/db-firebase/__tests__/filter-aliases.test.d.ts +0 -1
  441. package/dist/providers/db-firebase/__tests__/filter-aliases.test.js +0 -93
  442. package/dist/providers/shipping-shiprocket/index.d.ts +0 -297
  443. package/dist/providers/shipping-shiprocket/index.js +0 -194
  444. package/dist/providers/shipping-shiprocket/shiprocket-provider.d.ts +0 -45
  445. package/dist/providers/shipping-shiprocket/shiprocket-provider.js +0 -168
  446. package/dist/react/contexts/ThemeContext.d.ts +0 -13
  447. package/dist/react/contexts/ThemeContext.js +0 -64
  448. package/dist/schemas/webhooks/shiprocket.d.ts +0 -30
  449. package/dist/schemas/webhooks/shiprocket.js +0 -22
  450. package/dist/seed/actions/demo-seed-actions.d.ts +0 -42
  451. package/dist/seed/actions/demo-seed-actions.js +0 -36
  452. package/dist/seed/actions/index.d.ts +0 -1
  453. package/dist/seed/actions/index.js +0 -1
  454. package/dist/seed/sub-listings-seed-data.d.ts +0 -123
  455. package/dist/seed/sub-listings-seed-data.js +0 -447
  456. package/dist/seed/tester-checklist-seed-data.d.ts +0 -2
  457. package/dist/seed/tester-checklist-seed-data.js +0 -248
  458. package/dist/ui/components/DashboardStatsCard.d.ts +0 -15
  459. package/dist/ui/components/DashboardStatsCard.js +0 -27
  460. package/dist/ui/components/DashboardStatsCard.style.css +0 -68
  461. package/dist/ui/components/DynamicSelect.d.ts +0 -23
  462. package/dist/ui/components/DynamicSelect.js +0 -77
  463. package/dist/ui/components/DynamicSelect.style.css +0 -101
  464. package/dist/ui/components/InlineCreateSelect.d.ts +0 -48
  465. package/dist/ui/components/InlineCreateSelect.js +0 -75
  466. package/dist/ui/components/ListingViewShell.d.ts +0 -37
  467. package/dist/ui/components/ListingViewShell.js +0 -9
  468. package/dist/ui/components/PaginatedMultiSelect.d.ts +0 -28
  469. package/dist/ui/components/PaginatedMultiSelect.js +0 -141
  470. package/dist/ui/components/PaginatedMultiSelect.style.css +0 -272
  471. package/dist/ui/components/SectionTabs.d.ts +0 -19
  472. package/dist/ui/components/SectionTabs.js +0 -66
  473. package/dist/ui/components/SectionTabs.style.css +0 -164
  474. package/dist/ui/components/__tests__/BulkActionBar.test.d.ts +0 -1
  475. package/dist/ui/components/__tests__/BulkActionBar.test.js +0 -96
  476. package/dist/ui/components/__tests__/ListingToolbar.test.d.ts +0 -1
  477. package/dist/ui/components/__tests__/ListingToolbar.test.js +0 -125
  478. package/dist/ui/components/__tests__/new-primitives.test.d.ts +0 -1
  479. package/dist/ui/components/__tests__/new-primitives.test.js +0 -187
@@ -20,6 +20,6 @@ export function LiveItemDetailView({ product, isLoading = false, renderActions,
20
20
  const price = formatCurrency(product.price, product.currency ?? "INR");
21
21
  const jurisdictions = meta?.jurisdictionAllowed ?? [];
22
22
  const transport = meta?.transport;
23
- return (_jsx(Container, { children: _jsx(Section, { padding: "y-xl", children: _jsxs(Stack, { gap: "lg", children: [product.images.length > 0 && (_jsx(Div, { className: `relative h-80 w-full ${__O.hidden} bg-muted`, rounded: "lg", children: _jsx(MediaImage, { src: product.mainImage || product.images[0], alt: product.title, size: "hero", objectFit: "contain" }) })), _jsxs(Stack, { gap: "sm", children: [_jsxs(Row, { gap: "sm", wrap: true, children: [_jsx(Badge, { variant: "secondary", children: "Live Item" }), meta?.vendorVerified && (_jsx(Badge, { variant: "active", children: "Verified Seller" })), meta?.cites && (_jsxs(Badge, { variant: "warning", children: ["CITES: ", meta.cites] }))] }), _jsx(Heading, { level: 1, weight: "bold", size: "2xl", children: product.title }), meta?.species && (_jsxs(Text, { className: "italic text-muted-foreground", size: "sm", children: [meta.species, meta.sex && meta.sex !== "n/a" && ` · ${meta.sex}`, meta.ageMonths !== undefined && ` · ${meta.ageMonths}mo`] })), _jsx(Text, { className: "text-primary", size: "2xl", weight: "semibold", children: price }), _jsx(Text, { className: "text-muted-foreground", children: product.description })] }), jurisdictions.length > 0 && (_jsxs(Div, { className: CLS_WARN_BOX, children: [_jsx(Text, { className: CLS_WARN_TITLE, children: "Delivery restrictions" }), _jsxs(Text, { className: CLS_WARN_BODY, children: ["This item can only be shipped to: ", jurisdictions.join(", ")] })] })), transport && (_jsxs(Div, { textSize: "sm", className: `border border-border bg-muted/40 ${__P.p4}`, rounded: "lg", children: [_jsx(Text, { weight: "medium", children: "Transport" }), _jsxs(Text, { className: "text-muted-foreground", children: ["Method: ", transport.method, transport.handlingFeeInPaise !== undefined &&
24
- ` · Handling: ${formatCurrency(transport.handlingFeeInPaise, "INR")}`, transport.insuranceIncluded && " · Insurance included"] })] })), meta?.careInfo && (_jsxs(Div, { textSize: "sm", className: `border border-border bg-muted/40 ${__P.p4}`, rounded: "lg", children: [_jsx(Text, { weight: "medium", children: "Care information" }), _jsx(Text, { className: "mt-1 text-muted-foreground", children: meta.careInfo })] })), renderActions?.()] }) }) }));
23
+ return (_jsx(Container, { children: _jsx(Section, { padding: "y-xl", children: _jsxs(Stack, { gap: "lg", children: [product.images.length > 0 && (_jsx(Div, { className: `relative h-80 w-full ${__O.hidden} bg-muted`, rounded: "lg", children: _jsx(MediaImage, { src: product.mainImage || product.images[0], alt: product.title, size: "hero", objectFit: "contain" }) })), _jsxs(Stack, { gap: "sm", children: [_jsxs(Row, { gap: "sm", wrap: true, children: [_jsx(Badge, { variant: "secondary", children: "Live Item" }), meta?.vendorVerified && (_jsx(Badge, { variant: "active", children: "Verified Seller" })), meta?.cites && (_jsxs(Badge, { variant: "warning", children: ["CITES: ", meta.cites] }))] }), _jsx(Heading, { level: 1, weight: "bold", size: "2xl", children: product.title }), meta?.species && (_jsxs(Text, { className: "italic text-muted-foreground", size: "sm", children: [meta.species, meta.sex && meta.sex !== "n/a" && ` · ${meta.sex}`, meta.ageMonths !== undefined && ` · ${meta.ageMonths}mo`] })), _jsx(Text, { className: "text-primary", size: "2xl", weight: "semibold", children: price }), _jsx(Text, { className: "text-muted-foreground", children: product.description })] }), jurisdictions.length > 0 && (_jsxs(Div, { className: CLS_WARN_BOX, children: [_jsx(Text, { className: CLS_WARN_TITLE, children: "Delivery restrictions" }), _jsxs(Text, { className: CLS_WARN_BODY, children: ["This item can only be shipped to: ", jurisdictions.join(", ")] })] })), transport && (_jsxs(Div, { textSize: "sm", className: `border border-border bg-muted/40 ${__P.p4}`, rounded: "lg", children: [_jsx(Text, { weight: "medium", children: "Transport" }), _jsxs(Text, { className: "text-muted-foreground", children: ["Method: ", transport.method, transport.handlingFee !== undefined &&
24
+ ` · Handling: ${formatCurrency(transport.handlingFee, "INR")}`, transport.insuranceIncluded && " · Insurance included"] })] })), meta?.careInfo && (_jsxs(Div, { textSize: "sm", className: `border border-border bg-muted/40 ${__P.p4}`, rounded: "lg", children: [_jsx(Text, { weight: "medium", children: "Care information" }), _jsx(Text, { className: "mt-1 text-muted-foreground", children: meta.careInfo })] })), renderActions?.()] }) }) }));
25
25
  }
@@ -2,7 +2,7 @@ import React from "react";
2
2
  interface LotterySlotRow {
3
3
  slotNumber: number;
4
4
  name: string;
5
- priceInPaise: number;
5
+ price: number;
6
6
  }
7
7
  interface LotteryEventFormData {
8
8
  title: string;
@@ -12,13 +12,13 @@ interface LotteryEventFormData {
12
12
  slots: Array<{
13
13
  slotNumber: number;
14
14
  name: string;
15
- priceInPaise: number;
15
+ price: number;
16
16
  weight: number;
17
17
  isBooked: boolean;
18
18
  }>;
19
19
  totalSlots: number;
20
20
  pricingMode: "uniform" | "variable";
21
- uniformPriceInPaise?: number;
21
+ uniformPrice?: number;
22
22
  drawWindowDurationMinutes: number;
23
23
  maxPullsPerTransaction: number;
24
24
  maxPullsPerUser: number;
@@ -31,7 +31,7 @@ interface LotteryAdminEditViewProps {
31
31
  description?: string;
32
32
  totalSlots: number;
33
33
  pricingMode: "uniform" | "variable";
34
- uniformPriceInPaise?: number;
34
+ uniformPrice?: number;
35
35
  drawWindowDurationMinutes: number;
36
36
  maxPullsPerTransaction: number;
37
37
  maxPullsPerUser: number;
@@ -10,15 +10,15 @@ export function LotteryAdminEditView({ eventId, initialData, onSubmit, }) {
10
10
  const [title, setTitle] = useState(initialData?.title ?? "");
11
11
  const [description, setDescription] = useState(initialData?.description ?? "");
12
12
  const [pricingMode, setPricingMode] = useState(initialData?.pricingMode ?? "uniform");
13
- const [uniformPrice, setUniformPrice] = useState(String((initialData?.uniformPriceInPaise ?? 0) / 100));
13
+ const [uniformPrice, setUniformPrice] = useState(String(initialData?.uniformPrice ?? 0));
14
14
  const [drawWindowMinutes, setDrawWindowMinutes] = useState(String(initialData?.drawWindowDurationMinutes ?? 5));
15
15
  const [maxPullsPerTx, setMaxPullsPerTx] = useState(String(initialData?.maxPullsPerTransaction ?? 1));
16
16
  const [maxPullsPerUser, setMaxPullsPerUser] = useState(String(initialData?.maxPullsPerUser ?? 1));
17
- const [slots, setSlots] = useState(initialData?.slots ?? [{ slotNumber: 1, name: "", priceInPaise: 0 }]);
17
+ const [slots, setSlots] = useState(initialData?.slots ?? [{ slotNumber: 1, name: "", price: 0 }]);
18
18
  const addSlot = () => {
19
19
  setSlots((prev) => [
20
20
  ...prev,
21
- { slotNumber: prev.length + 1, name: "", priceInPaise: 0 },
21
+ { slotNumber: prev.length + 1, name: "", price: 0 },
22
22
  ]);
23
23
  };
24
24
  const removeSlot = (idx) => {
@@ -26,7 +26,7 @@ export function LotteryAdminEditView({ eventId, initialData, onSubmit, }) {
26
26
  };
27
27
  const updateSlot = (idx, field, value) => {
28
28
  setSlots((prev) => prev.map((s, i) => i === idx
29
- ? { ...s, [field]: field === "priceInPaise" ? Math.round(parseFloat(value) * 100) || 0 : value }
29
+ ? { ...s, [field]: field === "price" ? Math.round(parseFloat(value) * 100) / 100 || 0 : value }
30
30
  : s));
31
31
  };
32
32
  const handleSubmit = () => {
@@ -37,13 +37,13 @@ export function LotteryAdminEditView({ eventId, initialData, onSubmit, }) {
37
37
  slots: slots.map((s) => ({
38
38
  slotNumber: s.slotNumber,
39
39
  name: s.name,
40
- priceInPaise: s.priceInPaise,
40
+ price: s.price,
41
41
  weight: 0,
42
42
  isBooked: false,
43
43
  })),
44
44
  totalSlots: slots.length,
45
45
  pricingMode,
46
- uniformPriceInPaise: pricingMode === "uniform" ? Math.round(parseFloat(uniformPrice) * 100) || 0 : undefined,
46
+ uniformPrice: pricingMode === "uniform" ? Math.round(parseFloat(uniformPrice) * 100) / 100 || 0 : undefined,
47
47
  drawWindowDurationMinutes: parseInt(drawWindowMinutes, 10) || 5,
48
48
  maxPullsPerTransaction: parseInt(maxPullsPerTx, 10) || 1,
49
49
  maxPullsPerUser: parseInt(maxPullsPerUser, 10) || 1,
@@ -71,9 +71,9 @@ export function LotteryAdminEditView({ eventId, initialData, onSubmit, }) {
71
71
  ...(pricingMode === "variable"
72
72
  ? [
73
73
  {
74
- key: "priceInPaise",
74
+ key: "price",
75
75
  header: "Price (₹)",
76
- render: (s) => (_jsx(Input, { type: "number", className: "w-24", placeholder: "0", value: s.priceInPaise / 100, onChange: (e) => updateSlot(s._idx, "priceInPaise", e.target.value), "aria-label": `Slot ${s.slotNumber} price` })),
76
+ render: (s) => (_jsx(Input, { type: "number", className: "w-24", placeholder: "0", value: s.price, onChange: (e) => updateSlot(s._idx, "price", e.target.value), "aria-label": `Slot ${s.slotNumber} price` })),
77
77
  },
78
78
  ]
79
79
  : []),
@@ -1,7 +1,7 @@
1
1
  import React from "react";
2
2
  import type { ClientLotterySlot } from "../../../../features/lottery/types";
3
3
  interface AdminLotterySlot extends ClientLotterySlot {
4
- priceInPaise: number;
4
+ price: number;
5
5
  weight: number;
6
6
  }
7
7
  interface LotteryAdminSlotViewProps {
@@ -19,9 +19,9 @@ export function LotteryAdminSlotView({ slots }) {
19
19
  render: (s) => _jsx(Text, { size: "sm", children: s.name }),
20
20
  },
21
21
  {
22
- key: "priceInPaise",
22
+ key: "price",
23
23
  header: "Price (₹)",
24
- render: (s) => (_jsxs(Text, { size: "sm", family: "mono", children: ["\u20B9", (s.priceInPaise / 100).toLocaleString("en-IN")] })),
24
+ render: (s) => (_jsxs(Text, { size: "sm", family: "mono", children: ["\u20B9", s.price.toLocaleString("en-IN")] })),
25
25
  },
26
26
  {
27
27
  key: "weight",
@@ -29,14 +29,14 @@ export async function addBundleToCartAction(userId, bundleSlug) {
29
29
  if (bundle.bundleStockStatus === "out_of_stock") {
30
30
  throw new ValidationError("Bundle is currently out of stock");
31
31
  }
32
- if (!bundle.bundlePriceInPaise || bundle.bundlePriceInPaise < 1) {
32
+ if (!bundle.bundlePrice || bundle.bundlePrice < 1) {
33
33
  throw new ValidationError("Bundle price is not configured");
34
34
  }
35
35
  await cartRepository.addItem(userId, {
36
36
  productId: bundle.id,
37
37
  productTitle: bundle.name,
38
38
  productImage: bundle.display?.coverImage ?? "",
39
- price: bundle.bundlePriceInPaise,
39
+ price: bundle.bundlePrice,
40
40
  currency: getDefaultCurrency(),
41
41
  quantity: 1,
42
42
  storeId: bundle.createdByStoreId ?? "",
@@ -27,7 +27,7 @@ interface BundleDocLike {
27
27
  display?: {
28
28
  coverImage?: string | null;
29
29
  } | null;
30
- bundlePriceInPaise?: number | null;
30
+ bundlePrice?: number | null;
31
31
  bundleProductIds?: string[] | null;
32
32
  bundleStockStatus?: "in_stock" | "partial" | "out_of_stock" | null;
33
33
  }
@@ -1,13 +1,12 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { resolveOgImageUrl } from "../seo/og";
3
- function formatPriceInr(paise) {
4
- const rupees = Math.round(paise / 100);
5
- return `₹${rupees.toLocaleString("en-IN")}`;
3
+ function formatPriceInr(amount) {
4
+ return `₹${amount.toLocaleString("en-IN")}`;
6
5
  }
7
6
  export function renderBundleOg(doc, opts) {
8
7
  const name = doc?.name ?? "Bundle";
9
- const priceLabel = typeof doc?.bundlePriceInPaise === "number" && doc.bundlePriceInPaise > 0
10
- ? formatPriceInr(doc.bundlePriceInPaise)
8
+ const priceLabel = typeof doc?.bundlePrice === "number" && doc.bundlePrice > 0
9
+ ? formatPriceInr(doc.bundlePrice)
11
10
  : null;
12
11
  return renderBundleOgImage({
13
12
  name,
@@ -1,5 +1,6 @@
1
1
  import { normalizeError } from "../../../../errors/normalize";
2
2
  import { safeFireAndForget } from "../../../../utils/safe-fire-forget";
3
+ import { roundRupees } from "../../../../utils/number.formatter";
3
4
  /**
4
5
  * Checkout server actions (appkit).
5
6
  *
@@ -36,6 +37,9 @@ import { getListingRule, runSyncPreflight, } from "../../../shared/checkout/rule
36
37
  import { cartIsDigitalOnly } from "../../../shared/listing-types/cart-shipping";
37
38
  import { processRefundAction } from "../refunds/actions";
38
39
  import { sendNotification } from "../../../../features/admin/actions/notification-actions";
40
+ import { resolveDisplayedUpiId } from "./upi-resolution";
41
+ import { PAYMENT_WINDOW_MS } from "../../../../features/orders/constants/payment-window";
42
+ import { isCheckoutValueOtpVerified } from "../../../../features/checkout/actions/checkout-value-otp-actions";
39
43
  const AUDIT_LOG_FAIL_MSG = "checkout: audit log failed (non-critical)";
40
44
  /**
41
45
  * SB-UNI-N — Atomically claim the next available digital code for a confirmed
@@ -247,7 +251,7 @@ function unitPriceFor(item, product) {
247
251
  * so the caller can accumulate the checkout-wide `total`.
248
252
  */
249
253
  async function createOrderForGroup(group, orderType, ctx) {
250
- const { paymentMethod, emiTenureMonths, emiSettings, commissions, appliedCoupons, cartSubtotal, couponUsageAccumulator, uid, userName, userEmail, shippingAddress, notes, adminBypass, adminBypassBy, adminBatchId, orderIds, emailsToSend, outOfStockPolicy, droppedItems, buyerState, gstSettings, } = ctx;
254
+ const { paymentMethod, emiTenureMonths, emiSettings, commissions, appliedCoupons, cartSubtotal, couponUsageAccumulator, uid, userName, userEmail, shippingAddress, notes, adminBypass, adminBypassBy, adminBatchId, orderIds, emailsToSend, outOfStockPolicy, droppedItems, buyerState, gstSettings, siteContactUpiVpa, } = ctx;
251
255
  const firstItem = group[0].item;
252
256
  const firstProduct = group[0].product;
253
257
  const groupTotal = group.reduce((sum, { item, product }) => sum + unitPriceFor(item, product) * item.quantity, 0);
@@ -308,15 +312,15 @@ async function createOrderForGroup(group, orderType, ctx) {
308
312
  ? undefined
309
313
  : orderType === "preorder"
310
314
  ? computePreOrderDepositAmount(group, commissions.codDepositPercent)
311
- : Math.round(groupTotal * (commissions.codDepositPercent / 100) * 100) / 100;
315
+ : roundRupees(groupTotal * (commissions.codDepositPercent / 100));
312
316
  const codRemainingAmount = isCodLike
313
- ? Math.round((groupTotal - (depositAmount ?? 0)) * 100) / 100
317
+ ? roundRupees(groupTotal - (depositAmount ?? 0))
314
318
  : undefined;
315
319
  let emiSchedule;
316
320
  if (paymentMethod === "emi" && emiTenureMonths) {
317
321
  const eligibility = checkEmiEligibility(groupTotal, storeEmiEnabled, emiSettings);
318
322
  if (!eligibility.eligible) {
319
- throw new ValidationError(`EMI is not available for this order (${eligibility.reason}). Minimum order value per seller is ₹${Math.round(emiSettings.minOrderValueInPaise / 100)}.`);
323
+ throw new ValidationError(`EMI is not available for this order (${eligibility.reason}). Minimum order value per seller is ₹${emiSettings.minOrderValue}.`);
320
324
  }
321
325
  emiSchedule = computeEmiSchedule(groupTotal, emiTenureMonths, emiSettings);
322
326
  }
@@ -338,7 +342,7 @@ async function createOrderForGroup(group, orderType, ctx) {
338
342
  .reduce((s, { item }) => s + item.price * item.quantity, 0);
339
343
  couponGroupDiscount =
340
344
  eligibleTotal > 0
341
- ? Math.min(Math.round((eligibleTotal / groupTotal) * coupon.discountAmount * 100) / 100, eligibleTotal)
345
+ ? Math.min(roundRupees((eligibleTotal / groupTotal) * coupon.discountAmount), eligibleTotal)
342
346
  : 0;
343
347
  }
344
348
  else {
@@ -347,7 +351,7 @@ async function createOrderForGroup(group, orderType, ctx) {
347
351
  }
348
352
  else {
349
353
  if (cartSubtotal > 0) {
350
- couponGroupDiscount = Math.min(Math.round((groupTotal / cartSubtotal) * coupon.discountAmount * 100) / 100, groupTotal);
354
+ couponGroupDiscount = Math.min(roundRupees((groupTotal / cartSubtotal) * coupon.discountAmount), groupTotal);
351
355
  }
352
356
  }
353
357
  if (couponGroupDiscount > 0) {
@@ -382,6 +386,20 @@ async function createOrderForGroup(group, orderType, ctx) {
382
386
  ? { prizeRevealDeadline: computePrizeRevealDeadline(group[0].product) }
383
387
  : {}),
384
388
  };
389
+ // ── 15-minute payment window + seller UPI resolution (Tier PP) ──────────
390
+ // Deadline + displayed UPI apply only to methods with a buyer-uploaded
391
+ // proof step — never cod (paid on delivery), razorpay (paid before order
392
+ // creation), or admin_bypass (already marked paid above).
393
+ const hasPaymentWindow = !adminBypass &&
394
+ (paymentMethod === PaymentMethodValues.UPI_MANUAL ||
395
+ paymentMethod === PaymentMethodValues.CASH ||
396
+ paymentMethod === PaymentMethodValues.EMI);
397
+ const paymentDeadline = hasPaymentWindow
398
+ ? new Date(Date.now() + PAYMENT_WINDOW_MS)
399
+ : undefined;
400
+ const displayedUpiId = hasPaymentWindow
401
+ ? await resolveDisplayedUpiId(firstItem.storeId, siteContactUpiVpa)
402
+ : undefined;
385
403
  const order = await unitOfWork.orders.create({
386
404
  productId: firstItem.productId,
387
405
  productTitle: firstItem.productTitle,
@@ -401,6 +419,8 @@ async function createOrderForGroup(group, orderType, ctx) {
401
419
  paymentStatus: adminBypass ? PaymentStatusValues.PAID : PaymentStatusValues.PENDING,
402
420
  paymentMethod: adminBypass ? PaymentMethodValues.ADMIN_BYPASS : paymentMethod,
403
421
  paymentId: adminBatchId,
422
+ paymentDeadline,
423
+ displayedUpiId,
404
424
  adminBypassBy: adminBypassBy,
405
425
  shippingAddress,
406
426
  notes,
@@ -510,6 +530,21 @@ export async function createCheckoutOrderAction(input) {
510
530
  if (cartItems.length === 0) {
511
531
  throw new ValidationError(ERROR_MESSAGES.CHECKOUT.CART_EMPTY);
512
532
  }
533
+ // Tier PP — OTP gate for high-value checkouts. Evaluated against the
534
+ // WHOLE checkout batch's total (not each resulting per-seller order),
535
+ // otherwise a buyer could dodge it by splitting a big cart across
536
+ // sellers. Skipped for COD (physical hand-off at the door is its own
537
+ // verification) and admin-bypass checkouts.
538
+ const otpThreshold = siteSettings?.payment?.otpCheckoutThreshold;
539
+ if (!adminBypass && paymentMethod !== "cod" && typeof otpThreshold === "number" && otpThreshold > 0) {
540
+ const cartTotalForOtpCheck = cartItems.reduce((sum, item) => sum + item.price * item.quantity, 0);
541
+ if (cartTotalForOtpCheck >= otpThreshold) {
542
+ const verified = await isCheckoutValueOtpVerified(uid);
543
+ if (!verified) {
544
+ throw new ApiError(403, "CHECKOUT_VALUE_OTP_REQUIRED");
545
+ }
546
+ }
547
+ }
513
548
  const isDigitalCart = cartIsDigitalOnly(cartItems);
514
549
  let shippingAddress;
515
550
  let resolvedAddress = null;
@@ -711,6 +746,7 @@ export async function createCheckoutOrderAction(input) {
711
746
  droppedItems: unavailable,
712
747
  buyerState: resolvedAddress?.state,
713
748
  gstSettings: siteSettings?.gst,
749
+ siteContactUpiVpa: siteSettings?.contact?.upiVpa,
714
750
  };
715
751
  for (const { items: group, orderType } of orderGroups) {
716
752
  total += await createOrderForGroup(group, orderType, groupCtx);
@@ -770,8 +806,8 @@ async function refundDroppedItemsForRazorpayCheckout(input) {
770
806
  const { unavailablePaid, orderIds, productByIdPaid, razorpayPaymentId } = input;
771
807
  if (unavailablePaid.length === 0 || orderIds.length === 0)
772
808
  return;
773
- const droppedValueInPaise = unavailablePaid.reduce((sum, u) => sum + (productByIdPaid.get(u.productId)?.price ?? 0) * u.requestedQty, 0);
774
- if (droppedValueInPaise <= 0)
809
+ const droppedValue = unavailablePaid.reduce((sum, u) => sum + (productByIdPaid.get(u.productId)?.price ?? 0) * u.requestedQty, 0);
810
+ if (droppedValue <= 0)
775
811
  return;
776
812
  const primaryOrderId = orderIds[0];
777
813
  try {
@@ -783,12 +819,12 @@ async function refundDroppedItemsForRazorpayCheckout(input) {
783
819
  // FIRST order created in this batch is used as the refund's book-
784
820
  // keeping anchor).
785
821
  const refundAmount = primaryOrder
786
- ? Math.min(droppedValueInPaise, primaryOrder.totalPrice)
787
- : droppedValueInPaise;
822
+ ? Math.min(droppedValue, primaryOrder.totalPrice)
823
+ : droppedValue;
788
824
  const refundResult = await processRefundAction({
789
825
  orderId: primaryOrderId,
790
826
  type: "partial",
791
- amountInPaise: refundAmount,
827
+ amount: refundAmount,
792
828
  reason: `Automatic refund — ${unavailablePaid.length} item(s) unavailable at checkout: ${unavailablePaid.map((u) => u.productTitle).join(", ")}`,
793
829
  method: "razorpay",
794
830
  razorpayPaymentId,
@@ -803,7 +839,7 @@ async function refundDroppedItemsForRazorpayCheckout(input) {
803
839
  void normalizeError(refundErr);
804
840
  serverLogger.warn("verifyAndPlaceRazorpayOrderAction: automatic partial refund for dropped items failed — flagging for manual follow-up", {
805
841
  orderId: primaryOrderId,
806
- droppedValueInPaise,
842
+ droppedValue,
807
843
  err: refundErr instanceof Error ? refundErr.message : String(refundErr),
808
844
  });
809
845
  await unitOfWork.orders
@@ -973,14 +1009,14 @@ export async function verifyAndPlaceRazorpayOrderAction(input) {
973
1009
  }
974
1010
  {
975
1011
  // SB-UNI-5 2026-05-13 — bundle cart-lines use item.price (locked
976
- // bundlePriceInPaise) instead of the representative member's product.price.
1012
+ // bundlePrice) instead of the representative member's product.price.
977
1013
  const cartSubtotalRs = productChecks.reduce((sum, { item, product }) => {
978
1014
  const isBundle = Boolean(item.bundleCategorySlug && item.bundleProductIds?.length);
979
1015
  const unit = isBundle ? item.price : product.price;
980
1016
  return sum + unit * item.quantity;
981
1017
  }, 0);
982
- const expectedPlatformFee = Math.round(cartSubtotalRs * (platformFeePercent / 100) * 100) / 100;
983
- const expectedGstOnFee = Math.round(expectedPlatformFee * (gstPercent / 100) * 100) / 100;
1018
+ const expectedPlatformFee = roundRupees(cartSubtotalRs * (platformFeePercent / 100));
1019
+ const expectedGstOnFee = roundRupees(expectedPlatformFee * (gstPercent / 100));
984
1020
  const expectedPaymentAmountRs = cartSubtotalRs + expectedPlatformFee + expectedGstOnFee;
985
1021
  const rzpOrderRecord = await fetchRazorpayOrder(razorpay_order_id);
986
1022
  const paidAmountRs = paiseToRupees(rzpOrderRecord.amount);
@@ -1035,7 +1071,7 @@ export async function verifyAndPlaceRazorpayOrderAction(input) {
1035
1071
  .reduce((s, { item, product }) => s + unitPriceFor(item, product) * item.quantity, 0);
1036
1072
  couponGroupDiscount =
1037
1073
  eligibleTotal > 0
1038
- ? Math.min(Math.round((eligibleTotal / groupTotal) * coupon.discountAmount * 100) / 100, eligibleTotal)
1074
+ ? Math.min(roundRupees((eligibleTotal / groupTotal) * coupon.discountAmount), eligibleTotal)
1039
1075
  : 0;
1040
1076
  }
1041
1077
  else {
@@ -1043,7 +1079,7 @@ export async function verifyAndPlaceRazorpayOrderAction(input) {
1043
1079
  }
1044
1080
  }
1045
1081
  else if (cartSubtotal > 0) {
1046
- couponGroupDiscount = Math.min(Math.round((groupTotal / cartSubtotal) * coupon.discountAmount * 100) / 100, groupTotal);
1082
+ couponGroupDiscount = Math.min(roundRupees((groupTotal / cartSubtotal) * coupon.discountAmount), groupTotal);
1047
1083
  }
1048
1084
  if (couponGroupDiscount > 0) {
1049
1085
  couponDiscount += couponGroupDiscount;
@@ -1058,8 +1094,8 @@ export async function verifyAndPlaceRazorpayOrderAction(input) {
1058
1094
  }
1059
1095
  }
1060
1096
  couponDiscount = Math.min(couponDiscount, groupTotal);
1061
- const rawPlatformFee = Math.round(groupTotal * (platformFeePercent / 100) * 100) / 100;
1062
- const gstOnFee = Math.round(rawPlatformFee * (gstPercent / 100) * 100) / 100;
1097
+ const rawPlatformFee = roundRupees(groupTotal * (platformFeePercent / 100));
1098
+ const gstOnFee = roundRupees(rawPlatformFee * (gstPercent / 100));
1063
1099
  const platformFee = rawPlatformFee + gstOnFee;
1064
1100
  const orderTotal = Math.max(0, groupTotal - couponDiscount) + shippingFee;
1065
1101
  total += orderTotal;
@@ -1077,7 +1113,7 @@ export async function verifyAndPlaceRazorpayOrderAction(input) {
1077
1113
  const lt = (product?.listingType ?? "standard");
1078
1114
  const itemRule = getListingRule(lt);
1079
1115
  // SB-UNI-5 2026-05-13 — bundle cart-lines surface the locked
1080
- // bundlePriceInPaise (item.price), not the representative member's
1116
+ // bundlePrice (item.price), not the representative member's
1081
1117
  // product.price. Stock decrement still runs per member elsewhere.
1082
1118
  const isBundle = Boolean(item.bundleCategorySlug && item.bundleProductIds?.length);
1083
1119
  const unitPrice = isBundle ? item.price : product.price;
@@ -1134,7 +1170,7 @@ export async function verifyAndPlaceRazorpayOrderAction(input) {
1134
1170
  paymentRecord: {
1135
1171
  method: "razorpay",
1136
1172
  transactionId: razorpay_payment_id,
1137
- amountPaise: orderTotal,
1173
+ amount: orderTotal,
1138
1174
  paidAt: new Date(),
1139
1175
  verifiedBy: "razorpay-webhook",
1140
1176
  verificationMethod: "webhook",
@@ -0,0 +1,19 @@
1
+ import type { OrderDocument } from "../../../../features/orders/schemas/firestore";
2
+ /**
3
+ * Restores stock for a single order — increments `availableQuantity` (+ any
4
+ * rule-specific counters, via the symmetric `stockIncrementExtras` hook) for
5
+ * every product the order touched, then marks the order `stockRestored` so
6
+ * a second call is a no-op. Call sites: the 15-min `paymentWindowTimeout`
7
+ * sweep, the 24h `pendingOrderTimeout` sweep (COD), and
8
+ * `adminRejectPaymentAsFraudAction`.
9
+ *
10
+ * Runs its own Firestore transaction — Firestore requires all reads before
11
+ * any writes, so this cannot be folded into a caller's existing batch/
12
+ * transaction that has already started writing. `extraOrderUpdate` lets the
13
+ * caller's own order-cancellation fields (`status`, `cancellationReason`,
14
+ * `cancellationDate`, ...) land in the SAME transaction as the stock
15
+ * restore, so the two can never partially apply.
16
+ */
17
+ export declare function restoreStockForOrder(db: FirebaseFirestore.Firestore, order: OrderDocument & {
18
+ id: string;
19
+ }, extraOrderUpdate: Partial<OrderDocument>): Promise<void>;
@@ -0,0 +1,80 @@
1
+ import { ORDER_COLLECTION } from "../../../../features/orders/schemas/firestore";
2
+ import { PRODUCT_COLLECTION } from "../../../../features/products/schemas/firestore";
3
+ import { getListingRule } from "../../../shared/checkout/rules";
4
+ /**
5
+ * Per-product quantity to restore for one order — the inverse of
6
+ * `getExpandedDecrements` (bundle-expansion.ts), but reads from
7
+ * `OrderDocument.items` (post-checkout) rather than `CartItemDocument[]`
8
+ * (pre-checkout). Nets out any partial per-item cancellation that already
9
+ * happened (`cancelledQuantity`) so a previously-cancelled line isn't
10
+ * double-restored.
11
+ */
12
+ function getOrderRestoreMap(order) {
13
+ const map = new Map();
14
+ for (const item of order.items ?? []) {
15
+ const remainingQty = item.quantity - (item.cancelledQuantity ?? 0);
16
+ if (remainingQty <= 0)
17
+ continue;
18
+ const memberIds = item.bundleProductIds && item.bundleProductIds.length > 0
19
+ ? item.bundleProductIds
20
+ : [item.productId];
21
+ for (const pid of memberIds) {
22
+ map.set(pid, (map.get(pid) ?? 0) + remainingQty);
23
+ }
24
+ }
25
+ return map;
26
+ }
27
+ /**
28
+ * Restores stock for a single order — increments `availableQuantity` (+ any
29
+ * rule-specific counters, via the symmetric `stockIncrementExtras` hook) for
30
+ * every product the order touched, then marks the order `stockRestored` so
31
+ * a second call is a no-op. Call sites: the 15-min `paymentWindowTimeout`
32
+ * sweep, the 24h `pendingOrderTimeout` sweep (COD), and
33
+ * `adminRejectPaymentAsFraudAction`.
34
+ *
35
+ * Runs its own Firestore transaction — Firestore requires all reads before
36
+ * any writes, so this cannot be folded into a caller's existing batch/
37
+ * transaction that has already started writing. `extraOrderUpdate` lets the
38
+ * caller's own order-cancellation fields (`status`, `cancellationReason`,
39
+ * `cancellationDate`, ...) land in the SAME transaction as the stock
40
+ * restore, so the two can never partially apply.
41
+ */
42
+ export async function restoreStockForOrder(db, order, extraOrderUpdate) {
43
+ if (order.stockRestored)
44
+ return;
45
+ const restoreMap = getOrderRestoreMap(order);
46
+ const orderRef = db.collection(ORDER_COLLECTION).doc(order.id);
47
+ if (restoreMap.size === 0) {
48
+ await orderRef.update({
49
+ ...extraOrderUpdate,
50
+ stockRestored: true,
51
+ stockRestoredAt: new Date(),
52
+ });
53
+ return;
54
+ }
55
+ await db.runTransaction(async (tx) => {
56
+ const productIds = [...restoreMap.keys()];
57
+ const refs = productIds.map((pid) => db.collection(PRODUCT_COLLECTION).doc(pid));
58
+ const snaps = await Promise.all(refs.map((ref) => tx.get(ref)));
59
+ for (const snap of snaps) {
60
+ if (!snap.exists)
61
+ continue;
62
+ const product = snap.data();
63
+ const qty = restoreMap.get(snap.id) ?? 0;
64
+ if (qty <= 0)
65
+ continue;
66
+ const lt = (product.listingType ?? "standard");
67
+ const rule = getListingRule(lt);
68
+ tx.update(snap.ref, {
69
+ availableQuantity: product.availableQuantity + qty,
70
+ updatedAt: new Date(),
71
+ ...rule.stockIncrementExtras(product, qty),
72
+ });
73
+ }
74
+ tx.update(orderRef, {
75
+ ...extraOrderUpdate,
76
+ stockRestored: true,
77
+ stockRestoredAt: new Date(),
78
+ });
79
+ });
80
+ }
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Resolves the UPI VPA to show a buyer paying manually for an order — the
3
+ * seller's own `payoutDetails.upiId` for a seller-owned store (falling back
4
+ * to the site default if the seller hasn't configured one), or the site UPI
5
+ * directly for an admin-owned store. Called once at order-creation time and
6
+ * stored as `order.displayedUpiId` — resolving server-side here (rather than
7
+ * client-side at render time) makes the value immutable and un-spoofable,
8
+ * which is what the buyer-reported-UPI cross-check at proof-submission time
9
+ * depends on.
10
+ */
11
+ export declare function resolveDisplayedUpiId(storeId: string | undefined, siteContactUpiVpa: string | undefined): Promise<string | undefined>;
@@ -0,0 +1,28 @@
1
+ import { storeRepository, userRepository } from "../../../../repositories";
2
+ import { isSellerUser } from "../../../../features/auth/role-predicates";
3
+ /**
4
+ * Resolves the UPI VPA to show a buyer paying manually for an order — the
5
+ * seller's own `payoutDetails.upiId` for a seller-owned store (falling back
6
+ * to the site default if the seller hasn't configured one), or the site UPI
7
+ * directly for an admin-owned store. Called once at order-creation time and
8
+ * stored as `order.displayedUpiId` — resolving server-side here (rather than
9
+ * client-side at render time) makes the value immutable and un-spoofable,
10
+ * which is what the buyer-reported-UPI cross-check at proof-submission time
11
+ * depends on.
12
+ */
13
+ export async function resolveDisplayedUpiId(storeId, siteContactUpiVpa) {
14
+ const siteDefault = siteContactUpiVpa || undefined;
15
+ if (!storeId)
16
+ return siteDefault;
17
+ const store = await storeRepository.findById(storeId);
18
+ if (!store?.ownerId)
19
+ return siteDefault;
20
+ const owner = await userRepository.findById(store.ownerId);
21
+ if (!owner || !isSellerUser(owner))
22
+ return siteDefault;
23
+ const payoutDetails = owner.payoutDetails;
24
+ if (payoutDetails?.method === "upi" && payoutDetails.upiId) {
25
+ return payoutDetails.upiId;
26
+ }
27
+ return siteDefault;
28
+ }
@@ -10,7 +10,7 @@ export function renderClassifiedOg(doc, opts) {
10
10
  style: "currency",
11
11
  currency: doc.currency ?? "INR",
12
12
  maximumFractionDigits: 0,
13
- }).format(doc.price / 100)
13
+ }).format(doc.price)
14
14
  : null;
15
15
  return renderClassifiedOgImage({
16
16
  title: doc?.title ?? "Classified Listing",
@@ -6,7 +6,7 @@ export function renderDigitalCodeOg(doc, opts) {
6
6
  style: "currency",
7
7
  currency: doc.currency ?? "INR",
8
8
  maximumFractionDigits: 0,
9
- }).format(doc.price / 100)
9
+ }).format(doc.price)
10
10
  : null;
11
11
  const deliveryMethod = doc?.digitalCode?.codeDeliveryMethod === "auto-claim"
12
12
  ? "Instant delivery"
@@ -10,7 +10,7 @@
10
10
  * Item-request-specific accents:
11
11
  * - Header pill says "Wanted" with cyan accent.
12
12
  * - Status badge (Open / Closed).
13
- * - Budget chip when maxBudgetInPaise is set.
13
+ * - Budget chip when maxBudget is set.
14
14
  * - Reply count chip.
15
15
  */
16
16
  import type { ReactElement } from "react";
@@ -26,7 +26,7 @@ export interface ItemRequestOgData {
26
26
  interface ItemRequestDocLike {
27
27
  title?: string | null;
28
28
  opDisplayName?: string | null;
29
- maxBudgetInPaise?: number | null;
29
+ maxBudget?: number | null;
30
30
  imageUrls?: (string | null | undefined)[] | null;
31
31
  status?: string | null;
32
32
  replyCount?: number | null;
@@ -1,8 +1,7 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { resolveOgImageUrl } from "../seo/og";
3
- function formatPriceInr(paise) {
4
- const rupees = Math.round(paise / 100);
5
- return `≤ ₹${rupees.toLocaleString("en-IN")}`;
3
+ function formatPriceInr(amount) {
4
+ return `≤ ₹${amount.toLocaleString("en-IN")}`;
6
5
  }
7
6
  function normalizeStatus(s) {
8
7
  if (s === "open" || s === "closed" || s === "removed" || s === "approved")
@@ -10,8 +9,8 @@ function normalizeStatus(s) {
10
9
  return null;
11
10
  }
12
11
  export function renderItemRequestOg(doc, opts) {
13
- const budgetLabel = typeof doc?.maxBudgetInPaise === "number" && doc.maxBudgetInPaise > 0
14
- ? formatPriceInr(doc.maxBudgetInPaise)
12
+ const budgetLabel = typeof doc?.maxBudget === "number" && doc.maxBudget > 0
13
+ ? formatPriceInr(doc.maxBudget)
15
14
  : null;
16
15
  return renderItemRequestOgImage({
17
16
  title: doc?.title ?? "Item Request",
@@ -6,7 +6,7 @@ export function renderLiveItemOg(doc, opts) {
6
6
  style: "currency",
7
7
  currency: doc.currency ?? "INR",
8
8
  maximumFractionDigits: 0,
9
- }).format(doc.price / 100)
9
+ }).format(doc.price)
10
10
  : null;
11
11
  return renderLiveItemOgImage({
12
12
  title: doc?.title ?? "Live Listing",
@@ -1,9 +1,9 @@
1
1
  /**
2
- * Lottery adapters — strips server-only fields (priceInPaise, weight)
2
+ * Lottery adapters — strips server-only fields (price, weight)
3
3
  * before any slot/config data leaves the server.
4
4
  */
5
5
  import type { LotteryConfig, LotterySlot, ClientLotteryConfig, ClientLotterySlot } from "../../../../features/lottery/types";
6
- /** Strip priceInPaise and weight from a single slot for client consumption. */
6
+ /** Strip price and weight from a single slot for client consumption. */
7
7
  export declare function toClientLotterySlot(slot: LotterySlot): ClientLotterySlot;
8
8
  /** Strip price/weight from the entire config for client consumption. */
9
9
  export declare function toClientLotteryConfig(config: LotteryConfig): ClientLotteryConfig;
@@ -1,4 +1,4 @@
1
- /** Strip priceInPaise and weight from a single slot for client consumption. */
1
+ /** Strip price and weight from a single slot for client consumption. */
2
2
  export function toClientLotterySlot(slot) {
3
3
  return {
4
4
  slotNumber: slot.slotNumber,