@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
@@ -107,6 +107,27 @@ export interface StoreDocument extends BaseDocument {
107
107
  adminNotes?: string;
108
108
  /** Admin "verified store" badge — distinct from `status`/`isPublic`. */
109
109
  isVerified?: boolean;
110
+ /**
111
+ * Paid at SHIPPING rather than at delivery.
112
+ *
113
+ * 🛑 **A risk transfer, not a courtesy or a badge.** Paying before delivery
114
+ * means the platform carries a lost parcel and a non-delivery dispute with
115
+ * the money already gone. Admin-granted only, `recordAdminAction`-logged,
116
+ * revocable — and **PRIVATE in the public projection**, because it describes
117
+ * our risk posture rather than anything a buyer should weigh. A store does
118
+ * not get to display that we trust it.
119
+ *
120
+ * 🛑 A faster path through the SAME machinery, never a second one. The
121
+ * eligibility sweep moves the delivered-status test, not the payout, the
122
+ * hold, the deductions or the dispatch.
123
+ *
124
+ * 🛑 **A refund after a trusted payout has no money left to net against.**
125
+ * The ordinary path deducts from a still-`pending` payout; once paid there
126
+ * is nothing to deduct from, so it becomes a `manual_refund_due` case —
127
+ * which already exists and already means exactly this. Never a negative
128
+ * payout.
129
+ */
130
+ trustedSeller?: boolean;
110
131
  /** Reason recorded when `status` is set to "suspended". */
111
132
  suspensionReason?: string;
112
133
  stats?: {
@@ -233,6 +254,77 @@ export interface StoreDocument extends BaseDocument {
233
254
  */
234
255
  supportsShippingProtection?: boolean;
235
256
  supportsSaleProtection?: boolean;
257
+ /**
258
+ * This store accepts buyer points as part-payment.
259
+ *
260
+ * ## 🛑 OPT-IN, because the accepting store ABSORBS the redemption
261
+ *
262
+ * Decision 3: a redeemed point reduces THAT store's payout for THAT order.
263
+ * Earning is mandatory (it costs the seller nothing at issue time); accepting
264
+ * is optional, because accepting is where the money actually moves. So this
265
+ * follows `supportsSaleProtection` above exactly — **absent means NOT
266
+ * accepted, never "unknown"** — and for the identical reason: defaulting it
267
+ * `true` would enrol every existing seller in funding discounts they never
268
+ * agreed to, and retrofitting consent later means switching a working feature
269
+ * off for them.
270
+ *
271
+ * 🛑 Live currently has ONE store, so this flag is inert today. It is still
272
+ * built now rather than later: the day a second seller exists, enabling
273
+ * redemption for them without asking is taking their money, and the cost of
274
+ * the field today is one boolean and one check.
275
+ *
276
+ * `store-letitrip-official` is always treated as accepting — the platform's
277
+ * own storefront cannot decline to fund its own programme. That is resolved
278
+ * in code rather than seeded, so it cannot be switched off by an edit.
279
+ */
280
+ acceptsPoints?: boolean;
281
+ /**
282
+ * ── S5a: this store allows a SHARED PURCHASE (one payer, N destinations) ──
283
+ *
284
+ * The coordinator buys everything and assigns a destination per item, so the
285
+ * seller packs one order into several parcels. That is real extra work —
286
+ * picking, packing and labelling N shipments instead of one — which is why
287
+ * it is an opt-in with its own fees rather than a free platform behaviour.
288
+ *
289
+ * 🛑 **Absent means NOT allowed**, matching `supportsSaleProtection` and
290
+ * `acceptsPoints` above, and for the same reason: the cost falls on the
291
+ * seller, so enrolling them without asking is taking their labour. Every
292
+ * existing store therefore starts with it off, which is the correct state
293
+ * rather than a migration problem.
294
+ *
295
+ * 🛑 This is S5a ONLY — one payer. It is NOT the N-party flow (S5b), which
296
+ * needs multi-party payment, a coordinator deposit, an approval cascade, a
297
+ * stock-reservation primitive that does not exist, and per-buyer invoicing
298
+ * and GST. A seller enabling this is agreeing to split one paid order across
299
+ * destinations, not to be paid by several people.
300
+ */
301
+ allowSharedPurchase?: boolean;
302
+ /**
303
+ * Flat fee per shared-purchase arrangement, in decimal rupees.
304
+ *
305
+ * Covers picking, packing and labelling one order into N parcels. Borne by
306
+ * the COORDINATOR — they chose the arrangement — which keeps each
307
+ * destination's own cost to goods plus that destination's shipping.
308
+ *
309
+ * 🛑 SNAPSHOTTED onto the order at checkout, never re-read later. The
310
+ * precedent is exact: the refund path reads `finalSale` from the ORDER
311
+ * snapshot rather than the live product, because "re-reading the live
312
+ * product would let a seller flip the switch afterwards" (D61). A fee read
313
+ * late is the same hole.
314
+ */
315
+ sharedPurchaseHandlingFee?: number;
316
+ /**
317
+ * Extra shipping per destination BEYOND THE FIRST, in decimal rupees.
318
+ *
319
+ * The first destination is the shipping the order would have paid anyway;
320
+ * this is the marginal cost of each additional parcel. Borne by the buyer at
321
+ * that destination in the full N-party flow — in S5a there is one payer, so
322
+ * the coordinator pays all of it, which is correct because they are the
323
+ * person who asked for the extra legs.
324
+ *
325
+ * Snapshotted with the handling fee, for the same reason.
326
+ */
327
+ sharedPurchaseExtraShippingPerDestination?: number;
236
328
  /**
237
329
  * ── C5g: ADMIN-GRANTED trust. Routes even a protected claim to the seller ──
238
330
  *
@@ -315,6 +407,7 @@ export declare const STORE_FIELDS: {
315
407
  readonly ADMIN_NOTES: "adminNotes";
316
408
  readonly IS_FEATURED: "isFeatured";
317
409
  readonly IS_VERIFIED: "isVerified";
410
+ readonly TRUSTED_SELLER: "trustedSeller";
318
411
  readonly SUSPENSION_REASON: "suspensionReason";
319
412
  readonly CAPABILITIES: "capabilities";
320
413
  readonly STATUS_VALUES: {
@@ -333,3 +426,22 @@ export type StoreAddressUpdateInput = _AddrUpdate;
333
426
  export { ADDRESS_FIELDS as STORE_ADDRESS_FIELDS, ADDRESS_INDEXED_FIELDS as STORE_ADDRESS_INDEXED_FIELDS, ADDRESS_PUBLIC_FIELDS as STORE_ADDRESS_PUBLIC_FIELDS, ADDRESS_UPDATABLE_FIELDS as STORE_ADDRESS_UPDATABLE_FIELDS, DEFAULT_ADDRESS_DATA as DEFAULT_STORE_ADDRESS_DATA, } from "../../addresses/schemas";
334
427
  /** @deprecated SB-UNI-A — literal alias only. Use ADDRESSES_COLLECTION. */
335
428
  export declare const STORE_ADDRESS_SUBCOLLECTION: "addresses";
429
+ /**
430
+ * The platform's own storefront.
431
+ *
432
+ * An IDENTITY, not a setting — it is the same id the seed's `REAL_STORE_IDS`
433
+ * and `realListingsOnly` already treat as the platform's own, and resolving it
434
+ * in code is what stops it being switched off by an edit, a reseed, or a
435
+ * mis-clicked admin toggle. `storeAcceptsPoints` is the motivating reader: the
436
+ * one store the points programme is advertised on cannot be allowed to decline
437
+ * to fund it.
438
+ *
439
+ * 🛑 It lives HERE, in `features/`, and not beside its reader in
440
+ * `_internal/shared/features/points/` — `audit-ssr-in-appkit` Rule 3 forbids a
441
+ * brand-bearing literal inside `_internal/`, because a consumer of appkit would
442
+ * inherit OUR store id with no way to override it. `features/` is where the
443
+ * same literal already lives legitimately (`CONSIGNMENT_STORE_ID` in
444
+ * `features/catalogue/utils/product-from-item.ts`), and this file is the one
445
+ * that already documents the rule on `acceptsPoints` above.
446
+ */
447
+ export declare const PLATFORM_STORE_ID = "store-letitrip-official";
@@ -74,6 +74,7 @@ export const STORE_FIELDS = {
74
74
  ADMIN_NOTES: "adminNotes",
75
75
  IS_FEATURED: "isFeatured",
76
76
  IS_VERIFIED: "isVerified",
77
+ TRUSTED_SELLER: "trustedSeller",
77
78
  SUSPENSION_REASON: "suspensionReason",
78
79
  CAPABILITIES: "capabilities",
79
80
  STATUS_VALUES: {
@@ -101,3 +102,22 @@ export function generateStoreSlug(storeName, ownerDisplayName) {
101
102
  export { ADDRESS_FIELDS as STORE_ADDRESS_FIELDS, ADDRESS_INDEXED_FIELDS as STORE_ADDRESS_INDEXED_FIELDS, ADDRESS_PUBLIC_FIELDS as STORE_ADDRESS_PUBLIC_FIELDS, ADDRESS_UPDATABLE_FIELDS as STORE_ADDRESS_UPDATABLE_FIELDS, DEFAULT_ADDRESS_DATA as DEFAULT_STORE_ADDRESS_DATA, } from "../../addresses/schemas/index.js";
102
103
  /** @deprecated SB-UNI-A — literal alias only. Use ADDRESSES_COLLECTION. */
103
104
  export const STORE_ADDRESS_SUBCOLLECTION = "addresses";
105
+ /**
106
+ * The platform's own storefront.
107
+ *
108
+ * An IDENTITY, not a setting — it is the same id the seed's `REAL_STORE_IDS`
109
+ * and `realListingsOnly` already treat as the platform's own, and resolving it
110
+ * in code is what stops it being switched off by an edit, a reseed, or a
111
+ * mis-clicked admin toggle. `storeAcceptsPoints` is the motivating reader: the
112
+ * one store the points programme is advertised on cannot be allowed to decline
113
+ * to fund it.
114
+ *
115
+ * 🛑 It lives HERE, in `features/`, and not beside its reader in
116
+ * `_internal/shared/features/points/` — `audit-ssr-in-appkit` Rule 3 forbids a
117
+ * brand-bearing literal inside `_internal/`, because a consumer of appkit would
118
+ * inherit OUR store id with no way to override it. `features/` is where the
119
+ * same literal already lives legitimately (`CONSIGNMENT_STORE_ID` in
120
+ * `features/catalogue/utils/product-from-item.ts`), and this file is the one
121
+ * that already documents the rule on `acceptsPoints` above.
122
+ */
123
+ export const PLATFORM_STORE_ID = "store-letitrip-official";
@@ -218,13 +218,13 @@ export declare const storeFirestoreSchema: z.ZodObject<{
218
218
  totalReviews: z.ZodNumber;
219
219
  averageRating: z.ZodOptional<z.ZodNumber>;
220
220
  }, "strip", z.ZodTypeAny, {
221
- itemsSold: number;
222
221
  totalProducts: number;
222
+ itemsSold: number;
223
223
  totalReviews: number;
224
224
  averageRating?: number | undefined;
225
225
  }, {
226
- itemsSold: number;
227
226
  totalProducts: number;
227
+ itemsSold: number;
228
228
  totalReviews: number;
229
229
  averageRating?: number | undefined;
230
230
  }>>;
@@ -363,8 +363,8 @@ export declare const storeFirestoreSchema: z.ZodObject<{
363
363
  location?: string | undefined;
364
364
  returnPolicy?: string | undefined;
365
365
  stats?: {
366
- itemsSold: number;
367
366
  totalProducts: number;
367
+ itemsSold: number;
368
368
  totalReviews: number;
369
369
  averageRating?: number | undefined;
370
370
  } | undefined;
@@ -432,8 +432,8 @@ export declare const storeFirestoreSchema: z.ZodObject<{
432
432
  location?: string | undefined;
433
433
  returnPolicy?: string | undefined;
434
434
  stats?: {
435
- itemsSold: number;
436
435
  totalProducts: number;
436
+ itemsSold: number;
437
437
  totalReviews: number;
438
438
  averageRating?: number | undefined;
439
439
  } | undefined;
@@ -530,8 +530,8 @@ export declare const storeListItemSchema: z.ZodObject<{
530
530
  storeDescription?: string | undefined;
531
531
  storeLogoURL?: string | undefined;
532
532
  storeBannerURL?: string | undefined;
533
- itemsSold?: number | undefined;
534
533
  totalProducts?: number | undefined;
534
+ itemsSold?: number | undefined;
535
535
  totalReviews?: number | undefined;
536
536
  averageRating?: number | undefined;
537
537
  }, {
@@ -546,8 +546,8 @@ export declare const storeListItemSchema: z.ZodObject<{
546
546
  storeDescription?: string | undefined;
547
547
  storeLogoURL?: string | undefined;
548
548
  storeBannerURL?: string | undefined;
549
- itemsSold?: number | undefined;
550
549
  totalProducts?: number | undefined;
550
+ itemsSold?: number | undefined;
551
551
  totalReviews?: number | undefined;
552
552
  averageRating?: number | undefined;
553
553
  }>;
@@ -24,6 +24,25 @@ export interface StoreListItem {
24
24
  */
25
25
  supportsShippingProtection: boolean;
26
26
  supportsSaleProtection: boolean;
27
+ /**
28
+ * S5a — this seller will split one paid order across several destinations.
29
+ *
30
+ * Not optional, for the same reason as the two above: the projection
31
+ * resolves absence to `false`, so the client never decides what `undefined`
32
+ * means.
33
+ */
34
+ allowSharedPurchase: boolean;
35
+ /**
36
+ * The two shared-purchase fees, in decimal rupees.
37
+ *
38
+ * 🛑 OPTIONAL here where `allowSharedPurchase` is not, and the asymmetry is
39
+ * the point: a flag's absence means "no", but a fee's absence means "not
40
+ * configured" — which is not ₹0. A client that defaulted these to zero would
41
+ * quote a free arrangement from a store that has simply not priced one, and
42
+ * the coordinator commits against that quote.
43
+ */
44
+ sharedPurchaseHandlingFee?: number;
45
+ sharedPurchaseExtraShippingPerDestination?: number;
27
46
  createdAt?: string;
28
47
  }
29
48
  export interface StoreDetail extends StoreListItem {
@@ -9,6 +9,41 @@ import { sieveAnd, sieveFilter, SIEVE_OP } from "../../../utils/sieve-builder.js
9
9
  import { maskPii, revealPii } from "../../../security/pii-accessors.js";
10
10
  import { SUPPORT_TICKET_COLLECTION, SUPPORT_TICKET_PII_FIELDS, SUPPORT_TICKET_TRACKED_FIELDS, TicketStatusValues, ACTIVE_TICKET_STATUSES, } from "../schemas/firestore.js";
11
11
  import { withHistory } from "../../../_internal/shared/history/index.js";
12
+ /**
13
+ * Who, if anyone, gets credited with resolving this ticket.
14
+ *
15
+ * 🛑 **A BUYER is never the resolver**, even though a buyer can drive the
16
+ * transition — replying "that's sorted, thanks" is a legitimate way for a
17
+ * ticket to reach `resolved`, and crediting it would put a customer's uid in
18
+ * a field a payslip is computed from. `system` has no uid at all, which is
19
+ * the other case that must not be paid.
20
+ *
21
+ * Returning `undefined` is correct and expected: the ticket is still resolved,
22
+ * it simply earns nobody wages. A fabricated fallback — the assignee, the
23
+ * ticket owner — would be a wage attributed to someone who did not do the
24
+ * work, and it would look exactly like a real one.
25
+ */
26
+ const WAGE_EARNING_ACTOR_ROLES = new Set(["seller", "admin"]);
27
+ function resolverUid(ctx) {
28
+ const actor = ctx?.actor;
29
+ if (!actor?.uid)
30
+ return undefined;
31
+ /*
32
+ * An ALLOW-LIST, not `role !== "buyer"`. A tenth actor role added later
33
+ * would silently start earning wages under a deny-list, which is the
34
+ * `Record<Union, T>`-over-`Set<string>` argument this codebase makes
35
+ * everywhere else — and the roles that can be credited is the shorter,
36
+ * more stable list.
37
+ *
38
+ * 🛑 `HistoryActorRole` has no `employee` member, and that is FINE: this
39
+ * field records WHO resolved it, and the payroll decides whether that
40
+ * person is on it. A seller resolving their own store's ticket is recorded
41
+ * here and appears on no payslip, because they are not an employee.
42
+ */
43
+ if (!WAGE_EARNING_ACTOR_ROLES.has(actor.role))
44
+ return undefined;
45
+ return actor.uid;
46
+ }
12
47
  export class SupportRepository extends BaseRepository {
13
48
  constructor() {
14
49
  super(SUPPORT_TICKET_COLLECTION);
@@ -210,7 +245,7 @@ export class SupportRepository extends BaseRepository {
210
245
  // `piiFields`, which is what encrypts `assignedToName` on the way down.
211
246
  const patch = {
212
247
  ...update,
213
- ...this.resolutionStamps(current, update.status),
248
+ ...this.resolutionStamps(current, update.status, resolverUid(ctx)),
214
249
  updatedAt: new Date(),
215
250
  };
216
251
  return this.update(ticketId, this.withTicketHistory(current, patch, ctx, "updateTicketStatus"));
@@ -233,14 +268,45 @@ export class SupportRepository extends BaseRepository {
233
268
  * against the document would poison that patch's inferred type with
234
269
  * `Encrypted<string>` members it never actually sets.
235
270
  */
236
- resolutionStamps(current, next) {
271
+ resolutionStamps(current, next, actorUid) {
237
272
  if (!next || next === current?.status)
238
273
  return {};
239
274
  const now = new Date();
240
- if (next === TicketStatusValues.RESOLVED && !current?.resolvedAt)
241
- return { resolvedAt: now };
275
+ if (next === TicketStatusValues.RESOLVED && !current?.resolvedAt) {
276
+ /*
277
+ * 🛑 `resolvedBy` is stamped HERE and is not the same thing as
278
+ * `assignedTo`.
279
+ *
280
+ * `assignedTo` is the CURRENT assignee: reassign a resolved ticket for
281
+ * follow-up and it moves, so paying from it credits whoever happens to
282
+ * hold the ticket at month end rather than whoever did the work. That is
283
+ * the whole reason this field exists.
284
+ *
285
+ * Absent when the caller supplied no actor — a system transition has no
286
+ * person to pay, and a fabricated uid would be a wage attributed to
287
+ * somebody who did nothing.
288
+ */
289
+ return actorUid ? { resolvedAt: now, resolvedBy: actorUid } : { resolvedAt: now };
290
+ }
242
291
  if (next === TicketStatusValues.CLOSED && !current?.closedAt)
243
292
  return { closedAt: now };
293
+ /*
294
+ * 🛑 A REOPEN clears both, and clearing `resolvedBy` is load-bearing.
295
+ *
296
+ * Pay is computed from tickets STILL RESOLVED at period end, so a ticket
297
+ * that goes back to open must stop counting — otherwise close-it,
298
+ * let-it-reopen, close-it-again pays twice for one problem.
299
+ *
300
+ * Cleared rather than left in place with the status as the only signal,
301
+ * because `resolvedTicketsForPeriod` filters on all three and a stale
302
+ * `resolvedAt` surviving a reopen is a row that looks payable to anything
303
+ * that checks fewer of them.
304
+ */
305
+ const reopened = current?.resolvedAt != null &&
306
+ next !== TicketStatusValues.RESOLVED &&
307
+ next !== TicketStatusValues.CLOSED;
308
+ if (reopened)
309
+ return { resolvedAt: undefined, resolvedBy: undefined };
244
310
  return {};
245
311
  }
246
312
  /** Append a timeline entry when the patch touches a tracked field. */
@@ -259,7 +325,7 @@ export class SupportRepository extends BaseRepository {
259
325
  trigger: ctx?.trigger ?? defaultTrigger,
260
326
  reason: ctx?.reason,
261
327
  note: ctx?.note,
262
- // `encryptPiiFields` never descends into arrays, so a PII-named value
328
+ // `encryptPiiFields` covers only NAMED paths, so an undeclared PII-named value
263
329
  // reaching `changes` would persist in PLAINTEXT inside statusHistory.
264
330
  piiFields: SUPPORT_TICKET_PII_FIELDS,
265
331
  });
@@ -288,7 +354,7 @@ export class SupportRepository extends BaseRepository {
288
354
  };
289
355
  if (newStatus) {
290
356
  const current = prior !== undefined ? prior : await this.getTicketById(ticketId);
291
- Object.assign(updateData, this.withTicketHistory(current, { status: newStatus, ...this.resolutionStamps(current, newStatus) }, ctx, "addMessage"));
357
+ Object.assign(updateData, this.withTicketHistory(current, { status: newStatus, ...this.resolutionStamps(current, newStatus, resolverUid(ctx)) }, ctx, "addMessage"));
292
358
  }
293
359
  await ref.update(updateData);
294
360
  }
@@ -196,6 +196,23 @@ export interface SupportTicketDocument extends BaseDocument {
196
196
  * `Date` field and split the collection into two shapes.
197
197
  */
198
198
  resolvedAt?: Date;
199
+ /**
200
+ * The uid of whoever moved the ticket to `resolved`.
201
+ *
202
+ * 🛑 **Not `assignedTo`.** That is the CURRENT assignee and moves on
203
+ * reassignment, so paying from it credits whoever holds the ticket at period
204
+ * end rather than whoever did the work. Employee pay is computed from this
205
+ * field; see `resolvedTicketsForPeriod`.
206
+ *
207
+ * Server-stamped, never client-sent, and **cleared on reopen** — pay counts
208
+ * tickets still resolved at period end, so a reopened ticket must stop
209
+ * counting or closing it twice pays twice.
210
+ *
211
+ * Absent on a system transition and on a buyer-driven one: both are real
212
+ * resolutions that earn nobody wages, and a fallback to the assignee would
213
+ * be a wage attributed to someone who did nothing.
214
+ */
215
+ resolvedBy?: string;
199
216
  closedAt?: Date;
200
217
  /** When we acknowledged receipt. Server-stamped at intake. */
201
218
  acknowledgedAt?: Date;
@@ -157,7 +157,7 @@ export declare const supportTicketFirestoreSchema: z.ZodObject<{
157
157
  updatedAt: string | Date | z.objectOutputType<{
158
158
  toDate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodDate>;
159
159
  }, z.ZodTypeAny, "passthrough">;
160
- category: "general" | "order_issue" | "billing_payment" | "account" | "listing_dispute" | "scam_report" | "refund_request" | "auction_dispute" | "store_change_request" | "order_modification_request" | "unban_request";
160
+ category: "general" | "account" | "order_issue" | "billing_payment" | "listing_dispute" | "scam_report" | "refund_request" | "auction_dispute" | "store_change_request" | "order_modification_request" | "unban_request";
161
161
  priority: "normal" | "high" | "low" | "urgent";
162
162
  description: string;
163
163
  userId: string;
@@ -175,11 +175,11 @@ export declare const supportTicketFirestoreSchema: z.ZodObject<{
175
175
  attachments?: string[] | undefined;
176
176
  }[];
177
177
  orderId?: string | undefined;
178
- assignedTo?: string | undefined;
179
- resolvedAt?: string | Date | z.objectOutputType<{
178
+ closedAt?: string | Date | z.objectOutputType<{
180
179
  toDate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodDate>;
181
180
  }, z.ZodTypeAny, "passthrough"> | undefined;
182
- closedAt?: string | Date | z.objectOutputType<{
181
+ assignedTo?: string | undefined;
182
+ resolvedAt?: string | Date | z.objectOutputType<{
183
183
  toDate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodDate>;
184
184
  }, z.ZodTypeAny, "passthrough"> | undefined;
185
185
  assignedToName?: string | undefined;
@@ -200,7 +200,7 @@ export declare const supportTicketFirestoreSchema: z.ZodObject<{
200
200
  updatedAt: string | Date | z.objectInputType<{
201
201
  toDate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodDate>;
202
202
  }, z.ZodTypeAny, "passthrough">;
203
- category: "general" | "order_issue" | "billing_payment" | "account" | "listing_dispute" | "scam_report" | "refund_request" | "auction_dispute" | "store_change_request" | "order_modification_request" | "unban_request";
203
+ category: "general" | "account" | "order_issue" | "billing_payment" | "listing_dispute" | "scam_report" | "refund_request" | "auction_dispute" | "store_change_request" | "order_modification_request" | "unban_request";
204
204
  priority: "normal" | "high" | "low" | "urgent";
205
205
  description: string;
206
206
  userId: string;
@@ -218,11 +218,11 @@ export declare const supportTicketFirestoreSchema: z.ZodObject<{
218
218
  attachments?: string[] | undefined;
219
219
  }[];
220
220
  orderId?: string | undefined;
221
- assignedTo?: string | undefined;
222
- resolvedAt?: string | Date | z.objectInputType<{
221
+ closedAt?: string | Date | z.objectInputType<{
223
222
  toDate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodDate>;
224
223
  }, z.ZodTypeAny, "passthrough"> | undefined;
225
- closedAt?: string | Date | z.objectInputType<{
224
+ assignedTo?: string | undefined;
225
+ resolvedAt?: string | Date | z.objectInputType<{
226
226
  toDate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodDate>;
227
227
  }, z.ZodTypeAny, "passthrough"> | undefined;
228
228
  assignedToName?: string | undefined;
@@ -29,7 +29,7 @@ export declare function useWishlistWithGuest(userId: string | null | undefined,
29
29
  productPrice: number;
30
30
  productSlug: string;
31
31
  addedAt: string | undefined;
32
- type: "category" | "store" | "classified" | "auction" | "digital-code" | "live" | "product" | "preorder";
32
+ type: "category" | "store" | "classified" | "auction" | "digital-code" | "live" | "preorder" | "product";
33
33
  }[];
34
34
  total: number;
35
35
  wishlistedIds: Set<string>;
package/dist/index.d.ts CHANGED
@@ -550,6 +550,8 @@ export { scammerRepository } from "./repositories/index";
550
550
  export { supportRepository, SupportRepository } from "./repositories/index";
551
551
  export type { SupportTicketDocument, SupportTicketCreateInput, SupportTicketUpdateInput, TicketMessage, TicketCategory, TicketStatus, TicketPriority, } from "./repositories/index";
552
552
  export { ELIGIBLE_ORDER_STATUSES_FOR_TICKET, SUPPORT_TICKET_COLLECTION, ACTIVE_TICKET_STATUSES, SUPPORT_TICKET_FIELDS, TicketCategoryValues, TicketStatusValues, TicketPriorityValues, } from "./features/support/schemas/firestore";
553
+ export { AdminIntegrationsView } from "./features/admin/components/AdminIntegrationsView";
554
+ export type { AdminIntegrationsViewProps } from "./features/admin/components/AdminIntegrationsView";
553
555
  export { AdminTaxCodesView } from "./features/admin/components/AdminTaxCodesView";
554
556
  export type { AdminTaxCodesViewProps } from "./features/admin/components/AdminTaxCodesView";
555
557
  export { AdminTaxCodeEditorView } from "./features/admin/components/AdminTaxCodeEditorView";
@@ -1962,6 +1964,8 @@ export type { OrderSiblingPaymentsProps } from "./features/orders/index";
1962
1964
  export { OrderPaymentSummary } from "./features/orders/index";
1963
1965
  export type { OrderPaymentSummaryProps } from "./features/orders/index";
1964
1966
  export { OrderStatusTimeline } from "./features/orders/index";
1967
+ export { OrderProvenanceCard } from "./features/orders/index";
1968
+ export type { OrderProvenanceCardProps } from "./features/orders/index";
1965
1969
  export { OrderCompletionPanel } from "./features/orders/index";
1966
1970
  export { StatusTimeline, stepsFromEntries } from "./features/status-history/index";
1967
1971
  export type { StatusTimelineProps, TimelineEntry, TimelineStep } from "./features/status-history/index";
@@ -2000,6 +2004,7 @@ export type { OrderAdminUpdateInput } from "./features/orders/index";
2000
2004
  export type { AppliedOrderDiscount } from "./features/orders/index";
2001
2005
  export type { OrderCreateInput } from "./features/orders/index";
2002
2006
  export type { OrderDocument } from "./features/orders/index";
2007
+ export type { OrderSourceContext } from "./features/orders/index";
2003
2008
  export type { OrderRefundEvent, RefundType } from "./features/orders/schemas/firestore";
2004
2009
  export { MANUAL_PAYMENT_METHODS, isManualPaymentMethod, PAYMENT_REVIEW_QUEUE_MODES, isPaymentReviewQueueMode, PAYMENT_REVIEW_QUEUE_SCAN_LIMIT, } from "./features/orders/constants/payment-window";
2005
2010
  export type { PaymentReviewQueueMode } from "./features/orders/constants/payment-window";
@@ -2190,7 +2195,7 @@ export { actionTracker, setActionTrackerSink, resetActionTrackerSink, type Actio
2190
2195
  export { cartRequiresShipping, cartIsDigitalOnly, cartIsChatOnly, } from "./_internal/shared/listing-types/cart-shipping";
2191
2196
  export { ACTIONS, action, act, canPerformAction, actionsForListingType, actionLabel, type ActionDef, type ActionKind, type ActionResource, type ActionTree, type ActionConfirmation, } from "./_internal/shared/actions/action-registry";
2192
2197
  export { buildBulkAction } from "./_internal/shared/actions/bulk-helpers";
2193
- export { computeCheckoutFees, computePayoutDeduction, computeCodHandlingFee, computeGiftWrapFee, computeShipmentProtectionFee, computeSaleProtectionFee, calculateGst, } from "./_internal/shared/fees/calculator";
2198
+ export { computeCheckoutFees, allocateCheckoutFees, computePayoutDeduction, computeCodHandlingFee, computeGiftWrapFee, computeShipmentProtectionFee, computeSaleProtectionFee, calculateGst, } from "./_internal/shared/fees/calculator";
2194
2199
  export { searchPriceIndex, PRICE_INDEX_SEARCH_LIMIT, PRICE_INDEX_MIN_QUERY_LENGTH } from "./_internal/server/features/price-index/search";
2195
2200
  export type { PriceIndexSearchResponse, PriceIndexSearchResult, PriceIndexSearchResultBand, } from "./_internal/server/features/price-index/search";
2196
2201
  export { protectionAvailability, computeProtectionFees, adjudicateClaim, badgesFor, showsRiskNotice, showsSafetyBadge, returnDestination, rtoDestination, PROTECTION_KINDS, } from "./_internal/shared/features/shipping/protections";
@@ -2198,6 +2203,9 @@ export type { ProtectionKind, ProtectionAvailability, ProtectionTierInput, Prote
2198
2203
  export type { FeeCommissionRates, CheckoutFees, PayoutDeduction, CodHandlingFeeRates, GiftWrapFeeRates, ShipmentProtectionFeeRates, SaleProtectionFeeRates, GstBreakdown, } from "./_internal/shared/fees/calculator";
2199
2204
  export { checkEmiEligibility, computeEmiSchedule, computeBuyerEmiQuote } from "./_internal/shared/features/emi/schedule";
2200
2205
  export type { BuyerEmiQuote } from "./_internal/shared/features/emi/schedule";
2206
+ export { amountDueNow, groupEmiGate, groupEmiQuote, groupEmiSchedule, emiOrderFields } from "./_internal/shared/features/emi/group";
2207
+ export { emiTenderFor, resolveEmiChoice, emiTenderBlockReason, isTenderCompatibleWithEmi } from "./_internal/shared/features/emi/choice";
2208
+ export type { EmiChoice, EmiTender } from "./_internal/shared/features/emi/choice";
2201
2209
  export { toBuyerFacingFees, toBuyerEmiSettings, } from "./_internal/shared/features/site-settings/fees";
2202
2210
  export type { BuyerFacingFees, BuyerEmiSettings, } from "./_internal/shared/features/site-settings/fees";
2203
2211
  export { GSTIN_PATTERN, gstinCheckCharacter, isValidGstin, validateGstEnablement, canEnableGst, } from "./_internal/shared/features/site-settings/gst-registration";
@@ -2852,6 +2860,8 @@ export { BUNDLE_COPY, BUNDLE_STOCK_VARIANT, } from "./_internal/shared/features/
2852
2860
  export { REFUND_COPY } from "./_internal/shared/features/orders/refund-copy";
2853
2861
  export { RETURN_REASON, FINAL_SALE_EXEMPT_REASONS, RETURN_REASON_LABEL, RETURN_REASON_GROUP_LABEL, isFinalSaleExempt, isReturnReason, selectableReturnReasons, } from "./_internal/shared/features/orders/return-reasons";
2854
2862
  export type { ReturnReason } from "./_internal/shared/features/orders/return-reasons";
2863
+ export { DISPUTE_KIND, DISPUTE_KIND_LABEL, DISPUTE_GATE, DISPUTE_TRANSIT_WINDOW_DAYS, DISPUTE_NOT_REACHED_GRACE_DAYS, isDisputeKind, checkDisputeGate, resolveDisputeEtd, disputeNotReachedFilableFrom, } from "./_internal/shared/features/orders/dispute-reasons";
2864
+ export type { DisputeKind, DisputeGateOrder, DisputeGateResult, } from "./_internal/shared/features/orders/dispute-reasons";
2855
2865
  export { bundleCreateSchema, bundleUpdateSchema, bundleQueryRuleSchema, bundleDisplaySchema, type BundleCreateBody, type BundleUpdateBody, } from "./_internal/shared/features/categories/bundle-schemas";
2856
2866
  export type { GroupedListingDocument, GroupTheme, GroupVisibility } from "./features/grouped/schemas/firestore";
2857
2867
  export { navItemFormSchema, navItemCreateSchema, navItemUpdateSchema, type NavItemFormValues, } from "./features/admin/schemas/nav-item-form";
package/dist/index.js CHANGED
@@ -1090,6 +1090,15 @@ export { ELIGIBLE_ORDER_STATUSES_FOR_TICKET, SUPPORT_TICKET_COLLECTION, ACTIVE_T
1090
1090
  // SB-UNI-B â€" sublistingCategoriesRepository + SublistingCategoryDocument deleted.
1091
1091
  // Use categoriesRepository.findBySlugAndType(slug, "sublisting") and CategoryDocument with categoryType:"sublisting".
1092
1092
  // [DB]-Database layer â€" uses firebase-admin; server-only.
1093
+ /*
1094
+ * AdminIntegrationsView (12b) — /admin/integrations.
1095
+ *
1096
+ * The caller `INTEGRATIONS` / `integrationPatch` / `allIntegrationsPatch` were
1097
+ * missing: the model landed with every route guard resolving through it and
1098
+ * nothing in the UI reading it, which made those three exports speculative
1099
+ * infra. This is what reads them.
1100
+ */
1101
+ export { AdminIntegrationsView } from "./features/admin/components/AdminIntegrationsView.js";
1093
1102
  // AdminTaxCodesView / AdminTaxCodeEditorView (B3) — /admin/tax-codes.
1094
1103
  export { AdminTaxCodesView } from "./features/admin/components/AdminTaxCodesView.js";
1095
1104
  export { AdminTaxCodeEditorView } from "./features/admin/components/AdminTaxCodeEditorView.js";
@@ -3691,6 +3700,9 @@ export { OrdersList } from "./features/orders/index.js";
3691
3700
  export { OrderSiblingPayments } from "./features/orders/index.js";
3692
3701
  export { OrderPaymentSummary } from "./features/orders/index.js";
3693
3702
  export { OrderStatusTimeline } from "./features/orders/index.js";
3703
+ // OrderProvenanceCard — renders sourceContext, the record of HOW the buyer
3704
+ // earned this price. Mounted on the buyer, seller AND admin order detail.
3705
+ export { OrderProvenanceCard } from "./features/orders/index.js";
3694
3706
  // OrderCompletionPanel - Per-line ratings + Mark complete, the buyer's fast path.
3695
3707
  export { OrderCompletionPanel } from "./features/orders/index.js";
3696
3708
  // [CLIENT] StatusTimeline — the ONE rail both orders and offers render.
@@ -4075,7 +4087,14 @@ export { cartRequiresShipping, cartIsDigitalOnly, cartIsChatOnly, } from "./_int
4075
4087
  export { ACTIONS, action, act, canPerformAction, actionsForListingType, actionLabel, } from "./_internal/shared/actions/action-registry.js";
4076
4088
  export { buildBulkAction } from "./_internal/shared/actions/bulk-helpers.js";
4077
4089
  // Shared fee calculator — platform/gateway/GST/COD handling/addon fee math (pure, client-safe).
4078
- export { computeCheckoutFees, computePayoutDeduction, computeCodHandlingFee, computeGiftWrapFee, computeShipmentProtectionFee, computeSaleProtectionFee, calculateGst, } from "./_internal/shared/fees/calculator.js";
4090
+ export { computeCheckoutFees,
4091
+ // The per-group split of the ONE capped commission. Exported for the capture
4092
+ // route's points tender: the tender is applied per order group against the
4093
+ // same base the order path uses, and that base includes this share. Without
4094
+ // it the route would have to re-derive the apportionment — and the allocator
4095
+ // also carries the `minimumTransactionFee` floor (D41), which already spent
4096
+ // a release being re-implemented by hand in that very file.
4097
+ allocateCheckoutFees, computePayoutDeduction, computeCodHandlingFee, computeGiftWrapFee, computeShipmentProtectionFee, computeSaleProtectionFee, calculateGst, } from "./_internal/shared/fees/calculator.js";
4079
4098
  // C5e buyer protections — the pure three-tier gate plus the one fee pair
4080
4099
  // every money path must agree on. Public API because the capture route
4081
4100
  // (/api/payment/create-order) is one of the three sites that must agree.
@@ -4087,6 +4106,16 @@ export { searchPriceIndex, PRICE_INDEX_SEARCH_LIMIT, PRICE_INDEX_MIN_QUERY_LENGT
4087
4106
  export { protectionAvailability, computeProtectionFees, adjudicateClaim, badgesFor, showsRiskNotice, showsSafetyBadge, returnDestination, rtoDestination, PROTECTION_KINDS, } from "./_internal/shared/features/shipping/protections.js";
4088
4107
  // EMI eligibility + schedule computation (pure, client-safe — used for checkout quotes).
4089
4108
  export { checkEmiEligibility, computeEmiSchedule, computeBuyerEmiQuote } from "./_internal/shared/features/emi/schedule.js";
4109
+ /*
4110
+ * 0f — the per-group instalment helpers. Exported because the CAPTURE amount
4111
+ * is computed in a consumer route (`/api/payment/create-order`), and that
4112
+ * route is one of the four money paths that must agree about an EMI order.
4113
+ * There is no `./_internal/*` subpath, deliberately, so the barrel is how a
4114
+ * consumer reaches shared checkout maths — exactly as `lineTotalFor` and
4115
+ * `resolveShippingCost` already are.
4116
+ */
4117
+ export { amountDueNow, groupEmiGate, groupEmiQuote, groupEmiSchedule, emiOrderFields } from "./_internal/shared/features/emi/group.js";
4118
+ export { emiTenderFor, resolveEmiChoice, emiTenderBlockReason, isTenderCompatibleWithEmi } from "./_internal/shared/features/emi/choice.js";
4090
4119
  // Buyer-facing projections of siteSettings.commissions / .emi — the single
4091
4120
  // definition of "safe to send to a browser" for fee data. See fees.ts header.
4092
4121
  export { toBuyerFacingFees, toBuyerEmiSettings, } from "./_internal/shared/features/site-settings/fees.js";
@@ -5121,6 +5150,9 @@ export { REFUND_COPY } from "./_internal/shared/features/orders/refund-copy.js";
5121
5150
  // See the module docstring for why the exempt set is "seller or carrier fault"
5122
5151
  // rather than "serious reasons".
5123
5152
  export { RETURN_REASON, FINAL_SALE_EXEMPT_REASONS, RETURN_REASON_LABEL, RETURN_REASON_GROUP_LABEL, isFinalSaleExempt, isReturnReason, selectableReturnReasons, } from "./_internal/shared/features/orders/return-reasons.js";
5153
+ // Dispute KINDS and their gates. `_internal/*` is not a subpath export, so a
5154
+ // consumer route reaches these only through a barrel.
5155
+ export { DISPUTE_KIND, DISPUTE_KIND_LABEL, DISPUTE_GATE, DISPUTE_TRANSIT_WINDOW_DAYS, DISPUTE_NOT_REACHED_GRACE_DAYS, isDisputeKind, checkDisputeGate, resolveDisputeEtd, disputeNotReachedFilableFrom, } from "./_internal/shared/features/orders/dispute-reasons.js";
5124
5156
  // S-SBUNI-4 follow-up â€" shared admin bundle zod schemas.
5125
5157
  export { bundleCreateSchema, bundleUpdateSchema, bundleQueryRuleSchema, bundleDisplaySchema, } from "./_internal/shared/features/categories/bundle-schemas.js";
5126
5158
  export { navItemFormSchema, navItemCreateSchema, navItemUpdateSchema, } from "./features/admin/schemas/nav-item-form.js";