@mohasinac/appkit 2.6.1 → 2.6.2

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 (301) hide show
  1. package/dist/_internal/client/features/layout/DashboardLayoutClient.d.ts +38 -0
  2. package/dist/_internal/client/features/layout/DashboardLayoutClient.js +75 -0
  3. package/dist/_internal/client/features/layout/RoleGuard.d.ts +15 -0
  4. package/dist/_internal/client/features/layout/RoleGuard.js +25 -0
  5. package/dist/_internal/client/features/layout/index.d.ts +5 -0
  6. package/dist/_internal/client/features/layout/index.js +4 -0
  7. package/dist/_internal/server/features/brands/actions.d.ts +3 -3
  8. package/dist/_internal/server/features/brands/actions.js +72 -5
  9. package/dist/_internal/server/features/brands/data.d.ts +8 -8
  10. package/dist/_internal/server/features/brands/data.js +10 -11
  11. package/dist/_internal/server/features/brands/service.d.ts +2 -2
  12. package/dist/_internal/server/features/brands/service.js +5 -5
  13. package/dist/_internal/server/features/categories/og.d.ts +33 -0
  14. package/dist/_internal/server/features/categories/og.js +75 -0
  15. package/dist/_internal/server/features/checkout/actions.d.ts +24 -0
  16. package/dist/_internal/server/features/checkout/actions.js +442 -13
  17. package/dist/_internal/server/features/checkout/index.d.ts +1 -1
  18. package/dist/_internal/server/features/checkout/index.js +1 -1
  19. package/dist/_internal/server/features/checkout/prize-bundle-gates.d.ts +59 -0
  20. package/dist/_internal/server/features/checkout/prize-bundle-gates.js +99 -0
  21. package/dist/_internal/server/features/grouped/data.js +12 -5
  22. package/dist/_internal/server/features/homepage/data.d.ts +1 -1
  23. package/dist/_internal/server/features/homepage/data.js +2 -2
  24. package/dist/_internal/server/features/media/contextGuards.d.ts +52 -0
  25. package/dist/_internal/server/features/media/contextGuards.js +198 -0
  26. package/dist/_internal/server/features/orders/adapters.js +12 -0
  27. package/dist/_internal/server/features/products/data.d.ts +1 -1
  28. package/dist/_internal/server/features/sublisting-categories/data.d.ts +1 -1
  29. package/dist/_internal/server/features/sublisting-categories/data.js +2 -2
  30. package/dist/_internal/server/jobs/handlers/assignSpinPrize.d.ts +24 -0
  31. package/dist/_internal/server/jobs/handlers/assignSpinPrize.js +86 -0
  32. package/dist/_internal/server/jobs/handlers/bundleStockSync.d.ts +18 -0
  33. package/dist/_internal/server/jobs/handlers/bundleStockSync.js +80 -0
  34. package/dist/_internal/server/jobs/handlers/index.d.ts +8 -0
  35. package/dist/_internal/server/jobs/handlers/index.js +13 -0
  36. package/dist/_internal/server/jobs/handlers/listingProcessor.js +13 -3
  37. package/dist/_internal/server/jobs/handlers/onProductStockChange.d.ts +17 -0
  38. package/dist/_internal/server/jobs/handlers/onProductStockChange.js +136 -0
  39. package/dist/_internal/server/jobs/handlers/onProductWrite.js +17 -1
  40. package/dist/_internal/server/jobs/handlers/prizeRevealClose.d.ts +9 -0
  41. package/dist/_internal/server/jobs/handlers/prizeRevealClose.js +29 -0
  42. package/dist/_internal/server/jobs/handlers/prizeRevealExpiry.d.ts +10 -0
  43. package/dist/_internal/server/jobs/handlers/prizeRevealExpiry.js +58 -0
  44. package/dist/_internal/server/jobs/handlers/prizeRevealOpen.d.ts +10 -0
  45. package/dist/_internal/server/jobs/handlers/prizeRevealOpen.js +65 -0
  46. package/dist/_internal/server/jobs/handlers/prizeRevealReminder.d.ts +9 -0
  47. package/dist/_internal/server/jobs/handlers/prizeRevealReminder.js +45 -0
  48. package/dist/_internal/server/jobs/handlers/triggerEventRaffle.d.ts +30 -0
  49. package/dist/_internal/server/jobs/handlers/triggerEventRaffle.js +94 -0
  50. package/dist/_internal/shared/features/brands/schema.d.ts +3 -3
  51. package/dist/_internal/shared/features/cart/schema.d.ts +8 -8
  52. package/dist/_internal/shared/features/cart/schema.js +1 -1
  53. package/dist/_internal/shared/features/categories/bundle-config.d.ts +17 -0
  54. package/dist/_internal/shared/features/categories/bundle-config.js +17 -0
  55. package/dist/_internal/shared/features/layout/config.d.ts +35 -0
  56. package/dist/_internal/shared/features/layout/config.js +58 -0
  57. package/dist/_internal/shared/features/layout/index.d.ts +3 -0
  58. package/dist/_internal/shared/features/layout/index.js +2 -0
  59. package/dist/_internal/shared/features/layout/types.d.ts +137 -0
  60. package/dist/_internal/shared/features/layout/types.js +13 -0
  61. package/dist/_internal/shared/features/products/types.d.ts +1 -1
  62. package/dist/_internal/shared/listing-types/_registry.d.ts +57 -0
  63. package/dist/_internal/shared/listing-types/_registry.js +28 -0
  64. package/dist/_internal/shared/listing-types/auction/config.d.ts +7 -0
  65. package/dist/_internal/shared/listing-types/auction/config.js +8 -0
  66. package/dist/_internal/shared/listing-types/auction/ctas.d.ts +1 -0
  67. package/dist/_internal/shared/listing-types/auction/ctas.js +2 -0
  68. package/dist/_internal/shared/listing-types/auction/og.d.ts +1 -0
  69. package/dist/_internal/shared/listing-types/auction/og.js +1 -0
  70. package/dist/_internal/shared/listing-types/auction/schema.d.ts +1 -0
  71. package/dist/_internal/shared/listing-types/auction/schema.js +1 -0
  72. package/dist/_internal/shared/listing-types/auction/seed-factory.d.ts +1 -0
  73. package/dist/_internal/shared/listing-types/auction/seed-factory.js +1 -0
  74. package/dist/_internal/shared/listing-types/capabilities.d.ts +41 -0
  75. package/dist/_internal/shared/listing-types/capabilities.js +75 -0
  76. package/dist/_internal/shared/listing-types/pre-order/config.d.ts +7 -0
  77. package/dist/_internal/shared/listing-types/pre-order/config.js +8 -0
  78. package/dist/_internal/shared/listing-types/pre-order/ctas.d.ts +1 -0
  79. package/dist/_internal/shared/listing-types/pre-order/ctas.js +2 -0
  80. package/dist/_internal/shared/listing-types/pre-order/og.d.ts +1 -0
  81. package/dist/_internal/shared/listing-types/pre-order/og.js +1 -0
  82. package/dist/_internal/shared/listing-types/pre-order/schema.d.ts +1 -0
  83. package/dist/_internal/shared/listing-types/pre-order/schema.js +1 -0
  84. package/dist/_internal/shared/listing-types/pre-order/seed-factory.d.ts +1 -0
  85. package/dist/_internal/shared/listing-types/pre-order/seed-factory.js +1 -0
  86. package/dist/_internal/shared/listing-types/prize-draw/config.d.ts +7 -0
  87. package/dist/_internal/shared/listing-types/prize-draw/config.js +8 -0
  88. package/dist/_internal/shared/listing-types/prize-draw/ctas.d.ts +1 -0
  89. package/dist/_internal/shared/listing-types/prize-draw/ctas.js +2 -0
  90. package/dist/_internal/shared/listing-types/prize-draw/og.d.ts +1 -0
  91. package/dist/_internal/shared/listing-types/prize-draw/og.js +1 -0
  92. package/dist/_internal/shared/listing-types/prize-draw/schema.d.ts +1 -0
  93. package/dist/_internal/shared/listing-types/prize-draw/schema.js +1 -0
  94. package/dist/_internal/shared/listing-types/prize-draw/seed-factory.d.ts +1 -0
  95. package/dist/_internal/shared/listing-types/prize-draw/seed-factory.js +1 -0
  96. package/dist/_internal/shared/listing-types/standard/config.d.ts +7 -0
  97. package/dist/_internal/shared/listing-types/standard/config.js +8 -0
  98. package/dist/_internal/shared/listing-types/standard/ctas.d.ts +1 -0
  99. package/dist/_internal/shared/listing-types/standard/ctas.js +3 -0
  100. package/dist/_internal/shared/listing-types/standard/og.d.ts +1 -0
  101. package/dist/_internal/shared/listing-types/standard/og.js +1 -0
  102. package/dist/_internal/shared/listing-types/standard/schema.d.ts +1 -0
  103. package/dist/_internal/shared/listing-types/standard/schema.js +1 -0
  104. package/dist/_internal/shared/listing-types/standard/seed-factory.d.ts +1 -0
  105. package/dist/_internal/shared/listing-types/standard/seed-factory.js +1 -0
  106. package/dist/_internal/shared/media/limits.d.ts +33 -0
  107. package/dist/_internal/shared/media/limits.js +97 -0
  108. package/dist/_internal/shared/schema-versions.d.ts +76 -0
  109. package/dist/_internal/shared/schema-versions.js +82 -0
  110. package/dist/client.d.ts +9 -0
  111. package/dist/client.js +7 -0
  112. package/dist/constants/api-endpoints.d.ts +6 -3
  113. package/dist/constants/api-endpoints.js +2 -1
  114. package/dist/errors/messages.d.ts +1 -1
  115. package/dist/errors/messages.js +1 -1
  116. package/dist/features/account/migrations.d.ts +2 -0
  117. package/dist/features/account/migrations.js +10 -0
  118. package/dist/features/admin/components/AdminMediaView.js +1 -1
  119. package/dist/features/admin/components/AdminProductsView.js +7 -3
  120. package/dist/features/admin/migrations.d.ts +2 -0
  121. package/dist/features/admin/migrations.js +10 -0
  122. package/dist/features/admin/types/product.types.d.ts +1 -1
  123. package/dist/features/auctions/components/MarketplaceAuctionCard.d.ts +1 -1
  124. package/dist/features/auctions/migrations.d.ts +2 -0
  125. package/dist/features/auctions/migrations.js +10 -0
  126. package/dist/features/auctions/schemas/index.d.ts +3 -3
  127. package/dist/features/auctions/schemas/index.js +1 -1
  128. package/dist/features/auth/migrations.d.ts +2 -0
  129. package/dist/features/auth/migrations.js +10 -0
  130. package/dist/features/blog/migrations.d.ts +2 -0
  131. package/dist/features/blog/migrations.js +10 -0
  132. package/dist/features/brands/migrations.d.ts +2 -0
  133. package/dist/features/brands/migrations.js +10 -0
  134. package/dist/features/bundles/components/BundlesByCategoryListing.d.ts +6 -0
  135. package/dist/features/bundles/components/BundlesByCategoryListing.js +50 -0
  136. package/dist/features/bundles/components/index.d.ts +2 -0
  137. package/dist/features/bundles/components/index.js +1 -0
  138. package/dist/features/bundles/migrations.d.ts +2 -0
  139. package/dist/features/bundles/migrations.js +10 -0
  140. package/dist/features/bundles/schemas/index.d.ts +1 -0
  141. package/dist/features/bundles/schemas/index.js +1 -0
  142. package/dist/features/bundles/schemas/zod.d.ts +377 -0
  143. package/dist/features/bundles/schemas/zod.js +71 -0
  144. package/dist/features/cart/migrations.d.ts +2 -0
  145. package/dist/features/cart/migrations.js +10 -0
  146. package/dist/features/cart/schemas/firestore.d.ts +2 -2
  147. package/dist/features/categories/components/BrandDetailPageView.js +35 -4
  148. package/dist/features/categories/components/BrandDetailTabs.d.ts +5 -1
  149. package/dist/features/categories/components/BrandDetailTabs.js +22 -8
  150. package/dist/features/categories/components/CategoryBundlesListing.d.ts +6 -0
  151. package/dist/features/categories/components/CategoryBundlesListing.js +74 -0
  152. package/dist/features/categories/components/CategoryDetailPageView.js +29 -4
  153. package/dist/features/categories/components/CategoryDetailTabs.d.ts +5 -1
  154. package/dist/features/categories/components/CategoryDetailTabs.js +22 -8
  155. package/dist/features/categories/migrations.d.ts +2 -0
  156. package/dist/features/categories/migrations.js +10 -0
  157. package/dist/features/categories/repository/categories.repository.d.ts +29 -0
  158. package/dist/features/categories/repository/categories.repository.js +83 -0
  159. package/dist/features/categories/schemas/firestore.d.ts +59 -2
  160. package/dist/features/categories/schemas/firestore.js +6 -0
  161. package/dist/features/categories/types/index.d.ts +11 -3
  162. package/dist/features/events/migrations.d.ts +2 -0
  163. package/dist/features/events/migrations.js +10 -0
  164. package/dist/features/faq/migrations.d.ts +2 -0
  165. package/dist/features/faq/migrations.js +10 -0
  166. package/dist/features/grouped/migrations.d.ts +2 -0
  167. package/dist/features/grouped/migrations.js +10 -0
  168. package/dist/features/grouped/schemas/firestore.d.ts +29 -10
  169. package/dist/features/grouped/schemas/firestore.js +10 -5
  170. package/dist/features/history/migrations.d.ts +2 -0
  171. package/dist/features/history/migrations.js +10 -0
  172. package/dist/features/homepage/hooks/useFeaturedAuctions.js +2 -2
  173. package/dist/features/homepage/hooks/useFeaturedPreOrders.js +2 -2
  174. package/dist/features/homepage/lib/section-renderer.js +5 -3
  175. package/dist/features/media/AvatarUpload.js +6 -28
  176. package/dist/features/media/hooks/useMedia.d.ts +31 -15
  177. package/dist/features/media/hooks/useMedia.js +48 -13
  178. package/dist/features/media/upload/ImageUpload.js +1 -1
  179. package/dist/features/media/upload/MediaUploadField.js +1 -1
  180. package/dist/features/messages/migrations.d.ts +2 -0
  181. package/dist/features/messages/migrations.js +10 -0
  182. package/dist/features/orders/components/OrdersList.js +10 -1
  183. package/dist/features/orders/migrations.d.ts +2 -0
  184. package/dist/features/orders/migrations.js +10 -0
  185. package/dist/features/orders/repository/orders.repository.d.ts +16 -0
  186. package/dist/features/orders/repository/orders.repository.js +49 -0
  187. package/dist/features/orders/schemas/firestore.d.ts +8 -0
  188. package/dist/features/orders/types/index.d.ts +12 -0
  189. package/dist/features/orders/utils/order-splitter.d.ts +2 -2
  190. package/dist/features/orders/utils/order-splitter.js +5 -0
  191. package/dist/features/payments/migrations.d.ts +2 -0
  192. package/dist/features/payments/migrations.js +10 -0
  193. package/dist/features/pre-orders/components/PreOrderDetailPageView.js +4 -1
  194. package/dist/features/products/actions/product-actions.d.ts +1 -1
  195. package/dist/features/products/api/[id]/route.js +34 -0
  196. package/dist/features/products/api/route.js +1 -19
  197. package/dist/features/products/components/CompareOverlay.d.ts +1 -1
  198. package/dist/features/products/components/MarketplacePrizeDrawCard.d.ts +24 -0
  199. package/dist/features/products/components/MarketplacePrizeDrawCard.js +102 -0
  200. package/dist/features/products/components/PrizeDrawCollage.d.ts +32 -0
  201. package/dist/features/products/components/PrizeDrawCollage.js +22 -0
  202. package/dist/features/products/components/PrizeDrawDetailPageView.d.ts +27 -0
  203. package/dist/features/products/components/PrizeDrawDetailPageView.js +118 -0
  204. package/dist/features/products/components/PrizeDrawEntryActions.d.ts +19 -0
  205. package/dist/features/products/components/PrizeDrawEntryActions.js +48 -0
  206. package/dist/features/products/components/PrizeDrawItemsEditor.d.ts +13 -0
  207. package/dist/features/products/components/PrizeDrawItemsEditor.js +97 -0
  208. package/dist/features/products/components/PrizeDrawsIndexListing.d.ts +8 -0
  209. package/dist/features/products/components/PrizeDrawsIndexListing.js +128 -0
  210. package/dist/features/products/components/PrizeDrawsListingView.d.ts +15 -0
  211. package/dist/features/products/components/PrizeDrawsListingView.js +49 -0
  212. package/dist/features/products/components/PrizeRevealModal.d.ts +34 -0
  213. package/dist/features/products/components/PrizeRevealModal.js +124 -0
  214. package/dist/features/products/components/ProductDetailPageView.js +13 -1
  215. package/dist/features/products/components/ProductForm.js +35 -2
  216. package/dist/features/products/components/ProductGrid.js +3 -1
  217. package/dist/features/products/components/index.d.ts +16 -0
  218. package/dist/features/products/components/index.js +8 -0
  219. package/dist/features/products/constants/listing-tabs.d.ts +113 -0
  220. package/dist/features/products/constants/listing-tabs.js +43 -0
  221. package/dist/features/products/index.d.ts +1 -0
  222. package/dist/features/products/index.js +1 -0
  223. package/dist/features/products/migrations.d.ts +2 -0
  224. package/dist/features/products/migrations.js +10 -0
  225. package/dist/features/products/repository/products.repository.d.ts +11 -7
  226. package/dist/features/products/repository/products.repository.js +49 -24
  227. package/dist/features/products/schemas/firestore.d.ts +3 -3
  228. package/dist/features/products/schemas/firestore.js +2 -2
  229. package/dist/features/products/schemas/index.d.ts +5 -5
  230. package/dist/features/products/schemas/index.js +3 -1
  231. package/dist/features/products/schemas/product-features.validators.d.ts +6 -6
  232. package/dist/features/products/types/index.d.ts +17 -1
  233. package/dist/features/products/utils/listing-type.d.ts +7 -4
  234. package/dist/features/products/utils/listing-type.js +8 -4
  235. package/dist/features/promotions/actions/coupon-actions.d.ts +1 -1
  236. package/dist/features/promotions/hooks/useCouponValidate.d.ts +1 -1
  237. package/dist/features/promotions/migrations.d.ts +2 -0
  238. package/dist/features/promotions/migrations.js +10 -0
  239. package/dist/features/promotions/repository/coupons.repository.d.ts +1 -1
  240. package/dist/features/promotions/schemas/index.d.ts +2 -2
  241. package/dist/features/reviews/migrations.d.ts +2 -0
  242. package/dist/features/reviews/migrations.js +10 -0
  243. package/dist/features/scams/migrations.d.ts +2 -0
  244. package/dist/features/scams/migrations.js +10 -0
  245. package/dist/features/search/api/route.d.ts +1 -1
  246. package/dist/features/search/api/route.js +3 -3
  247. package/dist/features/search/components/Search.d.ts +1 -1
  248. package/dist/features/search/schemas/index.d.ts +3 -3
  249. package/dist/features/search/schemas/index.js +3 -1
  250. package/dist/features/search/types/index.d.ts +2 -2
  251. package/dist/features/seller/components/SellerProductShell.d.ts +1 -1
  252. package/dist/features/seller/components/SellerProductsView.js +20 -6
  253. package/dist/features/seller/migrations.d.ts +2 -0
  254. package/dist/features/seller/migrations.js +10 -0
  255. package/dist/features/seller/schemas/index.d.ts +2 -2
  256. package/dist/features/stores/components/StoreBundlesPageView.d.ts +12 -0
  257. package/dist/features/stores/components/StoreBundlesPageView.js +24 -0
  258. package/dist/features/stores/components/StoreDetailLayoutView.js +15 -3
  259. package/dist/features/stores/components/StorePrizeDrawsPageView.d.ts +11 -0
  260. package/dist/features/stores/components/StorePrizeDrawsPageView.js +27 -0
  261. package/dist/features/stores/components/index.d.ts +2 -0
  262. package/dist/features/stores/migrations.d.ts +2 -0
  263. package/dist/features/stores/migrations.js +10 -0
  264. package/dist/features/stores/schemas/index.d.ts +2 -2
  265. package/dist/features/stores/types/index.d.ts +1 -1
  266. package/dist/features/sublisting/migrations.d.ts +2 -0
  267. package/dist/features/sublisting/migrations.js +10 -0
  268. package/dist/features/sublisting/schemas/firestore.d.ts +2 -0
  269. package/dist/features/support/migrations.d.ts +2 -0
  270. package/dist/features/support/migrations.js +10 -0
  271. package/dist/features/wishlist/migrations.d.ts +2 -0
  272. package/dist/features/wishlist/migrations.js +10 -0
  273. package/dist/features/wishlist/types/index.d.ts +1 -1
  274. package/dist/index.d.ts +26 -18
  275. package/dist/index.js +41 -24
  276. package/dist/jobs.d.ts +1 -1
  277. package/dist/jobs.js +4 -0
  278. package/dist/next/routing/route-map.d.ts +4 -0
  279. package/dist/next/routing/route-map.js +2 -0
  280. package/dist/providers/db-firebase/filter-aliases.d.ts +2 -2
  281. package/dist/repositories/index.d.ts +0 -5
  282. package/dist/repositories/index.js +5 -4
  283. package/dist/seed/actions/demo-seed-actions.d.ts +1 -1
  284. package/dist/seed/categories-seed-data.js +1105 -6
  285. package/dist/seed/faq-seed-data.js +160 -0
  286. package/dist/seed/grouped-listings-seed-data.js +32 -32
  287. package/dist/seed/homepage-sections-seed-data.js +52 -6
  288. package/dist/seed/index.d.ts +1 -3
  289. package/dist/seed/index.js +4 -3
  290. package/dist/seed/manifest.js +8 -13
  291. package/dist/seed/products-prize-draws-seed-data.d.ts +17 -0
  292. package/dist/seed/products-prize-draws-seed-data.js +313 -0
  293. package/dist/seo/json-ld.d.ts +1 -1
  294. package/dist/server-entry.d.ts +2 -2
  295. package/dist/server-entry.js +5 -3
  296. package/dist/server.d.ts +9 -2
  297. package/dist/server.js +11 -5
  298. package/dist/tailwind-utilities.css +1 -1
  299. package/dist/validation/schemas.d.ts +8 -8
  300. package/package.json +1 -1
  301. package/scripts/seed-cli.mjs +2 -4
