@mohasinac/appkit 4.62.0 → 4.63.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 (391) hide show
  1. package/dist/.build-stamp.json +3 -3
  2. package/dist/_internal/client/features/layout/DashboardLayoutClient.js +8 -29
  3. package/dist/_internal/client/features/layout/filterNavItems.d.ts +28 -0
  4. package/dist/_internal/client/features/layout/filterNavItems.js +35 -0
  5. package/dist/_internal/server/features/ads/booking.d.ts +118 -0
  6. package/dist/_internal/server/features/ads/booking.js +326 -0
  7. package/dist/_internal/server/features/checkout/actions.d.ts +129 -9
  8. package/dist/_internal/server/features/checkout/actions.js +850 -79
  9. package/dist/_internal/server/features/checkout/expand-order-items.d.ts +1 -2
  10. package/dist/_internal/server/features/checkout/expand-order-items.js +32 -0
  11. package/dist/_internal/server/features/checkout/freeze-parts.d.ts +50 -0
  12. package/dist/_internal/server/features/checkout/freeze-parts.js +94 -0
  13. package/dist/_internal/server/features/checkout/value-otp-gate.d.ts +55 -0
  14. package/dist/_internal/server/features/checkout/value-otp-gate.js +60 -0
  15. package/dist/_internal/server/features/dashboard/attention.d.ts +128 -0
  16. package/dist/_internal/server/features/dashboard/attention.js +183 -0
  17. package/dist/_internal/server/features/dashboard/data.d.ts +47 -0
  18. package/dist/_internal/server/features/dashboard/data.js +82 -0
  19. package/dist/_internal/server/features/inventory/reservations.d.ts +99 -0
  20. package/dist/_internal/server/features/inventory/reservations.js +273 -0
  21. package/dist/_internal/server/features/invoicing/allocate.d.ts +63 -0
  22. package/dist/_internal/server/features/invoicing/allocate.js +162 -0
  23. package/dist/_internal/server/features/invoicing/credit-note.d.ts +57 -0
  24. package/dist/_internal/server/features/invoicing/credit-note.js +126 -0
  25. package/dist/_internal/server/features/invoicing/gstr1.d.ts +74 -0
  26. package/dist/_internal/server/features/invoicing/gstr1.js +251 -0
  27. package/dist/_internal/server/features/invoicing/issue.d.ts +96 -0
  28. package/dist/_internal/server/features/invoicing/issue.js +202 -0
  29. package/dist/_internal/server/features/offers/destinations.d.ts +40 -0
  30. package/dist/_internal/server/features/offers/destinations.js +65 -0
  31. package/dist/_internal/server/features/orders/actions.d.ts +8 -1
  32. package/dist/_internal/server/features/orders/actions.js +81 -8
  33. package/dist/_internal/server/features/orders/adapters.js +54 -0
  34. package/dist/_internal/server/features/orders/amend-delivery.d.ts +56 -0
  35. package/dist/_internal/server/features/orders/amend-delivery.js +124 -0
  36. package/dist/_internal/server/features/orders/balance.d.ts +89 -0
  37. package/dist/_internal/server/features/orders/balance.js +256 -0
  38. package/dist/_internal/server/features/orders/cancellation-refund.d.ts +15 -9
  39. package/dist/_internal/server/features/orders/cancellation-refund.js +15 -9
  40. package/dist/_internal/server/features/points/award.js +46 -4
  41. package/dist/_internal/server/features/pricing/actions.d.ts +58 -0
  42. package/dist/_internal/server/features/pricing/actions.js +144 -0
  43. package/dist/_internal/server/features/refunds/actions.js +26 -0
  44. package/dist/_internal/server/features/shipping/book-split.d.ts +86 -0
  45. package/dist/_internal/server/features/shipping/book-split.js +130 -0
  46. package/dist/_internal/server/features/shipping/book.d.ts +61 -0
  47. package/dist/_internal/server/features/shipping/book.js +176 -0
  48. package/dist/_internal/server/features/shipping/courier-block.d.ts +69 -0
  49. package/dist/_internal/server/features/shipping/courier-block.js +264 -0
  50. package/dist/_internal/server/features/site-settings/adapters.d.ts +2 -2
  51. package/dist/_internal/server/features/site-settings/adapters.js +29 -0
  52. package/dist/_internal/server/features/stores/adapters.d.ts +2 -2
  53. package/dist/_internal/server/features/stores/adapters.js +65 -0
  54. package/dist/_internal/server/functions/scheduled.d.ts +2 -1
  55. package/dist/_internal/server/functions/scheduled.js +95 -2
  56. package/dist/_internal/server/jobs/core/autoPayoutEligibility.js +11 -2
  57. package/dist/_internal/server/jobs/core/dailyStatusDigest.d.ts +4 -0
  58. package/dist/_internal/server/jobs/core/dailyStatusDigest.js +19 -2
  59. package/dist/_internal/server/jobs/core/index.d.ts +2 -1
  60. package/dist/_internal/server/jobs/core/index.js +2 -1
  61. package/dist/_internal/server/jobs/core/jobRunners.js +45 -0
  62. package/dist/_internal/server/jobs/core/onJobCreated.d.ts +30 -7
  63. package/dist/_internal/server/jobs/core/onJobCreated.js +78 -45
  64. package/dist/_internal/server/jobs/core/onOrderStatusChange.d.ts +7 -0
  65. package/dist/_internal/server/jobs/core/onOrderStatusChange.js +65 -0
  66. package/dist/_internal/server/jobs/core/paymentWindowTimeout.js +33 -0
  67. package/dist/_internal/server/jobs/core/reservationExpiry.d.ts +17 -0
  68. package/dist/_internal/server/jobs/core/reservationExpiry.js +40 -0
  69. package/dist/_internal/server/jobs/core/runJobOnce.d.ts +48 -0
  70. package/dist/_internal/server/jobs/core/runJobOnce.js +195 -0
  71. package/dist/_internal/server/jobs/core/weeklyPayoutEligibility.js +25 -2
  72. package/dist/_internal/server/jobs/handlers/index.d.ts +1 -0
  73. package/dist/_internal/server/jobs/handlers/index.js +1 -0
  74. package/dist/_internal/server/jobs/handlers/onOrderStatusChange.js +17 -0
  75. package/dist/_internal/server/jobs/handlers/reservationExpiry.d.ts +2 -0
  76. package/dist/_internal/server/jobs/handlers/reservationExpiry.js +2 -0
  77. package/dist/_internal/server/notifications/channel-health.d.ts +26 -3
  78. package/dist/_internal/shared/actions/action-registry.d.ts +1 -1
  79. package/dist/_internal/shared/actions/action-registry.js +296 -0
  80. package/dist/_internal/shared/checkout/coupon-discount.d.ts +43 -1
  81. package/dist/_internal/shared/checkout/coupon-discount.js +26 -1
  82. package/dist/_internal/shared/checkout/order-math.d.ts +174 -0
  83. package/dist/_internal/shared/checkout/order-math.js +159 -0
  84. package/dist/_internal/shared/checkout/refundable-base.d.ts +25 -0
  85. package/dist/_internal/shared/checkout/refundable-base.js +13 -1
  86. package/dist/_internal/shared/checkout/rules/index.d.ts +1 -1
  87. package/dist/_internal/shared/checkout/rules/index.js +1 -1
  88. package/dist/_internal/shared/checkout/rules/payment-gate.d.ts +18 -0
  89. package/dist/_internal/shared/checkout/rules/payment-gate.js +25 -0
  90. package/dist/_internal/shared/checkout/split.d.ts +75 -0
  91. package/dist/_internal/shared/checkout/split.js +120 -0
  92. package/dist/_internal/shared/content/disclaimers.d.ts +88 -0
  93. package/dist/_internal/shared/content/disclaimers.js +217 -0
  94. package/dist/_internal/shared/content/published-values.d.ts +93 -0
  95. package/dist/_internal/shared/content/published-values.js +206 -0
  96. package/dist/_internal/shared/features/admin/integrations.d.ts +139 -0
  97. package/dist/_internal/shared/features/admin/integrations.js +263 -0
  98. package/dist/_internal/shared/features/dashboard/hub-sections.d.ts +72 -0
  99. package/dist/_internal/shared/features/dashboard/hub-sections.js +75 -0
  100. package/dist/_internal/shared/features/emi/choice.d.ts +98 -0
  101. package/dist/_internal/shared/features/emi/choice.js +69 -0
  102. package/dist/_internal/shared/features/emi/group.d.ts +84 -0
  103. package/dist/_internal/shared/features/emi/group.js +126 -0
  104. package/dist/_internal/shared/features/ledger/posting.d.ts +107 -0
  105. package/dist/_internal/shared/features/ledger/posting.js +165 -0
  106. package/dist/_internal/shared/features/ledger/reports.d.ts +76 -0
  107. package/dist/_internal/shared/features/ledger/reports.js +127 -0
  108. package/dist/_internal/shared/features/ledger/rules.d.ts +170 -0
  109. package/dist/_internal/shared/features/ledger/rules.js +221 -0
  110. package/dist/_internal/shared/features/offers/coordination.d.ts +122 -0
  111. package/dist/_internal/shared/features/offers/coordination.js +80 -0
  112. package/dist/_internal/shared/features/orders/delivery-snapshot.d.ts +114 -0
  113. package/dist/_internal/shared/features/orders/delivery-snapshot.js +116 -0
  114. package/dist/_internal/shared/features/orders/dispute-reasons.d.ts +113 -0
  115. package/dist/_internal/shared/features/orders/dispute-reasons.js +181 -0
  116. package/dist/_internal/shared/features/orders/refund-copy.d.ts +1 -1
  117. package/dist/_internal/shared/features/orders/refund-copy.js +18 -1
  118. package/dist/_internal/shared/features/payouts/pay-period.d.ts +91 -0
  119. package/dist/_internal/shared/features/payouts/pay-period.js +104 -0
  120. package/dist/_internal/shared/features/points/accepts.d.ts +29 -0
  121. package/dist/_internal/shared/features/points/accepts.js +49 -0
  122. package/dist/_internal/shared/features/pricing/rate-registry.d.ts +150 -0
  123. package/dist/_internal/shared/features/pricing/rate-registry.js +246 -0
  124. package/dist/_internal/shared/features/shipping/parcel.d.ts +123 -0
  125. package/dist/_internal/shared/features/shipping/parcel.js +139 -0
  126. package/dist/_internal/shared/features/shipping/shared-purchase.d.ts +91 -0
  127. package/dist/_internal/shared/features/shipping/shared-purchase.js +108 -0
  128. package/dist/_internal/shared/features/site-settings/fees.d.ts +16 -8
  129. package/dist/_internal/shared/features/site-settings/fees.js +12 -8
  130. package/dist/_internal/shared/features/site-settings/types.d.ts +11 -0
  131. package/dist/_internal/shared/fees/calculator.d.ts +33 -1
  132. package/dist/_internal/shared/fees/calculator.js +32 -2
  133. package/dist/_internal/shared/fees/explain.d.ts +81 -0
  134. package/dist/_internal/shared/fees/explain.js +101 -0
  135. package/dist/_internal/shared/history/index.d.ts +1 -1
  136. package/dist/_internal/shared/history/index.js +1 -1
  137. package/dist/_internal/shared/history/types.d.ts +7 -1
  138. package/dist/_internal/shared/history/types.js +25 -0
  139. package/dist/client.d.ts +21 -0
  140. package/dist/client.js +43 -0
  141. package/dist/constants/api-endpoints.d.ts +114 -0
  142. package/dist/constants/api-endpoints.js +55 -0
  143. package/dist/constants/field-names.d.ts +42 -0
  144. package/dist/constants/field-names.js +52 -0
  145. package/dist/contracts/index.d.ts +1 -1
  146. package/dist/contracts/shipping.d.ts +45 -0
  147. package/dist/contracts/shipping.js +15 -0
  148. package/dist/features/about/components/AboutView.js +1 -1
  149. package/dist/features/account/components/BuyerAuctionsGuideView.js +4 -1
  150. package/dist/features/account/components/UserOrdersView.js +47 -35
  151. package/dist/features/admin/components/AdminCouponEditorView.js +17 -0
  152. package/dist/features/admin/components/AdminIntegrationsView.d.ts +55 -0
  153. package/dist/features/admin/components/AdminIntegrationsView.js +74 -0
  154. package/dist/features/admin/components/AdminInvoicingView.d.ts +2 -0
  155. package/dist/features/admin/components/AdminInvoicingView.js +65 -0
  156. package/dist/features/admin/components/AdminOrderEditorView.d.ts +33 -1
  157. package/dist/features/admin/components/AdminOrderEditorView.js +81 -3
  158. package/dist/features/admin/components/AdminOrdersGuideView.js +23 -2
  159. package/dist/features/admin/components/AdminOrdersView.js +86 -5
  160. package/dist/features/admin/components/OwnerQuickActions.js +24 -2
  161. package/dist/features/admin/constants/filter-tabs.d.ts +6 -0
  162. package/dist/features/admin/constants/filter-tabs.js +6 -0
  163. package/dist/features/admin/constants/site-settings-tabs.d.ts +1 -1
  164. package/dist/features/admin/hooks/useAdminListingData.js +16 -0
  165. package/dist/features/admin/schemas/admin-user-form.d.ts +2 -2
  166. package/dist/features/admin/schemas/firestore.d.ts +62 -0
  167. package/dist/features/admin/schemas/firestore.js +5 -0
  168. package/dist/features/ads/schemas/booking-write.d.ts +120 -0
  169. package/dist/features/ads/schemas/booking-write.js +75 -0
  170. package/dist/features/ads/schemas/creative-form.d.ts +18 -0
  171. package/dist/features/ads/schemas/creative-form.js +51 -0
  172. package/dist/features/ads/schemas/firestore.d.ts +140 -0
  173. package/dist/features/ads/schemas/firestore.js +109 -0
  174. package/dist/features/auctions/repository/bid.repository.js +3 -1
  175. package/dist/features/audit-log/schemas/firestore.d.ts +140 -0
  176. package/dist/features/audit-log/schemas/firestore.js +89 -0
  177. package/dist/features/auth/actions/profile-actions.d.ts +69 -1
  178. package/dist/features/auth/actions/profile-actions.js +62 -1
  179. package/dist/features/auth/permissions/constants.js +13 -0
  180. package/dist/features/auth/schemas/firestore.d.ts +16 -2
  181. package/dist/features/auth/schemas/firestore.js +2 -1
  182. package/dist/features/blog/actions/blog-actions.d.ts +6 -0
  183. package/dist/features/blog/actions/blog-actions.js +17 -2
  184. package/dist/features/blog/api/route.js +4 -1
  185. package/dist/features/blog/columns/index.js +5 -0
  186. package/dist/features/blog/components/BlogIndexPageView.js +2 -1
  187. package/dist/features/blog/repository/blog.repository.d.ts +4 -0
  188. package/dist/features/blog/repository/blog.repository.js +5 -0
  189. package/dist/features/blog/schemas/blog-form.d.ts +3 -0
  190. package/dist/features/blog/schemas/blog-form.js +1 -0
  191. package/dist/features/blog/schemas/firestore.d.ts +38 -1
  192. package/dist/features/blog/schemas/firestore.js +23 -0
  193. package/dist/features/blog/schemas/index.d.ts +6 -0
  194. package/dist/features/blog/schemas/index.js +2 -0
  195. package/dist/features/blog/types/index.d.ts +2 -0
  196. package/dist/features/cart/components/CartPriceBreakdown.d.ts +25 -1
  197. package/dist/features/cart/components/CartPriceBreakdown.js +29 -6
  198. package/dist/features/cart/components/PointsTenderPicker.d.ts +61 -0
  199. package/dist/features/cart/components/PointsTenderPicker.js +15 -0
  200. package/dist/features/cart/components/StoreAddonsPicker.js +2 -1
  201. package/dist/features/cart/components/index.d.ts +2 -0
  202. package/dist/features/cart/components/index.js +1 -0
  203. package/dist/features/cart/repository/cart.repository.d.ts +33 -0
  204. package/dist/features/cart/repository/cart.repository.js +47 -0
  205. package/dist/features/cart/schemas/firestore.d.ts +116 -0
  206. package/dist/features/contact/email.d.ts +27 -10
  207. package/dist/features/contact/email.js +20 -3
  208. package/dist/features/dashboard/components/DashboardHubView.d.ts +83 -0
  209. package/dist/features/dashboard/components/DashboardHubView.js +56 -0
  210. package/dist/features/dashboard/components/DashboardSectionsClient.d.ts +23 -0
  211. package/dist/features/dashboard/components/DashboardSectionsClient.js +66 -0
  212. package/dist/features/dispute-reasons/components/AdminDisputeReasonsView.d.ts +55 -0
  213. package/dist/features/dispute-reasons/components/AdminDisputeReasonsView.js +175 -0
  214. package/dist/features/dispute-reasons/repository/dispute-reasons.repository.d.ts +62 -0
  215. package/dist/features/dispute-reasons/repository/dispute-reasons.repository.js +108 -0
  216. package/dist/features/dispute-reasons/schemas/firestore.d.ts +62 -0
  217. package/dist/features/dispute-reasons/schemas/firestore.js +40 -0
  218. package/dist/features/events/components/EventSaleBanner.js +1 -1
  219. package/dist/features/faq/components/FAQAccordion.d.ts +13 -1
  220. package/dist/features/faq/components/FAQAccordion.js +29 -4
  221. package/dist/features/faq/components/FAQPageContent.js +2 -2
  222. package/dist/features/gateway-events/schemas/index.d.ts +2 -2
  223. package/dist/features/homepage/schemas/index.d.ts +8 -8
  224. package/dist/features/inventory/schemas/stock-reservation.d.ts +114 -0
  225. package/dist/features/inventory/schemas/stock-reservation.js +103 -0
  226. package/dist/features/invoicing/schemas/firestore.d.ts +112 -0
  227. package/dist/features/invoicing/schemas/firestore.js +45 -0
  228. package/dist/features/invoicing/utils/financial-year.d.ts +43 -0
  229. package/dist/features/invoicing/utils/financial-year.js +53 -0
  230. package/dist/features/jobs/actions/enqueue-job.js +18 -1
  231. package/dist/features/jobs/repository/jobs.repository.d.ts +62 -1
  232. package/dist/features/jobs/repository/jobs.repository.js +84 -1
  233. package/dist/features/jobs/schemas/firestore.d.ts +80 -0
  234. package/dist/features/jobs/schemas/firestore.js +37 -0
  235. package/dist/features/layout/AppLayoutShell.d.ts +9 -1
  236. package/dist/features/layout/AppLayoutShell.js +12 -4
  237. package/dist/features/layout/BottomActions.js +2 -1
  238. package/dist/features/layout/BottomNavbar.d.ts +10 -2
  239. package/dist/features/layout/SideActionDock.js +52 -2
  240. package/dist/features/layout/TitleBarLayout.js +13 -4
  241. package/dist/features/layout/TitleBarLayout.style.css +59 -0
  242. package/dist/features/layout/useCtaReveal.d.ts +16 -1
  243. package/dist/features/layout/useCtaReveal.js +17 -26
  244. package/dist/features/ledger/repository/journal.repository.d.ts +110 -0
  245. package/dist/features/ledger/repository/journal.repository.js +312 -0
  246. package/dist/features/ledger/schemas/expenses.d.ts +87 -0
  247. package/dist/features/ledger/schemas/expenses.js +27 -0
  248. package/dist/features/ledger/schemas/firestore.d.ts +183 -0
  249. package/dist/features/ledger/schemas/firestore.js +69 -0
  250. package/dist/features/lottery/schemas/zod.d.ts +6 -6
  251. package/dist/features/media/MediaImage.js +22 -1
  252. package/dist/features/media/upload/ImageUpload.js +1 -1
  253. package/dist/features/obligations/constants/policies.js +24 -1
  254. package/dist/features/orders/components/BalancePaymentPanel.d.ts +12 -0
  255. package/dist/features/orders/components/BalancePaymentPanel.js +94 -0
  256. package/dist/features/orders/components/OrderPaymentSummary.js +10 -1
  257. package/dist/features/orders/components/OrderProvenanceCard.d.ts +8 -0
  258. package/dist/features/orders/components/OrderProvenanceCard.js +185 -0
  259. package/dist/features/orders/components/RaiseDisputeForm.d.ts +14 -0
  260. package/dist/features/orders/components/RaiseDisputeForm.js +119 -0
  261. package/dist/features/orders/components/RefundRequestView.js +19 -1
  262. package/dist/features/orders/components/index.d.ts +4 -0
  263. package/dist/features/orders/components/index.js +2 -0
  264. package/dist/features/orders/constants/order-lane-tabs.d.ts +69 -0
  265. package/dist/features/orders/constants/order-lane-tabs.js +88 -0
  266. package/dist/features/orders/repository/orders.repository.d.ts +85 -1
  267. package/dist/features/orders/repository/orders.repository.js +205 -6
  268. package/dist/features/orders/schemas/balance.d.ts +40 -0
  269. package/dist/features/orders/schemas/balance.js +47 -0
  270. package/dist/features/orders/schemas/firestore.d.ts +398 -1
  271. package/dist/features/orders/schemas/firestore.js +43 -0
  272. package/dist/features/orders/schemas/index.d.ts +56 -8
  273. package/dist/features/orders/schemas/index.js +12 -0
  274. package/dist/features/orders/types/index.d.ts +47 -0
  275. package/dist/features/orders/utils/courier-block.d.ts +25 -0
  276. package/dist/features/orders/utils/courier-block.js +23 -0
  277. package/dist/features/payment-cases/schemas/firestore.d.ts +26 -1
  278. package/dist/features/payment-cases/schemas/firestore.js +1 -0
  279. package/dist/features/payments/repository/payout.repository.js +3 -2
  280. package/dist/features/payments/schemas/firestore.d.ts +92 -1
  281. package/dist/features/payments/schemas/firestore.js +23 -0
  282. package/dist/features/pricing/components/AdminPricingView.d.ts +13 -0
  283. package/dist/features/pricing/components/AdminPricingView.js +157 -0
  284. package/dist/features/products/components/PrizeDrawDetailPageView.js +2 -2
  285. package/dist/features/products/components/ProductDetailPageView.d.ts +17 -1
  286. package/dist/features/products/components/ProductDetailPageView.js +2 -2
  287. package/dist/features/products/schemas/firestore.d.ts +26 -1
  288. package/dist/features/products/schemas/firestore.js +2 -0
  289. package/dist/features/products/schemas/index.d.ts +2 -2
  290. package/dist/features/products/schemas/product-features.validators.d.ts +10 -10
  291. package/dist/features/promotions/actions/coupon-stacking.d.ts +30 -3
  292. package/dist/features/promotions/actions/coupon-stacking.js +21 -2
  293. package/dist/features/promotions/components/CouponCard.js +13 -0
  294. package/dist/features/promotions/constants/coupon-help.d.ts +2 -2
  295. package/dist/features/promotions/constants/coupon-help.js +9 -1
  296. package/dist/features/promotions/schemas/firestore.d.ts +24 -0
  297. package/dist/features/promotions/schemas/firestore.js +4 -0
  298. package/dist/features/promotions/types/index.d.ts +19 -1
  299. package/dist/features/reviews/repository/reviews.repository.d.ts +14 -0
  300. package/dist/features/reviews/repository/reviews.repository.js +16 -0
  301. package/dist/features/scams/components/ScamProfileView.js +2 -2
  302. package/dist/features/scams/components/ScamRegistryView.js +2 -2
  303. package/dist/features/scams/repository/scammer.repository.js +2 -1
  304. package/dist/features/scams/schemas/firestore.d.ts +2 -1
  305. package/dist/features/scams/schemas/firestore.js +2 -1
  306. package/dist/features/search/action-index/tab-entries.js +1 -1
  307. package/dist/features/seller/actions/offer-actions.js +56 -0
  308. package/dist/features/seller/actions/seller-actions.d.ts +1 -1
  309. package/dist/features/seller/actions/seller-actions.js +37 -3
  310. package/dist/features/seller/components/DispatchForm.d.ts +11 -0
  311. package/dist/features/seller/components/DispatchForm.js +190 -0
  312. package/dist/features/seller/components/SellerOrdersView.js +221 -27
  313. package/dist/features/seller/components/index.d.ts +1 -0
  314. package/dist/features/seller/components/index.js +1 -0
  315. package/dist/features/seller/hooks/useSellerListingData.js +25 -0
  316. package/dist/features/seller/repository/offer.repository.js +4 -3
  317. package/dist/features/seller/schemas/firestore.d.ts +23 -2
  318. package/dist/features/seller/schemas/firestore.js +3 -2
  319. package/dist/features/seller/schemas/index.d.ts +4 -4
  320. package/dist/features/seller/schemas/order-forms.d.ts +61 -4
  321. package/dist/features/seller/schemas/order-forms.js +41 -8
  322. package/dist/features/shipments/schemas/firestore.d.ts +25 -0
  323. package/dist/features/shipments/schemas/validation.d.ts +4 -4
  324. package/dist/features/shipping-boxes/repository/shipping-boxes.repository.d.ts +82 -0
  325. package/dist/features/shipping-boxes/repository/shipping-boxes.repository.js +145 -0
  326. package/dist/features/shipping-boxes/schemas/firestore.d.ts +80 -0
  327. package/dist/features/shipping-boxes/schemas/firestore.js +53 -0
  328. package/dist/features/store-extensions/schemas/report-create-form.d.ts +2 -2
  329. package/dist/features/store-extensions/schemas/shipping-config-form.d.ts +2 -2
  330. package/dist/features/stores/components/StoreOrdersGuideView.js +6 -1
  331. package/dist/features/stores/repository/store.repository.d.ts +18 -0
  332. package/dist/features/stores/repository/store.repository.js +27 -1
  333. package/dist/features/stores/schemas/firestore.d.ts +112 -0
  334. package/dist/features/stores/schemas/firestore.js +20 -0
  335. package/dist/features/stores/schemas/index.d.ts +6 -6
  336. package/dist/features/stores/types/index.d.ts +19 -0
  337. package/dist/features/support/repository/support.repository.js +72 -6
  338. package/dist/features/support/schemas/firestore.d.ts +17 -0
  339. package/dist/features/support/schemas/index.d.ts +8 -8
  340. package/dist/features/wishlist/hooks/useWishlistWithGuest.d.ts +1 -1
  341. package/dist/index.d.ts +11 -1
  342. package/dist/index.js +33 -1
  343. package/dist/next/routing/route-map.d.ts +112 -0
  344. package/dist/next/routing/route-map.js +63 -0
  345. package/dist/providers/shipping-shiprocket/index.d.ts +27 -1
  346. package/dist/providers/shipping-shiprocket/index.js +84 -1
  347. package/dist/react/contexts/SessionContext.d.ts +17 -1
  348. package/dist/schemas/registry.d.ts +69 -34
  349. package/dist/schemas/sieve.d.ts +2 -2
  350. package/dist/security/pii-schemas.d.ts +1 -1
  351. package/dist/security/pii-schemas.js +45 -0
  352. package/dist/server-entry.d.ts +2 -2
  353. package/dist/server-entry.js +8 -1
  354. package/dist/server.d.ts +36 -1
  355. package/dist/server.js +183 -1
  356. package/dist/styles.css +412 -80
  357. package/dist/tailwind-utilities.css +1 -1
  358. package/dist/tokens/themes/default-dark.js +1 -0
  359. package/dist/tokens/themes/default-light.js +1 -0
  360. package/dist/tokens/themes/required.d.ts +1 -1
  361. package/dist/tokens/themes/required.js +1 -0
  362. package/dist/tokens/tokens.css +15 -0
  363. package/dist/ui/components/Button.d.ts +10 -1
  364. package/dist/ui/components/Button.js +25 -3
  365. package/dist/ui/components/Chart.d.ts +63 -0
  366. package/dist/ui/components/Chart.js +169 -0
  367. package/dist/ui/components/Chart.style.css +214 -0
  368. package/dist/ui/components/Disclaimer.d.ts +19 -0
  369. package/dist/ui/components/Disclaimer.js +83 -0
  370. package/dist/ui/components/OverflowRow.js +54 -2
  371. package/dist/ui/components/OverflowRow.style.css +38 -0
  372. package/dist/ui/components/RichTextEditor.js +99 -8
  373. package/dist/ui/components/chart-spec.d.ts +68 -0
  374. package/dist/ui/components/chart-spec.js +140 -0
  375. package/dist/ui/components/index.style.css +1 -0
  376. package/dist/ui/components/surface-tokens.d.ts +1 -1
  377. package/dist/ui/components/surface-tokens.js +9 -0
  378. package/dist/ui/components/tabs-overflow.js +64 -11
  379. package/dist/ui/components/toolbar-collapse.d.ts +13 -0
  380. package/dist/ui/components/toolbar-collapse.js +10 -1
  381. package/dist/ui/index.d.ts +8 -0
  382. package/dist/ui/index.js +9 -0
  383. package/dist/ui/rich-text/RichText.d.ts +10 -1
  384. package/dist/ui/rich-text/RichText.js +33 -2
  385. package/dist/ui/rich-text/RichText.style.css +83 -79
  386. package/dist/ui/rich-text/RichTextRenderer.d.ts +30 -1
  387. package/dist/ui/rich-text/RichTextRenderer.js +34 -2
  388. package/dist/ui/rich-text/chart-blocks.d.ts +62 -0
  389. package/dist/ui/rich-text/chart-blocks.js +87 -0
  390. package/package.json +1 -1
  391. package/scripts/seed-cli.mjs +1834 -1822
