@mohasinac/appkit 2.6.3 → 2.6.5

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 (615) hide show
  1. package/dist/_internal/server/features/account/data.js +2 -2
  2. package/dist/_internal/server/features/bundles/data.d.ts +26 -6
  3. package/dist/_internal/server/features/bundles/data.js +41 -6
  4. package/dist/_internal/server/features/bundles/index.d.ts +3 -2
  5. package/dist/_internal/server/features/bundles/index.js +4 -2
  6. package/dist/_internal/server/features/bundles/metadata.d.ts +20 -0
  7. package/dist/_internal/server/features/bundles/metadata.js +46 -0
  8. package/dist/_internal/server/features/bundles/og.d.ts +38 -0
  9. package/dist/_internal/server/features/bundles/og.js +122 -0
  10. package/dist/_internal/server/features/checkout/actions.js +192 -133
  11. package/dist/_internal/server/features/checkout/bundle-expansion.d.ts +57 -0
  12. package/dist/_internal/server/features/checkout/bundle-expansion.js +70 -0
  13. package/dist/_internal/server/features/checkout/prize-bundle-gates.d.ts +5 -15
  14. package/dist/_internal/server/features/checkout/prize-bundle-gates.js +5 -21
  15. package/dist/_internal/server/features/media/contextGuards.js +15 -1
  16. package/dist/_internal/server/features/payouts/actions.d.ts +19 -0
  17. package/dist/_internal/server/features/payouts/actions.js +38 -0
  18. package/dist/_internal/server/features/products/data.js +1 -2
  19. package/dist/_internal/server/features/raffle/actions.d.ts +11 -0
  20. package/dist/_internal/server/features/raffle/actions.js +31 -0
  21. package/dist/_internal/server/features/refunds/actions.d.ts +31 -0
  22. package/dist/_internal/server/features/refunds/actions.js +77 -0
  23. package/dist/_internal/server/jobs/core/adminAnalytics.d.ts +28 -0
  24. package/dist/_internal/server/jobs/core/adminAnalytics.js +98 -0
  25. package/dist/_internal/server/jobs/core/assignSpinPrize.d.ts +19 -0
  26. package/dist/_internal/server/jobs/core/assignSpinPrize.js +81 -0
  27. package/dist/_internal/server/jobs/core/auctionSettlement.d.ts +2 -0
  28. package/dist/_internal/server/jobs/core/auctionSettlement.js +70 -0
  29. package/dist/_internal/server/jobs/core/autoPayoutEligibility.d.ts +2 -0
  30. package/dist/_internal/server/jobs/core/autoPayoutEligibility.js +109 -0
  31. package/dist/_internal/server/jobs/core/bundleStockSync.d.ts +10 -0
  32. package/dist/_internal/server/jobs/core/bundleStockSync.js +71 -0
  33. package/dist/_internal/server/jobs/core/cartPrune.d.ts +2 -0
  34. package/dist/_internal/server/jobs/core/cartPrune.js +13 -0
  35. package/dist/_internal/server/jobs/core/cleanupRtdbEvents.d.ts +2 -0
  36. package/dist/_internal/server/jobs/core/cleanupRtdbEvents.js +45 -0
  37. package/dist/_internal/server/jobs/core/countersReconcile.d.ts +2 -0
  38. package/dist/_internal/server/jobs/core/countersReconcile.js +107 -0
  39. package/dist/_internal/server/jobs/core/couponExpiry.d.ts +2 -0
  40. package/dist/_internal/server/jobs/core/couponExpiry.js +13 -0
  41. package/dist/_internal/server/jobs/core/dailyDataCleanup.d.ts +2 -0
  42. package/dist/_internal/server/jobs/core/dailyDataCleanup.js +20 -0
  43. package/dist/_internal/server/jobs/core/index.d.ts +44 -0
  44. package/dist/_internal/server/jobs/core/index.js +47 -0
  45. package/dist/_internal/server/jobs/core/listingProcessor.d.ts +30 -0
  46. package/dist/_internal/server/jobs/core/listingProcessor.js +138 -0
  47. package/dist/_internal/server/jobs/core/mediaTmpCleanup.d.ts +14 -0
  48. package/dist/_internal/server/jobs/core/mediaTmpCleanup.js +68 -0
  49. package/dist/_internal/server/jobs/core/notificationPrune.d.ts +2 -0
  50. package/dist/_internal/server/jobs/core/notificationPrune.js +13 -0
  51. package/dist/_internal/server/jobs/core/offerExpiry.d.ts +2 -0
  52. package/dist/_internal/server/jobs/core/offerExpiry.js +50 -0
  53. package/dist/_internal/server/jobs/core/onBidPlaced.d.ts +15 -0
  54. package/dist/_internal/server/jobs/core/onBidPlaced.js +59 -0
  55. package/dist/_internal/server/jobs/core/onCategoryWrite.d.ts +14 -0
  56. package/dist/_internal/server/jobs/core/onCategoryWrite.js +134 -0
  57. package/dist/_internal/server/jobs/core/onOrderCreate.d.ts +18 -0
  58. package/dist/_internal/server/jobs/core/onOrderCreate.js +78 -0
  59. package/dist/_internal/server/jobs/core/onOrderStatusChange.d.ts +19 -0
  60. package/dist/_internal/server/jobs/core/onOrderStatusChange.js +139 -0
  61. package/dist/_internal/server/jobs/core/onProductStockChange.d.ts +23 -0
  62. package/dist/_internal/server/jobs/core/onProductStockChange.js +130 -0
  63. package/dist/_internal/server/jobs/core/onProductWrite.d.ts +12 -0
  64. package/dist/_internal/server/jobs/core/onProductWrite.js +94 -0
  65. package/dist/_internal/server/jobs/core/onReviewWrite.d.ts +7 -0
  66. package/dist/_internal/server/jobs/core/onReviewWrite.js +49 -0
  67. package/dist/_internal/server/jobs/core/onStoreWrite.d.ts +12 -0
  68. package/dist/_internal/server/jobs/core/onStoreWrite.js +7 -0
  69. package/dist/_internal/server/jobs/core/payoutBatch.d.ts +8 -0
  70. package/dist/_internal/server/jobs/core/payoutBatch.js +102 -0
  71. package/dist/_internal/server/jobs/core/pendingOrderTimeout.d.ts +2 -0
  72. package/dist/_internal/server/jobs/core/pendingOrderTimeout.js +27 -0
  73. package/dist/_internal/server/jobs/core/positionsReconcile.d.ts +7 -0
  74. package/dist/_internal/server/jobs/core/positionsReconcile.js +87 -0
  75. package/dist/_internal/server/jobs/core/prizeRevealClose.d.ts +2 -0
  76. package/dist/_internal/server/jobs/core/prizeRevealClose.js +22 -0
  77. package/dist/_internal/server/jobs/core/prizeRevealExpiry.d.ts +2 -0
  78. package/dist/_internal/server/jobs/core/prizeRevealExpiry.js +50 -0
  79. package/dist/_internal/server/jobs/core/prizeRevealOpen.d.ts +2 -0
  80. package/dist/_internal/server/jobs/core/prizeRevealOpen.js +56 -0
  81. package/dist/_internal/server/jobs/core/prizeRevealReminder.d.ts +2 -0
  82. package/dist/_internal/server/jobs/core/prizeRevealReminder.js +38 -0
  83. package/dist/_internal/server/jobs/core/productStatsSync.d.ts +8 -0
  84. package/dist/_internal/server/jobs/core/productStatsSync.js +36 -0
  85. package/dist/_internal/server/jobs/core/promotions.d.ts +12 -0
  86. package/dist/_internal/server/jobs/core/promotions.js +43 -0
  87. package/dist/_internal/server/jobs/core/storeAnalytics.d.ts +30 -0
  88. package/dist/_internal/server/jobs/core/storeAnalytics.js +109 -0
  89. package/dist/_internal/server/jobs/core/triggerEventRaffle.d.ts +19 -0
  90. package/dist/_internal/server/jobs/core/triggerEventRaffle.js +86 -0
  91. package/dist/_internal/server/jobs/core/weeklyPayoutEligibility.d.ts +6 -0
  92. package/dist/_internal/server/jobs/core/weeklyPayoutEligibility.js +85 -0
  93. package/dist/_internal/server/jobs/handlers/adminAnalytics.d.ts +2 -26
  94. package/dist/_internal/server/jobs/handlers/adminAnalytics.js +2 -98
  95. package/dist/_internal/server/jobs/handlers/assignSpinPrize.d.ts +1 -22
  96. package/dist/_internal/server/jobs/handlers/assignSpinPrize.js +2 -86
  97. package/dist/_internal/server/jobs/handlers/auctionSettlement.js +2 -70
  98. package/dist/_internal/server/jobs/handlers/autoPayoutEligibility.js +2 -110
  99. package/dist/_internal/server/jobs/handlers/bundleStockSync.d.ts +0 -16
  100. package/dist/_internal/server/jobs/handlers/bundleStockSync.js +2 -80
  101. package/dist/_internal/server/jobs/handlers/cartPrune.js +2 -13
  102. package/dist/_internal/server/jobs/handlers/cleanupRtdbEvents.js +2 -45
  103. package/dist/_internal/server/jobs/handlers/countersReconcile.js +2 -109
  104. package/dist/_internal/server/jobs/handlers/couponExpiry.js +2 -13
  105. package/dist/_internal/server/jobs/handlers/dailyDataCleanup.js +2 -20
  106. package/dist/_internal/server/jobs/handlers/listingProcessor.d.ts +3 -28
  107. package/dist/_internal/server/jobs/handlers/listingProcessor.js +3 -138
  108. package/dist/_internal/server/jobs/handlers/mediaTmpCleanup.d.ts +0 -12
  109. package/dist/_internal/server/jobs/handlers/mediaTmpCleanup.js +2 -69
  110. package/dist/_internal/server/jobs/handlers/notificationPrune.js +2 -13
  111. package/dist/_internal/server/jobs/handlers/offerExpiry.js +2 -50
  112. package/dist/_internal/server/jobs/handlers/onBidPlaced.d.ts +1 -10
  113. package/dist/_internal/server/jobs/handlers/onBidPlaced.js +2 -56
  114. package/dist/_internal/server/jobs/handlers/onCategoryWrite.d.ts +1 -8
  115. package/dist/_internal/server/jobs/handlers/onCategoryWrite.js +6 -134
  116. package/dist/_internal/server/jobs/handlers/onOrderCreate.d.ts +1 -12
  117. package/dist/_internal/server/jobs/handlers/onOrderCreate.js +2 -76
  118. package/dist/_internal/server/jobs/handlers/onOrderStatusChange.d.ts +1 -12
  119. package/dist/_internal/server/jobs/handlers/onOrderStatusChange.js +2 -139
  120. package/dist/_internal/server/jobs/handlers/onProductStockChange.d.ts +0 -13
  121. package/dist/_internal/server/jobs/handlers/onProductStockChange.js +7 -134
  122. package/dist/_internal/server/jobs/handlers/onProductWrite.d.ts +1 -6
  123. package/dist/_internal/server/jobs/handlers/onProductWrite.js +6 -106
  124. package/dist/_internal/server/jobs/handlers/onReviewWrite.js +2 -49
  125. package/dist/_internal/server/jobs/handlers/onStoreWrite.d.ts +1 -8
  126. package/dist/_internal/server/jobs/handlers/onStoreWrite.js +7 -8
  127. package/dist/_internal/server/jobs/handlers/payoutBatch.d.ts +0 -9
  128. package/dist/_internal/server/jobs/handlers/payoutBatch.js +2 -104
  129. package/dist/_internal/server/jobs/handlers/pendingOrderTimeout.d.ts +0 -6
  130. package/dist/_internal/server/jobs/handlers/pendingOrderTimeout.js +2 -33
  131. package/dist/_internal/server/jobs/handlers/positionsReconcile.d.ts +0 -5
  132. package/dist/_internal/server/jobs/handlers/positionsReconcile.js +2 -87
  133. package/dist/_internal/server/jobs/handlers/prizeRevealClose.d.ts +0 -7
  134. package/dist/_internal/server/jobs/handlers/prizeRevealClose.js +2 -29
  135. package/dist/_internal/server/jobs/handlers/prizeRevealExpiry.d.ts +0 -8
  136. package/dist/_internal/server/jobs/handlers/prizeRevealExpiry.js +2 -58
  137. package/dist/_internal/server/jobs/handlers/prizeRevealOpen.d.ts +0 -8
  138. package/dist/_internal/server/jobs/handlers/prizeRevealOpen.js +2 -65
  139. package/dist/_internal/server/jobs/handlers/prizeRevealReminder.d.ts +0 -7
  140. package/dist/_internal/server/jobs/handlers/prizeRevealReminder.js +2 -45
  141. package/dist/_internal/server/jobs/handlers/productStatsSync.d.ts +0 -6
  142. package/dist/_internal/server/jobs/handlers/productStatsSync.js +2 -36
  143. package/dist/_internal/server/jobs/handlers/promotions.d.ts +2 -10
  144. package/dist/_internal/server/jobs/handlers/promotions.js +2 -43
  145. package/dist/_internal/server/jobs/handlers/storeAnalytics.d.ts +2 -28
  146. package/dist/_internal/server/jobs/handlers/storeAnalytics.js +2 -109
  147. package/dist/_internal/server/jobs/handlers/triggerEventRaffle.d.ts +1 -28
  148. package/dist/_internal/server/jobs/handlers/triggerEventRaffle.js +2 -94
  149. package/dist/_internal/server/jobs/handlers/weeklyPayoutEligibility.d.ts +0 -6
  150. package/dist/_internal/server/jobs/handlers/weeklyPayoutEligibility.js +2 -87
  151. package/dist/_internal/server/jobs/index.d.ts +1 -0
  152. package/dist/_internal/server/jobs/index.js +1 -0
  153. package/dist/_internal/server/jobs/runtime/adapters/firebase.js +21 -0
  154. package/dist/_internal/shared/actions/action-registry.d.ts +84 -0
  155. package/dist/_internal/shared/actions/action-registry.js +160 -0
  156. package/dist/_internal/shared/checkout/rules/_defaults.d.ts +3 -0
  157. package/dist/_internal/shared/checkout/rules/_defaults.js +22 -0
  158. package/dist/_internal/shared/checkout/rules/_limits.d.ts +19 -0
  159. package/dist/_internal/shared/checkout/rules/_limits.js +19 -0
  160. package/dist/_internal/shared/checkout/rules/_registry.d.ts +44 -0
  161. package/dist/_internal/shared/checkout/rules/_registry.js +87 -0
  162. package/dist/_internal/shared/checkout/rules/auction.rule.d.ts +2 -0
  163. package/dist/_internal/shared/checkout/rules/auction.rule.js +10 -0
  164. package/dist/_internal/shared/checkout/rules/bundle.rule.d.ts +11 -0
  165. package/dist/_internal/shared/checkout/rules/bundle.rule.js +6 -0
  166. package/dist/_internal/shared/checkout/rules/classified.rule.d.ts +9 -0
  167. package/dist/_internal/shared/checkout/rules/classified.rule.js +9 -0
  168. package/dist/_internal/shared/checkout/rules/digital-code.rule.d.ts +8 -0
  169. package/dist/_internal/shared/checkout/rules/digital-code.rule.js +6 -0
  170. package/dist/_internal/shared/checkout/rules/index.d.ts +12 -0
  171. package/dist/_internal/shared/checkout/rules/index.js +12 -0
  172. package/dist/_internal/shared/checkout/rules/live.rule.d.ts +10 -0
  173. package/dist/_internal/shared/checkout/rules/live.rule.js +6 -0
  174. package/dist/_internal/shared/checkout/rules/offer.rule.d.ts +2 -0
  175. package/dist/_internal/shared/checkout/rules/offer.rule.js +9 -0
  176. package/dist/_internal/shared/checkout/rules/preorder.rule.d.ts +2 -0
  177. package/dist/_internal/shared/checkout/rules/preorder.rule.js +28 -0
  178. package/dist/_internal/shared/checkout/rules/prize-draw.rule.d.ts +2 -0
  179. package/dist/_internal/shared/checkout/rules/prize-draw.rule.js +65 -0
  180. package/dist/_internal/shared/checkout/rules/standard.rule.d.ts +2 -0
  181. package/dist/_internal/shared/checkout/rules/standard.rule.js +5 -0
  182. package/dist/_internal/shared/checkout/rules/types.d.ts +125 -0
  183. package/dist/_internal/shared/checkout/rules/types.js +13 -0
  184. package/dist/_internal/shared/features/cart/schema.d.ts +6 -6
  185. package/dist/_internal/shared/features/categories/bundle-copy.d.ts +123 -0
  186. package/dist/_internal/shared/features/categories/bundle-copy.js +134 -0
  187. package/dist/_internal/shared/features/categories/bundle-schemas.d.ts +318 -0
  188. package/dist/_internal/shared/features/categories/bundle-schemas.js +55 -0
  189. package/dist/_internal/shared/features/events/schema.d.ts +4 -4
  190. package/dist/_internal/shared/features/orders/refund-copy.d.ts +36 -0
  191. package/dist/_internal/shared/features/orders/refund-copy.js +40 -0
  192. package/dist/_internal/shared/features/orders/schema.d.ts +4 -4
  193. package/dist/_internal/shared/features/products/schema.d.ts +8 -8
  194. package/dist/_internal/shared/listing-types/_registry.d.ts +27 -0
  195. package/dist/_internal/shared/listing-types/_registry.js +8 -0
  196. package/dist/_internal/shared/listing-types/action-tracker.d.ts +41 -0
  197. package/dist/_internal/shared/listing-types/action-tracker.js +70 -0
  198. package/dist/_internal/shared/listing-types/capabilities.js +25 -0
  199. package/dist/_internal/shared/listing-types/cart-shipping.d.ts +37 -0
  200. package/dist/_internal/shared/listing-types/cart-shipping.js +46 -0
  201. package/dist/_internal/shared/listing-types/classified/config.d.ts +7 -0
  202. package/dist/_internal/shared/listing-types/classified/config.js +8 -0
  203. package/dist/_internal/shared/listing-types/classified/ctas.d.ts +1 -0
  204. package/dist/_internal/shared/listing-types/classified/ctas.js +3 -0
  205. package/dist/_internal/shared/listing-types/classified/og.d.ts +1 -0
  206. package/dist/_internal/shared/listing-types/classified/og.js +1 -0
  207. package/dist/_internal/shared/listing-types/classified/schema.d.ts +1 -0
  208. package/dist/_internal/shared/listing-types/classified/schema.js +1 -0
  209. package/dist/_internal/shared/listing-types/classified/seed-factory.d.ts +1 -0
  210. package/dist/_internal/shared/listing-types/classified/seed-factory.js +1 -0
  211. package/dist/_internal/shared/listing-types/digital-code/config.d.ts +7 -0
  212. package/dist/_internal/shared/listing-types/digital-code/config.js +8 -0
  213. package/dist/_internal/shared/listing-types/digital-code/ctas.d.ts +1 -0
  214. package/dist/_internal/shared/listing-types/digital-code/ctas.js +3 -0
  215. package/dist/_internal/shared/listing-types/digital-code/og.d.ts +1 -0
  216. package/dist/_internal/shared/listing-types/digital-code/og.js +1 -0
  217. package/dist/_internal/shared/listing-types/digital-code/schema.d.ts +1 -0
  218. package/dist/_internal/shared/listing-types/digital-code/schema.js +1 -0
  219. package/dist/_internal/shared/listing-types/digital-code/seed-factory.d.ts +1 -0
  220. package/dist/_internal/shared/listing-types/digital-code/seed-factory.js +1 -0
  221. package/dist/_internal/shared/listing-types/feature-flags.d.ts +34 -0
  222. package/dist/_internal/shared/listing-types/feature-flags.js +45 -0
  223. package/dist/_internal/shared/listing-types/live/config.d.ts +7 -0
  224. package/dist/_internal/shared/listing-types/live/config.js +8 -0
  225. package/dist/_internal/shared/listing-types/live/ctas.d.ts +1 -0
  226. package/dist/_internal/shared/listing-types/live/ctas.js +3 -0
  227. package/dist/_internal/shared/listing-types/live/og.d.ts +1 -0
  228. package/dist/_internal/shared/listing-types/live/og.js +1 -0
  229. package/dist/_internal/shared/listing-types/live/schema.d.ts +1 -0
  230. package/dist/_internal/shared/listing-types/live/schema.js +1 -0
  231. package/dist/_internal/shared/listing-types/live/seed-factory.d.ts +1 -0
  232. package/dist/_internal/shared/listing-types/live/seed-factory.js +1 -0
  233. package/dist/_internal/shared/media/limits.js +8 -0
  234. package/dist/client.d.ts +10 -5
  235. package/dist/client.js +16 -3
  236. package/dist/configs/next.js +7 -0
  237. package/dist/constants/api-endpoints.d.ts +6 -0
  238. package/dist/constants/api-endpoints.js +4 -0
  239. package/dist/core/hooks/useSyncManager.js +13 -1
  240. package/dist/core/unit-of-work.d.ts +1 -1
  241. package/dist/core/unit-of-work.js +2 -2
  242. package/dist/features/account/actions/address-actions.d.ts +1 -1
  243. package/dist/features/account/actions/address-actions.js +15 -7
  244. package/dist/features/account/schemas/firestore.d.ts +8 -43
  245. package/dist/features/account/schemas/firestore.js +8 -54
  246. package/dist/features/account/schemas/index.d.ts +6 -6
  247. package/dist/features/account/server.d.ts +1 -1
  248. package/dist/features/account/server.js +3 -1
  249. package/dist/features/addresses/index.d.ts +2 -0
  250. package/dist/features/addresses/index.js +2 -0
  251. package/dist/features/addresses/repository/addresses.repository.d.ts +29 -0
  252. package/dist/features/addresses/repository/addresses.repository.js +157 -0
  253. package/dist/features/addresses/schemas/firestore.d.ts +53 -0
  254. package/dist/features/addresses/schemas/firestore.js +68 -0
  255. package/dist/features/{bundles → addresses}/schemas/index.d.ts +0 -1
  256. package/dist/features/{bundles → addresses}/schemas/index.js +0 -1
  257. package/dist/features/addresses/server.d.ts +2 -0
  258. package/dist/features/addresses/server.js +2 -0
  259. package/dist/features/admin/components/AdminAllEventEntriesView.js +4 -3
  260. package/dist/features/admin/components/AdminBidsView.js +4 -3
  261. package/dist/features/admin/components/AdminBlogView.js +8 -3
  262. package/dist/features/admin/components/AdminBundleEditorView.d.ts +9 -0
  263. package/dist/features/admin/components/AdminBundleEditorView.js +209 -0
  264. package/dist/features/admin/components/AdminBundlesView.d.ts +9 -0
  265. package/dist/features/admin/components/AdminBundlesView.js +59 -0
  266. package/dist/features/admin/components/AdminCartsView.js +13 -3
  267. package/dist/features/admin/components/AdminContactView.js +4 -3
  268. package/dist/features/admin/components/AdminCouponsView.js +32 -13
  269. package/dist/features/admin/components/AdminNewsletterView.js +4 -3
  270. package/dist/features/admin/components/AdminOrdersView.js +15 -7
  271. package/dist/features/admin/components/AdminPayoutsView.js +4 -3
  272. package/dist/features/admin/components/AdminPrizeDrawsView.d.ts +4 -0
  273. package/dist/features/admin/components/AdminPrizeDrawsView.js +135 -0
  274. package/dist/features/admin/components/AdminProductsView.js +6 -5
  275. package/dist/features/admin/components/AdminReviewsView.js +5 -4
  276. package/dist/features/admin/components/AdminStoresView.js +4 -3
  277. package/dist/features/admin/components/AdminUsersView.js +15 -5
  278. package/dist/features/admin/components/AdminWishlistsView.js +10 -1
  279. package/dist/features/admin/components/DataTable.d.ts +5 -1
  280. package/dist/features/admin/components/DataTable.js +24 -20
  281. package/dist/features/admin/components/index.d.ts +6 -0
  282. package/dist/features/admin/components/index.js +5 -0
  283. package/dist/features/admin/constants/filter-tabs.d.ts +435 -0
  284. package/dist/features/admin/constants/filter-tabs.js +216 -0
  285. package/dist/features/admin/hooks/useAdminListingData.d.ts +1 -0
  286. package/dist/features/admin/hooks/useAdminListingData.js +1 -0
  287. package/dist/features/admin/schemas/firestore.d.ts +15 -0
  288. package/dist/features/admin/schemas/firestore.js +18 -0
  289. package/dist/features/admin/types/product.types.d.ts +2 -2
  290. package/dist/features/auctions/components/AuctionCard.d.ts +4 -1
  291. package/dist/features/auctions/components/AuctionCard.js +5 -3
  292. package/dist/features/auctions/components/AuctionDetailPageView.js +1 -1
  293. package/dist/features/auctions/components/MarketplaceAuctionCard.d.ts +2 -2
  294. package/dist/features/auctions/components/PlaceBidFormClient.js +12 -2
  295. package/dist/features/auctions/schemas/index.d.ts +2 -2
  296. package/dist/features/auth/index.d.ts +1 -0
  297. package/dist/features/auth/index.js +1 -0
  298. package/dist/features/auth/role-predicates.d.ts +16 -0
  299. package/dist/features/auth/role-predicates.js +15 -0
  300. package/dist/features/blog/components/BlogFeaturedCard.d.ts +4 -1
  301. package/dist/features/blog/components/BlogFeaturedCard.js +5 -3
  302. package/dist/features/cart/actions/cart-actions.d.ts +1 -0
  303. package/dist/features/cart/actions/cart-actions.js +16 -0
  304. package/dist/features/cart/components/CartView.d.ts +19 -1
  305. package/dist/features/cart/components/CartView.js +2 -2
  306. package/dist/features/cart/components/ShippingPicker.d.ts +13 -0
  307. package/dist/features/cart/components/ShippingPicker.js +48 -0
  308. package/dist/features/cart/components/index.d.ts +3 -1
  309. package/dist/features/cart/components/index.js +1 -0
  310. package/dist/features/cart/hooks/useCartCount.js +7 -1
  311. package/dist/features/cart/repository/cart.repository.d.ts +1 -0
  312. package/dist/features/cart/repository/cart.repository.js +35 -0
  313. package/dist/features/cart/schemas/firestore.d.ts +27 -2
  314. package/dist/features/categories/components/BundleAddToCartCta.d.ts +16 -0
  315. package/dist/features/categories/components/BundleAddToCartCta.js +54 -0
  316. package/dist/features/categories/components/BundleBuyNowCta.d.ts +8 -0
  317. package/dist/features/categories/components/BundleBuyNowCta.js +37 -0
  318. package/dist/features/categories/components/BundleDetailView.d.ts +22 -0
  319. package/dist/features/categories/components/BundleDetailView.js +31 -0
  320. package/dist/features/categories/components/BundleDynamicRuleEditor.d.ts +18 -0
  321. package/dist/features/categories/components/BundleDynamicRuleEditor.js +60 -0
  322. package/dist/features/categories/components/BundleItemsPicker.d.ts +26 -0
  323. package/dist/features/categories/components/BundleItemsPicker.js +135 -0
  324. package/dist/features/categories/components/BundlesListView.d.ts +13 -0
  325. package/dist/features/categories/components/BundlesListView.js +27 -0
  326. package/dist/features/categories/components/index.d.ts +12 -0
  327. package/dist/features/categories/components/index.js +9 -0
  328. package/dist/features/checkout/actions/checkout-actions.js +10 -3
  329. package/dist/features/events/components/AdminEventEditorView.js +108 -2
  330. package/dist/features/events/components/AdminEventsView.js +16 -4
  331. package/dist/features/events/components/EventCard.d.ts +4 -1
  332. package/dist/features/events/components/EventCard.js +7 -3
  333. package/dist/features/events/components/EventRaffleWinnerView.d.ts +21 -0
  334. package/dist/features/events/components/EventRaffleWinnerView.js +18 -0
  335. package/dist/features/events/components/SpinWheelView.d.ts +27 -0
  336. package/dist/features/events/components/SpinWheelView.js +64 -0
  337. package/dist/features/events/components/index.d.ts +4 -0
  338. package/dist/features/events/components/index.js +2 -0
  339. package/dist/features/events/schemas/firestore.d.ts +27 -1
  340. package/dist/features/events/schemas/firestore.js +7 -0
  341. package/dist/features/events/types/index.d.ts +27 -1
  342. package/dist/features/homepage/components/FeaturedBundlesSection.d.ts +16 -0
  343. package/dist/features/homepage/components/FeaturedBundlesSection.js +24 -0
  344. package/dist/features/homepage/components/MarketplaceHomepageView.js +4 -1
  345. package/dist/features/homepage/components/WhatsAppCommunitySection.js +2 -2
  346. package/dist/features/homepage/lib/section-renderer.d.ts +2 -0
  347. package/dist/features/homepage/lib/section-renderer.js +5 -5
  348. package/dist/features/layout/NavbarLayout.d.ts +3 -1
  349. package/dist/features/layout/NavbarLayout.js +32 -3
  350. package/dist/features/layout/TitleBarLayout.d.ts +6 -3
  351. package/dist/features/layout/TitleBarLayout.js +22 -7
  352. package/dist/features/media/upload/MediaUploadField.d.ts +15 -1
  353. package/dist/features/media/upload/MediaUploadField.js +22 -1
  354. package/dist/features/orders/components/MarketplaceOrderCard.js +4 -2
  355. package/dist/features/orders/components/OrderSiblingPayments.d.ts +8 -0
  356. package/dist/features/orders/components/OrderSiblingPayments.js +16 -0
  357. package/dist/features/orders/components/RefundHistoryTable.d.ts +6 -0
  358. package/dist/features/orders/components/RefundHistoryTable.js +23 -0
  359. package/dist/features/orders/components/RefundRequestView.d.ts +8 -0
  360. package/dist/features/orders/components/RefundRequestView.js +42 -0
  361. package/dist/features/orders/components/index.d.ts +6 -0
  362. package/dist/features/orders/components/index.js +3 -0
  363. package/dist/features/orders/index.d.ts +1 -0
  364. package/dist/features/orders/index.js +2 -0
  365. package/dist/features/orders/repository/orders.repository.d.ts +20 -1
  366. package/dist/features/orders/repository/orders.repository.js +30 -1
  367. package/dist/features/orders/schemas/firestore.d.ts +63 -13
  368. package/dist/features/orders/schemas/firestore.js +5 -5
  369. package/dist/features/orders/schemas/index.d.ts +4 -4
  370. package/dist/features/orders/types/index.d.ts +12 -2
  371. package/dist/features/orders/utils/bundle-grouping.d.ts +48 -0
  372. package/dist/features/orders/utils/bundle-grouping.js +54 -0
  373. package/dist/features/orders/utils/order-splitter.d.ts +9 -10
  374. package/dist/features/orders/utils/order-splitter.js +24 -30
  375. package/dist/features/payments/repository/payout.repository.d.ts +17 -1
  376. package/dist/features/payments/repository/payout.repository.js +47 -0
  377. package/dist/features/payments/schemas/firestore.d.ts +26 -0
  378. package/dist/features/pre-orders/components/PreorderCard.d.ts +4 -1
  379. package/dist/features/pre-orders/components/PreorderCard.js +8 -6
  380. package/dist/features/products/actions/product-actions.d.ts +1 -1
  381. package/dist/features/products/actions/product-actions.js +1 -1
  382. package/dist/features/products/components/CompareOverlay.d.ts +2 -2
  383. package/dist/features/products/components/CompareOverlay.js +4 -4
  384. package/dist/features/products/components/InteractiveProductCard.js +7 -12
  385. package/dist/features/products/components/NonRefundableConsentModal.d.ts +1 -1
  386. package/dist/features/products/components/NonRefundableConsentModal.js +0 -10
  387. package/dist/features/products/components/ProductGrid.js +28 -12
  388. package/dist/features/products/components/ShowGroupSection.js +3 -3
  389. package/dist/features/products/components/SublistingCarouselSection.js +2 -2
  390. package/dist/features/products/components/index.d.ts +0 -4
  391. package/dist/features/products/components/index.js +5 -2
  392. package/dist/features/products/index.d.ts +1 -1
  393. package/dist/features/products/index.js +3 -1
  394. package/dist/features/products/repository/products.repository.js +4 -0
  395. package/dist/features/products/schemas/catalog-product.d.ts +70 -0
  396. package/dist/features/products/schemas/catalog-product.js +50 -0
  397. package/dist/features/products/schemas/firestore.d.ts +110 -2
  398. package/dist/features/products/schemas/firestore.js +30 -0
  399. package/dist/features/products/schemas/index.d.ts +8 -8
  400. package/dist/features/products/types/index.d.ts +1 -1
  401. package/dist/features/products/utils/listing-type.d.ts +9 -0
  402. package/dist/features/products/utils/listing-type.js +4 -0
  403. package/dist/features/promotions/actions/coupon-actions.d.ts +2 -2
  404. package/dist/features/promotions/actions/coupon-actions.js +1 -1
  405. package/dist/features/promotions/components/CouponCard.d.ts +28 -10
  406. package/dist/features/promotions/components/CouponCard.js +116 -14
  407. package/dist/features/promotions/hooks/useCouponValidate.d.ts +1 -1
  408. package/dist/features/promotions/repository/coupons.repository.d.ts +1 -1
  409. package/dist/features/reviews/schemas/index.d.ts +2 -2
  410. package/dist/features/search/schemas/index.d.ts +2 -2
  411. package/dist/features/search/types/index.d.ts +2 -2
  412. package/dist/features/seller/components/SellerAuctionsView.js +4 -5
  413. package/dist/features/seller/components/SellerBidsView.js +5 -13
  414. package/dist/features/seller/components/SellerCouponsView.js +31 -67
  415. package/dist/features/seller/components/SellerOffersView.js +4 -5
  416. package/dist/features/seller/components/SellerOrdersView.js +4 -5
  417. package/dist/features/seller/components/SellerPayoutsView.js +4 -5
  418. package/dist/features/seller/components/SellerPreOrdersView.d.ts +4 -0
  419. package/dist/features/seller/components/SellerPreOrdersView.js +141 -0
  420. package/dist/features/seller/components/SellerPrizeDrawsView.d.ts +4 -0
  421. package/dist/features/seller/components/SellerPrizeDrawsView.js +138 -0
  422. package/dist/features/seller/components/SellerProductsView.js +4 -8
  423. package/dist/features/seller/components/index.d.ts +4 -0
  424. package/dist/features/seller/components/index.js +2 -0
  425. package/dist/features/seller/schemas/index.d.ts +2 -2
  426. package/dist/features/stores/actions/store-address-actions.d.ts +10 -6
  427. package/dist/features/stores/actions/store-address-actions.js +8 -7
  428. package/dist/features/stores/components/InteractiveStoreCard.js +3 -10
  429. package/dist/features/stores/components/StoreDetailLayoutView.js +20 -5
  430. package/dist/features/stores/schemas/firestore.d.ts +45 -38
  431. package/dist/features/stores/schemas/firestore.js +2 -49
  432. package/dist/features/stores/server.d.ts +0 -1
  433. package/dist/features/stores/server.js +2 -1
  434. package/dist/features/wishlist/hooks/useWishlistCount.d.ts +7 -9
  435. package/dist/features/wishlist/hooks/useWishlistCount.js +67 -86
  436. package/dist/features/wishlist/types/index.d.ts +1 -1
  437. package/dist/index.d.ts +56 -9
  438. package/dist/index.js +66 -11
  439. package/dist/next/routing/route-map.d.ts +6 -0
  440. package/dist/next/routing/route-map.js +4 -0
  441. package/dist/providers/db-firebase/admin.d.ts +6 -2
  442. package/dist/providers/db-firebase/admin.js +23 -0
  443. package/dist/repositories/index.d.ts +1 -2
  444. package/dist/repositories/index.js +5 -2
  445. package/dist/security/authorization.d.ts +2 -1
  446. package/dist/security/authorization.js +3 -2
  447. package/dist/seed/actions/demo-seed-actions.d.ts +1 -1
  448. package/dist/seed/bids-seed-data.d.ts +2 -2
  449. package/dist/seed/bids-seed-data.js +77 -2
  450. package/dist/seed/cart-seed-data.d.ts +10 -10
  451. package/dist/seed/cart-seed-data.js +15 -15
  452. package/dist/seed/events-seed-data.js +77 -0
  453. package/dist/seed/manifest.js +16 -8
  454. package/dist/seed/orders-seed-data.js +41 -2
  455. package/dist/seed/payouts-seed-data.js +18 -2
  456. package/dist/seed/stores-seed-data.js +55 -0
  457. package/dist/server-entry.d.ts +1 -0
  458. package/dist/server-entry.js +2 -0
  459. package/dist/server.d.ts +4 -0
  460. package/dist/server.js +8 -0
  461. package/dist/tailwind-utilities.css +1 -1
  462. package/dist/ui/components/FilterChipGroup.d.ts +39 -0
  463. package/dist/ui/components/FilterChipGroup.js +15 -0
  464. package/dist/ui/components/HorizontalScroller.js +32 -7
  465. package/dist/ui/components/HorizontalScroller.style.css +6 -0
  466. package/dist/ui/components/SiteLogo.js +1 -1
  467. package/dist/ui/index.d.ts +2 -0
  468. package/dist/ui/index.js +2 -0
  469. package/dist/utils/id-generators.d.ts +11 -0
  470. package/dist/utils/id-generators.js +16 -0
  471. package/package.json +1 -1
  472. package/dist/_internal/shared/features/bundles/config.d.ts +0 -6
  473. package/dist/_internal/shared/features/bundles/config.js +0 -6
  474. package/dist/_internal/shared/schema-versions.d.ts +0 -76
  475. package/dist/_internal/shared/schema-versions.js +0 -82
  476. package/dist/features/account/migrations.d.ts +0 -2
  477. package/dist/features/account/migrations.js +0 -10
  478. package/dist/features/admin/migrations.d.ts +0 -2
  479. package/dist/features/admin/migrations.js +0 -10
  480. package/dist/features/auctions/migrations.d.ts +0 -2
  481. package/dist/features/auctions/migrations.js +0 -10
  482. package/dist/features/auth/migrations.d.ts +0 -2
  483. package/dist/features/auth/migrations.js +0 -10
  484. package/dist/features/blog/migrations.d.ts +0 -2
  485. package/dist/features/blog/migrations.js +0 -10
  486. package/dist/features/brands/actions/brand-actions.d.ts +0 -2
  487. package/dist/features/brands/actions/brand-actions.js +0 -5
  488. package/dist/features/brands/index.d.ts +0 -3
  489. package/dist/features/brands/index.js +0 -3
  490. package/dist/features/brands/migrations.d.ts +0 -2
  491. package/dist/features/brands/migrations.js +0 -10
  492. package/dist/features/brands/repository/brands.repository.d.ts +0 -13
  493. package/dist/features/brands/repository/brands.repository.js +0 -60
  494. package/dist/features/brands/schemas/index.d.ts +0 -33
  495. package/dist/features/brands/schemas/index.js +0 -15
  496. package/dist/features/brands/server.d.ts +0 -7
  497. package/dist/features/brands/server.js +0 -7
  498. package/dist/features/bundles/components/AdminBundleEditorView.d.ts +0 -8
  499. package/dist/features/bundles/components/AdminBundleEditorView.js +0 -7
  500. package/dist/features/bundles/components/BundleDetailPageView.d.ts +0 -9
  501. package/dist/features/bundles/components/BundleDetailPageView.js +0 -45
  502. package/dist/features/bundles/components/BundleForm.d.ts +0 -12
  503. package/dist/features/bundles/components/BundleForm.js +0 -126
  504. package/dist/features/bundles/components/BundleItemsPicker.d.ts +0 -9
  505. package/dist/features/bundles/components/BundleItemsPicker.js +0 -77
  506. package/dist/features/bundles/components/BundlesByCategoryListing.d.ts +0 -6
  507. package/dist/features/bundles/components/BundlesByCategoryListing.js +0 -50
  508. package/dist/features/bundles/components/BundlesListingView.d.ts +0 -17
  509. package/dist/features/bundles/components/BundlesListingView.js +0 -50
  510. package/dist/features/bundles/components/FeaturedBundlesSection.d.ts +0 -5
  511. package/dist/features/bundles/components/FeaturedBundlesSection.js +0 -55
  512. package/dist/features/bundles/components/SellerBundleCreateView.d.ts +0 -8
  513. package/dist/features/bundles/components/SellerBundleCreateView.js +0 -7
  514. package/dist/features/bundles/components/SellerBundleEditView.d.ts +0 -9
  515. package/dist/features/bundles/components/SellerBundleEditView.js +0 -7
  516. package/dist/features/bundles/components/index.d.ts +0 -18
  517. package/dist/features/bundles/components/index.js +0 -9
  518. package/dist/features/bundles/constants/index.d.ts +0 -32
  519. package/dist/features/bundles/constants/index.js +0 -35
  520. package/dist/features/bundles/index.d.ts +0 -2
  521. package/dist/features/bundles/index.js +0 -2
  522. package/dist/features/bundles/migrations.d.ts +0 -2
  523. package/dist/features/bundles/migrations.js +0 -10
  524. package/dist/features/bundles/repository/bundles.repository.d.ts +0 -36
  525. package/dist/features/bundles/repository/bundles.repository.js +0 -148
  526. package/dist/features/bundles/repository/index.d.ts +0 -1
  527. package/dist/features/bundles/repository/index.js +0 -1
  528. package/dist/features/bundles/schemas/firestore.d.ts +0 -88
  529. package/dist/features/bundles/schemas/firestore.js +0 -29
  530. package/dist/features/bundles/schemas/zod.d.ts +0 -377
  531. package/dist/features/bundles/schemas/zod.js +0 -71
  532. package/dist/features/cart/migrations.d.ts +0 -2
  533. package/dist/features/cart/migrations.js +0 -10
  534. package/dist/features/categories/migrations.d.ts +0 -2
  535. package/dist/features/categories/migrations.js +0 -10
  536. package/dist/features/events/migrations.d.ts +0 -2
  537. package/dist/features/events/migrations.js +0 -10
  538. package/dist/features/faq/migrations.d.ts +0 -2
  539. package/dist/features/faq/migrations.js +0 -10
  540. package/dist/features/grouped/migrations.d.ts +0 -2
  541. package/dist/features/grouped/migrations.js +0 -10
  542. package/dist/features/history/migrations.d.ts +0 -2
  543. package/dist/features/history/migrations.js +0 -10
  544. package/dist/features/messages/migrations.d.ts +0 -2
  545. package/dist/features/messages/migrations.js +0 -10
  546. package/dist/features/orders/migrations.d.ts +0 -2
  547. package/dist/features/orders/migrations.js +0 -10
  548. package/dist/features/payments/migrations.d.ts +0 -2
  549. package/dist/features/payments/migrations.js +0 -10
  550. package/dist/features/products/migrations.d.ts +0 -2
  551. package/dist/features/products/migrations.js +0 -10
  552. package/dist/features/products/repository/sublisting-categories.repository.d.ts +0 -16
  553. package/dist/features/products/repository/sublisting-categories.repository.js +0 -126
  554. package/dist/features/products/schemas/sublisting-categories.d.ts +0 -45
  555. package/dist/features/products/schemas/sublisting-categories.js +0 -16
  556. package/dist/features/promotions/migrations.d.ts +0 -2
  557. package/dist/features/promotions/migrations.js +0 -10
  558. package/dist/features/reviews/migrations.d.ts +0 -2
  559. package/dist/features/reviews/migrations.js +0 -10
  560. package/dist/features/scams/migrations.d.ts +0 -2
  561. package/dist/features/scams/migrations.js +0 -10
  562. package/dist/features/seller/migrations.d.ts +0 -2
  563. package/dist/features/seller/migrations.js +0 -10
  564. package/dist/features/stores/migrations.d.ts +0 -2
  565. package/dist/features/stores/migrations.js +0 -10
  566. package/dist/features/sublisting/migrations.d.ts +0 -2
  567. package/dist/features/sublisting/migrations.js +0 -10
  568. package/dist/features/sublisting/schemas/firestore.d.ts +0 -32
  569. package/dist/features/sublisting/schemas/firestore.js +0 -19
  570. package/dist/features/support/migrations.d.ts +0 -2
  571. package/dist/features/support/migrations.js +0 -10
  572. package/dist/features/wishlist/migrations.d.ts +0 -2
  573. package/dist/features/wishlist/migrations.js +0 -10
  574. package/dist/seed/_bundle-constants.d.ts +0 -14
  575. package/dist/seed/_bundle-constants.js +0 -14
  576. package/dist/seed/anime-figures-seed-data.d.ts +0 -8
  577. package/dist/seed/anime-figures-seed-data.js +0 -1033
  578. package/dist/seed/beyblade-seed-data.d.ts +0 -7
  579. package/dist/seed/beyblade-seed-data.js +0 -1129
  580. package/dist/seed/brands-seed-data.d.ts +0 -7
  581. package/dist/seed/brands-seed-data.js +0 -410
  582. package/dist/seed/bundles-seed-data.d.ts +0 -13
  583. package/dist/seed/bundles-seed-data.js +0 -229
  584. package/dist/seed/cosplay-accessories-seed-data.d.ts +0 -8
  585. package/dist/seed/cosplay-accessories-seed-data.js +0 -647
  586. package/dist/seed/hot-wheels-seed-data.d.ts +0 -7
  587. package/dist/seed/hot-wheels-seed-data.js +0 -1612
  588. package/dist/seed/letitrip-official-seed-data.d.ts +0 -8
  589. package/dist/seed/letitrip-official-seed-data.js +0 -399
  590. package/dist/seed/pokemon-carousel-slides-seed-data.d.ts +0 -8
  591. package/dist/seed/pokemon-carousel-slides-seed-data.js +0 -322
  592. package/dist/seed/pokemon-categories-seed-data.d.ts +0 -24
  593. package/dist/seed/pokemon-categories-seed-data.js +0 -547
  594. package/dist/seed/pokemon-coupons-seed-data.d.ts +0 -6
  595. package/dist/seed/pokemon-coupons-seed-data.js +0 -465
  596. package/dist/seed/pokemon-homepage-sections-seed-data.d.ts +0 -7
  597. package/dist/seed/pokemon-homepage-sections-seed-data.js +0 -241
  598. package/dist/seed/pokemon-products-seed-data.d.ts +0 -9
  599. package/dist/seed/pokemon-products-seed-data.js +0 -1791
  600. package/dist/seed/pokemon-seed-bundle.d.ts +0 -47
  601. package/dist/seed/pokemon-seed-bundle.js +0 -71
  602. package/dist/seed/pokemon-stores-seed-data.d.ts +0 -6
  603. package/dist/seed/pokemon-stores-seed-data.js +0 -179
  604. package/dist/seed/pokemon-users-seed-data.d.ts +0 -6
  605. package/dist/seed/pokemon-users-seed-data.js +0 -521
  606. package/dist/seed/products-seed-data.d.ts +0 -6
  607. package/dist/seed/products-seed-data.js +0 -2530
  608. package/dist/seed/retro-gaming-seed-data.d.ts +0 -8
  609. package/dist/seed/retro-gaming-seed-data.js +0 -801
  610. package/dist/seed/server.d.ts +0 -2
  611. package/dist/seed/server.js +0 -7
  612. package/dist/seed/sublisting-categories-seed-data.d.ts +0 -7
  613. package/dist/seed/sublisting-categories-seed-data.js +0 -159
  614. package/dist/seed/transformers-seed-data.d.ts +0 -7
  615. package/dist/seed/transformers-seed-data.js +0 -530