@@ -10,11 +10,9 @@ const PRODUCT_FIELDS = {
10
10
  FEATURED: "featured",
11
11
  CATEGORY: "category",
12
12
  SLUG: "slug",
13
- // SB1-G (S21 2026-05-12) — canonical discriminator. Boolean flags below kept
14
- // as deprecated aliases for any consumer code that hasn't migrated yet.
13
+ // SB1-G (S3 2026-05-13) — canonical discriminator. Legacy `isAuction` /
14
+ // `isPreOrder` boolean fields were removed in this session.
15
15
  LISTING_TYPE: "listingType",
16
- IS_AUCTION: "isAuction",
17
- IS_PRE_ORDER: "isPreOrder",
18
16
  PRE_ORDER_DELIVERY_DATE: "preOrderDeliveryDate",
19
17
  IS_PROMOTED: "isPromoted",
20
18
  AUCTION_END_DATE: "auctionEndDate",
@@ -37,16 +35,23 @@ const LISTING_TYPE_VALUES = {
37
35
  // clauses with single-field `listingType==X` clauses now that every doc
38
36
  // carries the discriminator.
39
37
  const SIEVE_CLAUSE_PUBLISHED = `${PRODUCT_FIELDS.STATUS}==${ProductStatusValues.PUBLISHED}`;
40
- const SIEVE_CLAUSE_IS_AUCTION = `${PRODUCT_FIELDS.LISTING_TYPE}==${LISTING_TYPE_VALUES.AUCTION}`;
41
- const SIEVE_CLAUSE_IS_PREORDER = `${PRODUCT_FIELDS.LISTING_TYPE}==${LISTING_TYPE_VALUES.PRE_ORDER}`;
42
- const SIEVE_CLAUSE_IS_STANDARD = `${PRODUCT_FIELDS.LISTING_TYPE}==${LISTING_TYPE_VALUES.STANDARD}`;
38
+ const SIEVE_CLAUSE_LT_AUCTION = `${PRODUCT_FIELDS.LISTING_TYPE}==${LISTING_TYPE_VALUES.AUCTION}`;
39
+ const SIEVE_CLAUSE_LT_PREORDER = `${PRODUCT_FIELDS.LISTING_TYPE}==${LISTING_TYPE_VALUES.PRE_ORDER}`;
40
+ const SIEVE_CLAUSE_LT_STANDARD = `${PRODUCT_FIELDS.LISTING_TYPE}==${LISTING_TYPE_VALUES.STANDARD}`;
41
+ const SIEVE_CLAUSE_LT_PRIZE_DRAW = `${PRODUCT_FIELDS.LISTING_TYPE}==${LISTING_TYPE_VALUES.PRIZE_DRAW}`;
42
+ const LISTING_KIND_ALIAS_MAP = {
43
+ standard: LISTING_TYPE_VALUES.STANDARD,
44
+ auction: LISTING_TYPE_VALUES.AUCTION,
45
+ "pre-order": LISTING_TYPE_VALUES.PRE_ORDER,
46
+ "prize-draw": LISTING_TYPE_VALUES.PRIZE_DRAW,
47
+ // Legacy → canonical.
48
+ product: LISTING_TYPE_VALUES.STANDARD,
49
+ preorder: LISTING_TYPE_VALUES.PRE_ORDER,
50
+ prizedraw: LISTING_TYPE_VALUES.PRIZE_DRAW,
51
+ };
52
+ const LISTING_KIND_ACCEPTED = new Set(Object.keys(LISTING_KIND_ALIAS_MAP));
43
53
  function buildListingKindClause(kind, inverted) {
44
- // Map the public alias tokens to canonical Firestore values.
45
- const canonical = kind === "auction"
46
- ? LISTING_TYPE_VALUES.AUCTION
47
- : kind === "preorder"
48
- ? LISTING_TYPE_VALUES.PRE_ORDER
49
- : LISTING_TYPE_VALUES.STANDARD;
54
+ const canonical = LISTING_KIND_ALIAS_MAP[kind];
50
55
  const op = inverted ? "!=" : "==";
51
56
  return `${PRODUCT_FIELDS.LISTING_TYPE}${op}${canonical}`;
52
57
  }
@@ -399,6 +404,21 @@ export class ProductRepository extends BaseRepository {
399
404
  updatedAt: serverTimestamp(),
400
405
  });
401
406
  }