@@ -21,6 +21,8 @@ export declare const DEFAULT_ROUTE_MAP: {
21
21
  readonly AUCTIONS: "/auctions";
22
22
  readonly AUCTION_DETAIL: (id: string) => string;
23
23
  readonly PRE_ORDERS: "/pre-orders";
24
+ /** D56 — the public rate card + self-serve booking form. */
25
+ readonly ADVERTISE: "/advertise";
24
26
  readonly PRE_ORDER_DETAIL: (id: string) => string;
25
27
  readonly BUNDLES: "/bundles";
26
28
  readonly BUNDLE_DETAIL: (slug: string) => string;
@@ -157,6 +159,16 @@ export declare const DEFAULT_ROUTE_MAP: {
157
159
  };
158
160
  readonly USER: {
159
161
  readonly DASHBOARD: "/user";
162
+ /**
163
+ * A dashboard SECTION hub — the screens of one sidebar group, each with a
164
+ * sentence on what it is for.
165
+ *
166
+ * One parametric route serves every section of the portal; the slug is
167
+ * `hubSectionSlug(group.title)` and is DERIVED, so there is no list of
168
+ * section keys here to drift from the nav. `audit-dashboard-hub-coverage`
169
+ * cross-checks the two.
170
+ */
171
+ readonly SECTION: (slug: string) => string;
160
172
  readonly PROFILE: "/user/profile";
161
173
  readonly SETTINGS: "/user/settings";
162
174
  readonly ORDERS: "/user/orders";
@@ -177,6 +189,17 @@ export declare const DEFAULT_ROUTE_MAP: {
177
189
  readonly ORDER_CLAIM: (id: string) => string;
178
190
  readonly ORDER_INVOICE: (id: string) => string;
179
191
  readonly ORDER_PAYMENT: (id: string) => string;
192
+ /**
193
+ * Raise a dispute on one order.
194
+ *
195
+ * Deep-linkable on purpose: a notification `actionUrl` points here, and
196
+ * `/user/orders/view/{id}` carries a "Report a problem" button to the same
197
+ * place. One surface, two ways in — an email link that works only while
198
+ * the buyer still has the email is the shape Root Cause #57 records,
199
+ * where `ORDER_PAYMENT` had exactly ONE caller and a buyer who navigated
200
+ * away could not get back.
201
+ */
202
+ readonly ORDER_DISPUTE: (id: string) => string;
180
203
  readonly NOTIFICATIONS: "/user/notifications";
181
204
  /** Plan §10 — claimed-coupons wallet (Active / Expired / Used tabs). */
182
205
  readonly CLAIMED_COUPONS: "/user/coupons";
@@ -198,6 +221,8 @@ export declare const DEFAULT_ROUTE_MAP: {
198
221
  readonly SUPPORT_NEW: "/user/support/new";
199
222
  readonly SUPPORT_TICKET: (id: string) => string;
200
223
  readonly PRE_ORDERS: "/user/pre-orders";
224
+ /** D56 — the advertiser's own bookings and their moderation state. */
225
+ readonly AD_BOOKINGS: "/user/ad-bookings";
201
226
  readonly DIGITAL_CODES: "/user/digital-codes";
202
227
  readonly PRIZE_DRAWS: "/user/prize-draws";
203
228
  readonly EVENTS: "/user/events";
@@ -210,6 +235,8 @@ export declare const DEFAULT_ROUTE_MAP: {
210
235
  };
211
236
  readonly STORE: {
212
237
  readonly DASHBOARD: "/store";
238
+ /** A dashboard SECTION hub — see `USER.SECTION` for the derivation. */
239
+ readonly SECTION: (slug: string) => string;
213
240
  readonly PRODUCTS: "/store/products";
214
241
  readonly PRODUCTS_NEW: "/store/products/new";
215
242
  readonly PRODUCTS_EDIT: (id: string) => string;
@@ -300,6 +327,18 @@ export declare const DEFAULT_ROUTE_MAP: {
300
327
  };
301
328
  readonly ADMIN: {
302
329
  readonly DASHBOARD: "/admin/dashboard";
330
+ /**
331
+ * The sectioned landing at `/admin` — what used to `redirect()` to
332
+ * `DASHBOARD`.
333
+ *
334
+ * 🛑 `DASHBOARD` is `/admin/dashboard` and stays a separate page: it is the
335
+ * metrics screen, and the sidebar's "Dashboard" entry points at it. This
336
+ * key is the index that lists the twelve sections. Collapsing the two would
337
+ * either bury the metrics or make the index unreachable.
338
+ */
339
+ readonly HOME: "/admin";
340
+ /** A dashboard SECTION hub — see `USER.SECTION` for the derivation. */
341
+ readonly SECTION: (slug: string) => string;
303
342
  readonly SHIPMENTS: "/admin/shipments";
304
343
  readonly INVENTORY_BOXES: "/admin/inventory/boxes";
305
344
  readonly INVENTORY_BOX_DETAIL: (id: string) => string;
@@ -315,6 +354,7 @@ export declare const DEFAULT_ROUTE_MAP: {
315
354
  readonly USER_DETAIL: (id: string) => string;
316
355
  readonly USER_EDIT: (id: string) => string;
317
356
  readonly SITE: "/admin/site";
357
+ readonly INTEGRATIONS: "/admin/integrations";
318
358
  readonly CAROUSEL: "/admin/carousel";
319
359
  readonly CAROUSEL_NEW: "/admin/carousel/new";
320
360
  readonly CAROUSEL_EDIT: (id: string) => string;
@@ -374,9 +414,20 @@ export declare const DEFAULT_ROUTE_MAP: {
374
414
  readonly ANALYTICS: "/admin/analytics";
375
415
  readonly PAYOUTS: "/admin/payouts";
376
416
  readonly PAYOUT_DETAIL: (id: string) => string;
417
+ readonly PRICING: "/admin/pricing";
377
418
  readonly AUDIT_LOG: "/admin/audit-log";
378
419
  readonly MONEY_CASES: "/admin/money-cases";
379
420
  readonly MONEY_CASE_DETAIL: (id: string) => string;
421
+ /**
422
+ * Phase 7 — the GSTR-1 draft export.
423
+ *
424
+ * 🛑 Under Finance for the same reason `MONEY_CASES` is, and the reason is
425
+ * stronger here: the export contains the company's tax position for a
426
+ * quarter plus every buyer's place of supply. That is not a maintenance
427
+ * diagnostic, and it is admin-only — deliberately not granted to
428
+ * `maintenance_employee`.
429
+ */
430
+ readonly INVOICING: "/admin/invoicing";
380
431
  readonly PROTECTION_CLAIMS: "/admin/protection-claims";
381
432
  readonly MAINTENANCE_GATEWAY_EVENTS: "/admin/maintenance/gateway-events";
382
433
  readonly MAINTENANCE_OBLIGATIONS: "/admin/maintenance/obligations";
@@ -389,6 +440,8 @@ export declare const DEFAULT_ROUTE_MAP: {
389
440
  readonly ADS: "/admin/ads";
390
441
  readonly ADS_NEW: "/admin/ads/new";
391
442
  readonly ADS_EDIT: (id: string) => string;
443
+ /** D56 — the self-serve creative moderation queue. */
444
+ readonly AD_BOOKINGS: "/admin/ads/bookings";
392
445
  readonly NEWSLETTER: "/admin/newsletter";
393
446
  readonly CONTACT: "/admin/contact";
394
447
  readonly SESSIONS: "/admin/sessions";
@@ -423,6 +476,8 @@ export declare const DEFAULT_ROUTE_MAP: {
423
476
  readonly TEAM_NEW: "/admin/team/new";
424
477
  readonly TEAM_EDIT: (id: string) => string;
425
478
  readonly SUPPORT_TICKETS: "/admin/support-tickets";
479
+ /** Staff curation of the reasons a buyer can pick when disputing. */
480
+ readonly DISPUTE_REASONS: "/admin/dispute-reasons";
426
481
  readonly SUPPORT_TICKET_BY_ID: (id: string) => string;
427
482
  readonly SCAMMERS: "/admin/scammers";
428
483
  readonly SCAMMER_BY_ID: (id: string) => string;
@@ -475,6 +530,8 @@ export declare const ROUTES: {
475
530
  readonly AUCTIONS: "/auctions";
476
531
  readonly AUCTION_DETAIL: (id: string) => string;
477
532
  readonly PRE_ORDERS: "/pre-orders";
533
+ /** D56 — the public rate card + self-serve booking form. */
534
+ readonly ADVERTISE: "/advertise";
478
535
  readonly PRE_ORDER_DETAIL: (id: string) => string;
479
536
  readonly BUNDLES: "/bundles";
480
537
  readonly BUNDLE_DETAIL: (slug: string) => string;
@@ -611,6 +668,16 @@ export declare const ROUTES: {
611
668
  };
612
669
  readonly USER: {
613
670
  readonly DASHBOARD: "/user";
671
+ /**
672
+ * A dashboard SECTION hub — the screens of one sidebar group, each with a
673
+ * sentence on what it is for.
674
+ *
675
+ * One parametric route serves every section of the portal; the slug is
676
+ * `hubSectionSlug(group.title)` and is DERIVED, so there is no list of
677
+ * section keys here to drift from the nav. `audit-dashboard-hub-coverage`
678
+ * cross-checks the two.
679
+ */
680
+ readonly SECTION: (slug: string) => string;
614
681
  readonly PROFILE: "/user/profile";
615
682
  readonly SETTINGS: "/user/settings";
616
683
  readonly ORDERS: "/user/orders";
@@ -631,6 +698,17 @@ export declare const ROUTES: {
631
698
  readonly ORDER_CLAIM: (id: string) => string;
632
699
  readonly ORDER_INVOICE: (id: string) => string;
633
700
  readonly ORDER_PAYMENT: (id: string) => string;
701
+ /**
702
+ * Raise a dispute on one order.
703
+ *
704
+ * Deep-linkable on purpose: a notification `actionUrl` points here, and
705
+ * `/user/orders/view/{id}` carries a "Report a problem" button to the same
706
+ * place. One surface, two ways in — an email link that works only while
707
+ * the buyer still has the email is the shape Root Cause #57 records,
708
+ * where `ORDER_PAYMENT` had exactly ONE caller and a buyer who navigated
709
+ * away could not get back.
710
+ */
711
+ readonly ORDER_DISPUTE: (id: string) => string;
634
712
  readonly NOTIFICATIONS: "/user/notifications";
635
713
  /** Plan §10 — claimed-coupons wallet (Active / Expired / Used tabs). */
636
714
  readonly CLAIMED_COUPONS: "/user/coupons";
@@ -652,6 +730,8 @@ export declare const ROUTES: {
652
730
  readonly SUPPORT_NEW: "/user/support/new";
653
731
  readonly SUPPORT_TICKET: (id: string) => string;
654
732
  readonly PRE_ORDERS: "/user/pre-orders";
733
+ /** D56 — the advertiser's own bookings and their moderation state. */
734
+ readonly AD_BOOKINGS: "/user/ad-bookings";
655
735
  readonly DIGITAL_CODES: "/user/digital-codes";
656
736
  readonly PRIZE_DRAWS: "/user/prize-draws";
657
737
  readonly EVENTS: "/user/events";
@@ -664,6 +744,8 @@ export declare const ROUTES: {
664
744
  };
665
745
  readonly STORE: {
666
746
  readonly DASHBOARD: "/store";
747
+ /** A dashboard SECTION hub — see `USER.SECTION` for the derivation. */
748
+ readonly SECTION: (slug: string) => string;
667
749
  readonly PRODUCTS: "/store/products";
668
750
  readonly PRODUCTS_NEW: "/store/products/new";
669
751
  readonly PRODUCTS_EDIT: (id: string) => string;
@@ -754,6 +836,18 @@ export declare const ROUTES: {
754
836
  };
755
837
  readonly ADMIN: {
756
838
  readonly DASHBOARD: "/admin/dashboard";
839
+ /**
840
+ * The sectioned landing at `/admin` — what used to `redirect()` to
841
+ * `DASHBOARD`.
842
+ *
843
+ * 🛑 `DASHBOARD` is `/admin/dashboard` and stays a separate page: it is the
844
+ * metrics screen, and the sidebar's "Dashboard" entry points at it. This
845
+ * key is the index that lists the twelve sections. Collapsing the two would
846
+ * either bury the metrics or make the index unreachable.
847
+ */
848
+ readonly HOME: "/admin";
849
+ /** A dashboard SECTION hub — see `USER.SECTION` for the derivation. */
850
+ readonly SECTION: (slug: string) => string;
757
851
  readonly SHIPMENTS: "/admin/shipments";
758
852
  readonly INVENTORY_BOXES: "/admin/inventory/boxes";
759
853
  readonly INVENTORY_BOX_DETAIL: (id: string) => string;
@@ -769,6 +863,7 @@ export declare const ROUTES: {
769
863
  readonly USER_DETAIL: (id: string) => string;
770
864
  readonly USER_EDIT: (id: string) => string;
771
865
  readonly SITE: "/admin/site";
866
+ readonly INTEGRATIONS: "/admin/integrations";
772
867
  readonly CAROUSEL: "/admin/carousel";
773
868
  readonly CAROUSEL_NEW: "/admin/carousel/new";
774
869
  readonly CAROUSEL_EDIT: (id: string) => string;
@@ -828,9 +923,20 @@ export declare const ROUTES: {
828
923
  readonly ANALYTICS: "/admin/analytics";
829
924
  readonly PAYOUTS: "/admin/payouts";
830
925
  readonly PAYOUT_DETAIL: (id: string) => string;
926
+ readonly PRICING: "/admin/pricing";
831
927
  readonly AUDIT_LOG: "/admin/audit-log";
832
928
  readonly MONEY_CASES: "/admin/money-cases";
833
929
  readonly MONEY_CASE_DETAIL: (id: string) => string;
930
+ /**
931
+ * Phase 7 — the GSTR-1 draft export.
932
+ *
933
+ * 🛑 Under Finance for the same reason `MONEY_CASES` is, and the reason is
934
+ * stronger here: the export contains the company's tax position for a
935
+ * quarter plus every buyer's place of supply. That is not a maintenance
936
+ * diagnostic, and it is admin-only — deliberately not granted to
937
+ * `maintenance_employee`.
938
+ */
939
+ readonly INVOICING: "/admin/invoicing";
834
940
  readonly PROTECTION_CLAIMS: "/admin/protection-claims";
835
941
  readonly MAINTENANCE_GATEWAY_EVENTS: "/admin/maintenance/gateway-events";
836
942
  readonly MAINTENANCE_OBLIGATIONS: "/admin/maintenance/obligations";
@@ -843,6 +949,8 @@ export declare const ROUTES: {
843
949
  readonly ADS: "/admin/ads";
844
950
  readonly ADS_NEW: "/admin/ads/new";
845
951
  readonly ADS_EDIT: (id: string) => string;
952
+ /** D56 — the self-serve creative moderation queue. */
953
+ readonly AD_BOOKINGS: "/admin/ads/bookings";
846
954
  readonly NEWSLETTER: "/admin/newsletter";
847
955
  readonly CONTACT: "/admin/contact";
848
956
  readonly SESSIONS: "/admin/sessions";
@@ -877,6 +985,8 @@ export declare const ROUTES: {
877
985
  readonly TEAM_NEW: "/admin/team/new";
878
986
  readonly TEAM_EDIT: (id: string) => string;
879
987
  readonly SUPPORT_TICKETS: "/admin/support-tickets";
988
+ /** Staff curation of the reasons a buyer can pick when disputing. */
989
+ readonly DISPUTE_REASONS: "/admin/dispute-reasons";
880
990
  readonly SUPPORT_TICKET_BY_ID: (id: string) => string;
881
991
  readonly SCAMMERS: "/admin/scammers";
882
992
  readonly SCAMMER_BY_ID: (id: string) => string;
@@ -920,6 +1030,8 @@ export declare const ROUTES: {
920
1030
  /** @deprecated Use ROUTES.STORE instead */
921
1031
  export declare const SELLER_ROUTES: {
922
1032
  readonly DASHBOARD: "/store";
1033
+ /** A dashboard SECTION hub — see `USER.SECTION` for the derivation. */
1034
+ readonly SECTION: (slug: string) => string;
923
1035
  readonly PRODUCTS: "/store/products";
924
1036
  readonly PRODUCTS_NEW: "/store/products/new";
925
1037
  readonly PRODUCTS_EDIT: (id: string) => string;
@@ -9,6 +9,8 @@ export const DEFAULT_ROUTE_MAP = {
9
9
  AUCTIONS: "/auctions",
10
10
  AUCTION_DETAIL: (id) => `/auctions/${id}`,
11
11
  PRE_ORDERS: "/pre-orders",
12
+ /** D56 — the public rate card + self-serve booking form. */
13
+ ADVERTISE: "/advertise",
12
14
  PRE_ORDER_DETAIL: (id) => `/pre-orders/${id}`,
13
15
  // SB1-J — bundles + prize draws (additive, pages not yet built)
14
16
  BUNDLES: "/bundles",
@@ -261,6 +263,16 @@ export const DEFAULT_ROUTE_MAP = {
261
263
  },
262
264
  USER: {
263
265
  DASHBOARD: "/user",
266
+ /**
267
+ * A dashboard SECTION hub — the screens of one sidebar group, each with a
268
+ * sentence on what it is for.
269
+ *
270
+ * One parametric route serves every section of the portal; the slug is
271
+ * `hubSectionSlug(group.title)` and is DERIVED, so there is no list of
272
+ * section keys here to drift from the nav. `audit-dashboard-hub-coverage`
273
+ * cross-checks the two.
274
+ */
275
+ SECTION: (slug) => `/user/sections/${slug}`,
264
276
  PROFILE: "/user/profile",
265
277
  SETTINGS: "/user/settings",
266
278
  ORDERS: "/user/orders",
@@ -297,6 +309,17 @@ export const DEFAULT_ROUTE_MAP = {
297
309
  ORDER_CLAIM: (id) => `/user/orders/${id}/claim`,
298
310
  ORDER_INVOICE: (id) => `/user/orders/${id}/invoice`,
299
311
  ORDER_PAYMENT: (id) => `/user/orders/${id}/payment`,
312
+ /**
313
+ * Raise a dispute on one order.
314
+ *
315
+ * Deep-linkable on purpose: a notification `actionUrl` points here, and
316
+ * `/user/orders/view/{id}` carries a "Report a problem" button to the same
317
+ * place. One surface, two ways in — an email link that works only while
318
+ * the buyer still has the email is the shape Root Cause #57 records,
319
+ * where `ORDER_PAYMENT` had exactly ONE caller and a buyer who navigated
320
+ * away could not get back.
321
+ */
322
+ ORDER_DISPUTE: (id) => `/user/orders/${id}/dispute`,
300
323
  NOTIFICATIONS: "/user/notifications",
301
324
  /** Plan §10 — claimed-coupons wallet (Active / Expired / Used tabs). */
302
325
  CLAIMED_COUPONS: "/user/coupons",
@@ -333,6 +356,8 @@ export const DEFAULT_ROUTE_MAP = {
333
356
  SUPPORT_NEW: "/user/support/new",
334
357
  SUPPORT_TICKET: (id) => `/user/support/${id}`,
335
358
  PRE_ORDERS: "/user/pre-orders",
359
+ /** D56 — the advertiser's own bookings and their moderation state. */
360
+ AD_BOOKINGS: "/user/ad-bookings",
336
361
  DIGITAL_CODES: "/user/digital-codes",
337
362
  PRIZE_DRAWS: "/user/prize-draws",
338
363
  EVENTS: "/user/events",
@@ -345,6 +370,8 @@ export const DEFAULT_ROUTE_MAP = {
345
370
  },
346
371
  STORE: {
347
372
  DASHBOARD: "/store",
373
+ /** A dashboard SECTION hub — see `USER.SECTION` for the derivation. */
374
+ SECTION: (slug) => `/store/sections/${slug}`,
348
375
  PRODUCTS: "/store/products",
349
376
  PRODUCTS_NEW: "/store/products/new",
350
377
  PRODUCTS_EDIT: (id) => `/store/products/${id}/edit`,
@@ -441,6 +468,18 @@ export const DEFAULT_ROUTE_MAP = {
441
468
  },
442
469
  ADMIN: {
443
470
  DASHBOARD: "/admin/dashboard",
471
+ /**
472
+ * The sectioned landing at `/admin` — what used to `redirect()` to
473
+ * `DASHBOARD`.
474
+ *
475
+ * 🛑 `DASHBOARD` is `/admin/dashboard` and stays a separate page: it is the
476
+ * metrics screen, and the sidebar's "Dashboard" entry points at it. This
477
+ * key is the index that lists the twelve sections. Collapsing the two would
478
+ * either bury the metrics or make the index unreachable.
479
+ */
480
+ HOME: "/admin",
481
+ /** A dashboard SECTION hub — see `USER.SECTION` for the derivation. */
482
+ SECTION: (slug) => `/admin/sections/${slug}`,
444
483
  SHIPMENTS: "/admin/shipments",
445
484
  /*
446
485
  * 🛑 There is deliberately NO `INVENTORY: "/admin/inventory"` key.
@@ -476,6 +515,15 @@ export const DEFAULT_ROUTE_MAP = {
476
515
  USER_DETAIL: (id) => `/admin/users/${id}`,
477
516
  USER_EDIT: (id) => `/admin/users/${id}/edit`,
478
517
  SITE: "/admin/site",
518
+ /*
519
+ * The integration kill switches — its OWN page, not a Site Settings tab.
520
+ *
521
+ * A switch that stops money has to be findable without hunting a tab
522
+ * strip, and this is the one surface where all four are visible together
523
+ * (which matters, because their off-states are not comparable: three stop
524
+ * something and one selects a working alternative).
525
+ */
526
+ INTEGRATIONS: "/admin/integrations",
479
527
  CAROUSEL: "/admin/carousel",
480
528
  CAROUSEL_NEW: "/admin/carousel/new",
481
529
  CAROUSEL_EDIT: (id) => `/admin/carousel/${id}/edit`,
@@ -563,6 +611,7 @@ export const DEFAULT_ROUTE_MAP = {
563
611
  ANALYTICS: "/admin/analytics",
564
612
  PAYOUTS: "/admin/payouts",
565
613
  PAYOUT_DETAIL: (id) => `/admin/payouts/${id}/view`,
614
+ PRICING: "/admin/pricing",
566
615
  AUDIT_LOG: "/admin/audit-log",
567
616
  /*
568
617
  * 🛑 MONEY_CASES is deliberately NOT under `/admin/maintenance/`.
@@ -579,6 +628,16 @@ export const DEFAULT_ROUTE_MAP = {
579
628
  */
580
629
  MONEY_CASES: "/admin/money-cases",
581
630
  MONEY_CASE_DETAIL: (id) => `/admin/money-cases/${id}`,
631
+ /**
632
+ * Phase 7 — the GSTR-1 draft export.
633
+ *
634
+ * 🛑 Under Finance for the same reason `MONEY_CASES` is, and the reason is
635
+ * stronger here: the export contains the company's tax position for a
636
+ * quarter plus every buyer's place of supply. That is not a maintenance
637
+ * diagnostic, and it is admin-only — deliberately not granted to
638
+ * `maintenance_employee`.
639
+ */
640
+ INVOICING: "/admin/invoicing",
582
641
  PROTECTION_CLAIMS: "/admin/protection-claims",
583
642
  MAINTENANCE_GATEWAY_EVENTS: "/admin/maintenance/gateway-events",
584
643
  MAINTENANCE_OBLIGATIONS: "/admin/maintenance/obligations",
@@ -591,6 +650,8 @@ export const DEFAULT_ROUTE_MAP = {
591
650
  ADS: "/admin/ads",
592
651
  ADS_NEW: "/admin/ads/new",
593
652
  ADS_EDIT: (id) => `/admin/ads/${id}/edit`,
653
+ /** D56 — the self-serve creative moderation queue. */
654
+ AD_BOOKINGS: "/admin/ads/bookings",
594
655
  NEWSLETTER: "/admin/newsletter",
595
656
  CONTACT: "/admin/contact",
596
657
  SESSIONS: "/admin/sessions",
@@ -634,6 +695,8 @@ export const DEFAULT_ROUTE_MAP = {
634
695
  TEAM_NEW: "/admin/team/new",
635
696
  TEAM_EDIT: (id) => `/admin/team/${id}/edit`,
636
697
  SUPPORT_TICKETS: "/admin/support-tickets",
698
+ /** Staff curation of the reasons a buyer can pick when disputing. */
699
+ DISPUTE_REASONS: "/admin/dispute-reasons",
637
700
  SUPPORT_TICKET_BY_ID: (id) => `/admin/support-tickets/${id}`,
638
701
  SCAMMERS: "/admin/scammers",
639
702
  SCAMMER_BY_ID: (id) => `/admin/scammers/${id}`,
@@ -66,7 +66,7 @@
66
66
  * @tag access:server-only
67
67
  */
68
68
  import { IShippingProvider } from "../../contracts";
69
- import type { CreateShipmentInput, Shipment, TrackingInfo, ServiceabilityResult } from "../../contracts";
69
+ import type { CreateShipmentInput, Shipment, TrackingInfo, ServiceabilityResult, WalletBalance } from "../../contracts";
70
70
  export interface ShiprocketConfig {
71
71
  /** The API user's email. See the header on why this is not a "login id". */
72
72
  email: string;
@@ -74,6 +74,21 @@ export interface ShiprocketConfig {
74
74
  /** Shiprocket pickup-location nickname, as registered in their dashboard. */
75
75
  pickupLocation?: string;
76
76
  }
77
+ /**
78
+ * Does this upstream error body look like "your wallet is empty"?
79
+ *
80
+ * 🛑 The substring list is UNVERIFIED and that is acceptable, because of where
81
+ * it sits in the design: a funding failure and any other booking failure take
82
+ * the SAME path — the order gets a `courierBlock`, the admin is alerted, the
83
+ * seller is offered retry-or-self-ship. Classifying only changes the WORDING
84
+ * of the operator's alert. So a false negative costs a less specific message
85
+ * and never a wrong action, which is why this is allowed to be a heuristic
86
+ * rather than something this plan pretended to have confirmed.
87
+ *
88
+ * Triggering the real error would mean deliberately booking a shipment against
89
+ * a drained wallet, which is not a probe anyone should run on a live account.
90
+ */
91
+ export declare function looksLikeInsufficientFunds(body: string): boolean;
77
92
  export declare class ShiprocketShippingProvider extends IShippingProvider {
78
93
  private readonly config;
79
94
  readonly name = "shiprocket";
@@ -119,6 +134,17 @@ export declare class ShiprocketShippingProvider extends IShippingProvider {
119
134
  */
120
135
  createShipment(data: CreateShipmentInput): Promise<Shipment>;
121
136
  trackShipment(trackingId: string): Promise<TrackingInfo>;
137
+ /**
138
+ * The prepaid wallet balance. Read-only; never charges anything.
139
+ *
140
+ * 🛑 Returns `{ known: false, supported: true }` on ANY failure rather than
141
+ * `0`. Shiprocket HAS a wallet, so `supported` is true regardless — the
142
+ * caller must treat "unreadable" as "attempt the booking anyway and let the
143
+ * attempt's own failure decide", because refusing on an unreadable balance
144
+ * would block every order on a transient network blip. A `0` here is a real
145
+ * decision to skip; an unreadable balance is not.
146
+ */
147
+ getWalletBalance(): Promise<WalletBalance>;
122
148
  cancelShipment(shipmentId: string): Promise<void>;
123
149
  checkServiceability(pincode: string, weight: number): Promise<ServiceabilityResult>;
124
150
  generateLabel(shipmentId: string): Promise<ArrayBuffer>;
@@ -117,6 +117,42 @@ const serviceabilityResponse = z.object({
117
117
  .nullish(),
118
118
  }),
119
119
  });
120
+ /*
121
+ * Measured against the live API 2026-10-22 (read-only probe, one auth + GETs):
122
+ *
123
+ * GET /account/details/wallet-balance -> 200 { data: { balance_amount: string } }
124
+ * GET /account/details -> 404
125
+ *
126
+ * 🛑 `balance_amount` is a STRING, and there is NO credit-limit field — so
127
+ * postpaid headroom is not readable from this API at all. See `WalletBalance`
128
+ * in contracts/shipping.ts for why no such field is declared.
129
+ */
130
+ const walletBalanceResponse = z.object({
131
+ data: z.object({
132
+ balance_amount: z.union([z.number(), z.string()]).nullish(),
133
+ }),
134
+ });
135
+ /**
136
+ * Does this upstream error body look like "your wallet is empty"?
137
+ *
138
+ * 🛑 The substring list is UNVERIFIED and that is acceptable, because of where
139
+ * it sits in the design: a funding failure and any other booking failure take
140
+ * the SAME path — the order gets a `courierBlock`, the admin is alerted, the
141
+ * seller is offered retry-or-self-ship. Classifying only changes the WORDING
142
+ * of the operator's alert. So a false negative costs a less specific message
143
+ * and never a wrong action, which is why this is allowed to be a heuristic
144
+ * rather than something this plan pretended to have confirmed.
145
+ *
146
+ * Triggering the real error would mean deliberately booking a shipment against
147
+ * a drained wallet, which is not a probe anyone should run on a live account.
148
+ */
149
+ export function looksLikeInsufficientFunds(body) {
150
+ const s = body.toLowerCase();
151
+ return (s.includes("insufficient") ||
152
+ s.includes("low balance") ||
153
+ s.includes("recharge") ||
154
+ (s.includes("wallet") && s.includes("balance")));
155
+ }
120
156
  function num(v, fallback = 0) {
121
157
  const n = typeof v === "string" ? Number.parseFloat(v) : v;
122
158
  return typeof n === "number" && Number.isFinite(n) ? n : fallback;
@@ -230,7 +266,24 @@ export class ShiprocketShippingProvider extends IShippingProvider {
230
266
  res = await attempt(true);
231
267
  }
232
268
  if (!res.ok) {
233
- throw new ApiError(502, `Shiprocket ${path} failed (${res.status}).`, { code: "SHIPROCKET_REQUEST_FAILED" });
269
+ /*
270
+ * The body is read and carried, not discarded.
271
+ *
272
+ * It used to throw on `res.status` alone, which meant a funding failure
273
+ * and a malformed-address failure were indistinguishable to every
274
+ * caller — and the first of those is the one an operator can actually
275
+ * fix, by topping up.
276
+ *
277
+ * Truncated, because an upstream error page can be a whole HTML
278
+ * document and this string ends up in a log line.
279
+ */
280
+ const body = await res.text().catch(() => "");
281
+ const insufficient = looksLikeInsufficientFunds(body);
282
+ throw new ApiError(502, `Shiprocket ${path} failed (${res.status}).`, {
283
+ code: insufficient ? "SHIPROCKET_INSUFFICIENT_FUNDS" : "SHIPROCKET_REQUEST_FAILED",
284
+ upstreamStatus: res.status,
285
+ upstreamBody: body.slice(0, 500),
286
+ });
234
287
  }
235
288
  const json = await res.json();
236
289
  return parseUpstream(contract, json, path);
@@ -331,6 +384,36 @@ export class ShiprocketShippingProvider extends IShippingProvider {
331
384
  })),
332
385
  };
333
386
  }
387
+ /**
388
+ * The prepaid wallet balance. Read-only; never charges anything.
389
+ *
390
+ * 🛑 Returns `{ known: false, supported: true }` on ANY failure rather than
391
+ * `0`. Shiprocket HAS a wallet, so `supported` is true regardless — the
392
+ * caller must treat "unreadable" as "attempt the booking anyway and let the
393
+ * attempt's own failure decide", because refusing on an unreadable balance
394
+ * would block every order on a transient network blip. A `0` here is a real
395
+ * decision to skip; an unreadable balance is not.
396
+ */
397
+ async getWalletBalance() {
398
+ try {
399
+ const out = await this.call("/account/details/wallet-balance", { method: "GET" }, walletBalanceResponse);
400
+ const raw = out.data.balance_amount;
401
+ /*
402
+ * `num()` would silently fold an unparseable string into its fallback,
403
+ * which is exactly the 0-means-unknown conflation this type exists to
404
+ * prevent. Parsed explicitly so a bad payload reports `known: false`.
405
+ */
406
+ const parsed = typeof raw === "string" ? Number.parseFloat(raw) : raw;
407
+ if (typeof parsed !== "number" || !Number.isFinite(parsed)) {
408
+ return { known: false, supported: true, reason: "unparseable balance_amount" };
409
+ }
410
+ return { known: true, amount: parsed, currency: "INR" };
411
+ }
412
+ catch (err) {
413
+ const normalized = normalizeError(err);
414
+ return { known: false, supported: true, reason: normalized.message };
415
+ }
416
+ }
334
417
  async cancelShipment(shipmentId) {
335
418
  await this.call("/orders/cancel", { method: "POST", body: JSON.stringify({ ids: [shipmentId] }) },
336
419
  // Their cancel returns a message envelope we do not read; accepting any
@@ -40,7 +40,23 @@ export interface SessionUser {
40
40
  /** Orthogonal to isTester — unlocks admin-only checklist items and real /admin/** RBAC access. */
41
41
  canTestAdmin?: boolean;
42
42
  publicProfile?: FirestoreDocument;
43
- stats?: FirestoreDocument;
43
+ /**
44
+ * Buyer activity counts, DERIVED by `/api/user/profile` — orders placed,
45
+ * auctions won, reviews written. Each is optional and `undefined` means the
46
+ * count could not be taken, which is NOT the same as zero: render nothing.
47
+ *
48
+ * 🛑 Not the `users/{uid}.stats` document field, which has no writer at all
49
+ * and holds seed literals. Do not "restore" it by reading the profile
50
+ * document here; see `getBuyerActivityStats`.
51
+ *
52
+ * Seller numbers are deliberately absent. This is the account holder's own
53
+ * record; what their store has sold belongs to the store.
54
+ */
55
+ stats?: {
56
+ totalOrders?: number;
57
+ auctionsWon?: number;
58
+ reviewsCount?: number;
59
+ };
44
60
  metadata?: FirestoreDocument;
45
61
  scamAwarenessAcknowledgedAt?: Date | null;
46
62
  /** RBAC permission keys granted to this user (from their role's permission set). */