@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.
- package/dist/_internal/client/features/layout/DashboardLayoutClient.d.ts +38 -0
- package/dist/_internal/client/features/layout/DashboardLayoutClient.js +75 -0
- package/dist/_internal/client/features/layout/RoleGuard.d.ts +15 -0
- package/dist/_internal/client/features/layout/RoleGuard.js +25 -0
- package/dist/_internal/client/features/layout/index.d.ts +5 -0
- package/dist/_internal/client/features/layout/index.js +4 -0
- package/dist/_internal/server/features/brands/actions.d.ts +3 -3
- package/dist/_internal/server/features/brands/actions.js +72 -5
- package/dist/_internal/server/features/brands/data.d.ts +8 -8
- package/dist/_internal/server/features/brands/data.js +10 -11
- package/dist/_internal/server/features/brands/service.d.ts +2 -2
- package/dist/_internal/server/features/brands/service.js +5 -5
- package/dist/_internal/server/features/categories/og.d.ts +33 -0
- package/dist/_internal/server/features/categories/og.js +75 -0
- package/dist/_internal/server/features/checkout/actions.d.ts +24 -0
- package/dist/_internal/server/features/checkout/actions.js +442 -13
- package/dist/_internal/server/features/checkout/index.d.ts +1 -1
- package/dist/_internal/server/features/checkout/index.js +1 -1
- package/dist/_internal/server/features/checkout/prize-bundle-gates.d.ts +59 -0
- package/dist/_internal/server/features/checkout/prize-bundle-gates.js +99 -0
- package/dist/_internal/server/features/grouped/data.js +12 -5
- package/dist/_internal/server/features/homepage/data.d.ts +1 -1
- package/dist/_internal/server/features/homepage/data.js +2 -2
- package/dist/_internal/server/features/media/contextGuards.d.ts +52 -0
- package/dist/_internal/server/features/media/contextGuards.js +198 -0
- package/dist/_internal/server/features/orders/adapters.js +12 -0
- package/dist/_internal/server/features/products/data.d.ts +1 -1
- package/dist/_internal/server/features/sublisting-categories/data.d.ts +1 -1
- package/dist/_internal/server/features/sublisting-categories/data.js +2 -2
- package/dist/_internal/server/jobs/handlers/assignSpinPrize.d.ts +24 -0
- package/dist/_internal/server/jobs/handlers/assignSpinPrize.js +86 -0
- package/dist/_internal/server/jobs/handlers/bundleStockSync.d.ts +18 -0
- package/dist/_internal/server/jobs/handlers/bundleStockSync.js +80 -0
- package/dist/_internal/server/jobs/handlers/index.d.ts +8 -0
- package/dist/_internal/server/jobs/handlers/index.js +13 -0
- package/dist/_internal/server/jobs/handlers/listingProcessor.js +13 -3
- package/dist/_internal/server/jobs/handlers/onProductStockChange.d.ts +17 -0
- package/dist/_internal/server/jobs/handlers/onProductStockChange.js +136 -0
- package/dist/_internal/server/jobs/handlers/onProductWrite.js +17 -1
- package/dist/_internal/server/jobs/handlers/prizeRevealClose.d.ts +9 -0
- package/dist/_internal/server/jobs/handlers/prizeRevealClose.js +29 -0
- package/dist/_internal/server/jobs/handlers/prizeRevealExpiry.d.ts +10 -0
- package/dist/_internal/server/jobs/handlers/prizeRevealExpiry.js +58 -0
- package/dist/_internal/server/jobs/handlers/prizeRevealOpen.d.ts +10 -0
- package/dist/_internal/server/jobs/handlers/prizeRevealOpen.js +65 -0
- package/dist/_internal/server/jobs/handlers/prizeRevealReminder.d.ts +9 -0
- package/dist/_internal/server/jobs/handlers/prizeRevealReminder.js +45 -0
- package/dist/_internal/server/jobs/handlers/triggerEventRaffle.d.ts +30 -0
- package/dist/_internal/server/jobs/handlers/triggerEventRaffle.js +94 -0
- package/dist/_internal/shared/features/brands/schema.d.ts +3 -3
- package/dist/_internal/shared/features/cart/schema.d.ts +8 -8
- package/dist/_internal/shared/features/cart/schema.js +1 -1
- package/dist/_internal/shared/features/categories/bundle-config.d.ts +17 -0
- package/dist/_internal/shared/features/categories/bundle-config.js +17 -0
- package/dist/_internal/shared/features/layout/config.d.ts +35 -0
- package/dist/_internal/shared/features/layout/config.js +58 -0
- package/dist/_internal/shared/features/layout/index.d.ts +3 -0
- package/dist/_internal/shared/features/layout/index.js +2 -0
- package/dist/_internal/shared/features/layout/types.d.ts +137 -0
- package/dist/_internal/shared/features/layout/types.js +13 -0
- package/dist/_internal/shared/features/products/types.d.ts +1 -1
- package/dist/_internal/shared/listing-types/_registry.d.ts +57 -0
- package/dist/_internal/shared/listing-types/_registry.js +28 -0
- package/dist/_internal/shared/listing-types/auction/config.d.ts +7 -0
- package/dist/_internal/shared/listing-types/auction/config.js +8 -0
- package/dist/_internal/shared/listing-types/auction/ctas.d.ts +1 -0
- package/dist/_internal/shared/listing-types/auction/ctas.js +2 -0
- package/dist/_internal/shared/listing-types/auction/og.d.ts +1 -0
- package/dist/_internal/shared/listing-types/auction/og.js +1 -0
- package/dist/_internal/shared/listing-types/auction/schema.d.ts +1 -0
- package/dist/_internal/shared/listing-types/auction/schema.js +1 -0
- package/dist/_internal/shared/listing-types/auction/seed-factory.d.ts +1 -0
- package/dist/_internal/shared/listing-types/auction/seed-factory.js +1 -0
- package/dist/_internal/shared/listing-types/capabilities.d.ts +41 -0
- package/dist/_internal/shared/listing-types/capabilities.js +75 -0
- package/dist/_internal/shared/listing-types/pre-order/config.d.ts +7 -0
- package/dist/_internal/shared/listing-types/pre-order/config.js +8 -0
- package/dist/_internal/shared/listing-types/pre-order/ctas.d.ts +1 -0
- package/dist/_internal/shared/listing-types/pre-order/ctas.js +2 -0
- package/dist/_internal/shared/listing-types/pre-order/og.d.ts +1 -0
- package/dist/_internal/shared/listing-types/pre-order/og.js +1 -0
- package/dist/_internal/shared/listing-types/pre-order/schema.d.ts +1 -0
- package/dist/_internal/shared/listing-types/pre-order/schema.js +1 -0
- package/dist/_internal/shared/listing-types/pre-order/seed-factory.d.ts +1 -0
- package/dist/_internal/shared/listing-types/pre-order/seed-factory.js +1 -0
- package/dist/_internal/shared/listing-types/prize-draw/config.d.ts +7 -0
- package/dist/_internal/shared/listing-types/prize-draw/config.js +8 -0
- package/dist/_internal/shared/listing-types/prize-draw/ctas.d.ts +1 -0
- package/dist/_internal/shared/listing-types/prize-draw/ctas.js +2 -0
- package/dist/_internal/shared/listing-types/prize-draw/og.d.ts +1 -0
- package/dist/_internal/shared/listing-types/prize-draw/og.js +1 -0
- package/dist/_internal/shared/listing-types/prize-draw/schema.d.ts +1 -0
- package/dist/_internal/shared/listing-types/prize-draw/schema.js +1 -0
- package/dist/_internal/shared/listing-types/prize-draw/seed-factory.d.ts +1 -0
- package/dist/_internal/shared/listing-types/prize-draw/seed-factory.js +1 -0
- package/dist/_internal/shared/listing-types/standard/config.d.ts +7 -0
- package/dist/_internal/shared/listing-types/standard/config.js +8 -0
- package/dist/_internal/shared/listing-types/standard/ctas.d.ts +1 -0
- package/dist/_internal/shared/listing-types/standard/ctas.js +3 -0
- package/dist/_internal/shared/listing-types/standard/og.d.ts +1 -0
- package/dist/_internal/shared/listing-types/standard/og.js +1 -0
- package/dist/_internal/shared/listing-types/standard/schema.d.ts +1 -0
- package/dist/_internal/shared/listing-types/standard/schema.js +1 -0
- package/dist/_internal/shared/listing-types/standard/seed-factory.d.ts +1 -0
- package/dist/_internal/shared/listing-types/standard/seed-factory.js +1 -0
- package/dist/_internal/shared/media/limits.d.ts +33 -0
- package/dist/_internal/shared/media/limits.js +97 -0
- package/dist/_internal/shared/schema-versions.d.ts +76 -0
- package/dist/_internal/shared/schema-versions.js +82 -0
- package/dist/client.d.ts +9 -0
- package/dist/client.js +7 -0
- package/dist/constants/api-endpoints.d.ts +6 -3
- package/dist/constants/api-endpoints.js +2 -1
- package/dist/errors/messages.d.ts +1 -1
- package/dist/errors/messages.js +1 -1
- package/dist/features/account/migrations.d.ts +2 -0
- package/dist/features/account/migrations.js +10 -0
- package/dist/features/admin/components/AdminMediaView.js +1 -1
- package/dist/features/admin/components/AdminProductsView.js +7 -3
- package/dist/features/admin/migrations.d.ts +2 -0
- package/dist/features/admin/migrations.js +10 -0
- package/dist/features/admin/types/product.types.d.ts +1 -1
- package/dist/features/auctions/components/MarketplaceAuctionCard.d.ts +1 -1
- package/dist/features/auctions/migrations.d.ts +2 -0
- package/dist/features/auctions/migrations.js +10 -0
- package/dist/features/auctions/schemas/index.d.ts +3 -3
- package/dist/features/auctions/schemas/index.js +1 -1
- package/dist/features/auth/migrations.d.ts +2 -0
- package/dist/features/auth/migrations.js +10 -0
- package/dist/features/blog/migrations.d.ts +2 -0
- package/dist/features/blog/migrations.js +10 -0
- package/dist/features/brands/migrations.d.ts +2 -0
- package/dist/features/brands/migrations.js +10 -0
- package/dist/features/bundles/components/BundlesByCategoryListing.d.ts +6 -0
- package/dist/features/bundles/components/BundlesByCategoryListing.js +50 -0
- package/dist/features/bundles/components/index.d.ts +2 -0
- package/dist/features/bundles/components/index.js +1 -0
- package/dist/features/bundles/migrations.d.ts +2 -0
- package/dist/features/bundles/migrations.js +10 -0
- package/dist/features/bundles/schemas/index.d.ts +1 -0
- package/dist/features/bundles/schemas/index.js +1 -0
- package/dist/features/bundles/schemas/zod.d.ts +377 -0
- package/dist/features/bundles/schemas/zod.js +71 -0
- package/dist/features/cart/migrations.d.ts +2 -0
- package/dist/features/cart/migrations.js +10 -0
- package/dist/features/cart/schemas/firestore.d.ts +2 -2
- package/dist/features/categories/components/BrandDetailPageView.js +35 -4
- package/dist/features/categories/components/BrandDetailTabs.d.ts +5 -1
- package/dist/features/categories/components/BrandDetailTabs.js +22 -8
- package/dist/features/categories/components/CategoryBundlesListing.d.ts +6 -0
- package/dist/features/categories/components/CategoryBundlesListing.js +74 -0
- package/dist/features/categories/components/CategoryDetailPageView.js +29 -4
- package/dist/features/categories/components/CategoryDetailTabs.d.ts +5 -1
- package/dist/features/categories/components/CategoryDetailTabs.js +22 -8
- package/dist/features/categories/migrations.d.ts +2 -0
- package/dist/features/categories/migrations.js +10 -0
- package/dist/features/categories/repository/categories.repository.d.ts +29 -0
- package/dist/features/categories/repository/categories.repository.js +83 -0
- package/dist/features/categories/schemas/firestore.d.ts +59 -2
- package/dist/features/categories/schemas/firestore.js +6 -0
- package/dist/features/categories/types/index.d.ts +11 -3
- package/dist/features/events/migrations.d.ts +2 -0
- package/dist/features/events/migrations.js +10 -0
- package/dist/features/faq/migrations.d.ts +2 -0
- package/dist/features/faq/migrations.js +10 -0
- package/dist/features/grouped/migrations.d.ts +2 -0
- package/dist/features/grouped/migrations.js +10 -0
- package/dist/features/grouped/schemas/firestore.d.ts +29 -10
- package/dist/features/grouped/schemas/firestore.js +10 -5
- package/dist/features/history/migrations.d.ts +2 -0
- package/dist/features/history/migrations.js +10 -0
- package/dist/features/homepage/hooks/useFeaturedAuctions.js +2 -2
- package/dist/features/homepage/hooks/useFeaturedPreOrders.js +2 -2
- package/dist/features/homepage/lib/section-renderer.js +5 -3
- package/dist/features/media/AvatarUpload.js +6 -28
- package/dist/features/media/hooks/useMedia.d.ts +31 -15
- package/dist/features/media/hooks/useMedia.js +48 -13
- package/dist/features/media/upload/ImageUpload.js +1 -1
- package/dist/features/media/upload/MediaUploadField.js +1 -1
- package/dist/features/messages/migrations.d.ts +2 -0
- package/dist/features/messages/migrations.js +10 -0
- package/dist/features/orders/components/OrdersList.js +10 -1
- package/dist/features/orders/migrations.d.ts +2 -0
- package/dist/features/orders/migrations.js +10 -0
- package/dist/features/orders/repository/orders.repository.d.ts +16 -0
- package/dist/features/orders/repository/orders.repository.js +49 -0
- package/dist/features/orders/schemas/firestore.d.ts +8 -0
- package/dist/features/orders/types/index.d.ts +12 -0
- package/dist/features/orders/utils/order-splitter.d.ts +2 -2
- package/dist/features/orders/utils/order-splitter.js +5 -0
- package/dist/features/payments/migrations.d.ts +2 -0
- package/dist/features/payments/migrations.js +10 -0
- package/dist/features/pre-orders/components/PreOrderDetailPageView.js +4 -1
- package/dist/features/products/actions/product-actions.d.ts +1 -1
- package/dist/features/products/api/[id]/route.js +34 -0
- package/dist/features/products/api/route.js +1 -19
- package/dist/features/products/components/CompareOverlay.d.ts +1 -1
- package/dist/features/products/components/MarketplacePrizeDrawCard.d.ts +24 -0
- package/dist/features/products/components/MarketplacePrizeDrawCard.js +102 -0
- package/dist/features/products/components/PrizeDrawCollage.d.ts +32 -0
- package/dist/features/products/components/PrizeDrawCollage.js +22 -0
- package/dist/features/products/components/PrizeDrawDetailPageView.d.ts +27 -0
- package/dist/features/products/components/PrizeDrawDetailPageView.js +118 -0
- package/dist/features/products/components/PrizeDrawEntryActions.d.ts +19 -0
- package/dist/features/products/components/PrizeDrawEntryActions.js +48 -0
- package/dist/features/products/components/PrizeDrawItemsEditor.d.ts +13 -0
- package/dist/features/products/components/PrizeDrawItemsEditor.js +97 -0
- package/dist/features/products/components/PrizeDrawsIndexListing.d.ts +8 -0
- package/dist/features/products/components/PrizeDrawsIndexListing.js +128 -0
- package/dist/features/products/components/PrizeDrawsListingView.d.ts +15 -0
- package/dist/features/products/components/PrizeDrawsListingView.js +49 -0
- package/dist/features/products/components/PrizeRevealModal.d.ts +34 -0
- package/dist/features/products/components/PrizeRevealModal.js +124 -0
- package/dist/features/products/components/ProductDetailPageView.js +13 -1
- package/dist/features/products/components/ProductForm.js +35 -2
- package/dist/features/products/components/ProductGrid.js +3 -1
- package/dist/features/products/components/index.d.ts +16 -0
- package/dist/features/products/components/index.js +8 -0
- package/dist/features/products/constants/listing-tabs.d.ts +113 -0
- package/dist/features/products/constants/listing-tabs.js +43 -0
- package/dist/features/products/index.d.ts +1 -0
- package/dist/features/products/index.js +1 -0
- package/dist/features/products/migrations.d.ts +2 -0
- package/dist/features/products/migrations.js +10 -0
- package/dist/features/products/repository/products.repository.d.ts +11 -7
- package/dist/features/products/repository/products.repository.js +49 -24
- package/dist/features/products/schemas/firestore.d.ts +3 -3
- package/dist/features/products/schemas/firestore.js +2 -2
- package/dist/features/products/schemas/index.d.ts +5 -5
- package/dist/features/products/schemas/index.js +3 -1
- package/dist/features/products/schemas/product-features.validators.d.ts +6 -6
- package/dist/features/products/types/index.d.ts +17 -1
- package/dist/features/products/utils/listing-type.d.ts +7 -4
- package/dist/features/products/utils/listing-type.js +8 -4
- package/dist/features/promotions/actions/coupon-actions.d.ts +1 -1
- package/dist/features/promotions/hooks/useCouponValidate.d.ts +1 -1
- package/dist/features/promotions/migrations.d.ts +2 -0
- package/dist/features/promotions/migrations.js +10 -0
- package/dist/features/promotions/repository/coupons.repository.d.ts +1 -1
- package/dist/features/promotions/schemas/index.d.ts +2 -2
- package/dist/features/reviews/migrations.d.ts +2 -0
- package/dist/features/reviews/migrations.js +10 -0
- package/dist/features/scams/migrations.d.ts +2 -0
- package/dist/features/scams/migrations.js +10 -0
- package/dist/features/search/api/route.d.ts +1 -1
- package/dist/features/search/api/route.js +3 -3
- package/dist/features/search/components/Search.d.ts +1 -1
- package/dist/features/search/schemas/index.d.ts +3 -3
- package/dist/features/search/schemas/index.js +3 -1
- package/dist/features/search/types/index.d.ts +2 -2
- package/dist/features/seller/components/SellerProductShell.d.ts +1 -1
- package/dist/features/seller/components/SellerProductsView.js +20 -6
- package/dist/features/seller/migrations.d.ts +2 -0
- package/dist/features/seller/migrations.js +10 -0
- package/dist/features/seller/schemas/index.d.ts +2 -2
- package/dist/features/stores/components/StoreBundlesPageView.d.ts +12 -0
- package/dist/features/stores/components/StoreBundlesPageView.js +24 -0
- package/dist/features/stores/components/StoreDetailLayoutView.js +15 -3
- package/dist/features/stores/components/StorePrizeDrawsPageView.d.ts +11 -0
- package/dist/features/stores/components/StorePrizeDrawsPageView.js +27 -0
- package/dist/features/stores/components/index.d.ts +2 -0
- package/dist/features/stores/migrations.d.ts +2 -0
- package/dist/features/stores/migrations.js +10 -0
- package/dist/features/stores/schemas/index.d.ts +2 -2
- package/dist/features/stores/types/index.d.ts +1 -1
- package/dist/features/sublisting/migrations.d.ts +2 -0
- package/dist/features/sublisting/migrations.js +10 -0
- package/dist/features/sublisting/schemas/firestore.d.ts +2 -0
- package/dist/features/support/migrations.d.ts +2 -0
- package/dist/features/support/migrations.js +10 -0
- package/dist/features/wishlist/migrations.d.ts +2 -0
- package/dist/features/wishlist/migrations.js +10 -0
- package/dist/features/wishlist/types/index.d.ts +1 -1
- package/dist/index.d.ts +26 -18
- package/dist/index.js +41 -24
- package/dist/jobs.d.ts +1 -1
- package/dist/jobs.js +4 -0
- package/dist/next/routing/route-map.d.ts +4 -0
- package/dist/next/routing/route-map.js +2 -0
- package/dist/providers/db-firebase/filter-aliases.d.ts +2 -2
- package/dist/repositories/index.d.ts +0 -5
- package/dist/repositories/index.js +5 -4
- package/dist/seed/actions/demo-seed-actions.d.ts +1 -1
- package/dist/seed/categories-seed-data.js +1105 -6
- package/dist/seed/faq-seed-data.js +160 -0
- package/dist/seed/grouped-listings-seed-data.js +32 -32
- package/dist/seed/homepage-sections-seed-data.js +52 -6
- package/dist/seed/index.d.ts +1 -3
- package/dist/seed/index.js +4 -3
- package/dist/seed/manifest.js +8 -13
- package/dist/seed/products-prize-draws-seed-data.d.ts +17 -0
- package/dist/seed/products-prize-draws-seed-data.js +313 -0
- package/dist/seo/json-ld.d.ts +1 -1
- package/dist/server-entry.d.ts +2 -2
- package/dist/server-entry.js +5 -3
- package/dist/server.d.ts +9 -2
- package/dist/server.js +11 -5
- package/dist/tailwind-utilities.css +1 -1
- package/dist/validation/schemas.d.ts +8 -8
- package/package.json +1 -1
- package/scripts/seed-cli.mjs +2 -4
|
@@ -8,7 +8,7 @@ export declare const addToCartSchema: z.ZodObject<{
|
|
|
8
8
|
storeId: z.ZodString;
|
|
9
9
|
storeName: z.ZodDefault<z.ZodString>;
|
|
10
10
|
quantity: z.ZodDefault<z.ZodNumber>;
|
|
11
|
-
listingType: z.ZodEnum<["standard", "auction", "pre-order", "prize-draw"
|
|
11
|
+
listingType: z.ZodEnum<["standard", "auction", "pre-order", "prize-draw"]>;
|
|
12
12
|
isOffer: z.ZodOptional<z.ZodBoolean>;
|
|
13
13
|
offerId: z.ZodOptional<z.ZodString>;
|
|
14
14
|
lockedPrice: z.ZodOptional<z.ZodNumber>;
|
|
@@ -20,7 +20,7 @@ export declare const addToCartSchema: z.ZodObject<{
|
|
|
20
20
|
productTitle: string;
|
|
21
21
|
productImage: string;
|
|
22
22
|
price: number;
|
|
23
|
-
listingType: "auction" | "standard" | "
|
|
23
|
+
listingType: "auction" | "standard" | "prize-draw" | "pre-order";
|
|
24
24
|
storeName: string;
|
|
25
25
|
offerId?: string | undefined;
|
|
26
26
|
lockedPrice?: number | undefined;
|
|
@@ -30,7 +30,7 @@ export declare const addToCartSchema: z.ZodObject<{
|
|
|
30
30
|
productId: string;
|
|
31
31
|
productTitle: string;
|
|
32
32
|
price: number;
|
|
33
|
-
listingType: "auction" | "standard" | "
|
|
33
|
+
listingType: "auction" | "standard" | "prize-draw" | "pre-order";
|
|
34
34
|
currency?: string | undefined;
|
|
35
35
|
quantity?: number | undefined;
|
|
36
36
|
productImage?: string | undefined;
|
|
@@ -66,7 +66,7 @@ export declare const mergeGuestCartSchema: z.ZodObject<{
|
|
|
66
66
|
storeId: z.ZodString;
|
|
67
67
|
storeName: z.ZodDefault<z.ZodString>;
|
|
68
68
|
quantity: z.ZodDefault<z.ZodNumber>;
|
|
69
|
-
listingType: z.ZodEnum<["standard", "auction", "pre-order", "prize-draw"
|
|
69
|
+
listingType: z.ZodEnum<["standard", "auction", "pre-order", "prize-draw"]>;
|
|
70
70
|
isOffer: z.ZodOptional<z.ZodBoolean>;
|
|
71
71
|
offerId: z.ZodOptional<z.ZodString>;
|
|
72
72
|
lockedPrice: z.ZodOptional<z.ZodNumber>;
|
|
@@ -78,7 +78,7 @@ export declare const mergeGuestCartSchema: z.ZodObject<{
|
|
|
78
78
|
productTitle: string;
|
|
79
79
|
productImage: string;
|
|
80
80
|
price: number;
|
|
81
|
-
listingType: "auction" | "standard" | "
|
|
81
|
+
listingType: "auction" | "standard" | "prize-draw" | "pre-order";
|
|
82
82
|
storeName: string;
|
|
83
83
|
offerId?: string | undefined;
|
|
84
84
|
lockedPrice?: number | undefined;
|
|
@@ -88,7 +88,7 @@ export declare const mergeGuestCartSchema: z.ZodObject<{
|
|
|
88
88
|
productId: string;
|
|
89
89
|
productTitle: string;
|
|
90
90
|
price: number;
|
|
91
|
-
listingType: "auction" | "standard" | "
|
|
91
|
+
listingType: "auction" | "standard" | "prize-draw" | "pre-order";
|
|
92
92
|
currency?: string | undefined;
|
|
93
93
|
quantity?: number | undefined;
|
|
94
94
|
productImage?: string | undefined;
|
|
@@ -106,7 +106,7 @@ export declare const mergeGuestCartSchema: z.ZodObject<{
|
|
|
106
106
|
productTitle: string;
|
|
107
107
|
productImage: string;
|
|
108
108
|
price: number;
|
|
109
|
-
listingType: "auction" | "standard" | "
|
|
109
|
+
listingType: "auction" | "standard" | "prize-draw" | "pre-order";
|
|
110
110
|
storeName: string;
|
|
111
111
|
offerId?: string | undefined;
|
|
112
112
|
lockedPrice?: number | undefined;
|
|
@@ -118,7 +118,7 @@ export declare const mergeGuestCartSchema: z.ZodObject<{
|
|
|
118
118
|
productId: string;
|
|
119
119
|
productTitle: string;
|
|
120
120
|
price: number;
|
|
121
|
-
listingType: "auction" | "standard" | "
|
|
121
|
+
listingType: "auction" | "standard" | "prize-draw" | "pre-order";
|
|
122
122
|
currency?: string | undefined;
|
|
123
123
|
quantity?: number | undefined;
|
|
124
124
|
productImage?: string | undefined;
|
|
@@ -9,12 +9,12 @@ const cartItemBaseSchema = z.object({
|
|
|
9
9
|
storeName: z.string().default(""),
|
|
10
10
|
quantity: z.number().int().min(1).max(99).default(1),
|
|
11
11
|
// SB1-G Phase 4 — canonical listing-kind snapshot.
|
|
12
|
+
// SB-UNI-D — "bundle" removed from the listing-kind enum.
|
|
12
13
|
listingType: z.enum([
|
|
13
14
|
"standard",
|
|
14
15
|
"auction",
|
|
15
16
|
"pre-order",
|
|
16
17
|
"prize-draw",
|
|
17
|
-
"bundle",
|
|
18
18
|
]),
|
|
19
19
|
isOffer: z.boolean().optional(),
|
|
20
20
|
offerId: z.string().optional(),
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bundle config — SB-UNI-V.
|
|
3
|
+
*
|
|
4
|
+
* Constants that used to live in `_internal/shared/features/bundles/config.ts`
|
|
5
|
+
* before bundles were folded into the categories collection as
|
|
6
|
+
* `categoryType:"bundle"` rows.
|
|
7
|
+
*/
|
|
8
|
+
/** Minimum products allowed in a bundle's `bundleQueryRule`. */
|
|
9
|
+
export declare const BUNDLE_MIN_ITEMS: 3;
|
|
10
|
+
/** Maximum products allowed in a bundle's `bundleQueryRule`. */
|
|
11
|
+
export declare const BUNDLE_MAX_ITEMS: 16;
|
|
12
|
+
/** Default per-user purchase cap when the bundle category doesn't override. */
|
|
13
|
+
export declare const BUNDLE_MAX_PER_USER_DEFAULT: 3;
|
|
14
|
+
/** Page size for `/api/categories?categoryType=bundle` listing. */
|
|
15
|
+
export declare const BUNDLES_PAGE_SIZE: 24;
|
|
16
|
+
/** Cap on homepage featured-bundles strip. */
|
|
17
|
+
export declare const BUNDLES_FEATURED_LIMIT: 12;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bundle config — SB-UNI-V.
|
|
3
|
+
*
|
|
4
|
+
* Constants that used to live in `_internal/shared/features/bundles/config.ts`
|
|
5
|
+
* before bundles were folded into the categories collection as
|
|
6
|
+
* `categoryType:"bundle"` rows.
|
|
7
|
+
*/
|
|
8
|
+
/** Minimum products allowed in a bundle's `bundleQueryRule`. */
|
|
9
|
+
export const BUNDLE_MIN_ITEMS = 3;
|
|
10
|
+
/** Maximum products allowed in a bundle's `bundleQueryRule`. */
|
|
11
|
+
export const BUNDLE_MAX_ITEMS = 16;
|
|
12
|
+
/** Default per-user purchase cap when the bundle category doesn't override. */
|
|
13
|
+
export const BUNDLE_MAX_PER_USER_DEFAULT = 3;
|
|
14
|
+
/** Page size for `/api/categories?categoryType=bundle` listing. */
|
|
15
|
+
export const BUNDLES_PAGE_SIZE = 24;
|
|
16
|
+
/** Cap on homepage featured-bundles strip. */
|
|
17
|
+
export const BUNDLES_FEATURED_LIMIT = 12;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Layout feature — shared config constants.
|
|
3
|
+
*
|
|
4
|
+
* Pixel widths, breakpoint values, default classNames. All sections read from
|
|
5
|
+
* here so the responsive contract is single-sourced.
|
|
6
|
+
*/
|
|
7
|
+
import type { DashboardVariant, LayoutBreakpoint } from "./types";
|
|
8
|
+
/** Drawer (slide-out) width tokens — Tailwind classnames. */
|
|
9
|
+
export declare const SIDE_DRAWER_WIDTH: Record<"sm" | "md" | "lg", string>;
|
|
10
|
+
/** Persistent dashboard sidebar rail width (collapsed/expanded). */
|
|
11
|
+
export declare const DASHBOARD_SIDEBAR_WIDTH: {
|
|
12
|
+
expanded: string;
|
|
13
|
+
compact: string;
|
|
14
|
+
};
|
|
15
|
+
/** Per-variant accent token map. Drives DashboardSidebar active-item styling. */
|
|
16
|
+
export declare const DASHBOARD_ACCENT_CLASSES: Record<DashboardVariant, {
|
|
17
|
+
activeBg: string;
|
|
18
|
+
activeText: string;
|
|
19
|
+
hoverBg: string;
|
|
20
|
+
}>;
|
|
21
|
+
/** hideAt → Tailwind class. `md:hidden` etc. */
|
|
22
|
+
export declare function hideAtClass(bp: LayoutBreakpoint | undefined): string;
|
|
23
|
+
/** showAt → Tailwind class. `md:block` etc. */
|
|
24
|
+
export declare function showAtClass(bp: LayoutBreakpoint | undefined, display?: string): string;
|
|
25
|
+
/** Default bottom-nav padding to reserve space (mobile only). */
|
|
26
|
+
export declare const BOTTOM_NAV_CONTENT_PADDING = "pb-16 md:pb-0";
|
|
27
|
+
/** Sticky-header CSS custom property — written by AppLayoutShell / AppShellServer. */
|
|
28
|
+
export declare const HEADER_HEIGHT_CSS_VAR = "--header-height";
|
|
29
|
+
/**
|
|
30
|
+
* Desktop breakpoint for dashboard drawer behaviour. Mirrors Tailwind's `md` (768px).
|
|
31
|
+
* Exported so DashboardLayoutClient can call `window.matchMedia(DASHBOARD_DESKTOP_MEDIA_QUERY)`
|
|
32
|
+
* without re-hardcoding the value across every layout consumer.
|
|
33
|
+
*/
|
|
34
|
+
export declare const DASHBOARD_DESKTOP_BREAKPOINT_PX = 768;
|
|
35
|
+
export declare const DASHBOARD_DESKTOP_MEDIA_QUERY = "(min-width: 768px)";
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Layout feature — shared config constants.
|
|
3
|
+
*
|
|
4
|
+
* Pixel widths, breakpoint values, default classNames. All sections read from
|
|
5
|
+
* here so the responsive contract is single-sourced.
|
|
6
|
+
*/
|
|
7
|
+
/** Drawer (slide-out) width tokens — Tailwind classnames. */
|
|
8
|
+
export const SIDE_DRAWER_WIDTH = {
|
|
9
|
+
sm: "w-72",
|
|
10
|
+
md: "w-80",
|
|
11
|
+
lg: "w-96",
|
|
12
|
+
};
|
|
13
|
+
/** Persistent dashboard sidebar rail width (collapsed/expanded). */
|
|
14
|
+
export const DASHBOARD_SIDEBAR_WIDTH = {
|
|
15
|
+
expanded: "lg:w-64",
|
|
16
|
+
compact: "lg:w-16",
|
|
17
|
+
};
|
|
18
|
+
/** Per-variant accent token map. Drives DashboardSidebar active-item styling. */
|
|
19
|
+
export const DASHBOARD_ACCENT_CLASSES = {
|
|
20
|
+
admin: {
|
|
21
|
+
activeBg: "bg-zinc-100 dark:bg-slate-800",
|
|
22
|
+
activeText: "text-zinc-900 dark:text-zinc-100",
|
|
23
|
+
hoverBg: "hover:bg-zinc-50 dark:hover:bg-slate-800/60",
|
|
24
|
+
},
|
|
25
|
+
store: {
|
|
26
|
+
activeBg: "bg-orange-50 dark:bg-orange-900/20",
|
|
27
|
+
activeText: "text-orange-700 dark:text-orange-300",
|
|
28
|
+
hoverBg: "hover:bg-zinc-50 dark:hover:bg-slate-800/60",
|
|
29
|
+
},
|
|
30
|
+
user: {
|
|
31
|
+
activeBg: "bg-primary-50 dark:bg-primary-900/25",
|
|
32
|
+
activeText: "text-primary-700 dark:text-primary-300",
|
|
33
|
+
hoverBg: "hover:bg-zinc-50 dark:hover:bg-slate-800",
|
|
34
|
+
},
|
|
35
|
+
};
|
|
36
|
+
/** hideAt → Tailwind class. `md:hidden` etc. */
|
|
37
|
+
export function hideAtClass(bp) {
|
|
38
|
+
if (!bp)
|
|
39
|
+
return "";
|
|
40
|
+
return `${bp}:hidden`;
|
|
41
|
+
}
|
|
42
|
+
/** showAt → Tailwind class. `md:block` etc. */
|
|
43
|
+
export function showAtClass(bp, display = "block") {
|
|
44
|
+
if (!bp)
|
|
45
|
+
return "";
|
|
46
|
+
return `hidden ${bp}:${display}`;
|
|
47
|
+
}
|
|
48
|
+
/** Default bottom-nav padding to reserve space (mobile only). */
|
|
49
|
+
export const BOTTOM_NAV_CONTENT_PADDING = "pb-16 md:pb-0";
|
|
50
|
+
/** Sticky-header CSS custom property — written by AppLayoutShell / AppShellServer. */
|
|
51
|
+
export const HEADER_HEIGHT_CSS_VAR = "--header-height";
|
|
52
|
+
/**
|
|
53
|
+
* Desktop breakpoint for dashboard drawer behaviour. Mirrors Tailwind's `md` (768px).
|
|
54
|
+
* Exported so DashboardLayoutClient can call `window.matchMedia(DASHBOARD_DESKTOP_MEDIA_QUERY)`
|
|
55
|
+
* without re-hardcoding the value across every layout consumer.
|
|
56
|
+
*/
|
|
57
|
+
export const DASHBOARD_DESKTOP_BREAKPOINT_PX = 768;
|
|
58
|
+
export const DASHBOARD_DESKTOP_MEDIA_QUERY = `(min-width: ${DASHBOARD_DESKTOP_BREAKPOINT_PX}px)`;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
/** Layout feature — shared types + config barrel. */
|
|
2
|
+
export type { LayoutBreakpoint, DashboardVariant, LayoutRole, SidebarNavItem, SidebarNavGroup, MainNavItem, BrandingConfig, FooterLinkGroup, FooterTrustBarItem, FooterSocialLink, FooterConfig, SectionResponsive, SectionTheming, LayoutConfig, DashboardLayoutConfig, } from "./types";
|
|
3
|
+
export { SIDE_DRAWER_WIDTH, DASHBOARD_SIDEBAR_WIDTH, DASHBOARD_ACCENT_CLASSES, hideAtClass, showAtClass, BOTTOM_NAV_CONTENT_PADDING, HEADER_HEIGHT_CSS_VAR, DASHBOARD_DESKTOP_BREAKPOINT_PX, DASHBOARD_DESKTOP_MEDIA_QUERY, } from "./config";
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/** Layout feature — shared types + config barrel. */
|
|
2
|
+
export { SIDE_DRAWER_WIDTH, DASHBOARD_SIDEBAR_WIDTH, DASHBOARD_ACCENT_CLASSES, hideAtClass, showAtClass, BOTTOM_NAV_CONTENT_PADDING, HEADER_HEIGHT_CSS_VAR, DASHBOARD_DESKTOP_BREAKPOINT_PX, DASHBOARD_DESKTOP_MEDIA_QUERY, } from "./config";
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Layout feature — shared types.
|
|
3
|
+
*
|
|
4
|
+
* These types describe the pure-data configuration surfaces for every layout
|
|
5
|
+
* section. They are framework-agnostic; consumers pass them into server or
|
|
6
|
+
* client section components as props.
|
|
7
|
+
*
|
|
8
|
+
* Three-layer override contract (see CLAUDE.md SSR Architecture §Encapsulation):
|
|
9
|
+
* 1. Config props (this file's types).
|
|
10
|
+
* 2. render-prop slots on each section (defined on the section component itself).
|
|
11
|
+
* 3. Section replacement via AppShell named slots.
|
|
12
|
+
*/
|
|
13
|
+
import type { ReactNode } from "react";
|
|
14
|
+
/** Tailwind breakpoint keys used by responsive visibility props. */
|
|
15
|
+
export type LayoutBreakpoint = "sm" | "md" | "lg" | "xl";
|
|
16
|
+
/** A discriminator for the three dashboard surfaces. Drives accent colour + sidebar component selection. */
|
|
17
|
+
export type DashboardVariant = "admin" | "store" | "user";
|
|
18
|
+
/** Role tokens recognised by RoleGuard (mirrors appkit's UserRole). */
|
|
19
|
+
export type LayoutRole = "admin" | "seller" | "moderator" | "employee" | "user";
|
|
20
|
+
/** Single sidebar/nav link. */
|
|
21
|
+
export interface SidebarNavItem {
|
|
22
|
+
href: string;
|
|
23
|
+
label: string;
|
|
24
|
+
icon?: ReactNode;
|
|
25
|
+
badge?: number;
|
|
26
|
+
}
|
|
27
|
+
/** Sidebar group with title + items + default-open state. */
|
|
28
|
+
export interface SidebarNavGroup {
|
|
29
|
+
title: string;
|
|
30
|
+
items: SidebarNavItem[];
|
|
31
|
+
defaultOpen?: boolean;
|
|
32
|
+
}
|
|
33
|
+
/** Top-level main-nav item (horizontal nav, ≥lg). */
|
|
34
|
+
export interface MainNavItem {
|
|
35
|
+
href: string;
|
|
36
|
+
label: string;
|
|
37
|
+
icon?: ReactNode;
|
|
38
|
+
/** Translation key (consumer fills in `label` at render time via t(key)). */
|
|
39
|
+
key?: string;
|
|
40
|
+
}
|
|
41
|
+
/** Branding config — propagated to TitleBar / Footer / mobile chrome. */
|
|
42
|
+
export interface BrandingConfig {
|
|
43
|
+
name: string;
|
|
44
|
+
shortName?: string;
|
|
45
|
+
description?: string;
|
|
46
|
+
logoUrl?: string;
|
|
47
|
+
logoHref?: string;
|
|
48
|
+
copyrightText?: string;
|
|
49
|
+
madeInText?: string;
|
|
50
|
+
}
|
|
51
|
+
/** Footer config (used by FooterServer + the existing FooterLayout). */
|
|
52
|
+
export interface FooterLinkGroup {
|
|
53
|
+
title: string;
|
|
54
|
+
links: {
|
|
55
|
+
href: string;
|
|
56
|
+
label: string;
|
|
57
|
+
}[];
|
|
58
|
+
}
|
|
59
|
+
export interface FooterTrustBarItem {
|
|
60
|
+
icon?: ReactNode;
|
|
61
|
+
label: string;
|
|
62
|
+
description?: string;
|
|
63
|
+
}
|
|
64
|
+
export interface FooterSocialLink {
|
|
65
|
+
href: string;
|
|
66
|
+
label: string;
|
|
67
|
+
icon?: ReactNode;
|
|
68
|
+
}
|
|
69
|
+
export interface FooterConfig {
|
|
70
|
+
branding: Pick<BrandingConfig, "name" | "description" | "copyrightText" | "madeInText">;
|
|
71
|
+
linkGroups: FooterLinkGroup[];
|
|
72
|
+
trustBarItems?: FooterTrustBarItem[];
|
|
73
|
+
socialLinks?: FooterSocialLink[];
|
|
74
|
+
bottomLinks?: {
|
|
75
|
+
href: string;
|
|
76
|
+
label: string;
|
|
77
|
+
}[];
|
|
78
|
+
showTrustBar?: boolean;
|
|
79
|
+
tone?: "dark" | "light" | "match";
|
|
80
|
+
}
|
|
81
|
+
/** Section-level responsive controls — every section accepts these. */
|
|
82
|
+
export interface SectionResponsive {
|
|
83
|
+
hideAt?: LayoutBreakpoint;
|
|
84
|
+
showAt?: LayoutBreakpoint;
|
|
85
|
+
compactAt?: LayoutBreakpoint;
|
|
86
|
+
}
|
|
87
|
+
/** Section-level theming knobs — every section accepts these. */
|
|
88
|
+
export interface SectionTheming {
|
|
89
|
+
/** Surface variant. Each section interprets these in its own way. */
|
|
90
|
+
variant?: "default" | "transparent" | "elevated" | "muted" | "subtle";
|
|
91
|
+
/** Accent token override (resolves to --appkit-color-<accent>). */
|
|
92
|
+
accent?: "primary" | "secondary" | "success" | "warning" | "danger";
|
|
93
|
+
/** Background variant for shell-level backgrounds. */
|
|
94
|
+
backgroundVariant?: "default" | "muted" | "subtle";
|
|
95
|
+
/** Free-form className to merge with the section's root. */
|
|
96
|
+
className?: string;
|
|
97
|
+
}
|
|
98
|
+
/** Top-level layout config (public surface). */
|
|
99
|
+
export interface LayoutConfig {
|
|
100
|
+
branding: BrandingConfig;
|
|
101
|
+
mainNav: {
|
|
102
|
+
items: MainNavItem[];
|
|
103
|
+
hiddenAt?: LayoutBreakpoint;
|
|
104
|
+
};
|
|
105
|
+
sideDrawer?: {
|
|
106
|
+
title?: string;
|
|
107
|
+
sections: SidebarNavGroup[];
|
|
108
|
+
width?: "sm" | "md" | "lg";
|
|
109
|
+
position?: "left" | "right";
|
|
110
|
+
};
|
|
111
|
+
footer: FooterConfig;
|
|
112
|
+
bottomNav?: {
|
|
113
|
+
items: SidebarNavItem[];
|
|
114
|
+
};
|
|
115
|
+
/** Admin-overridable theme tokens (CSS variables) — written to :root / .dark by the server scaffold. */
|
|
116
|
+
theme?: {
|
|
117
|
+
primary?: string;
|
|
118
|
+
secondary?: string;
|
|
119
|
+
accent?: string;
|
|
120
|
+
primaryDark?: string;
|
|
121
|
+
secondaryDark?: string;
|
|
122
|
+
accentDark?: string;
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
/** Per-dashboard layout config. */
|
|
126
|
+
export interface DashboardLayoutConfig {
|
|
127
|
+
variant: DashboardVariant;
|
|
128
|
+
role: LayoutRole | LayoutRole[];
|
|
129
|
+
groups: SidebarNavGroup[];
|
|
130
|
+
/** Path resolution for active-link highlight. */
|
|
131
|
+
activeHref?: string;
|
|
132
|
+
/** Optional rail collapse behaviour. */
|
|
133
|
+
collapsible?: boolean;
|
|
134
|
+
defaultCollapsed?: boolean;
|
|
135
|
+
responsive?: SectionResponsive;
|
|
136
|
+
theming?: SectionTheming;
|
|
137
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Layout feature — shared types.
|
|
3
|
+
*
|
|
4
|
+
* These types describe the pure-data configuration surfaces for every layout
|
|
5
|
+
* section. They are framework-agnostic; consumers pass them into server or
|
|
6
|
+
* client section components as props.
|
|
7
|
+
*
|
|
8
|
+
* Three-layer override contract (see CLAUDE.md SSR Architecture §Encapsulation):
|
|
9
|
+
* 1. Config props (this file's types).
|
|
10
|
+
* 2. render-prop slots on each section (defined on the section component itself).
|
|
11
|
+
* 3. Section replacement via AppShell named slots.
|
|
12
|
+
*/
|
|
13
|
+
export {};
|
|
@@ -21,7 +21,7 @@ export interface ProductDetailInitial {
|
|
|
21
21
|
tags: string[];
|
|
22
22
|
condition?: string;
|
|
23
23
|
/** Canonical listing-kind discriminator (SB1-G — Phase 4 dropped legacy booleans). */
|
|
24
|
-
listingType?: "standard" | "auction" | "pre-order" | "prize-draw"
|
|
24
|
+
listingType?: "standard" | "auction" | "pre-order" | "prize-draw";
|
|
25
25
|
auctionEndDate?: string;
|
|
26
26
|
startingBid?: number;
|
|
27
27
|
currentBid?: number;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Listing-type plugin registry — SB-UNI X2.
|
|
3
|
+
*
|
|
4
|
+
* Adding a new listing type later means:
|
|
5
|
+
* 1. Add a folder `<type>/{config,schema,ctas,og,seed-factory}.ts`
|
|
6
|
+
* 2. Add a row to `LISTING_TYPE_CAPABILITIES` in `./capabilities.ts`
|
|
7
|
+
* 3. Add the import + entry below
|
|
8
|
+
*
|
|
9
|
+
* No grep-the-codebase sweep required. Future-expansion Pattern 3.
|
|
10
|
+
*/
|
|
11
|
+
import { LISTING_TYPE_CAPABILITIES } from "./capabilities";
|
|
12
|
+
import type { ListingType } from "../../../features/products/types/index";
|
|
13
|
+
export interface ListingTypePlugin {
|
|
14
|
+
listingType: ListingType;
|
|
15
|
+
slugPrefix: string;
|
|
16
|
+
cartLine: "single-product" | "blocked" | "bundle-expand";
|
|
17
|
+
}
|
|
18
|
+
export declare const LISTING_TYPE_REGISTRY: {
|
|
19
|
+
readonly standard: {
|
|
20
|
+
listingType: "standard";
|
|
21
|
+
slugPrefix: string;
|
|
22
|
+
cartLine: "single-product";
|
|
23
|
+
};
|
|
24
|
+
readonly auction: {
|
|
25
|
+
listingType: "auction";
|
|
26
|
+
slugPrefix: string;
|
|
27
|
+
cartLine: "blocked";
|
|
28
|
+
};
|
|
29
|
+
readonly "pre-order": {
|
|
30
|
+
listingType: "pre-order";
|
|
31
|
+
slugPrefix: string;
|
|
32
|
+
cartLine: "single-product";
|
|
33
|
+
};
|
|
34
|
+
readonly "prize-draw": {
|
|
35
|
+
listingType: "prize-draw";
|
|
36
|
+
slugPrefix: string;
|
|
37
|
+
cartLine: "single-product";
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
export declare function pluginFor(type: ListingType): {
|
|
41
|
+
listingType: "standard";
|
|
42
|
+
slugPrefix: string;
|
|
43
|
+
cartLine: "single-product";
|
|
44
|
+
} | {
|
|
45
|
+
listingType: "auction";
|
|
46
|
+
slugPrefix: string;
|
|
47
|
+
cartLine: "blocked";
|
|
48
|
+
} | {
|
|
49
|
+
listingType: "pre-order";
|
|
50
|
+
slugPrefix: string;
|
|
51
|
+
cartLine: "single-product";
|
|
52
|
+
} | {
|
|
53
|
+
listingType: "prize-draw";
|
|
54
|
+
slugPrefix: string;
|
|
55
|
+
cartLine: "single-product";
|
|
56
|
+
};
|
|
57
|
+
export { LISTING_TYPE_CAPABILITIES };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Listing-type plugin registry — SB-UNI X2.
|
|
3
|
+
*
|
|
4
|
+
* Adding a new listing type later means:
|
|
5
|
+
* 1. Add a folder `<type>/{config,schema,ctas,og,seed-factory}.ts`
|
|
6
|
+
* 2. Add a row to `LISTING_TYPE_CAPABILITIES` in `./capabilities.ts`
|
|
7
|
+
* 3. Add the import + entry below
|
|
8
|
+
*
|
|
9
|
+
* No grep-the-codebase sweep required. Future-expansion Pattern 3.
|
|
10
|
+
*/
|
|
11
|
+
import * as standard from "./standard/config";
|
|
12
|
+
import * as auction from "./auction/config";
|
|
13
|
+
import * as preOrder from "./pre-order/config";
|
|
14
|
+
import * as prizeDraw from "./prize-draw/config";
|
|
15
|
+
import { LISTING_TYPE_CAPABILITIES } from "./capabilities";
|
|
16
|
+
// SB-UNI-D — bundle entry removed; bundles are a categoryType, not a listingType.
|
|
17
|
+
export const LISTING_TYPE_REGISTRY = {
|
|
18
|
+
standard: standard.config,
|
|
19
|
+
auction: auction.config,
|
|
20
|
+
"pre-order": preOrder.config,
|
|
21
|
+
"prize-draw": prizeDraw.config,
|
|
22
|
+
};
|
|
23
|
+
export function pluginFor(type) {
|
|
24
|
+
return LISTING_TYPE_REGISTRY[type];
|
|
25
|
+
}
|
|
26
|
+
// Re-export the capability map so consumers can pull both surfaces from
|
|
27
|
+
// the same module path.
|
|
28
|
+
export { LISTING_TYPE_CAPABILITIES };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { LISTING_TYPE_CAPABILITIES } from "../capabilities";
|
|
2
|
+
export const LISTING_TYPE = "auction";
|
|
3
|
+
export const capability = LISTING_TYPE_CAPABILITIES.auction;
|
|
4
|
+
export const config = {
|
|
5
|
+
listingType: LISTING_TYPE,
|
|
6
|
+
slugPrefix: "auction-",
|
|
7
|
+
cartLine: "blocked",
|
|
8
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const ctas: readonly string[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Listing-type capability registry — Pattern 1 + 2 from the SB-UNI plan.
|
|
3
|
+
*
|
|
4
|
+
* Every consumer that needs to branch on listing type reads from this
|
|
5
|
+
* registry rather than writing `if (listingType === "X")`. Adding a new
|
|
6
|
+
* listing type later means adding one row here + one folder under
|
|
7
|
+
* `_internal/shared/listing-types/<type>/` — no scattered grep needed.
|
|
8
|
+
*
|
|
9
|
+
* Capabilities are intentionally minimal — only behavioral facts that
|
|
10
|
+
* cross feature boundaries. Per-type rendering / form layout / SEO live
|
|
11
|
+
* inside the per-type folder (X2 plugin layout).
|
|
12
|
+
*/
|
|
13
|
+
import type { ListingType } from "../../../features/products/types/index";
|
|
14
|
+
export interface ListingTypeCapability {
|
|
15
|
+
/** Buyers can add this listing to a cart and check out. */
|
|
16
|
+
canAddToCart: boolean;
|
|
17
|
+
/** Listing accepts bid placements. */
|
|
18
|
+
canBid: boolean;
|
|
19
|
+
/** Listing has physical fulfillment (drives shipping address requirement). */
|
|
20
|
+
supportsShipping: boolean;
|
|
21
|
+
/** Seller must be a verified vendor for KYC-gated listings. */
|
|
22
|
+
requiresVendorVerified: boolean;
|
|
23
|
+
/** Checkout must validate buyer jurisdiction (regulated items). */
|
|
24
|
+
requiresJurisdictionCheck: boolean;
|
|
25
|
+
/** Listing fulfills immediately on purchase (no shipping label flow). */
|
|
26
|
+
hasInstantFulfillment: boolean;
|
|
27
|
+
}
|
|
28
|
+
export declare const LISTING_TYPE_CAPABILITIES: Record<ListingType, ListingTypeCapability>;
|
|
29
|
+
export declare function capabilityFor(type: ListingType): ListingTypeCapability;
|
|
30
|
+
export declare function canAddToCart(type: ListingType): boolean;
|
|
31
|
+
export declare function canBid(type: ListingType): boolean;
|
|
32
|
+
export declare function supportsShipping(type: ListingType): boolean;
|
|
33
|
+
export declare function requiresVendorVerified(type: ListingType): boolean;
|
|
34
|
+
export declare function requiresJurisdictionCheck(type: ListingType): boolean;
|
|
35
|
+
export declare function hasInstantFulfillment(type: ListingType): boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Exhaustive-switch helper. Use in `switch (type) { case ...: default: assertNever(type); }`
|
|
38
|
+
* so adding a new `ListingType` member is a TS error at every consumer
|
|
39
|
+
* that didn't update.
|
|
40
|
+
*/
|
|
41
|
+
export declare function assertNever(value: never): never;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Listing-type capability registry — Pattern 1 + 2 from the SB-UNI plan.
|
|
3
|
+
*
|
|
4
|
+
* Every consumer that needs to branch on listing type reads from this
|
|
5
|
+
* registry rather than writing `if (listingType === "X")`. Adding a new
|
|
6
|
+
* listing type later means adding one row here + one folder under
|
|
7
|
+
* `_internal/shared/listing-types/<type>/` — no scattered grep needed.
|
|
8
|
+
*
|
|
9
|
+
* Capabilities are intentionally minimal — only behavioral facts that
|
|
10
|
+
* cross feature boundaries. Per-type rendering / form layout / SEO live
|
|
11
|
+
* inside the per-type folder (X2 plugin layout).
|
|
12
|
+
*/
|
|
13
|
+
export const LISTING_TYPE_CAPABILITIES = {
|
|
14
|
+
standard: {
|
|
15
|
+
canAddToCart: true,
|
|
16
|
+
canBid: false,
|
|
17
|
+
supportsShipping: true,
|
|
18
|
+
requiresVendorVerified: false,
|
|
19
|
+
requiresJurisdictionCheck: false,
|
|
20
|
+
hasInstantFulfillment: false,
|
|
21
|
+
},
|
|
22
|
+
auction: {
|
|
23
|
+
canAddToCart: false,
|
|
24
|
+
canBid: true,
|
|
25
|
+
supportsShipping: true,
|
|
26
|
+
requiresVendorVerified: false,
|
|
27
|
+
requiresJurisdictionCheck: false,
|
|
28
|
+
hasInstantFulfillment: false,
|
|
29
|
+
},
|
|
30
|
+
"pre-order": {
|
|
31
|
+
canAddToCart: true,
|
|
32
|
+
canBid: false,
|
|
33
|
+
supportsShipping: true,
|
|
34
|
+
requiresVendorVerified: false,
|
|
35
|
+
requiresJurisdictionCheck: false,
|
|
36
|
+
hasInstantFulfillment: false,
|
|
37
|
+
},
|
|
38
|
+
"prize-draw": {
|
|
39
|
+
canAddToCart: true,
|
|
40
|
+
canBid: false,
|
|
41
|
+
supportsShipping: true,
|
|
42
|
+
requiresVendorVerified: false,
|
|
43
|
+
requiresJurisdictionCheck: false,
|
|
44
|
+
hasInstantFulfillment: false,
|
|
45
|
+
},
|
|
46
|
+
};
|
|
47
|
+
export function capabilityFor(type) {
|
|
48
|
+
return LISTING_TYPE_CAPABILITIES[type];
|
|
49
|
+
}
|
|
50
|
+
export function canAddToCart(type) {
|
|
51
|
+
return LISTING_TYPE_CAPABILITIES[type].canAddToCart;
|
|
52
|
+
}
|
|
53
|
+
export function canBid(type) {
|
|
54
|
+
return LISTING_TYPE_CAPABILITIES[type].canBid;
|
|
55
|
+
}
|
|
56
|
+
export function supportsShipping(type) {
|
|
57
|
+
return LISTING_TYPE_CAPABILITIES[type].supportsShipping;
|
|
58
|
+
}
|
|
59
|
+
export function requiresVendorVerified(type) {
|
|
60
|
+
return LISTING_TYPE_CAPABILITIES[type].requiresVendorVerified;
|
|
61
|
+
}
|
|
62
|
+
export function requiresJurisdictionCheck(type) {
|
|
63
|
+
return LISTING_TYPE_CAPABILITIES[type].requiresJurisdictionCheck;
|
|
64
|
+
}
|
|
65
|
+
export function hasInstantFulfillment(type) {
|
|
66
|
+
return LISTING_TYPE_CAPABILITIES[type].hasInstantFulfillment;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Exhaustive-switch helper. Use in `switch (type) { case ...: default: assertNever(type); }`
|
|
70
|
+
* so adding a new `ListingType` member is a TS error at every consumer
|
|
71
|
+
* that didn't update.
|
|
72
|
+
*/
|
|
73
|
+
export function assertNever(value) {
|
|
74
|
+
throw new Error(`Unhandled discriminant: ${String(value)}`);
|
|
75
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { LISTING_TYPE_CAPABILITIES } from "../capabilities";
|
|
2
|
+
export const LISTING_TYPE = "pre-order";
|
|
3
|
+
export const capability = LISTING_TYPE_CAPABILITIES["pre-order"];
|
|
4
|
+
export const config = {
|
|
5
|
+
listingType: LISTING_TYPE,
|
|
6
|
+
slugPrefix: "preorder-",
|
|
7
|
+
cartLine: "single-product",
|
|
8
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const ctas: readonly string[];
|