407
+ /**
408
+ * SB6-C / SB4-H — atomically bump `prizeCurrentEntries` by `count`. The
409
+ * checkout transaction calls this after pool-cap validation; the reveal
410
+ * code-path uses it as a defence-in-depth check (already incremented at
411
+ * order create, so this is a no-op unless we shift accounting later).
412
+ */
413
+ incrementPrizeEntriesInBatch(batch, productId, count) {
414
+ batch.update(this.db.collection(this.collection).doc(productId), {
415
+ prizeCurrentEntries: increment(count),
416
+ updatedAt: serverTimestamp(),
417
+ });
418
+ }
419
+ productRef(productId) {
420
+ return this.db.collection(this.collection).doc(productId);
421
+ }
402
422
  }
403
423
  ProductRepository.CACHE_TTL_MS = 30000;
404
424
  ProductRepository.SIEVE_FIELDS = {
@@ -413,8 +433,7 @@ ProductRepository.SIEVE_FIELDS = {
413
433
  storeId: { canFilter: true, canSort: false },
414
434
  storeName: { canFilter: true, canSort: true },
415
435
  featured: { canFilter: true, canSort: false },
416
- isAuction: { canFilter: true, canSort: false },
417
- isPreOrder: { canFilter: true, canSort: false },
436
+ listingType: { canFilter: true, canSort: false },
418
437
  isPromoted: { canFilter: true, canSort: false },
419
438
  price: { canFilter: true, canSort: true },
420
439
  stockQuantity: { canFilter: true, canSort: true },
@@ -443,8 +462,8 @@ ProductRepository.SIEVE_FIELDS = {
443
462
  freeShipping: { canFilter: true, canSort: false },
444
463
  };
445
464
  /**
446
- * Virtual filter aliases — callers can pass `f=listingType==auction` instead
447
- * of `f=isAuction==true,isPreOrder==false`. The Sieve adapter expands the
465
+ * Virtual filter aliases — callers can pass `f=listingType==auction` for
466
+ * the canonical listing-kind discriminator. The Sieve adapter expands the
448
467
  * alias into real clauses before reaching Firestore.
449
468
  *
450
469
  * Adding a new alias here makes it usable everywhere `productRepository.list`
@@ -466,7 +485,11 @@ ProductRepository.FILTER_ALIASES = {
466
485
  listingType: (value, operator) => {
467
486
  if (operator !== "==" && operator !== "!=")
468
487
  return "";
469
- if (value !== "auction" && value !== "preorder" && value !== "product")
488
+ // Accept both canonical tokens (`standard`, `auction`, `pre-order`,
489
+ // `prize-draw`) and legacy aliases (`product`, `preorder`, `prizedraw`).
490
+ // `LISTING_KIND_ACCEPTED` is the single source of truth — keep it in
491
+ // sync with `LISTING_KIND_ALIAS_MAP`.
492
+ if (!LISTING_KIND_ACCEPTED.has(value))
470
493
  return "";
471
494
  return buildListingKindClause(value, operator === "!=");
472
495
  },
@@ -474,9 +497,9 @@ ProductRepository.FILTER_ALIASES = {
474
497
  * Public catalog scope shorthand. Maps a single token to the canonical
475
498
  * combination most public pages use.
476
499
  *
477
- * scope==publicProducts → status==published,isAuction==false,isPreOrder==false
478
- * scope==publicAuctions → status==published,isAuction==true
479
- * scope==publicPreorders → status==published,isPreOrder==true
500
+ * scope==publicProducts → status==published,listingType==standard
501
+ * scope==publicAuctions → status==published,listingType==auction
502
+ * scope==publicPreorders → status==published,listingType==pre-order
480
503
  * scope==published → status==published
481
504
  */
482
505
  scope: (value, operator) => {
@@ -484,11 +507,13 @@ ProductRepository.FILTER_ALIASES = {
484
507
  return "";
485
508
  switch (value) {
486
509
  case "publicProducts":
487
- return [SIEVE_CLAUSE_PUBLISHED, SIEVE_CLAUSE_IS_STANDARD].join(",");
510
+ return [SIEVE_CLAUSE_PUBLISHED, SIEVE_CLAUSE_LT_STANDARD].join(",");
488
511
  case "publicAuctions":
489
- return [SIEVE_CLAUSE_PUBLISHED, SIEVE_CLAUSE_IS_AUCTION].join(",");
512
+ return [SIEVE_CLAUSE_PUBLISHED, SIEVE_CLAUSE_LT_AUCTION].join(",");
490
513
  case "publicPreorders":
491
- return [SIEVE_CLAUSE_PUBLISHED, SIEVE_CLAUSE_IS_PREORDER].join(",");
514
+ return [SIEVE_CLAUSE_PUBLISHED, SIEVE_CLAUSE_LT_PREORDER].join(",");
515
+ case "publicPrizeDraws":
516
+ return [SIEVE_CLAUSE_PUBLISHED, SIEVE_CLAUSE_LT_PRIZE_DRAW].join(",");
492
517
  case "published":
493
518
  return SIEVE_CLAUSE_PUBLISHED;
494
519
  default:
@@ -111,7 +111,7 @@ export interface ProductDocument {
111
111
  * `where("listingType", "==", X)` against the `listingType+...` composite
112
112
  * indexes in `appkit/firebase/base/firestore.indexes.json`.
113
113
  */
114
- listingType: "standard" | "auction" | "pre-order" | "prize-draw" | "bundle";
114
+ listingType: "standard" | "auction" | "pre-order" | "prize-draw";
115
115
  /** Hard cap on units a single user may purchase (SB1-B; bundle/prize-draw). */
116
116
  maxPerUser?: number;
117
117
  /** Reverse pointers — bundle ids that include this product. */
@@ -172,8 +172,8 @@ export declare const productQueryHelpers: {
172
172
  readonly featured: () => readonly ["featured", "==", true];
173
173
  readonly published: () => readonly ["status", "==", "published"];
174
174
  readonly available: () => readonly ["availableQuantity", ">", 0];
175
- readonly auctions: () => readonly ["isAuction", "==", true];
176
- readonly preOrders: () => readonly ["isPreOrder", "==", true];
175
+ readonly auctions: () => readonly ["listingType", "==", "auction"];
176
+ readonly preOrders: () => readonly ["listingType", "==", "pre-order"];
177
177
  readonly promoted: () => readonly ["isPromoted", "==", true];
178
178
  readonly activeAuction: (date: Date) => readonly ["auctionEndDate", ">=", Date];
179
179
  };
@@ -158,8 +158,8 @@ export const productQueryHelpers = {
158
158
  featured: () => ["featured", "==", true],
159
159
  published: () => ["status", "==", "published"],
160
160
  available: () => ["availableQuantity", ">", 0],
161
- auctions: () => ["isAuction", "==", true],
162
- preOrders: () => ["isPreOrder", "==", true],
161
+ auctions: () => ["listingType", "==", "auction"],
162
+ preOrders: () => ["listingType", "==", "pre-order"],
163
163
  promoted: () => ["isPromoted", "==", true],
164
164
  activeAuction: (date) => ["auctionEndDate", ">=", date],
165
165
  };
@@ -309,7 +309,7 @@ export declare const productItemSchema: z.ZodObject<{
309
309
  rating?: number | undefined;
310
310
  description?: string | undefined;
311
311
  featured?: boolean | undefined;
312
- listingType?: "auction" | "standard" | "pre-order" | "prize-draw" | "bundle" | undefined;
312
+ listingType?: "auction" | "standard" | "prize-draw" | "pre-order" | "bundle" | undefined;
313
313
  isPromoted?: boolean | undefined;
314
314
  slug?: string | undefined;
315
315
  subcategory?: string | undefined;
@@ -438,7 +438,7 @@ export declare const productItemSchema: z.ZodObject<{
438
438
  rating?: number | undefined;
439
439
  description?: string | undefined;
440
440
  featured?: boolean | undefined;
441
- listingType?: "auction" | "standard" | "pre-order" | "prize-draw" | "bundle" | undefined;
441
+ listingType?: "auction" | "standard" | "prize-draw" | "pre-order" | "bundle" | undefined;
442
442
  isPromoted?: boolean | undefined;
443
443
  slug?: string | undefined;
444
444
  subcategory?: string | undefined;
@@ -551,7 +551,7 @@ export declare const productListParamsSchema: z.ZodObject<{
551
551
  minPrice: z.ZodOptional<z.ZodNumber>;
552
552
  maxPrice: z.ZodOptional<z.ZodNumber>;
553
553
  inStock: z.ZodOptional<z.ZodBoolean>;
554
- isAuction: z.ZodOptional<z.ZodBoolean>;
554
+ listingType: z.ZodOptional<z.ZodEnum<["standard", "auction", "pre-order", "prize-draw", "bundle"]>>;
555
555
  storeId: z.ZodOptional<z.ZodString>;
556
556
  sort: z.ZodOptional<z.ZodString>;
557
557
  page: z.ZodOptional<z.ZodNumber>;
@@ -568,8 +568,8 @@ export declare const productListParamsSchema: z.ZodObject<{
568
568
  minPrice?: number | undefined;
569
569
  maxPrice?: number | undefined;
570
570
  featured?: boolean | undefined;
571
+ listingType?: "auction" | "standard" | "prize-draw" | "pre-order" | "bundle" | undefined;
571
572
  condition?: "new" | "used" | "refurbished" | "fair" | "good" | "like_new" | "poor" | "broken" | undefined;
572
- isAuction?: boolean | undefined;
573
573
  inStock?: boolean | undefined;
574
574
  }, {
575
575
  sort?: string | undefined;
@@ -582,7 +582,7 @@ export declare const productListParamsSchema: z.ZodObject<{
582
582
  minPrice?: number | undefined;
583
583
  maxPrice?: number | undefined;
584
584
  featured?: boolean | undefined;
585
+ listingType?: "auction" | "standard" | "prize-draw" | "pre-order" | "bundle" | undefined;
585
586
  condition?: "new" | "used" | "refurbished" | "fair" | "good" | "like_new" | "poor" | "broken" | undefined;
586
- isAuction?: boolean | undefined;
587
587
  inStock?: boolean | undefined;
588
588
  }>;
@@ -214,7 +214,9 @@ export const productListParamsSchema = z.object({
214
214
  minPrice: z.coerce.number().optional(),
215
215
  maxPrice: z.coerce.number().optional(),
216
216
  inStock: z.coerce.boolean().optional(),
217
- isAuction: z.coerce.boolean().optional(),
217
+ listingType: z
218
+ .enum(["standard", "auction", "pre-order", "prize-draw", "bundle"])
219
+ .optional(),
218
220
  storeId: z.string().optional(),
219
221
  sort: z.string().optional(),
220
222
  page: z.coerce.number().optional(),
@@ -27,8 +27,8 @@ export declare const productFeatureAdminCreateSchema: z.ZodObject<{
27
27
  icon: string;
28
28
  isActive: boolean;
29
29
  category: "seller" | "auction" | "preorder" | "shipping" | "custom" | "condition" | "platform";
30
- displayOrder: number;
31
30
  productTypes: ("all" | "product" | "auction" | "preorder")[];
31
+ displayOrder: number;
32
32
  storeId?: string | undefined;
33
33
  description?: string | undefined;
34
34
  iconColor?: string | undefined;
@@ -38,8 +38,8 @@ export declare const productFeatureAdminCreateSchema: z.ZodObject<{
38
38
  icon: string;
39
39
  isActive: boolean;
40
40
  category: "seller" | "auction" | "preorder" | "shipping" | "custom" | "condition" | "platform";
41
- displayOrder: number;
42
41
  productTypes: ("all" | "product" | "auction" | "preorder")[];
42
+ displayOrder: number;
43
43
  storeId?: string | undefined;
44
44
  description?: string | undefined;
45
45
  iconColor?: string | undefined;
@@ -59,8 +59,8 @@ export declare const productFeatureStoreCreateSchema: z.ZodObject<{
59
59
  icon: string;
60
60
  isActive: boolean;
61
61
  category: "seller" | "auction" | "preorder" | "shipping" | "custom" | "condition" | "platform";
62
- displayOrder: number;
63
62
  productTypes: ("all" | "product" | "auction" | "preorder")[];
63
+ displayOrder: number;
64
64
  description?: string | undefined;
65
65
  iconColor?: string | undefined;
66
66
  }, {
@@ -68,8 +68,8 @@ export declare const productFeatureStoreCreateSchema: z.ZodObject<{
68
68
  icon: string;
69
69
  isActive: boolean;
70
70
  category: "seller" | "auction" | "preorder" | "shipping" | "custom" | "condition" | "platform";
71
- displayOrder: number;
72
71
  productTypes: ("all" | "product" | "auction" | "preorder")[];
72
+ displayOrder: number;
73
73
  description?: string | undefined;
74
74
  iconColor?: string | undefined;
75
75
  }>;
@@ -90,8 +90,8 @@ export declare const productFeatureUpdateSchema: z.ZodObject<{
90
90
  category?: "seller" | "auction" | "preorder" | "shipping" | "custom" | "condition" | "platform" | undefined;
91
91
  description?: string | undefined;
92
92
  iconColor?: string | undefined;
93
- displayOrder?: number | undefined;
94
93
  productTypes?: ("all" | "product" | "auction" | "preorder")[] | undefined;
94
+ displayOrder?: number | undefined;
95
95
  }, {
96
96
  label?: string | undefined;
97
97
  icon?: string | undefined;
@@ -99,8 +99,8 @@ export declare const productFeatureUpdateSchema: z.ZodObject<{
99
99
  category?: "seller" | "auction" | "preorder" | "shipping" | "custom" | "condition" | "platform" | undefined;
100
100
  description?: string | undefined;
101
101
  iconColor?: string | undefined;
102
- displayOrder?: number | undefined;
103
102
  productTypes?: ("all" | "product" | "auction" | "preorder")[] | undefined;
103
+ displayOrder?: number | undefined;
104
104
  }>;
105
105
  export type ProductFeatureAdminCreatePayload = z.infer<typeof productFeatureAdminCreateSchema>;
106
106
  export type ProductFeatureStoreCreatePayload = z.infer<typeof productFeatureStoreCreateSchema>;
@@ -10,7 +10,7 @@ export type ProductCondition = "new" | "like_new" | "good" | "fair" | "poor" | "
10
10
  * accepts legacy alias tokens (`preorder` → `pre-order`, `product` → `standard`)
11
11
  * but stored values are always one of these five.
12
12
  */
13
- export type ListingType = "standard" | "auction" | "pre-order" | "prize-draw" | "bundle";
13
+ export type ListingType = "standard" | "auction" | "pre-order" | "prize-draw";
14
14
  export interface ProductImage {
15
15
  url: string;
16
16
  thumbnailUrl?: string;
@@ -49,6 +49,12 @@ export interface ProductItem {
49
49
  condition?: ProductCondition;
50
50
  /** Canonical listing-kind discriminator (SB1-G Phase 4 — booleans removed). */
51
51
  listingType?: ListingType;
52
+ /** Reverse refs maintained by the bundles repository (SB3) — IDs of every
53
+ * bundle whose `bundleItems[]` includes this product. Powers the "In bundle"
54
+ * badge on cards (SB7-A) + detail pages (SB7-B). */
55
+ partOfBundleIds?: string[];
56
+ /** Parallel array of titles — same length + index as `partOfBundleIds`. */
57
+ partOfBundleTitles?: string[];
52
58
  sublistingCategoryId?: string;
53
59
  groupId?: string;
54
60
  isGroupParent?: boolean;
@@ -109,6 +115,16 @@ export interface ProductItem {
109
115
  preOrderCurrentCount?: number;
110
116
  preOrderProductionStatus?: "upcoming" | "in_production" | "ready_to_ship";
111
117
  preOrderCancellable?: boolean;
118
+ prizeDrawItems?: import("../schemas/firestore").PrizeDrawItem[];
119
+ pricePerEntry?: number;
120
+ prizeMaxEntries?: number;
121
+ prizeCurrentEntries?: number;
122
+ prizeRevealWindowStart?: string | Date;
123
+ prizeRevealWindowEnd?: string | Date;
124
+ prizeRevealStatus?: "pending" | "open" | "closed";
125
+ prizeRevealDeadlineDays?: number;
126
+ prizeGithubFileUrl?: string;
127
+ maxPerUser?: number;
112
128
  /** Winner's display name for ended auctions — shown masked in public UI */
113
129
  winnerDisplayName?: string;
114
130
  viewCount?: number;
@@ -1,9 +1,9 @@
1
1
  import type { ListingType } from "../types/index";
2
2
  /**
3
- * Canonical accessor for the listing-kind discriminator. SB1-G Phase 4
4
- * (S22 2026-05-12) made `listingType` the single source of truth on every
5
- * `ProductDocument` / `ProductItem` the legacy `isAuction` / `isPreOrder`
6
- * booleans were removed in the same session.
3
+ * Canonical accessor for the listing-kind discriminator. `listingType` is the
4
+ * single source of truth on every `ProductDocument` / `ProductItem` — the
5
+ * legacy `isAuction` / `isPreOrder` booleans were removed in S3 (SB1-G final,
6
+ * 2026-05-13).
7
7
  *
8
8
  * Returns `"standard"` when the input is undefined or missing the field, so
9
9
  * legacy payloads still classify safely without a separate guard.
@@ -21,3 +21,6 @@ export declare const isPreOrderListing: (input?: {
21
21
  export declare const isStandardListing: (input?: {
22
22
  listingType?: ListingType;
23
23
  }) => boolean;
24
+ export declare const isPrizeDrawListing: (input?: {
25
+ listingType?: ListingType;
26
+ }) => boolean;
@@ -1,8 +1,8 @@
1
1
  /**
2
- * Canonical accessor for the listing-kind discriminator. SB1-G Phase 4
3
- * (S22 2026-05-12) made `listingType` the single source of truth on every
4
- * `ProductDocument` / `ProductItem` the legacy `isAuction` / `isPreOrder`
5
- * booleans were removed in the same session.
2
+ * Canonical accessor for the listing-kind discriminator. `listingType` is the
3
+ * single source of truth on every `ProductDocument` / `ProductItem` — the
4
+ * legacy `isAuction` / `isPreOrder` booleans were removed in S3 (SB1-G final,
5
+ * 2026-05-13).
6
6
  *
7
7
  * Returns `"standard"` when the input is undefined or missing the field, so
8
8
  * legacy payloads still classify safely without a separate guard.
@@ -14,3 +14,7 @@ export function normalizeListingType(input) {
14
14
  export const isAuctionListing = (input) => normalizeListingType(input) === "auction";
15
15
  export const isPreOrderListing = (input) => normalizeListingType(input) === "pre-order";
16
16
  export const isStandardListing = (input) => normalizeListingType(input) === "standard";
17
+ export const isPrizeDrawListing = (input) => normalizeListingType(input) === "prize-draw";
18
+ // SB-UNI-D — isBundleListing removed. Bundles are now a categoryType
19
+ // discriminator on CategoryDocument; consumers should query
20
+ // `categoriesRepository.findBySlugAndType(slug, "bundle")` instead.
@@ -22,7 +22,7 @@ export type CouponCartItem = {
22
22
  price: number;
23
23
  quantity: number;
24
24
  /** Canonical listing-kind snapshot (SB1-G Phase 4). */
25
- listingType: "standard" | "auction" | "pre-order" | "prize-draw" | "bundle";
25
+ listingType: "standard" | "auction" | "pre-order" | "prize-draw";
26
26
  };
27
27
  export declare function validateCoupon(userId: string, code: string, orderTotal: number): Promise<CouponValidationResult>;
28
28
  export declare function validateCouponForCart(userId: string, code: string, cartItems: CouponCartItem[]): Promise<CouponCartValidationResult>;
@@ -7,7 +7,7 @@ interface ValidateCouponPayload {
7
7
  price: number;
8
8
  quantity: number;
9
9
  /** Canonical listing-kind snapshot (SB1-G Phase 4). */
10
- listingType?: "standard" | "auction" | "pre-order" | "prize-draw" | "bundle";
10
+ listingType?: "standard" | "auction" | "pre-order" | "prize-draw";
11
11
  }>;
12
12
  }
13
13
  interface ValidateCouponResult {
@@ -0,0 +1,2 @@
1
+ import type { MigrationStep } from "../../_internal/shared/schema-versions";
2
+ export declare const migrations: Record<number, MigrationStep<any>>;
@@ -0,0 +1,10 @@
1
+ // SB-UNI X3 — migrations shell for coupon/couponUsage.
2
+ // v1 schema is current; no migrations needed yet.
3
+ //
4
+ // To add a migration:
5
+ // 1. Bump the relevant SCHEMA_VERSIONS entry in
6
+ // `_internal/shared/schema-versions.ts` (e.g. `promotions: 2`)
7
+ // 2. Add a row below keyed by the FROM-version, returning the upgraded doc
8
+ // 3. Repository wraps reads with `migrateDocument(doc, current, migrations)`
9
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
10
+ export const migrations = {};
@@ -140,7 +140,7 @@ export declare class CouponsRepository extends BaseRepository<CouponDocument> {
140
140
  price: number;
141
141
  quantity: number;
142
142
  /** Canonical listing-kind snapshot (SB1-G Phase 4). */
143
- listingType: "standard" | "auction" | "pre-order" | "prize-draw" | "bundle";
143
+ listingType: "standard" | "auction" | "pre-order" | "prize-draw";
144
144
  }>): Promise<{
145
145
  valid: boolean;
146
146
  coupon?: CouponDocument;
@@ -47,8 +47,8 @@ export declare const couponItemSchema: z.ZodObject<{
47
47
  scope: "admin" | "seller";
48
48
  name: string;
49
49
  isActive: boolean;
50
- description: string;
51
50
  isPublic: boolean;
51
+ description: string;
52
52
  discountValue: number;
53
53
  usageCount: number;
54
54
  storeId?: string | undefined;
@@ -71,8 +71,8 @@ export declare const couponItemSchema: z.ZodObject<{
71
71
  scope: "admin" | "seller";
72
72
  name: string;
73
73
  isActive: boolean;
74
- description: string;
75
74
  isPublic: boolean;
75
+ description: string;
76
76
  discountValue: number;
77
77
  usageCount: number;
78
78
  storeId?: string | undefined;
@@ -0,0 +1,2 @@
1
+ import type { MigrationStep } from "../../_internal/shared/schema-versions";
2
+ export declare const migrations: Record<number, MigrationStep<any>>;
@@ -0,0 +1,10 @@
1
+ // SB-UNI X3 — migrations shell for review.
2
+ // v1 schema is current; no migrations needed yet.
3
+ //
4
+ // To add a migration:
5
+ // 1. Bump the relevant SCHEMA_VERSIONS entry in
6
+ // `_internal/shared/schema-versions.ts` (e.g. `reviews: 2`)
7
+ // 2. Add a row below keyed by the FROM-version, returning the upgraded doc
8
+ // 3. Repository wraps reads with `migrateDocument(doc, current, migrations)`
9
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
10
+ export const migrations = {};
@@ -0,0 +1,2 @@
1
+ import type { MigrationStep } from "../../_internal/shared/schema-versions";
2
+ export declare const migrations: Record<number, MigrationStep<any>>;
@@ -0,0 +1,10 @@
1
+ // SB-UNI X3 — migrations shell for scammer/incident/comment/contest.
2
+ // v1 schema is current; no migrations needed yet.
3
+ //
4
+ // To add a migration:
5
+ // 1. Bump the relevant SCHEMA_VERSIONS entry in
6
+ // `_internal/shared/schema-versions.ts` (e.g. `scams: 2`)
7
+ // 2. Add a row below keyed by the FROM-version, returning the upgraded doc
8
+ // 3. Repository wraps reads with `migrateDocument(doc, current, migrations)`
9
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
10
+ export const migrations = {};
@@ -9,7 +9,7 @@
9
9
  *
10
10
  * Performs Sieve-based product search via SearchRepository.
11
11
  * Supports: q, category, subcategory, minPrice, maxPrice, condition,
12
- * isAuction, isPreOrder, inStock, minRating, sort, page, pageSize.
12
+ * listingType, inStock, minRating, sort, page, pageSize.
13
13
  *
14
14
  * Note: external search providers are not built into this route. To enable one,
15
15
  * register an ISearchProvider via registerProviders() and handle it at
@@ -9,7 +9,7 @@
9
9
  *
10
10
  * Performs Sieve-based product search via SearchRepository.
11
11
  * Supports: q, category, subcategory, minPrice, maxPrice, condition,
12
- * isAuction, isPreOrder, inStock, minRating, sort, page, pageSize.
12
+ * listingType, inStock, minRating, sort, page, pageSize.
13
13
  *
14
14
  * Note: external search providers are not built into this route. To enable one,
15
15
  * register an ISearchProvider via registerProviders() and handle it at
@@ -37,14 +37,14 @@ export async function GET(request) {
37
37
  if (!db) {
38
38
  return NextResponse.json({ success: false, error: "Database provider not registered" }, { status: 503 });
39
39
  }
40
- // SB1-G Phase 4 — canonical `?listingType=auction|pre-order|standard|prize-draw|bundle`.
40
+ // SB1-G Phase 4 — canonical `?listingType=auction|pre-order|standard|prize-draw`.
41
+ // SB-UNI-D — "bundle" removed; bundles are a categoryType, not a listingType.
41
42
  const listingTypeRaw = param(url, "listingType");
42
43
  const VALID_LISTING_TYPES = new Set([
43
44
  "standard",
44
45
  "auction",
45
46
  "pre-order",
46
47
  "prize-draw",
47
- "bundle",
48
48
  ]);
49
49
  const listingType = listingTypeRaw && VALID_LISTING_TYPES.has(listingTypeRaw)
50
50
  ? listingTypeRaw
@@ -1,6 +1,6 @@
1
1
  import type { LucideIcon } from "lucide-react";
2
2
  import type { NavSuggestionRecord } from "../hooks/useNavSuggestions";
3
- export type SearchResourceType = "products" | "auctions" | "pre-orders" | "stores" | "categories" | "brands" | "events" | "blog" | "faqs";
3
+ export type SearchResourceType = "products" | "auctions" | "pre-orders" | "prize-draws" | "bundles" | "stores" | "categories" | "brands" | "events" | "blog" | "faqs";
4
4
  export interface SearchResourceTypeOption {
5
5
  value: SearchResourceType;
6
6
  label: string;
@@ -17,7 +17,7 @@ export declare const searchProductItemSchema: z.ZodObject<{
17
17
  mainImage: z.ZodOptional<z.ZodString>;
18
18
  status: z.ZodOptional<z.ZodString>;
19
19
  featured: z.ZodOptional<z.ZodBoolean>;
20
- isAuction: z.ZodOptional<z.ZodBoolean>;
20
+ listingType: z.ZodOptional<z.ZodEnum<["standard", "auction", "pre-order", "prize-draw", "bundle"]>>;
21
21
  isPromoted: z.ZodOptional<z.ZodBoolean>;
22
22
  slug: z.ZodString;
23
23
  }, "strip", z.ZodTypeAny, {
@@ -28,9 +28,9 @@ export declare const searchProductItemSchema: z.ZodObject<{
28
28
  status?: string | undefined;
29
29
  price?: number | undefined;
30
30
  featured?: boolean | undefined;
31
+ listingType?: "auction" | "standard" | "prize-draw" | "pre-order" | "bundle" | undefined;
31
32
  isPromoted?: boolean | undefined;
32
33
  mainImage?: string | undefined;
33
- isAuction?: boolean | undefined;
34
34
  }, {
35
35
  id: string;
36
36
  title: string;
@@ -39,9 +39,9 @@ export declare const searchProductItemSchema: z.ZodObject<{
39
39
  status?: string | undefined;
40
40
  price?: number | undefined;
41
41
  featured?: boolean | undefined;
42
+ listingType?: "auction" | "standard" | "prize-draw" | "pre-order" | "bundle" | undefined;
42
43
  isPromoted?: boolean | undefined;
43
44
  mainImage?: string | undefined;
44
- isAuction?: boolean | undefined;
45
45
  }>;
46
46
  /**
47
47
  * Form/query schema for a search request.
@@ -17,7 +17,9 @@ export const searchProductItemSchema = z.object({
17
17
  mainImage: z.string().optional(),
18
18
  status: z.string().optional(),
19
19
  featured: z.boolean().optional(),
20
- isAuction: z.boolean().optional(),
20
+ listingType: z
21
+ .enum(["standard", "auction", "pre-order", "prize-draw", "bundle"])
22
+ .optional(),
21
23
  isPromoted: z.boolean().optional(),
22
24
  slug: z.string(),
23
25
  });
@@ -9,7 +9,7 @@ export interface SearchProductItem {
9
9
  status: string;
10
10
  featured?: boolean;
11
11
  /** Canonical listing-kind discriminator (SB1-G Phase 4). */
12
- listingType?: "standard" | "auction" | "pre-order" | "prize-draw" | "bundle";
12
+ listingType?: "standard" | "auction" | "pre-order" | "prize-draw";
13
13
  currentBid?: number;
14
14
  isPromoted?: boolean;
15
15
  slug: string;
@@ -32,7 +32,7 @@ export interface SearchQuery {
32
32
  maxPrice?: number;
33
33
  condition?: string;
34
34
  /** Canonical listing-kind discriminator (SB1-G Phase 4). */
35
- listingType?: "standard" | "auction" | "pre-order" | "prize-draw" | "bundle";
35
+ listingType?: "standard" | "auction" | "pre-order" | "prize-draw";
36
36
  inStock?: boolean;
37
37
  minRating?: number;
38
38
  sort?: string;
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
- export type ProductListingMode = "standard" | "auction" | "pre-order";
2
+ export type ProductListingMode = "standard" | "auction" | "pre-order" | "prize-draw";
3
3
  export interface SellerProductDraft {
4
4
  title?: string;
5
5
  slug?: string;