@mohasinac/appkit 4.62.1 → 4.63.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (263) 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 +51 -11
  8. package/dist/_internal/server/features/checkout/actions.js +335 -80
  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/offers/destinations.d.ts +40 -0
  22. package/dist/_internal/server/features/offers/destinations.js +65 -0
  23. package/dist/_internal/server/features/orders/adapters.js +21 -0
  24. package/dist/_internal/server/features/orders/amend-delivery.d.ts +56 -0
  25. package/dist/_internal/server/features/orders/amend-delivery.js +124 -0
  26. package/dist/_internal/server/features/orders/balance.d.ts +89 -0
  27. package/dist/_internal/server/features/orders/balance.js +256 -0
  28. package/dist/_internal/server/features/pricing/actions.d.ts +58 -0
  29. package/dist/_internal/server/features/pricing/actions.js +144 -0
  30. package/dist/_internal/server/features/shipping/book-split.d.ts +86 -0
  31. package/dist/_internal/server/features/shipping/book-split.js +130 -0
  32. package/dist/_internal/server/features/shipping/book.d.ts +61 -0
  33. package/dist/_internal/server/features/shipping/book.js +176 -0
  34. package/dist/_internal/server/features/shipping/courier-block.js +26 -1
  35. package/dist/_internal/server/features/site-settings/adapters.d.ts +1 -1
  36. package/dist/_internal/server/features/site-settings/adapters.js +14 -0
  37. package/dist/_internal/server/features/stores/adapters.d.ts +1 -1
  38. package/dist/_internal/server/features/stores/adapters.js +14 -0
  39. package/dist/_internal/server/functions/scheduled.d.ts +2 -1
  40. package/dist/_internal/server/functions/scheduled.js +57 -1
  41. package/dist/_internal/server/jobs/core/autoPayoutEligibility.js +2 -0
  42. package/dist/_internal/server/jobs/core/jobRunners.js +45 -0
  43. package/dist/_internal/server/jobs/core/onOrderStatusChange.js +4 -1
  44. package/dist/_internal/server/jobs/core/reservationExpiry.d.ts +17 -0
  45. package/dist/_internal/server/jobs/core/reservationExpiry.js +40 -0
  46. package/dist/_internal/server/jobs/core/weeklyPayoutEligibility.js +15 -0
  47. package/dist/_internal/server/jobs/handlers/index.d.ts +1 -0
  48. package/dist/_internal/server/jobs/handlers/index.js +1 -0
  49. package/dist/_internal/server/jobs/handlers/reservationExpiry.d.ts +2 -0
  50. package/dist/_internal/server/jobs/handlers/reservationExpiry.js +2 -0
  51. package/dist/_internal/shared/actions/action-registry.d.ts +1 -1
  52. package/dist/_internal/shared/actions/action-registry.js +268 -0
  53. package/dist/_internal/shared/checkout/order-math.d.ts +31 -2
  54. package/dist/_internal/shared/checkout/order-math.js +22 -36
  55. package/dist/_internal/shared/checkout/rules/index.d.ts +1 -1
  56. package/dist/_internal/shared/checkout/rules/index.js +1 -1
  57. package/dist/_internal/shared/checkout/rules/payment-gate.d.ts +18 -0
  58. package/dist/_internal/shared/checkout/rules/payment-gate.js +25 -0
  59. package/dist/_internal/shared/checkout/split.d.ts +0 -12
  60. package/dist/_internal/shared/checkout/split.js +22 -2
  61. package/dist/_internal/shared/content/disclaimers.js +7 -7
  62. package/dist/_internal/shared/content/published-values.d.ts +6 -1
  63. package/dist/_internal/shared/content/published-values.js +8 -0
  64. package/dist/_internal/shared/features/admin/integrations.d.ts +32 -2
  65. package/dist/_internal/shared/features/admin/integrations.js +19 -9
  66. package/dist/_internal/shared/features/dashboard/hub-sections.d.ts +72 -0
  67. package/dist/_internal/shared/features/dashboard/hub-sections.js +75 -0
  68. package/dist/_internal/shared/features/emi/choice.d.ts +98 -0
  69. package/dist/_internal/shared/features/emi/choice.js +69 -0
  70. package/dist/_internal/shared/features/emi/group.d.ts +84 -0
  71. package/dist/_internal/shared/features/emi/group.js +126 -0
  72. package/dist/_internal/shared/features/ledger/posting.d.ts +107 -0
  73. package/dist/_internal/shared/features/ledger/posting.js +165 -0
  74. package/dist/_internal/shared/features/ledger/reports.d.ts +76 -0
  75. package/dist/_internal/shared/features/ledger/reports.js +127 -0
  76. package/dist/_internal/shared/features/ledger/rules.d.ts +170 -0
  77. package/dist/_internal/shared/features/ledger/rules.js +221 -0
  78. package/dist/_internal/shared/features/offers/coordination.d.ts +122 -0
  79. package/dist/_internal/shared/features/offers/coordination.js +80 -0
  80. package/dist/_internal/shared/features/orders/delivery-snapshot.d.ts +114 -0
  81. package/dist/_internal/shared/features/orders/delivery-snapshot.js +116 -0
  82. package/dist/_internal/shared/features/payouts/pay-period.d.ts +91 -0
  83. package/dist/_internal/shared/features/payouts/pay-period.js +104 -0
  84. package/dist/_internal/shared/features/points/accepts.d.ts +1 -8
  85. package/dist/_internal/shared/features/points/accepts.js +12 -6
  86. package/dist/_internal/shared/features/pricing/rate-registry.d.ts +150 -0
  87. package/dist/_internal/shared/features/pricing/rate-registry.js +246 -0
  88. package/dist/_internal/shared/features/shipping/parcel.d.ts +123 -0
  89. package/dist/_internal/shared/features/shipping/parcel.js +139 -0
  90. package/dist/_internal/shared/features/site-settings/fees.d.ts +16 -8
  91. package/dist/_internal/shared/features/site-settings/fees.js +12 -8
  92. package/dist/_internal/shared/fees/explain.d.ts +81 -0
  93. package/dist/_internal/shared/fees/explain.js +101 -0
  94. package/dist/_internal/shared/history/index.d.ts +1 -1
  95. package/dist/_internal/shared/history/index.js +1 -1
  96. package/dist/_internal/shared/history/types.d.ts +7 -1
  97. package/dist/_internal/shared/history/types.js +25 -0
  98. package/dist/client.d.ts +11 -1
  99. package/dist/client.js +13 -0
  100. package/dist/constants/api-endpoints.d.ts +72 -0
  101. package/dist/constants/api-endpoints.js +41 -0
  102. package/dist/constants/field-names.d.ts +41 -0
  103. package/dist/constants/field-names.js +47 -0
  104. package/dist/features/account/components/UserOrdersView.js +28 -2
  105. package/dist/features/admin/components/AdminIntegrationsView.d.ts +55 -0
  106. package/dist/features/admin/components/AdminIntegrationsView.js +74 -0
  107. package/dist/features/admin/components/AdminOrderEditorView.d.ts +16 -1
  108. package/dist/features/admin/components/AdminOrderEditorView.js +72 -3
  109. package/dist/features/admin/components/AdminOrdersView.js +20 -1
  110. package/dist/features/admin/schemas/firestore.d.ts +32 -0
  111. package/dist/features/ads/schemas/booking-write.d.ts +157 -0
  112. package/dist/features/ads/schemas/booking-write.js +88 -0
  113. package/dist/features/ads/schemas/creative-form.d.ts +18 -0
  114. package/dist/features/ads/schemas/creative-form.js +51 -0
  115. package/dist/features/ads/schemas/firestore.d.ts +140 -0
  116. package/dist/features/ads/schemas/firestore.js +109 -0
  117. package/dist/features/auctions/repository/bid.repository.js +3 -1
  118. package/dist/features/audit-log/schemas/firestore.d.ts +110 -0
  119. package/dist/features/audit-log/schemas/firestore.js +74 -0
  120. package/dist/features/auth/actions/profile-actions.d.ts +69 -1
  121. package/dist/features/auth/actions/profile-actions.js +62 -1
  122. package/dist/features/auth/schemas/firestore.d.ts +16 -2
  123. package/dist/features/auth/schemas/firestore.js +2 -1
  124. package/dist/features/blog/actions/blog-actions.d.ts +6 -0
  125. package/dist/features/blog/actions/blog-actions.js +17 -2
  126. package/dist/features/blog/api/route.js +4 -1
  127. package/dist/features/blog/columns/index.js +5 -0
  128. package/dist/features/blog/components/BlogIndexPageView.js +2 -1
  129. package/dist/features/blog/repository/blog.repository.d.ts +4 -0
  130. package/dist/features/blog/repository/blog.repository.js +5 -0
  131. package/dist/features/blog/schemas/blog-form.d.ts +3 -0
  132. package/dist/features/blog/schemas/blog-form.js +1 -0
  133. package/dist/features/blog/schemas/firestore.d.ts +38 -1
  134. package/dist/features/blog/schemas/firestore.js +23 -0
  135. package/dist/features/blog/schemas/index.d.ts +6 -0
  136. package/dist/features/blog/schemas/index.js +2 -0
  137. package/dist/features/blog/types/index.d.ts +2 -0
  138. package/dist/features/cart/components/CartPriceBreakdown.d.ts +12 -1
  139. package/dist/features/cart/components/CartPriceBreakdown.js +24 -5
  140. package/dist/features/cart/repository/cart.repository.d.ts +14 -0
  141. package/dist/features/cart/repository/cart.repository.js +20 -0
  142. package/dist/features/cart/schemas/firestore.d.ts +24 -0
  143. package/dist/features/dashboard/components/DashboardHubView.d.ts +83 -0
  144. package/dist/features/dashboard/components/DashboardHubView.js +56 -0
  145. package/dist/features/dashboard/components/DashboardSectionsClient.d.ts +23 -0
  146. package/dist/features/dashboard/components/DashboardSectionsClient.js +66 -0
  147. package/dist/features/dispute-reasons/components/AdminDisputeReasonsView.d.ts +55 -0
  148. package/dist/features/dispute-reasons/components/AdminDisputeReasonsView.js +175 -0
  149. package/dist/features/dispute-reasons/repository/dispute-reasons.repository.d.ts +24 -0
  150. package/dist/features/dispute-reasons/repository/dispute-reasons.repository.js +28 -0
  151. package/dist/features/dispute-reasons/schemas/firestore.d.ts +3 -5
  152. package/dist/features/events/components/EventSaleBanner.js +1 -1
  153. package/dist/features/faq/components/FAQPageContent.js +2 -2
  154. package/dist/features/gateway-events/schemas/index.d.ts +2 -2
  155. package/dist/features/homepage/schemas/index.d.ts +8 -8
  156. package/dist/features/inventory/schemas/stock-reservation.d.ts +114 -0
  157. package/dist/features/inventory/schemas/stock-reservation.js +103 -0
  158. package/dist/features/layout/AppLayoutShell.d.ts +9 -1
  159. package/dist/features/layout/AppLayoutShell.js +12 -4
  160. package/dist/features/layout/BottomActions.js +2 -1
  161. package/dist/features/layout/BottomNavbar.d.ts +10 -2
  162. package/dist/features/layout/SideActionDock.js +52 -2
  163. package/dist/features/layout/TitleBarLayout.js +13 -4
  164. package/dist/features/layout/TitleBarLayout.style.css +59 -0
  165. package/dist/features/layout/useCtaReveal.d.ts +16 -1
  166. package/dist/features/layout/useCtaReveal.js +17 -26
  167. package/dist/features/ledger/repository/journal.repository.d.ts +110 -0
  168. package/dist/features/ledger/repository/journal.repository.js +312 -0
  169. package/dist/features/ledger/schemas/expenses.d.ts +87 -0
  170. package/dist/features/ledger/schemas/expenses.js +27 -0
  171. package/dist/features/ledger/schemas/firestore.d.ts +183 -0
  172. package/dist/features/ledger/schemas/firestore.js +69 -0
  173. package/dist/features/orders/components/BalancePaymentPanel.d.ts +12 -0
  174. package/dist/features/orders/components/BalancePaymentPanel.js +94 -0
  175. package/dist/features/orders/components/RaiseDisputeForm.js +19 -11
  176. package/dist/features/orders/repository/orders.repository.d.ts +28 -1
  177. package/dist/features/orders/repository/orders.repository.js +60 -6
  178. package/dist/features/orders/schemas/balance.d.ts +40 -0
  179. package/dist/features/orders/schemas/balance.js +47 -0
  180. package/dist/features/orders/schemas/firestore.d.ts +202 -0
  181. package/dist/features/orders/schemas/firestore.js +43 -0
  182. package/dist/features/orders/schemas/index.d.ts +2 -2
  183. package/dist/features/orders/types/index.d.ts +21 -0
  184. package/dist/features/payments/repository/payout.repository.js +3 -2
  185. package/dist/features/payments/schemas/firestore.d.ts +92 -1
  186. package/dist/features/payments/schemas/firestore.js +23 -0
  187. package/dist/features/pricing/components/AdminPricingView.d.ts +13 -0
  188. package/dist/features/pricing/components/AdminPricingView.js +157 -0
  189. package/dist/features/products/schemas/firestore.d.ts +26 -1
  190. package/dist/features/products/schemas/firestore.js +2 -0
  191. package/dist/features/products/schemas/index.d.ts +2 -2
  192. package/dist/features/reviews/repository/reviews.repository.d.ts +14 -0
  193. package/dist/features/reviews/repository/reviews.repository.js +16 -0
  194. package/dist/features/scams/repository/scammer.repository.js +2 -1
  195. package/dist/features/scams/schemas/firestore.d.ts +2 -1
  196. package/dist/features/scams/schemas/firestore.js +2 -1
  197. package/dist/features/seller/actions/offer-actions.js +56 -0
  198. package/dist/features/seller/actions/seller-actions.d.ts +1 -1
  199. package/dist/features/seller/actions/seller-actions.js +4 -0
  200. package/dist/features/seller/components/DispatchForm.d.ts +11 -0
  201. package/dist/features/seller/components/DispatchForm.js +190 -0
  202. package/dist/features/seller/components/SellerOrdersView.js +94 -2
  203. package/dist/features/seller/components/index.d.ts +1 -0
  204. package/dist/features/seller/components/index.js +1 -0
  205. package/dist/features/seller/repository/offer.repository.js +4 -3
  206. package/dist/features/seller/schemas/firestore.d.ts +23 -2
  207. package/dist/features/seller/schemas/firestore.js +3 -2
  208. package/dist/features/seller/schemas/index.d.ts +4 -4
  209. package/dist/features/seller/schemas/order-forms.d.ts +61 -4
  210. package/dist/features/seller/schemas/order-forms.js +41 -8
  211. package/dist/features/shipments/schemas/firestore.d.ts +25 -0
  212. package/dist/features/shipping-boxes/repository/shipping-boxes.repository.d.ts +39 -0
  213. package/dist/features/shipping-boxes/repository/shipping-boxes.repository.js +55 -0
  214. package/dist/features/shipping-boxes/schemas/firestore.d.ts +2 -4
  215. package/dist/features/stores/repository/store.repository.d.ts +18 -0
  216. package/dist/features/stores/repository/store.repository.js +27 -1
  217. package/dist/features/stores/schemas/firestore.d.ts +41 -0
  218. package/dist/features/stores/schemas/firestore.js +20 -0
  219. package/dist/features/stores/schemas/index.d.ts +6 -6
  220. package/dist/features/support/repository/support.repository.js +72 -6
  221. package/dist/features/support/schemas/firestore.d.ts +17 -0
  222. package/dist/features/support/schemas/index.d.ts +2 -2
  223. package/dist/index.d.ts +5 -0
  224. package/dist/index.js +19 -0
  225. package/dist/next/routing/route-map.d.ts +92 -0
  226. package/dist/next/routing/route-map.js +53 -0
  227. package/dist/react/contexts/SessionContext.d.ts +17 -1
  228. package/dist/schemas/registry.d.ts +22 -16
  229. package/dist/security/pii-schemas.d.ts +1 -1
  230. package/dist/security/pii-schemas.js +45 -0
  231. package/dist/server-entry.d.ts +1 -1
  232. package/dist/server-entry.js +10 -1
  233. package/dist/server.d.ts +29 -1
  234. package/dist/server.js +158 -0
  235. package/dist/styles.css +349 -1
  236. package/dist/tailwind-utilities.css +1 -1
  237. package/dist/ui/components/Button.d.ts +10 -1
  238. package/dist/ui/components/Button.js +25 -3
  239. package/dist/ui/components/Chart.d.ts +63 -0
  240. package/dist/ui/components/Chart.js +169 -0
  241. package/dist/ui/components/Chart.style.css +214 -0
  242. package/dist/ui/components/Disclaimer.js +10 -1
  243. package/dist/ui/components/OverflowRow.js +54 -2
  244. package/dist/ui/components/OverflowRow.style.css +38 -0
  245. package/dist/ui/components/RichTextEditor.js +99 -8
  246. package/dist/ui/components/chart-spec.d.ts +68 -0
  247. package/dist/ui/components/chart-spec.js +140 -0
  248. package/dist/ui/components/index.style.css +1 -0
  249. package/dist/ui/components/surface-tokens.d.ts +1 -1
  250. package/dist/ui/components/surface-tokens.js +9 -0
  251. package/dist/ui/components/toolbar-collapse.d.ts +13 -0
  252. package/dist/ui/components/toolbar-collapse.js +10 -1
  253. package/dist/ui/index.d.ts +6 -0
  254. package/dist/ui/index.js +3 -0
  255. package/dist/ui/rich-text/RichText.d.ts +10 -1
  256. package/dist/ui/rich-text/RichText.js +33 -2
  257. package/dist/ui/rich-text/RichText.style.css +35 -0
  258. package/dist/ui/rich-text/RichTextRenderer.d.ts +30 -1
  259. package/dist/ui/rich-text/RichTextRenderer.js +34 -2
  260. package/dist/ui/rich-text/chart-blocks.d.ts +62 -0
  261. package/dist/ui/rich-text/chart-blocks.js +87 -0
  262. package/package.json +1 -1
  263. package/scripts/seed-cli.mjs +3 -0