@@ -0,0 +1,84 @@
1
+ /**
2
+ * CTA Action Registry — SB-UNI-W-1 shell (foundation only) 2026-05-13.
3
+ *
4
+ * Single source of truth for every CTA label, aria-label, permission, scope
5
+ * and confirmation across the app. Phase 7 W-2..W-4 sweeps the existing
6
+ * UI to consume `action(...)` references instead of inline strings.
7
+ *
8
+ * Shape (per spec):
9
+ * ACTIONS.{RESOURCE}.{actionId}: ActionDef
10
+ *
11
+ * Helpers:
12
+ * action(resource, id) → ActionDef | null
13
+ * canPerformAction(actionDef, role) → boolean (permission gate)
14
+ * actionsForListingType(scope) → ActionDef[] (filter by listingTypeScope)
15
+ * actionLabel(actionDef) → resolved label (LabelsProvider override hook)
16
+ *
17
+ * Extended <Button action={...}> in `ui/components/Button.tsx` is the W-1
18
+ * cohort's other half — wire to it when the consumer surfaces start
19
+ * adopting actions in W-2..W-4.
20
+ *
21
+ * This file ships the SHELL only — the per-resource action leaves are
22
+ * intentionally sparse so the W-2..W-4 sweeps can fill them surface-by-
23
+ * surface without merge churn here.
24
+ */
25
+ import type { UserRole } from "../../../features/auth/types";
26
+ import type { ListingType } from "../../../features/products/types/index";
27
+ import type { CategoryType } from "../../../features/categories/types/index";
28
+ /** What KIND of action — drives default UI affordance (link vs button vs danger). */
29
+ export type ActionKind = "primary" | "secondary" | "danger" | "ghost" | "link" | "chip";
30
+ /** Resource bucket — keyed top-level in the ACTIONS tree. */
31
+ export type ActionResource = "PRODUCT" | "AUCTION" | "PRE_ORDER" | "PRIZE_DRAW" | "CLASSIFIED" | "DIGITAL_CODE" | "LIVE" | "BUNDLE" | "GROUP" | "CATEGORY" | "BRAND" | "SUBLISTING" | "STORE" | "BLOG" | "EVENT" | "USER" | "SELLER" | "ADMIN" | "CART" | "CHECKOUT" | "NAV" | "MEDIA" | "SUPPORT";
32
+ /** Confirmation modal config — when set, <Button action={...}> opens
33
+ * a confirm dialog before firing the actual handler. */
34
+ export interface ActionConfirmation {
35
+ /** Title shown in the confirm dialog. */
36
+ title: string;
37
+ /** Body shown in the confirm dialog. */
38
+ body: string;
39
+ /** Confirm button label. */
40
+ confirmLabel: string;
41
+ /** Cancel button label (defaults to "Cancel"). */
42
+ cancelLabel?: string;
43
+ /** Visual variant of the confirm button. */
44
+ confirmKind?: ActionKind;
45
+ }
46
+ /** One CTA registration. */
47
+ export interface ActionDef {
48
+ /** Stable id, e.g. "product.add-to-cart". */
49
+ id: string;
50
+ /** User-visible label (English default; i18n overrides land via LabelsProvider). */
51
+ label: string;
52
+ /** Optional aria-label override (defaults to `label`). */
53
+ ariaLabel?: string;
54
+ /** One-line semantic comment — surfaces in dev tooling + audit reports. */
55
+ description: string;
56
+ /** Affordance hint. */
57
+ kind: ActionKind;
58
+ /** Optional target route — useful for Link-style actions. */
59
+ target?: string;
60
+ /** Roles that may perform this action; absent = anyone authed. */
61
+ permissions?: readonly UserRole[];
62
+ /** Listing-type scope — surfaces this action only on these listingTypes. */
63
+ listingTypeScope?: readonly ListingType[];
64
+ /** Category-type scope — same but for category discriminators. */
65
+ categoryTypeScope?: readonly CategoryType[];
66
+ /** Optional icon name (resolved by the consumer's icon set). */
67
+ iconKey?: string;
68
+ /** Optional confirmation modal config. */
69
+ confirmation?: ActionConfirmation;
70
+ }
71
+ export type ActionTree = Record<ActionResource, Record<string, ActionDef>>;
72
+ /** Pluck an `ActionDef` by resource + id. Returns null when missing. */
73
+ export declare function action(tree: ActionTree, resource: ActionResource, id: string): ActionDef | null;
74
+ /** Permission gate — returns true when the role may perform the action.
75
+ * Admin always passes. No `permissions` field = anyone authed passes. */
76
+ export declare function canPerformAction(def: ActionDef, role: UserRole | undefined): boolean;
77
+ /** Filter the registry to actions scoped to the given listingType. */
78
+ export declare function actionsForListingType(tree: ActionTree, listingType: ListingType): ActionDef[];
79
+ /** Resolve the label — placeholder for LabelsProvider i18n override.
80
+ * Today returns the English default; Phase 7 wires the override hook. */
81
+ export declare function actionLabel(def: ActionDef): string;
82
+ export declare const ACTIONS: ActionTree;
83
+ /** Sugar — `act("PRODUCT", "add-to-cart")` reads more naturally at call sites. */
84
+ export declare function act(resource: ActionResource, id: string): ActionDef | null;
@@ -0,0 +1,160 @@
1
+ /**
2
+ * CTA Action Registry — SB-UNI-W-1 shell (foundation only) 2026-05-13.
3
+ *
4
+ * Single source of truth for every CTA label, aria-label, permission, scope
5
+ * and confirmation across the app. Phase 7 W-2..W-4 sweeps the existing
6
+ * UI to consume `action(...)` references instead of inline strings.
7
+ *
8
+ * Shape (per spec):
9
+ * ACTIONS.{RESOURCE}.{actionId}: ActionDef
10
+ *
11
+ * Helpers:
12
+ * action(resource, id) → ActionDef | null
13
+ * canPerformAction(actionDef, role) → boolean (permission gate)
14
+ * actionsForListingType(scope) → ActionDef[] (filter by listingTypeScope)
15
+ * actionLabel(actionDef) → resolved label (LabelsProvider override hook)
16
+ *
17
+ * Extended <Button action={...}> in `ui/components/Button.tsx` is the W-1
18
+ * cohort's other half — wire to it when the consumer surfaces start
19
+ * adopting actions in W-2..W-4.
20
+ *
21
+ * This file ships the SHELL only — the per-resource action leaves are
22
+ * intentionally sparse so the W-2..W-4 sweeps can fill them surface-by-
23
+ * surface without merge churn here.
24
+ */
25
+ // ─── Helpers ─────────────────────────────────────────────────────────────────
26
+ /** Pluck an `ActionDef` by resource + id. Returns null when missing. */
27
+ export function action(tree, resource, id) {
28
+ const bucket = tree[resource];
29
+ if (!bucket)
30
+ return null;
31
+ return bucket[id] ?? null;
32
+ }
33
+ /** Permission gate — returns true when the role may perform the action.
34
+ * Admin always passes. No `permissions` field = anyone authed passes. */
35
+ export function canPerformAction(def, role) {
36
+ if (role === "admin")
37
+ return true;
38
+ if (!def.permissions || def.permissions.length === 0) {
39
+ return Boolean(role); // anyone authed
40
+ }
41
+ if (!role)
42
+ return false;
43
+ return def.permissions.includes(role);
44
+ }
45
+ /** Filter the registry to actions scoped to the given listingType. */
46
+ export function actionsForListingType(tree, listingType) {
47
+ const out = [];
48
+ for (const bucket of Object.values(tree)) {
49
+ for (const def of Object.values(bucket)) {
50
+ if (!def.listingTypeScope || def.listingTypeScope.includes(listingType)) {
51
+ out.push(def);
52
+ }
53
+ }
54
+ }
55
+ return out;
56
+ }
57
+ /** Resolve the label — placeholder for LabelsProvider i18n override.
58
+ * Today returns the English default; Phase 7 wires the override hook. */
59
+ export function actionLabel(def) {
60
+ return def.label;
61
+ }
62
+ // ─── Sparse seed tree ────────────────────────────────────────────────────────
63
+ // Phase 7 W-2..W-4 sweeps fill these out resource-by-resource. The shell
64
+ // just establishes the shape + a few "obvious" actions that other Phase 5
65
+ // flows can reference today.
66
+ export const ACTIONS = {
67
+ PRODUCT: {
68
+ "add-to-cart": {
69
+ id: "product.add-to-cart",
70
+ label: "Add to cart",
71
+ description: "Add a standard listing to the buyer's cart.",
72
+ kind: "primary",
73
+ listingTypeScope: ["standard", "pre-order", "prize-draw", "digital-code", "live"],
74
+ },
75
+ "buy-now": {
76
+ id: "product.buy-now",
77
+ label: "Buy now",
78
+ description: "Skip cart and head straight to checkout for this listing.",
79
+ kind: "primary",
80
+ listingTypeScope: ["standard", "pre-order"],
81
+ },
82
+ },
83
+ AUCTION: {
84
+ "place-bid": {
85
+ id: "auction.place-bid",
86
+ label: "Place bid",
87
+ description: "Submit a bid on an auction listing.",
88
+ kind: "primary",
89
+ listingTypeScope: ["auction"],
90
+ },
91
+ "buy-it-now": {
92
+ id: "auction.buy-it-now",
93
+ label: "Buy It Now",
94
+ description: "Skip bidding and purchase at the BIN price (SB-UNI-H). Hidden once bidsHaveStarted is true.",
95
+ kind: "secondary",
96
+ listingTypeScope: ["auction"],
97
+ },
98
+ },
99
+ PRE_ORDER: {},
100
+ PRIZE_DRAW: {},
101
+ CLASSIFIED: {
102
+ "contact-seller": {
103
+ id: "classified.contact-seller",
104
+ label: "Contact seller",
105
+ description: "Open a conversations thread with the seller — classified flow (SB-UNI-M).",
106
+ kind: "primary",
107
+ listingTypeScope: ["classified"],
108
+ },
109
+ },
110
+ DIGITAL_CODE: {},
111
+ LIVE: {},
112
+ BUNDLE: {
113
+ "add-bundle-to-cart": {
114
+ id: "bundle.add-to-cart",
115
+ label: "Add bundle to cart",
116
+ description: "Add a categoryType:'bundle' to the cart (SB-UNI-Bundle-Checkout).",
117
+ kind: "primary",
118
+ categoryTypeScope: ["bundle"],
119
+ },
120
+ },
121
+ GROUP: {},
122
+ CATEGORY: {},
123
+ BRAND: {},
124
+ SUBLISTING: {},
125
+ STORE: {},
126
+ BLOG: {},
127
+ EVENT: {},
128
+ USER: {},
129
+ SELLER: {},
130
+ ADMIN: {},
131
+ CART: {
132
+ "clear-cart": {
133
+ id: "cart.clear",
134
+ label: "Clear cart",
135
+ description: "Remove every item from the buyer's cart.",
136
+ kind: "danger",
137
+ confirmation: {
138
+ title: "Clear your cart?",
139
+ body: "Every item will be removed. This can't be undone.",
140
+ confirmLabel: "Clear cart",
141
+ confirmKind: "danger",
142
+ },
143
+ },
144
+ },
145
+ CHECKOUT: {
146
+ "place-order": {
147
+ id: "checkout.place-order",
148
+ label: "Place order",
149
+ description: "Submit the order with the chosen payment method.",
150
+ kind: "primary",
151
+ },
152
+ },
153
+ NAV: {},
154
+ MEDIA: {},
155
+ SUPPORT: {},
156
+ };
157
+ /** Sugar — `act("PRODUCT", "add-to-cart")` reads more naturally at call sites. */
158
+ export function act(resource, id) {
159
+ return action(ACTIONS, resource, id);
160
+ }
@@ -0,0 +1,3 @@
1
+ /** Default ListingCheckoutRule hook implementations. */
2
+ import type { ListingCheckoutRule } from "./types";
3
+ export declare const DEFAULT_LISTING_RULE: Omit<ListingCheckoutRule, "orderType">;
@@ -0,0 +1,22 @@
1
+ /** Default ListingCheckoutRule hook implementations. */
2
+ import { STANDARD_MAX_QTY_PER_LINE } from "./_limits";
3
+ export const DEFAULT_LISTING_RULE = {
4
+ purchaseable: true,
5
+ cartEligible: true,
6
+ requiresShippingAddress: true,
7
+ requiresConsentOtp: true,
8
+ nonRefundable: false,
9
+ maxQuantityPerLine: STANDARD_MAX_QTY_PER_LINE,
10
+ canMergeWithSameProduct: true,
11
+ maxLinesPerOrder: Infinity,
12
+ refundPolicy: { full: true, partial: true, partialGranularity: "item" },
13
+ splitKey: (item) => `standard:${item.storeId ?? "unknown"}`,
14
+ splitMultipleOrders: (item) => [item],
15
+ preflightChecks: (_pairs) => { },
16
+ stockDecrementExtras: (_product, _qty) => ({}),
17
+ decorateOrderItem: (line, product) => ({
18
+ ...line,
19
+ ...(product.listingType ? { listingType: product.listingType } : {}),
20
+ }),
21
+ decorateOrderDoc: (_groupFirstItem, _groupFirstProduct) => ({}),
22
+ };
@@ -0,0 +1,19 @@
1
+ /** Checkout window / capacity constants — single source of truth. */
2
+ /** Maximum distinct line items in one cart (hard cap, already enforced at addToCart). */
3
+ export declare const CART_MAX_ITEMS = 50;
4
+ /**
5
+ * Maximum number of order documents that can be created in one checkout
6
+ * transaction. If the cart produces more groups than this the checkout is
7
+ * rejected.
8
+ */
9
+ export declare const CHECKOUT_MAX_ORDERS_PER_TX = 20;
10
+ /**
11
+ * Maximum prize-draw reveal entries per order document. Buying 7 entries
12
+ * produces three orders: [3, 3, 1]. Each order has its own independent
13
+ * reveal flow.
14
+ */
15
+ export declare const PRIZE_DRAW_MAX_REVEALS_PER_ORDER = 3;
16
+ /** Maximum qty per bundle purchase (bundles are always single-shot direct buys). */
17
+ export declare const BUNDLE_MAX_QTY_PER_TX = 1;
18
+ /** Standard / pre-order max qty per cart line (enforced at addToCart). */
19
+ export declare const STANDARD_MAX_QTY_PER_LINE = 99;
@@ -0,0 +1,19 @@
1
+ /** Checkout window / capacity constants — single source of truth. */
2
+ /** Maximum distinct line items in one cart (hard cap, already enforced at addToCart). */
3
+ export const CART_MAX_ITEMS = 50;
4
+ /**
5
+ * Maximum number of order documents that can be created in one checkout
6
+ * transaction. If the cart produces more groups than this the checkout is
7
+ * rejected.
8
+ */
9
+ export const CHECKOUT_MAX_ORDERS_PER_TX = 20;
10
+ /**
11
+ * Maximum prize-draw reveal entries per order document. Buying 7 entries
12
+ * produces three orders: [3, 3, 1]. Each order has its own independent
13
+ * reveal flow.
14
+ */
15
+ export const PRIZE_DRAW_MAX_REVEALS_PER_ORDER = 3;
16
+ /** Maximum qty per bundle purchase (bundles are always single-shot direct buys). */
17
+ export const BUNDLE_MAX_QTY_PER_TX = 1;
18
+ /** Standard / pre-order max qty per cart line (enforced at addToCart). */
19
+ export const STANDARD_MAX_QTY_PER_LINE = 99;
@@ -0,0 +1,44 @@
1
+ /**
2
+ * Checkout rule registry — S-SBUNI-RULES 2026-05-13.
3
+ *
4
+ * Adding a new ListingType later means:
5
+ * 1. Create `<type>.rule.ts` with just the overrides from DEFAULT_LISTING_RULE
6
+ * 2. Add a capability row in `_internal/shared/listing-types/capabilities.ts`
7
+ * 3. Add the import + entry to CHECKOUT_RULES below
8
+ *
9
+ * No grep of the consumer codebase needed.
10
+ */
11
+ import type { ListingType } from "../../../../features/products/types/index";
12
+ import type { CartItemDocument } from "../../../../features/cart/schemas/firestore";
13
+ import type { ListingCheckoutRule, CategoryCheckoutRule, CartItemProductPair } from "./types";
14
+ import type { OrderType } from "../../../../features/orders/utils/order-splitter";
15
+ export declare const CHECKOUT_RULES: Record<ListingType, ListingCheckoutRule>;
16
+ export declare const CATEGORY_CHECKOUT_RULES: Record<string, CategoryCheckoutRule>;
17
+ /**
18
+ * Lookup the checkout rule for a listing type. Every consumer that used to
19
+ * inline `if (listingType === "X")` should call this instead.
20
+ */
21
+ export declare function getListingRule(listingType: ListingType): ListingCheckoutRule;
22
+ /**
23
+ * Lookup the checkout rule for a category type. Returns null for
24
+ * non-purchaseable category types (sublisting, brand, category).
25
+ */
26
+ export declare function getCategoryRule(categoryType: string): CategoryCheckoutRule | null;
27
+ /**
28
+ * Pick the OrderType for a cart item — replaces the if/else cascade in
29
+ * splitCartIntoOrderGroups.
30
+ */
31
+ export declare function pickOrderType(item: CartItemDocument): OrderType;
32
+ /**
33
+ * Get the order-grouping split key for a cart item — replaces the inline
34
+ * key construction in splitCartIntoOrderGroups.
35
+ */
36
+ export declare function getSplitKey(item: CartItemDocument): string;
37
+ /**
38
+ * Run all synchronous preflight guards across a cart. Each item is tested
39
+ * against its type's rule. Throws ValidationError on first violation.
40
+ *
41
+ * Note: the async maxPerUser cap check remains in the server-only
42
+ * `enforceMaxPerUserForCart` (prize-bundle-gates.ts) and runs separately.
43
+ */
44
+ export declare function runSyncPreflight(pairs: CartItemProductPair[]): void;
@@ -0,0 +1,87 @@
1
+ /**
2
+ * Checkout rule registry — S-SBUNI-RULES 2026-05-13.
3
+ *
4
+ * Adding a new ListingType later means:
5
+ * 1. Create `<type>.rule.ts` with just the overrides from DEFAULT_LISTING_RULE
6
+ * 2. Add a capability row in `_internal/shared/listing-types/capabilities.ts`
7
+ * 3. Add the import + entry to CHECKOUT_RULES below
8
+ *
9
+ * No grep of the consumer codebase needed.
10
+ */
11
+ import { standardRule } from "./standard.rule";
12
+ import { auctionRule } from "./auction.rule";
13
+ import { preOrderRule } from "./preorder.rule";
14
+ import { prizeDrawRule } from "./prize-draw.rule";
15
+ import { offerRule } from "./offer.rule";
16
+ import { bundleRule } from "./bundle.rule";
17
+ import { classifiedRule } from "./classified.rule";
18
+ import { digitalCodeRule } from "./digital-code.rule";
19
+ import { liveRule } from "./live.rule";
20
+ export const CHECKOUT_RULES = {
21
+ standard: standardRule,
22
+ auction: auctionRule,
23
+ "pre-order": preOrderRule,
24
+ "prize-draw": prizeDrawRule,
25
+ classified: classifiedRule,
26
+ "digital-code": digitalCodeRule,
27
+ live: liveRule,
28
+ };
29
+ export const CATEGORY_CHECKOUT_RULES = {
30
+ bundle: bundleRule,
31
+ };
32
+ /**
33
+ * Lookup the checkout rule for a listing type. Every consumer that used to
34
+ * inline `if (listingType === "X")` should call this instead.
35
+ */
36
+ export function getListingRule(listingType) {
37
+ return CHECKOUT_RULES[listingType] ?? CHECKOUT_RULES.standard;
38
+ }
39
+ /**
40
+ * Lookup the checkout rule for a category type. Returns null for
41
+ * non-purchaseable category types (sublisting, brand, category).
42
+ */
43
+ export function getCategoryRule(categoryType) {
44
+ return CATEGORY_CHECKOUT_RULES[categoryType] ?? null;
45
+ }
46
+ /**
47
+ * Pick the OrderType for a cart item — replaces the if/else cascade in
48
+ * splitCartIntoOrderGroups.
49
+ */
50
+ export function pickOrderType(item) {
51
+ if (item.isOffer)
52
+ return offerRule.orderType;
53
+ const lt = (item.listingType ?? "standard");
54
+ return (CHECKOUT_RULES[lt] ?? CHECKOUT_RULES.standard).orderType;
55
+ }
56
+ /**
57
+ * Get the order-grouping split key for a cart item — replaces the inline
58
+ * key construction in splitCartIntoOrderGroups.
59
+ */
60
+ export function getSplitKey(item) {
61
+ if (item.isOffer)
62
+ return offerRule.splitKey(item);
63
+ const lt = (item.listingType ?? "standard");
64
+ return (CHECKOUT_RULES[lt] ?? CHECKOUT_RULES.standard).splitKey(item);
65
+ }
66
+ /**
67
+ * Run all synchronous preflight guards across a cart. Each item is tested
68
+ * against its type's rule. Throws ValidationError on first violation.
69
+ *
70
+ * Note: the async maxPerUser cap check remains in the server-only
71
+ * `enforceMaxPerUserForCart` (prize-bundle-gates.ts) and runs separately.
72
+ */
73
+ export function runSyncPreflight(pairs) {
74
+ const byType = new Map();
75
+ for (const pair of pairs) {
76
+ if (pair.item.bundleProductIds?.length)
77
+ continue; // bundles skip — direct checkout
78
+ const lt = (pair.item.listingType ?? "standard");
79
+ const bucket = byType.get(lt) ?? [];
80
+ bucket.push(pair);
81
+ byType.set(lt, bucket);
82
+ }
83
+ for (const [lt, ltPairs] of byType) {
84
+ const rule = CHECKOUT_RULES[lt] ?? CHECKOUT_RULES.standard;
85
+ rule.preflightChecks(ltPairs);
86
+ }
87
+ }
@@ -0,0 +1,2 @@
1
+ import type { ListingCheckoutRule } from "./types";
2
+ export declare const auctionRule: ListingCheckoutRule;
@@ -0,0 +1,10 @@
1
+ import { DEFAULT_LISTING_RULE } from "./_defaults";
2
+ export const auctionRule = {
3
+ ...DEFAULT_LISTING_RULE,
4
+ orderType: "auction",
5
+ cartEligible: false, // bid-only; add-to-cart is blocked at the action layer
6
+ maxQuantityPerLine: 1,
7
+ canMergeWithSameProduct: false,
8
+ refundPolicy: { full: true, partial: false, partialGranularity: "none" },
9
+ splitKey: (item) => `auction:${item.itemId}`,
10
+ };
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Bundle CategoryCheckoutRule — bundles are always direct-checkout-only.
3
+ *
4
+ * Bundles (categoryType:"bundle") never enter the cart. The buyer clicks
5
+ * "Buy bundle" on the bundle PDP which calls directBundleCheckoutAction,
6
+ * bypassing the cart pipeline entirely. This rule conveys that intent to the
7
+ * cart-add gate (cartEligible: false) and informs the checkout CART-UI which
8
+ * replaces "Add to cart" with "Buy now".
9
+ */
10
+ import type { CategoryCheckoutRule } from "./types";
11
+ export declare const bundleRule: CategoryCheckoutRule;
@@ -0,0 +1,6 @@
1
+ export const bundleRule = {
2
+ purchaseable: true,
3
+ cartEligible: false, // direct-checkout-only; addBundleToCart has been removed
4
+ orderType: "standard", // bundle orders resolve to standard orderType
5
+ requiresShippingAddress: true,
6
+ };
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Classified listing rule — chat-only, no checkout.
3
+ *
4
+ * Classified listings (OLX / Facebook Marketplace pattern) surface a
5
+ * "Contact Seller" CTA that opens a conversations thread. No cart, no
6
+ * payment, no order. SB-UNI-M will wire the full flow.
7
+ */
8
+ import type { ListingCheckoutRule } from "./types";
9
+ export declare const classifiedRule: ListingCheckoutRule;
@@ -0,0 +1,9 @@
1
+ import { DEFAULT_LISTING_RULE } from "./_defaults";
2
+ export const classifiedRule = {
3
+ ...DEFAULT_LISTING_RULE,
4
+ orderType: "standard", // placeholder — classified never reaches order creation
5
+ purchaseable: false,
6
+ cartEligible: false,
7
+ requiresShippingAddress: false,
8
+ requiresConsentOtp: false,
9
+ };
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Digital-code listing rule — no shipping, instant fulfilment.
3
+ *
4
+ * Codes are delivered electronically at purchase confirmation. No shipping
5
+ * address required. SB-UNI-N wires the full code-pool claim + reveal flow.
6
+ */
7
+ import type { ListingCheckoutRule } from "./types";
8
+ export declare const digitalCodeRule: ListingCheckoutRule;
@@ -0,0 +1,6 @@
1
+ import { DEFAULT_LISTING_RULE } from "./_defaults";
2
+ export const digitalCodeRule = {
3
+ ...DEFAULT_LISTING_RULE,
4
+ orderType: "standard", // single-line standard order; fulfilment differs
5
+ requiresShippingAddress: false,
6
+ };
@@ -0,0 +1,12 @@
1
+ export type { ListingCheckoutRule, CategoryCheckoutRule, CartItemProductPair, OrderItemInput, RefundPolicy, } from "./types";
2
+ export { CHECKOUT_RULES, CATEGORY_CHECKOUT_RULES, getListingRule, getCategoryRule, pickOrderType, getSplitKey, runSyncPreflight, } from "./_registry";
3
+ export { CART_MAX_ITEMS, CHECKOUT_MAX_ORDERS_PER_TX, PRIZE_DRAW_MAX_REVEALS_PER_ORDER, BUNDLE_MAX_QTY_PER_TX, STANDARD_MAX_QTY_PER_LINE, } from "./_limits";
4
+ export { standardRule } from "./standard.rule";
5
+ export { auctionRule } from "./auction.rule";
6
+ export { preOrderRule } from "./preorder.rule";
7
+ export { prizeDrawRule } from "./prize-draw.rule";
8
+ export { offerRule } from "./offer.rule";
9
+ export { bundleRule } from "./bundle.rule";
10
+ export { classifiedRule } from "./classified.rule";
11
+ export { digitalCodeRule } from "./digital-code.rule";
12
+ export { liveRule } from "./live.rule";
@@ -0,0 +1,12 @@
1
+ export { CHECKOUT_RULES, CATEGORY_CHECKOUT_RULES, getListingRule, getCategoryRule, pickOrderType, getSplitKey, runSyncPreflight, } from "./_registry";
2
+ export { CART_MAX_ITEMS, CHECKOUT_MAX_ORDERS_PER_TX, PRIZE_DRAW_MAX_REVEALS_PER_ORDER, BUNDLE_MAX_QTY_PER_TX, STANDARD_MAX_QTY_PER_LINE, } from "./_limits";
3
+ // Individual rules — exported for tests and direct access.
4
+ export { standardRule } from "./standard.rule";
5
+ export { auctionRule } from "./auction.rule";
6
+ export { preOrderRule } from "./preorder.rule";
7
+ export { prizeDrawRule } from "./prize-draw.rule";
8
+ export { offerRule } from "./offer.rule";
9
+ export { bundleRule } from "./bundle.rule";
10
+ export { classifiedRule } from "./classified.rule";
11
+ export { digitalCodeRule } from "./digital-code.rule";
12
+ export { liveRule } from "./live.rule";
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Live-item listing rule — buyer jurisdiction check + vendor verification.
3
+ *
4
+ * Live animals/plants require a verified seller and that the buyer's delivery
5
+ * state is in the product's `jurisdictionAllowed` list. Cart eligibility is
6
+ * blocked at the action layer via `capabilityFor("live").requiresJurisdictionCheck`
7
+ * until the full gate (SB-UNI-O) is implemented.
8
+ */
9
+ import type { ListingCheckoutRule } from "./types";
10
+ export declare const liveRule: ListingCheckoutRule;
@@ -0,0 +1,6 @@
1
+ import { DEFAULT_LISTING_RULE } from "./_defaults";
2
+ export const liveRule = {
3
+ ...DEFAULT_LISTING_RULE,
4
+ orderType: "standard",
5
+ cartEligible: false, // blocked until SB-UNI-O jurisdiction + vendor-verified gate
6
+ };
@@ -0,0 +1,2 @@
1
+ import type { ListingCheckoutRule } from "./types";
2
+ export declare const offerRule: ListingCheckoutRule;
@@ -0,0 +1,9 @@
1
+ import { DEFAULT_LISTING_RULE } from "./_defaults";
2
+ export const offerRule = {
3
+ ...DEFAULT_LISTING_RULE,
4
+ orderType: "offer",
5
+ maxQuantityPerLine: 1,
6
+ canMergeWithSameProduct: false,
7
+ refundPolicy: { full: true, partial: false, partialGranularity: "none" },
8
+ splitKey: (item) => `offer:${item.itemId}`,
9
+ };
@@ -0,0 +1,2 @@
1
+ import type { ListingCheckoutRule } from "./types";
2
+ export declare const preOrderRule: ListingCheckoutRule;
@@ -0,0 +1,28 @@
1
+ import { ValidationError } from "../../../../errors";
2
+ import { DEFAULT_LISTING_RULE } from "./_defaults";
3
+ export const preOrderRule = {
4
+ ...DEFAULT_LISTING_RULE,
5
+ orderType: "preorder",
6
+ splitKey: (item) => `preorder:${item.storeId ?? "unknown"}`,
7
+ preflightChecks: (pairs) => {
8
+ for (const { item, product } of pairs) {
9
+ if (product.listingType !== "pre-order")
10
+ continue;
11
+ const cap = product.preOrderMaxQuantity ?? 0;
12
+ if (cap <= 0)
13
+ continue;
14
+ const current = product.preOrderCurrentCount ?? 0;
15
+ if (current + item.quantity > cap) {
16
+ throw Object.assign(new ValidationError(`Pre-order quota reached for "${product.title}". ` +
17
+ `${current}/${cap} already reserved.`), { code: "PREORDER_QUOTA_FULL", productId: product.id });
18
+ }
19
+ }
20
+ },
21
+ stockDecrementExtras: (product, quantity) => {
22
+ if (product.listingType !== "pre-order")
23
+ return {};
24
+ return {
25
+ preOrderCurrentCount: (product.preOrderCurrentCount ?? 0) + quantity,
26
+ };
27
+ },
28
+ };
@@ -0,0 +1,2 @@
1
+ import type { ListingCheckoutRule } from "./types";
2
+ export declare const prizeDrawRule: ListingCheckoutRule;