@@ -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/`.
@@ -601,6 +650,8 @@ export const DEFAULT_ROUTE_MAP = {
601
650
  ADS: "/admin/ads",
602
651
  ADS_NEW: "/admin/ads/new",
603
652
  ADS_EDIT: (id) => `/admin/ads/${id}/edit`,
653
+ /** D56 — the self-serve creative moderation queue. */
654
+ AD_BOOKINGS: "/admin/ads/bookings",
604
655
  NEWSLETTER: "/admin/newsletter",
605
656
  CONTACT: "/admin/contact",
606
657
  SESSIONS: "/admin/sessions",
@@ -644,6 +695,8 @@ export const DEFAULT_ROUTE_MAP = {
644
695
  TEAM_NEW: "/admin/team/new",
645
696
  TEAM_EDIT: (id) => `/admin/team/${id}/edit`,
646
697
  SUPPORT_TICKETS: "/admin/support-tickets",
698
+ /** Staff curation of the reasons a buyer can pick when disputing. */
699
+ DISPUTE_REASONS: "/admin/dispute-reasons",
647
700
  SUPPORT_TICKET_BY_ID: (id) => `/admin/support-tickets/${id}`,
648
701
  SCAMMERS: "/admin/scammers",
649
702
  SCAMMER_BY_ID: (id) => `/admin/scammers/${id}`,
@@ -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). */
@@ -170,6 +170,7 @@ export declare const SCHEMAS: {
170
170
  category: import("zod").ZodString;
171
171
  tags: import("zod").ZodArray<import("zod").ZodString, "many">;
172
172
  isFeatured: import("zod").ZodBoolean;
173
+ isPinned: import("zod").ZodBoolean;
173
174
  status: import("zod").ZodEnum<["draft", "published", "archived"]>;
174
175
  publishedAt: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodDate, import("zod").ZodString, import("zod").ZodObject<{
175
176
  toDate: import("zod").ZodFunction<import("zod").ZodTuple<[], import("zod").ZodUnknown>, import("zod").ZodDate>;
@@ -205,6 +206,7 @@ export declare const SCHEMAS: {
205
206
  authorId: string;
206
207
  authorName: string;
207
208
  readTimeMinutes: number;
209
+ isPinned: boolean;
208
210
  publishedAt?: string | Date | import("zod").objectOutputType<{
209
211
  toDate: import("zod").ZodFunction<import("zod").ZodTuple<[], import("zod").ZodUnknown>, import("zod").ZodDate>;
210
212
  }, import("zod").ZodTypeAny, "passthrough"> | undefined;
@@ -258,6 +260,7 @@ export declare const SCHEMAS: {
258
260
  authorId: string;
259
261
  authorName: string;
260
262
  readTimeMinutes: number;
263
+ isPinned: boolean;
261
264
  publishedAt?: string | Date | import("zod").objectInputType<{
262
265
  toDate: import("zod").ZodFunction<import("zod").ZodTuple<[], import("zod").ZodUnknown>, import("zod").ZodDate>;
263
266
  }, import("zod").ZodTypeAny, "passthrough"> | undefined;
@@ -816,16 +819,16 @@ export declare const SCHEMAS: {
816
819
  opacity?: number | undefined;
817
820
  subtitle?: string | undefined;
818
821
  } | undefined;
822
+ settings?: {
823
+ height?: "medium" | "viewport" | "tall" | undefined;
824
+ autoplayDelayMs?: number | undefined;
825
+ } | undefined;
819
826
  analytics?: {
820
827
  views: number;
821
828
  lastViewed?: string | Date | import("zod").objectOutputType<{
822
829
  toDate: import("zod").ZodFunction<import("zod").ZodTuple<[], import("zod").ZodUnknown>, import("zod").ZodDate>;
823
830
  }, import("zod").ZodTypeAny, "passthrough"> | undefined;
824
831
  } | undefined;
825
- settings?: {
826
- height?: "medium" | "viewport" | "tall" | undefined;
827
- autoplayDelayMs?: number | undefined;
828
- } | undefined;
829
832
  carouselId?: string | null | undefined;
830
833
  }, {
831
834
  id: string;
@@ -925,16 +928,16 @@ export declare const SCHEMAS: {
925
928
  opacity?: number | undefined;
926
929
  subtitle?: string | undefined;
927
930
  } | undefined;
931
+ settings?: {
932
+ height?: "medium" | "viewport" | "tall" | undefined;
933
+ autoplayDelayMs?: number | undefined;
934
+ } | undefined;
928
935
  analytics?: {
929
936
  views: number;
930
937
  lastViewed?: string | Date | import("zod").objectInputType<{
931
938
  toDate: import("zod").ZodFunction<import("zod").ZodTuple<[], import("zod").ZodUnknown>, import("zod").ZodDate>;
932
939
  }, import("zod").ZodTypeAny, "passthrough"> | undefined;
933
940
  } | undefined;
934
- settings?: {
935
- height?: "medium" | "viewport" | "tall" | undefined;
936
- autoplayDelayMs?: number | undefined;
937
- } | undefined;
938
941
  carouselId?: string | null | undefined;
939
942
  }>;
940
943
  readonly categories: import("zod").ZodObject<{
@@ -3061,6 +3064,7 @@ export declare const SCHEMAS: {
3061
3064
  prizeRevealStatus?: "closed" | "open" | "pending" | "revealed" | undefined;
3062
3065
  }[] | undefined;
3063
3066
  bundleId?: string | undefined;
3067
+ orderType?: string | undefined;
3064
3068
  prizeWon?: {
3065
3069
  title: string;
3066
3070
  images: string[];
@@ -3077,7 +3081,6 @@ export declare const SCHEMAS: {
3077
3081
  bin: string;
3078
3082
  } | undefined;
3079
3083
  offerId?: string | undefined;
3080
- orderType?: string | undefined;
3081
3084
  isNonRefundable?: boolean | undefined;
3082
3085
  imageUrls?: string[] | undefined;
3083
3086
  refundFeeDeducted?: number | undefined;
@@ -3220,6 +3223,7 @@ export declare const SCHEMAS: {
3220
3223
  prizeRevealStatus?: "closed" | "open" | "pending" | "revealed" | undefined;
3221
3224
  }[] | undefined;
3222
3225
  bundleId?: string | undefined;
3226
+ orderType?: string | undefined;
3223
3227
  prizeWon?: {
3224
3228
  title: string;
3225
3229
  images: string[];
@@ -3236,7 +3240,6 @@ export declare const SCHEMAS: {
3236
3240
  bin: string;
3237
3241
  } | undefined;
3238
3242
  offerId?: string | undefined;
3239
- orderType?: string | undefined;
3240
3243
  isNonRefundable?: boolean | undefined;
3241
3244
  imageUrls?: string[] | undefined;
3242
3245
  refundFeeDeducted?: number | undefined;
@@ -4151,13 +4154,13 @@ export declare const SCHEMAS: {
4151
4154
  totalReviews: import("zod").ZodNumber;
4152
4155
  averageRating: import("zod").ZodOptional<import("zod").ZodNumber>;
4153
4156
  }, "strip", import("zod").ZodTypeAny, {
4154
- itemsSold: number;
4155
4157
  totalProducts: number;
4158
+ itemsSold: number;
4156
4159
  totalReviews: number;
4157
4160
  averageRating?: number | undefined;
4158
4161
  }, {
4159
- itemsSold: number;
4160
4162
  totalProducts: number;
4163
+ itemsSold: number;
4161
4164
  totalReviews: number;
4162
4165
  averageRating?: number | undefined;
4163
4166
  }>>;
@@ -4296,8 +4299,8 @@ export declare const SCHEMAS: {
4296
4299
  location?: string | undefined;
4297
4300
  returnPolicy?: string | undefined;
4298
4301
  stats?: {
4299
- itemsSold: number;
4300
4302
  totalProducts: number;
4303
+ itemsSold: number;
4301
4304
  totalReviews: number;
4302
4305
  averageRating?: number | undefined;
4303
4306
  } | undefined;
@@ -4365,8 +4368,8 @@ export declare const SCHEMAS: {
4365
4368
  location?: string | undefined;
4366
4369
  returnPolicy?: string | undefined;
4367
4370
  stats?: {
4368
- itemsSold: number;
4369
4371
  totalProducts: number;
4372
+ itemsSold: number;
4370
4373
  totalReviews: number;
4371
4374
  averageRating?: number | undefined;
4372
4375
  } | undefined;
@@ -4521,7 +4524,7 @@ export declare const SCHEMAS: {
4521
4524
  updatedAt: string | Date | import("zod").objectOutputType<{
4522
4525
  toDate: import("zod").ZodFunction<import("zod").ZodTuple<[], import("zod").ZodUnknown>, import("zod").ZodDate>;
4523
4526
  }, import("zod").ZodTypeAny, "passthrough">;
4524
- category: "general" | "order_issue" | "billing_payment" | "account" | "listing_dispute" | "scam_report" | "refund_request" | "auction_dispute" | "store_change_request" | "order_modification_request" | "unban_request";
4527
+ category: "general" | "account" | "order_issue" | "billing_payment" | "listing_dispute" | "scam_report" | "refund_request" | "auction_dispute" | "store_change_request" | "order_modification_request" | "unban_request";
4525
4528
  priority: "normal" | "high" | "low" | "urgent";
4526
4529
  description: string;
4527
4530
  userId: string;
@@ -4564,7 +4567,7 @@ export declare const SCHEMAS: {
4564
4567
  updatedAt: string | Date | import("zod").objectInputType<{
4565
4568
  toDate: import("zod").ZodFunction<import("zod").ZodTuple<[], import("zod").ZodUnknown>, import("zod").ZodDate>;
4566
4569
  }, import("zod").ZodTypeAny, "passthrough">;
4567
- category: "general" | "order_issue" | "billing_payment" | "account" | "listing_dispute" | "scam_report" | "refund_request" | "auction_dispute" | "store_change_request" | "order_modification_request" | "unban_request";
4570
+ category: "general" | "account" | "order_issue" | "billing_payment" | "listing_dispute" | "scam_report" | "refund_request" | "auction_dispute" | "store_change_request" | "order_modification_request" | "unban_request";
4568
4571
  priority: "normal" | "high" | "low" | "urgent";
4569
4572
  description: string;
4570
4573
  userId: string;
@@ -4891,6 +4894,7 @@ export declare const SCHEMAS: {
4891
4894
  publishedAt: import("zod").ZodString;
4892
4895
  authorName: import("zod").ZodString;
4893
4896
  isFeatured: import("zod").ZodBoolean;
4897
+ isPinned: import("zod").ZodBoolean;
4894
4898
  }, "strip", import("zod").ZodTypeAny, {
4895
4899
  status: "published" | "draft" | "archived";
4896
4900
  title: string;
@@ -4904,6 +4908,7 @@ export declare const SCHEMAS: {
4904
4908
  excerpt: string;
4905
4909
  coverImage: string;
4906
4910
  authorName: string;
4911
+ isPinned: boolean;
4907
4912
  metaTitle: string;
4908
4913
  metaDescription: string;
4909
4914
  }, {
@@ -4919,6 +4924,7 @@ export declare const SCHEMAS: {
4919
4924
  excerpt: string;
4920
4925
  coverImage: string;
4921
4926
  authorName: string;
4927
+ isPinned: boolean;
4922
4928
  metaTitle: string;
4923
4929
  metaDescription: string;
4924
4930
  }>;
@@ -29,7 +29,7 @@ export declare const USER_PII_INDEX_MAP: Record<string, string>;
29
29
  /** PII fields in the addresses subcollection */
30
30
  export declare const ADDRESS_PII_FIELDS: readonly ["fullName", "phone", "addressLine1", "addressLine2"];
31
31
  /** PII fields in orders (denormalized buyer/seller data) */
32
- export declare const ORDER_PII_FIELDS: readonly ["userName", "userEmail", "sellerEmail"];
32
+ export declare const ORDER_PII_FIELDS: readonly ["userName", "userEmail", "sellerEmail", "deliveryFullName", "deliveryPhone", "deliveryAddressLine1", "deliveryAddressLine2", "deliveryLandmark", "deliveryAmendments[].fullName", "deliveryAmendments[].phone", "deliveryAmendments[].addressLine1", "deliveryAmendments[].addressLine2", "deliveryAmendments[].landmark"];
33
33
  /** PII fields in payouts */
34
34
  export declare const PAYOUT_PII_FIELDS: readonly ["sellerEmail", "upiId"];
35
35
  /** Blind-index mapping for queryable payout PII */
@@ -41,6 +41,51 @@ export const ORDER_PII_FIELDS = [
41
41
  "userName",
42
42
  "userEmail",
43
43
  "sellerEmail",
44
+ /*
45
+ * ── The delivery snapshot (Part 14) ──────────────────────────────────────
46
+ *
47
+ * 🛑 **CORRECTED 2026-10-23.** These were first written as flat keys on the
48
+ * argument that "`encryptPiiFields` is a flat top-level loop that never
49
+ * descends" — CLAUDE.md's wording, and it is FALSE. Read the function: it
50
+ * handles dotted paths (`lastMessage.body`, already live above) AND
51
+ * `array[].key` via `encryptInArray`, in both directions.
52
+ *
53
+ * Flat keys stay, on a smaller and true argument: city / state / pincode /
54
+ * country must remain unencrypted and QUERYABLE, so a single
55
+ * `deliveryAddress` object would be half-encrypted — and a half-encrypted
56
+ * object is the shape nobody can reason about at a glance. Flat keys make
57
+ * each field's treatment visible in this list.
58
+ *
59
+ * What the encryptor does NOT do is infer. A field is covered only if it is
60
+ * NAMED, in the right notation — and `"fullName"` does not cover
61
+ * `deliveryAmendments[].fullName`. That is the real failure mode, and what
62
+ * `audit-snapshot-integrity` R1 checks.
63
+ *
64
+ * 🛑 `shippingAddress` is deliberately NOT added. It is legacy free text on
65
+ * existing rows; encrypting the field now would encrypt it on the next
66
+ * write of an old order while every other old row stays plaintext, giving
67
+ * one field two formats and no way to tell which a given row holds.
68
+ * Forward-only means the new fields carry the protection.
69
+ *
70
+ * city / state / pincode / country are absent on purpose — they decide tax
71
+ * and serviceability and must stay QUERYABLE.
72
+ */
73
+ "deliveryFullName",
74
+ "deliveryPhone",
75
+ "deliveryAddressLine1",
76
+ "deliveryAddressLine2",
77
+ "deliveryLandmark",
78
+ /*
79
+ * The amendment array, in the `array[].key` notation `encryptInArray`
80
+ * implements. Declared HERE rather than encrypted by hand at the write
81
+ * site: the repository's write hook already runs this list, and a second
82
+ * mechanism doing the same job is the drift this codebase keeps paying for.
83
+ */
84
+ "deliveryAmendments[].fullName",
85
+ "deliveryAmendments[].phone",
86
+ "deliveryAmendments[].addressLine1",
87
+ "deliveryAmendments[].addressLine2",
88
+ "deliveryAmendments[].landmark",
44
89
  ];
45
90
  /** PII fields in payouts */
46
91
  export const PAYOUT_PII_FIELDS = ["sellerEmail", "upiId"];
@@ -68,7 +68,7 @@ export { renderScamOg, renderScamOgImage, type ScamOgData, getScammerForDetail,
68
68
  export { getCategoryForDetail, listRootCategories, listFeaturedCategories, listMenuCategories, getCategoryTree, listSitemapCategories, CATEGORIES_PAGE_SIZE, CATEGORIES_ROOT_TIER, CATEGORIES_MAX_DEPTH, CATEGORIES_SITEMAP_LIMIT, CATEGORIES_FEATURED_LIMIT, CATEGORIES_MENU_LIMIT, } from "./_internal/server/features/categories/index";
69
69
  export { getGroupedListingForDetail, getGroupedListingWithItems, listGroupedListings, listFeaturedGroupedListings, listSitemapGroupedListings, getGroupsForProduct, getGroupsWithItemsForProduct, GROUPED_LISTINGS_PAGE_SIZE, GROUPED_LISTINGS_FEATURED_LIMIT, GROUPED_LISTINGS_SITEMAP_LIMIT, buildGroupedListingMetadata, renderGroupedListingOg, type GroupedListingWithItems, type ListGroupedListingsParams, type SitemapGroupedListing, type GroupedListingMetadataOptions, } from "./_internal/server/features/grouped/index";
70
70
  export { createCheckoutOrderAction, attachPaymentAction, verifyAndPlaceGatewayOrderAction, previewCheckoutPricing, resolveShippingCost, formatShippingAddress, CHECKOUT_DEFAULT_COMMISSIONS, CHECKOUT_PAYMENT_METHODS, type CreateCheckoutOrderInput, type VerifyAndPlaceGatewayOrderInput, type CheckoutOrderResult, type CheckoutPaymentMethod, type CheckoutPricingPreviewInput, type CheckoutPricingPreview, } from "./_internal/server/features/checkout/index";
71
- export { unitPriceFor, lineTotalFor, sumGroupGst, computePreOrderDepositAmount, allocatePointsAcrossGroups, resolvePointsTender, type GroupGstSummary, type GstRateSlice, } from "./_internal/shared/checkout/order-math";
71
+ export { unitPriceFor, lineTotalFor, sumGroupGst, computePreOrderDepositAmount, allocatePointsAcrossGroups, pointsBaseForGroup, resolvePointsTender, type GroupGstSummary, type GstRateSlice, } from "./_internal/shared/checkout/order-math";
72
72
  export { computeGroupCouponDiscount, computeCartCouponDiscount, type GroupCouponDiscountResult, type CartCouponDiscountResult, } from "./_internal/shared/checkout/coupon-discount";
73
73
  export { refundCapacity, refundableBase, committedRefundTotal, platformFeeWithheld, wouldBeFullRefund, MONEY_EPSILON, type RefundCapacity, type RefundableOrderLike, } from "./_internal/shared/checkout/refundable-base";
74
74
  export { processRefundAction, type ProcessRefundInput, } from "./_internal/server/features/refunds/actions";
@@ -113,7 +113,16 @@ export { createCheckoutOrderAction, attachPaymentAction, verifyAndPlaceGatewayOr
113
113
  // BEFORE the route can get it wrong rather than after — which is the only
114
114
  // difference between this entry and the three defects recorded in the comment
115
115
  // above (D37, D38, C0c defect 1).
116
- export { unitPriceFor, lineTotalFor, sumGroupGst, computePreOrderDepositAmount, allocatePointsAcrossGroups, resolvePointsTender, } from "./_internal/shared/checkout/order-math.js";
116
+ export { unitPriceFor, lineTotalFor, sumGroupGst, computePreOrderDepositAmount, allocatePointsAcrossGroups,
117
+ /*
118
+ * The FIFTH, and it is the same story one more time: the route already
119
+ * imported `pointsBaseForGroup` and the import did not resolve, because the
120
+ * symbol was only ever reachable inside appkit. The points tender is
121
+ * computed on a BASE that excludes what points may not be spent on, and a
122
+ * consumer that cannot reach that function has to re-derive it — which is
123
+ * precisely how the four defects named above happened.
124
+ */
125
+ pointsBaseForGroup, resolvePointsTender, } from "./_internal/shared/checkout/order-math.js";
117
126
  /*
118
127
  * The coupon discount, exported for the SAME reason `sumGroupGst` above was —
119
128
  * and it is the third defect of that exact shape in this one route.
package/dist/server.d.ts CHANGED
@@ -429,6 +429,8 @@ export { piiBlindIndex } from "./security/index";
429
429
  export { piiIndicesFor } from "./security/index";
430
430
  export { reserveUserSlug, userSlugBase, USER_SLUGS_COLLECTION } from "./features/auth/actions/user-slug";
431
431
  export { resolveProfileUser } from "./features/auth/actions/profile-actions";
432
+ export { getBuyerActivityStats, getProfileStats, } from "./features/auth/actions/profile-actions";
433
+ export type { BuyerActivityStats } from "./features/auth/actions/profile-actions";
432
434
  export { getPiiConfigError } from "./security/index";
433
435
  export { encryptPayoutDetails } from "./security/index";
434
436
  export { decryptPayoutDetails } from "./security/index";
@@ -574,7 +576,7 @@ export { REFUND_COPY } from "./_internal/shared/features/orders/refund-copy";
574
576
  export { RETURN_REASON, FINAL_SALE_EXEMPT_REASONS, RETURN_REASON_LABEL, RETURN_REASON_GROUP_LABEL, isFinalSaleExempt, isReturnReason, selectableReturnReasons, } from "./_internal/shared/features/orders/return-reasons";
575
577
  export type { ReturnReason } from "./_internal/shared/features/orders/return-reasons";
576
578
  export { INTEGRATIONS, INTEGRATION_ORDER, readIntegrationStates, integrationPatch, allIntegrationsPatch, } from "./_internal/shared/features/admin/integrations";
577
- export type { IntegrationId, IntegrationDescriptor, IntegrationState, } from "./_internal/shared/features/admin/integrations";
579
+ export type { IntegrationId, IntegrationDescriptor, IntegrationState, IntegrationPatch, } from "./_internal/shared/features/admin/integrations";
578
580
  export { draftToProductInput, productToDraft, } from "./features/seller/utils/product-draft-mapping";
579
581
  export { RETURN_CUSTODY_STATES, RETURN_CUSTODY_COPY, isTerminalCustody, canAdvanceCustody, nextCustodyState, custodyOwner, isActionableBy, } from "./_internal/shared/features/returns/custody";
580
582
  export type { ReturnCustodyState } from "./_internal/shared/features/returns/custody";
@@ -613,3 +615,29 @@ export { financialYearLabel, formatSeriesNumber, INVOICE_PREFIX, CREDIT_NOTE_PRE
613
615
  export type { InvoiceCounterDocument, InvoiceAllocationDocument, InvoiceSeriesKind, } from "./features/invoicing/schemas/firestore";
614
616
  export { buildGstr1Export, gstr1ToCsv, type Gstr1Export, type Gstr1Row, } from "./_internal/server/features/invoicing/gstr1";
615
617
  export { quoteSharedPurchase, countDestinations, type SharedPurchaseRates, type SharedPurchaseQuote, type SharedPurchaseQuoteInput, } from "./_internal/shared/features/shipping/shared-purchase";
618
+ export { RATE_REGISTRY, RATE_TIER_ORDER, rateByPath, canEditRate, rejectRateChange, type RateDescriptor, type RateTier, type RateUnit, type RateChange, } from "./_internal/shared/features/pricing/rate-registry";
619
+ export { applyRateChange, RATE_CHANGE_LOG_MAX, type ApplyRateChangeInput, type ApplyRateChangeResult, } from "./_internal/server/features/pricing/actions";
620
+ export { SHARED_PURCHASE_MAX_MEMBERS, rejectCoordination, destinationIds, type CoordinationMember, type OfferCoordination, } from "./_internal/shared/features/offers/coordination";
621
+ export { assertOwnedAddresses } from "./_internal/server/features/offers/destinations";
622
+ export { checkDestinations, assertAllServiceable, planParcels, type DestinationCheck, type ParcelPlan, } from "./_internal/server/features/shipping/book-split";
623
+ export { snapshotDeliveryAddress, deliveryPartyFor, placeOfSupplyFrom, type DeliverySnapshot, type DeliveryParty, } from "./_internal/shared/features/orders/delivery-snapshot";
624
+ export { amendDeliveryAddress, revealAmendments, DELIVERY_AMENDMENT_MAX, type AmendDeliveryInput, } from "./_internal/server/features/orders/amend-delivery";
625
+ export { bookShipment, type BookShipmentInput, type BookShipmentResult, } from "./_internal/server/features/shipping/book";
626
+ export { journalRepository, JournalRepository, JOURNAL_PERIOD_SCAN_LIMIT } from "./features/ledger/repository/journal.repository";
627
+ export { assertBalanced, buildReversal, resolvePostingPeriod, periodOf, UnbalancedEntryError, BALANCE_TOLERANCE, type PostingInput, type BalancedPosting, } from "./_internal/shared/features/ledger/posting";
628
+ export { trialBalance, profitAndLoss, signedBalance, type TrialBalance, type ProfitAndLoss, type AccountTotals, } from "./_internal/shared/features/ledger/reports";
629
+ export { ACCOUNT, orderPlacedPosting, settlementPosting, payoutPosting, refundPosting, type OrderPostingInput, type SettlementPostingInput, type PayoutPostingInput, type RefundPostingInput, expensePosting, type ExpensePostingInput, } from "./_internal/shared/features/ledger/rules";
630
+ export { VENDORS_COLLECTION, EXPENSES_COLLECTION, EXPENSE_FIELDS, type VendorDocument, type ExpenseDocument, type ExpenseCategory, } from "./features/ledger/schemas/expenses";
631
+ export { BALANCE_WINDOW_DAYS, balanceDueOn, openBalanceCollection, submitBalanceProof, reviewBalanceProof, } from "./_internal/server/features/orders/balance";
632
+ export { reserveStock, releaseReservation, releaseReservationsForHolder, consumeReservation, expireDueReservations, activeReservationsForProduct, } from "./_internal/server/features/inventory/reservations";
633
+ export type { ReserveStockInput } from "./_internal/server/features/inventory/reservations";
634
+ export { RESERVATION_DEFAULT_TTL_HOURS, RESERVATION_MAX_TTL_HOURS, RESERVATION_HOLDER_KINDS, RESERVATION_STATUSES, STOCK_RESERVATION_COLLECTION, isReservationActive, } from "./features/inventory/schemas/stock-reservation";
635
+ export type { ReservationHolderKind, ReservationStatus, StockReservationDocument, } from "./features/inventory/schemas/stock-reservation";
636
+ export { assertCheckoutValueOtp } from "./_internal/server/features/checkout/value-otp-gate";
637
+ export type { CheckoutValueOtpGateInput } from "./_internal/server/features/checkout/value-otp-gate";
638
+ export { bookAdSlot, moderateAdCreative, resubmitAdCreative, cancelAdBooking, releaseAdSlot, liveBookingForPlacement, pendingAdBookings, adBookingsForAdvertiser, adSlotOffers, } from "./_internal/server/features/ads/booking";
639
+ export type { BookAdSlotInput, AdSlotOffer } from "./_internal/server/features/ads/booking";
640
+ export { AD_BOOKING_COLLECTION, AD_BOOKING_PAYMENT_STATES, AD_MODERATION_STATES, adBookingId, adPeriodOf, adPeriodStart, adPeriodEnd, isAdPeriod, isAdBookingLive, } from "./features/ads/schemas/firestore";
641
+ export type { AdBookingDocument, AdBookingCreative, AdBookingPaymentState, AdModerationState, AdPeriod, } from "./features/ads/schemas/firestore";
642
+ export { getDashboardHubData } from "./_internal/server/features/dashboard/data";
643
+ export type { DashboardHubData } from "./_internal/server/features/dashboard/data";
package/dist/server.js CHANGED
@@ -1327,6 +1327,7 @@ export { piiBlindIndex } from "./security/index.js";
1327
1327
  export { piiIndicesFor } from "./security/index.js";
1328
1328
  export { reserveUserSlug, userSlugBase, USER_SLUGS_COLLECTION } from "./features/auth/actions/user-slug.js";
1329
1329
  export { resolveProfileUser } from "./features/auth/actions/profile-actions.js";
1330
+ export { getBuyerActivityStats, getProfileStats, } from "./features/auth/actions/profile-actions.js";
1330
1331
  export { getPiiConfigError } from "./security/index.js";
1331
1332
  export { encryptPayoutDetails } from "./security/index.js";
1332
1333
  export { decryptPayoutDetails } from "./security/index.js";
@@ -1676,3 +1677,160 @@ export { buildGstr1Export, gstr1ToCsv, } from "./_internal/server/features/invoi
1676
1677
  * settings read; the rates are passed in snapshotted.
1677
1678
  */
1678
1679
  export { quoteSharedPurchase, countDestinations, } from "./_internal/shared/features/shipping/shared-purchase.js";
1680
+ /*
1681
+ * [SERVER-ONLY] The pricing registry and its one write path.
1682
+ *
1683
+ * 🛑 The REGISTRY is pure data with no Firestore and no `node:` import, so it
1684
+ * could sit in the main barrel — and deliberately does not. Its only consumer
1685
+ * outside appkit is `/api/admin/pricing`, and putting it in `index.ts` would
1686
+ * add sixteen descriptors and four symbols to every client bundle that imports
1687
+ * anything at all, to serve one route (Root Cause #18 — a re-export is a
1688
+ * public API contract, not a convenience).
1689
+ *
1690
+ * `applyRateChange` belongs here regardless: it reaches firebase-admin.
1691
+ */
1692
+ export { RATE_REGISTRY, RATE_TIER_ORDER, rateByPath, canEditRate, rejectRateChange, } from "./_internal/shared/features/pricing/rate-registry.js";
1693
+ export { applyRateChange, RATE_CHANGE_LOG_MAX, } from "./_internal/server/features/pricing/actions.js";
1694
+ /*
1695
+ * [SERVER-ONLY] Coordinated purchase — a SPECIALISED OFFER, not a new flow.
1696
+ *
1697
+ * `assertOwnedAddresses` is the one piece that must run server-side: a
1698
+ * destination is a REFERENCE, and an id is guessable in a way an address is
1699
+ * not, so an unverified one ships a parcel to a stranger's house with nothing
1700
+ * erroring. The shared half (the member shape, the member-count rule) is pure
1701
+ * and could sit in the main barrel — it stays here beside its checker so a
1702
+ * caller cannot reach for one without meeting the other.
1703
+ */
1704
+ export { SHARED_PURCHASE_MAX_MEMBERS, rejectCoordination, destinationIds, } from "./_internal/shared/features/offers/coordination.js";
1705
+ export { assertOwnedAddresses } from "./_internal/server/features/offers/destinations.js";
1706
+ /*
1707
+ * S5a — N destinations is N parcels, so N carrier quotes.
1708
+ *
1709
+ * 🛑 `checkDestinations` + `assertAllServiceable` are a PRE-FLIGHT and are
1710
+ * exported as a pair for that reason: booking as you go and failing on the
1711
+ * fourth leaves three parcels the carrier has already accepted and the
1712
+ * coordinator cannot undo. It is not a transaction — a booking has no
1713
+ * rollback — it just moves the common failure to the point where rolling
1714
+ * back is still free.
1715
+ */
1716
+ export { checkDestinations, assertAllServiceable, planParcels, } from "./_internal/server/features/shipping/book-split.js";
1717
+ /*
1718
+ * [SERVER-ONLY] Part 14 — the delivery snapshot and its corrections.
1719
+ *
1720
+ * `amendDeliveryAddress` is server-only (Firestore + the addresses
1721
+ * repository). The pure readers ship with it rather than from the main
1722
+ * barrel so a caller cannot reach `deliveryPartyFor` without the module that
1723
+ * explains why it reads the amendment while `placeOfSupplyFrom` reads the
1724
+ * snapshot — getting those two the wrong way round sends a parcel to the old
1725
+ * address, or restates tax on a filed invoice.
1726
+ */
1727
+ export { snapshotDeliveryAddress, deliveryPartyFor, placeOfSupplyFrom, } from "./_internal/shared/features/orders/delivery-snapshot.js";
1728
+ export { amendDeliveryAddress, revealAmendments, DELIVERY_AMENDMENT_MAX, } from "./_internal/server/features/orders/amend-delivery.js";
1729
+ /*
1730
+ * [SERVER-ONLY] Part 1′ — parcel booking.
1731
+ *
1732
+ * 🛑 Exported for the ENQUEUE route only. The booking itself runs in the
1733
+ * `bookShipment` job runner, because a carrier call on a 10s sync ceiling
1734
+ * times out in the one way that cannot be retried safely: the carrier may
1735
+ * have accepted, so a retry double-books and a non-retry leaves a parcel
1736
+ * nobody collects.
1737
+ */
1738
+ export { bookShipment, } from "./_internal/server/features/shipping/book.js";
1739
+ /*
1740
+ * [SERVER-ONLY] Part 4 — the double-entry books.
1741
+ *
1742
+ * 🛑 The repository is server-only (Firestore), and the posting rules ship
1743
+ * beside it rather than from the main barrel even though they are pure: a
1744
+ * caller who can reach `assertBalanced` without reaching `journalRepository`
1745
+ * can compute a balanced entry and write it some other way, which is exactly
1746
+ * the "every entry is machine-generated through one path" constraint the
1747
+ * whole design rests on. Same stance `assertOwnedAddresses` takes.
1748
+ *
1749
+ * 🛑 The LEDGER IS A PROJECTION. Orders, payouts and expenses are truth —
1750
+ * never read a balance to make an operational decision.
1751
+ */
1752
+ export { journalRepository, JournalRepository, JOURNAL_PERIOD_SCAN_LIMIT } from "./features/ledger/repository/journal.repository.js";
1753
+ export { assertBalanced, buildReversal, resolvePostingPeriod, periodOf, UnbalancedEntryError, BALANCE_TOLERANCE, } from "./_internal/shared/features/ledger/posting.js";
1754
+ export { trialBalance, profitAndLoss, signedBalance, } from "./_internal/shared/features/ledger/reports.js";
1755
+ /*
1756
+ * The per-event posting rules. These are WHERE the "every entry is
1757
+ * machine-generated" constraint lives — a caller posts an order by handing
1758
+ * `orderPlacedPosting(order)` to `journalRepository.post`, never by writing
1759
+ * legs. A backwards entry balances, so nothing downstream would object;
1760
+ * `verify-posting-rules` R7 checks the SIDES, with controls proving it
1761
+ * catches a credited bank, an un-reclaimed refund GST and an inverted
1762
+ * output-GST liability.
1763
+ */
1764
+ export { ACCOUNT, orderPlacedPosting, settlementPosting, payoutPosting, refundPosting, expensePosting, } from "./_internal/shared/features/ledger/rules.js";
1765
+ /*
1766
+ * Vendors and expenses. `ShipmentDocument.supplierId` joins to a vendor row;
1767
+ * `supplierName` stays as typed, because deriving the name on read would let
1768
+ * a vendor rename rewrite what every past shipment says it was bought from.
1769
+ */
1770
+ export { VENDORS_COLLECTION, EXPENSES_COLLECTION, EXPENSE_FIELDS, } from "./features/ledger/schemas/expenses.js";
1771
+ /*
1772
+ * [SERVER-ONLY] D55 — the pre-order balance collector.
1773
+ *
1774
+ * `balanceDue` has been computed and rendered since Part 2 with nothing to
1775
+ * collect it. These three are the whole collection path: the seller opens it
1776
+ * when stock lands, the buyer submits a proof, staff review it. Manual only —
1777
+ * the auto path is blocked on RBI mandate requirements, not on effort.
1778
+ */
1779
+ export { BALANCE_WINDOW_DAYS, balanceDueOn, openBalanceCollection, submitBalanceProof, reviewBalanceProof, } from "./_internal/server/features/orders/balance.js";
1780
+ /*
1781
+ * [SERVER-ONLY] Stock reservation with a TTL.
1782
+ *
1783
+ * A hold on units that is NOT an order. The only mechanism before this was
1784
+ * `onOrderCreate`'s decrement plus `pendingOrderTimeout`'s 15-minute restore,
1785
+ * both keyed to an order — which cannot serve a multi-day shared purchase
1786
+ * without either starting a payment clock on day one or letting an ordinary
1787
+ * buyer take the item out from under the arrangement.
1788
+ *
1789
+ * 🛑 Every one of these moves the reservation row and `availableQuantity`
1790
+ * inside ONE transaction. A caller that writes either half itself has
1791
+ * reintroduced exactly the drift this primitive exists to remove.
1792
+ */
1793
+ export { reserveStock, releaseReservation, releaseReservationsForHolder, consumeReservation, expireDueReservations, activeReservationsForProduct, } from "./_internal/server/features/inventory/reservations.js";
1794
+ export { RESERVATION_DEFAULT_TTL_HOURS, RESERVATION_MAX_TTL_HOURS, RESERVATION_HOLDER_KINDS, RESERVATION_STATUSES, STOCK_RESERVATION_COLLECTION, isReservationActive, } from "./features/inventory/schemas/stock-reservation.js";
1795
+ /*
1796
+ * [SERVER-ONLY] The high-value checkout OTP gate.
1797
+ *
1798
+ * 🛑 It takes the AMOUNT it judges. There were two hand-rolled copies of
1799
+ * this rule — `createOrderForGroup` summing the cart, the gateway route
1800
+ * using its own `subtotalRs` — which is Root Cause #75's shape, and they
1801
+ * had already drifted on what they measured.
1802
+ *
1803
+ * Taking the amount is also Part 6's prerequisite: `otpCheckoutThreshold`
1804
+ * is per CHECKOUT, so an N-party arrangement clears ₹12,000 in three
1805
+ * ₹4,000 pieces with no OTP unless it can present its own total.
1806
+ */
1807
+ export { assertCheckoutValueOtp } from "./_internal/server/features/checkout/value-otp-gate.js";
1808
+ /*
1809
+ * [SERVER-ONLY] D56 — self-serve ad bookings.
1810
+ *
1811
+ * 🛑 Availability is a DOCUMENT COLLISION, never a query. The booking id
1812
+ * is `${placementId}__${period}` and creation uses `tx.create`, so a second
1813
+ * booking of the same slot fails on an existing document inside its own
1814
+ * transaction. Query-then-write would let two concurrent requests both read
1815
+ * "free" and sell the slot twice, with nothing erroring.
1816
+ *
1817
+ * 🛑 Flat fee per period, explicitly NOT CPM — impression counting is a
1818
+ * write per page view, which is the cost pattern that suspended this
1819
+ * project (Root Cause #104).
1820
+ */
1821
+ export { bookAdSlot, moderateAdCreative, resubmitAdCreative, cancelAdBooking, releaseAdSlot, liveBookingForPlacement, pendingAdBookings, adBookingsForAdvertiser, adSlotOffers, } from "./_internal/server/features/ads/booking.js";
1822
+ export { AD_BOOKING_COLLECTION, AD_BOOKING_PAYMENT_STATES, AD_MODERATION_STATES, adBookingId, adPeriodOf, adPeriodStart, adPeriodEnd, isAdPeriod, isAdBookingLive, } from "./features/ads/schemas/firestore.js";
1823
+ /*
1824
+ * The dashboard hub's data, for `/admin`, `/store` and `/user` and their
1825
+ * `sections/[section]` pages.
1826
+ *
1827
+ * 🛑 Exported because **there is no `./_internal/*` subpath and there must not
1828
+ * be** — four consumer pages imported
1829
+ * `@mohasinac/appkit/_internal/server/features/dashboard/data` directly and it
1830
+ * resolved to nothing, so `/admin` and all three section indexes were a build
1831
+ * error waiting for the first consumer typecheck that could see it. `_internal`
1832
+ * is unpublished on purpose (audit-violations enforces the boundary); the
1833
+ * server entry is the sanctioned way through, exactly as the checkout maths
1834
+ * above reaches a consumer route.
1835
+ */
1836
+ export { getDashboardHubData } from "./_internal/server/features/dashboard/data.js";