@mohasinac/appkit 2.6.3 → 2.6.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_internal/server/features/account/data.js +2 -2
- package/dist/_internal/server/features/bundles/data.d.ts +26 -6
- package/dist/_internal/server/features/bundles/data.js +41 -6
- package/dist/_internal/server/features/bundles/index.d.ts +3 -2
- package/dist/_internal/server/features/bundles/index.js +4 -2
- package/dist/_internal/server/features/bundles/metadata.d.ts +20 -0
- package/dist/_internal/server/features/bundles/metadata.js +46 -0
- package/dist/_internal/server/features/bundles/og.d.ts +38 -0
- package/dist/_internal/server/features/bundles/og.js +122 -0
- package/dist/_internal/server/features/checkout/actions.js +192 -133
- package/dist/_internal/server/features/checkout/bundle-expansion.d.ts +57 -0
- package/dist/_internal/server/features/checkout/bundle-expansion.js +70 -0
- package/dist/_internal/server/features/checkout/prize-bundle-gates.d.ts +5 -15
- package/dist/_internal/server/features/checkout/prize-bundle-gates.js +5 -21
- package/dist/_internal/server/features/media/contextGuards.js +15 -1
- package/dist/_internal/server/features/payouts/actions.d.ts +19 -0
- package/dist/_internal/server/features/payouts/actions.js +38 -0
- package/dist/_internal/server/features/products/data.js +1 -2
- package/dist/_internal/server/features/raffle/actions.d.ts +11 -0
- package/dist/_internal/server/features/raffle/actions.js +31 -0
- package/dist/_internal/server/features/refunds/actions.d.ts +31 -0
- package/dist/_internal/server/features/refunds/actions.js +77 -0
- package/dist/_internal/server/jobs/core/adminAnalytics.d.ts +28 -0
- package/dist/_internal/server/jobs/core/adminAnalytics.js +98 -0
- package/dist/_internal/server/jobs/core/assignSpinPrize.d.ts +19 -0
- package/dist/_internal/server/jobs/core/assignSpinPrize.js +81 -0
- package/dist/_internal/server/jobs/core/auctionSettlement.d.ts +2 -0
- package/dist/_internal/server/jobs/core/auctionSettlement.js +70 -0
- package/dist/_internal/server/jobs/core/autoPayoutEligibility.d.ts +2 -0
- package/dist/_internal/server/jobs/core/autoPayoutEligibility.js +109 -0
- package/dist/_internal/server/jobs/core/bundleStockSync.d.ts +10 -0
- package/dist/_internal/server/jobs/core/bundleStockSync.js +71 -0
- package/dist/_internal/server/jobs/core/cartPrune.d.ts +2 -0
- package/dist/_internal/server/jobs/core/cartPrune.js +13 -0
- package/dist/_internal/server/jobs/core/cleanupRtdbEvents.d.ts +2 -0
- package/dist/_internal/server/jobs/core/cleanupRtdbEvents.js +45 -0
- package/dist/_internal/server/jobs/core/countersReconcile.d.ts +2 -0
- package/dist/_internal/server/jobs/core/countersReconcile.js +107 -0
- package/dist/_internal/server/jobs/core/couponExpiry.d.ts +2 -0
- package/dist/_internal/server/jobs/core/couponExpiry.js +13 -0
- package/dist/_internal/server/jobs/core/dailyDataCleanup.d.ts +2 -0
- package/dist/_internal/server/jobs/core/dailyDataCleanup.js +20 -0
- package/dist/_internal/server/jobs/core/index.d.ts +44 -0
- package/dist/_internal/server/jobs/core/index.js +47 -0
- package/dist/_internal/server/jobs/core/listingProcessor.d.ts +30 -0
- package/dist/_internal/server/jobs/core/listingProcessor.js +138 -0
- package/dist/_internal/server/jobs/core/mediaTmpCleanup.d.ts +14 -0
- package/dist/_internal/server/jobs/core/mediaTmpCleanup.js +68 -0
- package/dist/_internal/server/jobs/core/notificationPrune.d.ts +2 -0
- package/dist/_internal/server/jobs/core/notificationPrune.js +13 -0
- package/dist/_internal/server/jobs/core/offerExpiry.d.ts +2 -0
- package/dist/_internal/server/jobs/core/offerExpiry.js +50 -0
- package/dist/_internal/server/jobs/core/onBidPlaced.d.ts +15 -0
- package/dist/_internal/server/jobs/core/onBidPlaced.js +59 -0
- package/dist/_internal/server/jobs/core/onCategoryWrite.d.ts +14 -0
- package/dist/_internal/server/jobs/core/onCategoryWrite.js +134 -0
- package/dist/_internal/server/jobs/core/onOrderCreate.d.ts +18 -0
- package/dist/_internal/server/jobs/core/onOrderCreate.js +78 -0
- package/dist/_internal/server/jobs/core/onOrderStatusChange.d.ts +19 -0
- package/dist/_internal/server/jobs/core/onOrderStatusChange.js +139 -0
- package/dist/_internal/server/jobs/core/onProductStockChange.d.ts +23 -0
- package/dist/_internal/server/jobs/core/onProductStockChange.js +130 -0
- package/dist/_internal/server/jobs/core/onProductWrite.d.ts +12 -0
- package/dist/_internal/server/jobs/core/onProductWrite.js +94 -0
- package/dist/_internal/server/jobs/core/onReviewWrite.d.ts +7 -0
- package/dist/_internal/server/jobs/core/onReviewWrite.js +49 -0
- package/dist/_internal/server/jobs/core/onStoreWrite.d.ts +12 -0
- package/dist/_internal/server/jobs/core/onStoreWrite.js +7 -0
- package/dist/_internal/server/jobs/core/payoutBatch.d.ts +8 -0
- package/dist/_internal/server/jobs/core/payoutBatch.js +102 -0
- package/dist/_internal/server/jobs/core/pendingOrderTimeout.d.ts +2 -0
- package/dist/_internal/server/jobs/core/pendingOrderTimeout.js +27 -0
- package/dist/_internal/server/jobs/core/positionsReconcile.d.ts +7 -0
- package/dist/_internal/server/jobs/core/positionsReconcile.js +87 -0
- package/dist/_internal/server/jobs/core/prizeRevealClose.d.ts +2 -0
- package/dist/_internal/server/jobs/core/prizeRevealClose.js +22 -0
- package/dist/_internal/server/jobs/core/prizeRevealExpiry.d.ts +2 -0
- package/dist/_internal/server/jobs/core/prizeRevealExpiry.js +50 -0
- package/dist/_internal/server/jobs/core/prizeRevealOpen.d.ts +2 -0
- package/dist/_internal/server/jobs/core/prizeRevealOpen.js +56 -0
- package/dist/_internal/server/jobs/core/prizeRevealReminder.d.ts +2 -0
- package/dist/_internal/server/jobs/core/prizeRevealReminder.js +38 -0
- package/dist/_internal/server/jobs/core/productStatsSync.d.ts +8 -0
- package/dist/_internal/server/jobs/core/productStatsSync.js +36 -0
- package/dist/_internal/server/jobs/core/promotions.d.ts +12 -0
- package/dist/_internal/server/jobs/core/promotions.js +43 -0
- package/dist/_internal/server/jobs/core/storeAnalytics.d.ts +30 -0
- package/dist/_internal/server/jobs/core/storeAnalytics.js +109 -0
- package/dist/_internal/server/jobs/core/triggerEventRaffle.d.ts +19 -0
- package/dist/_internal/server/jobs/core/triggerEventRaffle.js +86 -0
- package/dist/_internal/server/jobs/core/weeklyPayoutEligibility.d.ts +6 -0
- package/dist/_internal/server/jobs/core/weeklyPayoutEligibility.js +85 -0
- package/dist/_internal/server/jobs/handlers/adminAnalytics.d.ts +2 -26
- package/dist/_internal/server/jobs/handlers/adminAnalytics.js +2 -98
- package/dist/_internal/server/jobs/handlers/assignSpinPrize.d.ts +1 -22
- package/dist/_internal/server/jobs/handlers/assignSpinPrize.js +2 -86
- package/dist/_internal/server/jobs/handlers/auctionSettlement.js +2 -70
- package/dist/_internal/server/jobs/handlers/autoPayoutEligibility.js +2 -110
- package/dist/_internal/server/jobs/handlers/bundleStockSync.d.ts +0 -16
- package/dist/_internal/server/jobs/handlers/bundleStockSync.js +2 -80
- package/dist/_internal/server/jobs/handlers/cartPrune.js +2 -13
- package/dist/_internal/server/jobs/handlers/cleanupRtdbEvents.js +2 -45
- package/dist/_internal/server/jobs/handlers/countersReconcile.js +2 -109
- package/dist/_internal/server/jobs/handlers/couponExpiry.js +2 -13
- package/dist/_internal/server/jobs/handlers/dailyDataCleanup.js +2 -20
- package/dist/_internal/server/jobs/handlers/listingProcessor.d.ts +3 -28
- package/dist/_internal/server/jobs/handlers/listingProcessor.js +3 -138
- package/dist/_internal/server/jobs/handlers/mediaTmpCleanup.d.ts +0 -12
- package/dist/_internal/server/jobs/handlers/mediaTmpCleanup.js +2 -69
- package/dist/_internal/server/jobs/handlers/notificationPrune.js +2 -13
- package/dist/_internal/server/jobs/handlers/offerExpiry.js +2 -50
- package/dist/_internal/server/jobs/handlers/onBidPlaced.d.ts +1 -10
- package/dist/_internal/server/jobs/handlers/onBidPlaced.js +2 -56
- package/dist/_internal/server/jobs/handlers/onCategoryWrite.d.ts +1 -8
- package/dist/_internal/server/jobs/handlers/onCategoryWrite.js +6 -134
- package/dist/_internal/server/jobs/handlers/onOrderCreate.d.ts +1 -12
- package/dist/_internal/server/jobs/handlers/onOrderCreate.js +2 -76
- package/dist/_internal/server/jobs/handlers/onOrderStatusChange.d.ts +1 -12
- package/dist/_internal/server/jobs/handlers/onOrderStatusChange.js +2 -139
- package/dist/_internal/server/jobs/handlers/onProductStockChange.d.ts +0 -13
- package/dist/_internal/server/jobs/handlers/onProductStockChange.js +7 -134
- package/dist/_internal/server/jobs/handlers/onProductWrite.d.ts +1 -6
- package/dist/_internal/server/jobs/handlers/onProductWrite.js +6 -106
- package/dist/_internal/server/jobs/handlers/onReviewWrite.js +2 -49
- package/dist/_internal/server/jobs/handlers/onStoreWrite.d.ts +1 -8
- package/dist/_internal/server/jobs/handlers/onStoreWrite.js +7 -8
- package/dist/_internal/server/jobs/handlers/payoutBatch.d.ts +0 -9
- package/dist/_internal/server/jobs/handlers/payoutBatch.js +2 -104
- package/dist/_internal/server/jobs/handlers/pendingOrderTimeout.d.ts +0 -6
- package/dist/_internal/server/jobs/handlers/pendingOrderTimeout.js +2 -33
- package/dist/_internal/server/jobs/handlers/positionsReconcile.d.ts +0 -5
- package/dist/_internal/server/jobs/handlers/positionsReconcile.js +2 -87
- package/dist/_internal/server/jobs/handlers/prizeRevealClose.d.ts +0 -7
- package/dist/_internal/server/jobs/handlers/prizeRevealClose.js +2 -29
- package/dist/_internal/server/jobs/handlers/prizeRevealExpiry.d.ts +0 -8
- package/dist/_internal/server/jobs/handlers/prizeRevealExpiry.js +2 -58
- package/dist/_internal/server/jobs/handlers/prizeRevealOpen.d.ts +0 -8
- package/dist/_internal/server/jobs/handlers/prizeRevealOpen.js +2 -65
- package/dist/_internal/server/jobs/handlers/prizeRevealReminder.d.ts +0 -7
- package/dist/_internal/server/jobs/handlers/prizeRevealReminder.js +2 -45
- package/dist/_internal/server/jobs/handlers/productStatsSync.d.ts +0 -6
- package/dist/_internal/server/jobs/handlers/productStatsSync.js +2 -36
- package/dist/_internal/server/jobs/handlers/promotions.d.ts +2 -10
- package/dist/_internal/server/jobs/handlers/promotions.js +2 -43
- package/dist/_internal/server/jobs/handlers/storeAnalytics.d.ts +2 -28
- package/dist/_internal/server/jobs/handlers/storeAnalytics.js +2 -109
- package/dist/_internal/server/jobs/handlers/triggerEventRaffle.d.ts +1 -28
- package/dist/_internal/server/jobs/handlers/triggerEventRaffle.js +2 -94
- package/dist/_internal/server/jobs/handlers/weeklyPayoutEligibility.d.ts +0 -6
- package/dist/_internal/server/jobs/handlers/weeklyPayoutEligibility.js +2 -87
- package/dist/_internal/server/jobs/index.d.ts +1 -0
- package/dist/_internal/server/jobs/index.js +1 -0
- package/dist/_internal/server/jobs/runtime/adapters/firebase.js +21 -0
- package/dist/_internal/shared/actions/action-registry.d.ts +84 -0
- package/dist/_internal/shared/actions/action-registry.js +160 -0
- package/dist/_internal/shared/checkout/rules/_defaults.d.ts +3 -0
- package/dist/_internal/shared/checkout/rules/_defaults.js +22 -0
- package/dist/_internal/shared/checkout/rules/_limits.d.ts +19 -0
- package/dist/_internal/shared/checkout/rules/_limits.js +19 -0
- package/dist/_internal/shared/checkout/rules/_registry.d.ts +44 -0
- package/dist/_internal/shared/checkout/rules/_registry.js +87 -0
- package/dist/_internal/shared/checkout/rules/auction.rule.d.ts +2 -0
- package/dist/_internal/shared/checkout/rules/auction.rule.js +10 -0
- package/dist/_internal/shared/checkout/rules/bundle.rule.d.ts +11 -0
- package/dist/_internal/shared/checkout/rules/bundle.rule.js +6 -0
- package/dist/_internal/shared/checkout/rules/classified.rule.d.ts +9 -0
- package/dist/_internal/shared/checkout/rules/classified.rule.js +9 -0
- package/dist/_internal/shared/checkout/rules/digital-code.rule.d.ts +8 -0
- package/dist/_internal/shared/checkout/rules/digital-code.rule.js +6 -0
- package/dist/_internal/shared/checkout/rules/index.d.ts +12 -0
- package/dist/_internal/shared/checkout/rules/index.js +12 -0
- package/dist/_internal/shared/checkout/rules/live.rule.d.ts +10 -0
- package/dist/_internal/shared/checkout/rules/live.rule.js +6 -0
- package/dist/_internal/shared/checkout/rules/offer.rule.d.ts +2 -0
- package/dist/_internal/shared/checkout/rules/offer.rule.js +9 -0
- package/dist/_internal/shared/checkout/rules/preorder.rule.d.ts +2 -0
- package/dist/_internal/shared/checkout/rules/preorder.rule.js +28 -0
- package/dist/_internal/shared/checkout/rules/prize-draw.rule.d.ts +2 -0
- package/dist/_internal/shared/checkout/rules/prize-draw.rule.js +65 -0
- package/dist/_internal/shared/checkout/rules/standard.rule.d.ts +2 -0
- package/dist/_internal/shared/checkout/rules/standard.rule.js +5 -0
- package/dist/_internal/shared/checkout/rules/types.d.ts +125 -0
- package/dist/_internal/shared/checkout/rules/types.js +13 -0
- package/dist/_internal/shared/features/cart/schema.d.ts +6 -6
- package/dist/_internal/shared/features/categories/bundle-copy.d.ts +123 -0
- package/dist/_internal/shared/features/categories/bundle-copy.js +134 -0
- package/dist/_internal/shared/features/categories/bundle-schemas.d.ts +318 -0
- package/dist/_internal/shared/features/categories/bundle-schemas.js +55 -0
- package/dist/_internal/shared/features/events/schema.d.ts +4 -4
- package/dist/_internal/shared/features/orders/refund-copy.d.ts +36 -0
- package/dist/_internal/shared/features/orders/refund-copy.js +40 -0
- package/dist/_internal/shared/features/orders/schema.d.ts +4 -4
- package/dist/_internal/shared/features/products/schema.d.ts +8 -8
- package/dist/_internal/shared/listing-types/_registry.d.ts +27 -0
- package/dist/_internal/shared/listing-types/_registry.js +8 -0
- package/dist/_internal/shared/listing-types/action-tracker.d.ts +41 -0
- package/dist/_internal/shared/listing-types/action-tracker.js +70 -0
- package/dist/_internal/shared/listing-types/capabilities.js +25 -0
- package/dist/_internal/shared/listing-types/cart-shipping.d.ts +37 -0
- package/dist/_internal/shared/listing-types/cart-shipping.js +46 -0
- package/dist/_internal/shared/listing-types/classified/config.d.ts +7 -0
- package/dist/_internal/shared/listing-types/classified/config.js +8 -0
- package/dist/_internal/shared/listing-types/classified/ctas.d.ts +1 -0
- package/dist/_internal/shared/listing-types/classified/ctas.js +3 -0
- package/dist/_internal/shared/listing-types/classified/og.d.ts +1 -0
- package/dist/_internal/shared/listing-types/classified/og.js +1 -0
- package/dist/_internal/shared/listing-types/classified/schema.d.ts +1 -0
- package/dist/_internal/shared/listing-types/classified/schema.js +1 -0
- package/dist/_internal/shared/listing-types/classified/seed-factory.d.ts +1 -0
- package/dist/_internal/shared/listing-types/classified/seed-factory.js +1 -0
- package/dist/_internal/shared/listing-types/digital-code/config.d.ts +7 -0
- package/dist/_internal/shared/listing-types/digital-code/config.js +8 -0
- package/dist/_internal/shared/listing-types/digital-code/ctas.d.ts +1 -0
- package/dist/_internal/shared/listing-types/digital-code/ctas.js +3 -0
- package/dist/_internal/shared/listing-types/digital-code/og.d.ts +1 -0
- package/dist/_internal/shared/listing-types/digital-code/og.js +1 -0
- package/dist/_internal/shared/listing-types/digital-code/schema.d.ts +1 -0
- package/dist/_internal/shared/listing-types/digital-code/schema.js +1 -0
- package/dist/_internal/shared/listing-types/digital-code/seed-factory.d.ts +1 -0
- package/dist/_internal/shared/listing-types/digital-code/seed-factory.js +1 -0
- package/dist/_internal/shared/listing-types/feature-flags.d.ts +34 -0
- package/dist/_internal/shared/listing-types/feature-flags.js +45 -0
- package/dist/_internal/shared/listing-types/live/config.d.ts +7 -0
- package/dist/_internal/shared/listing-types/live/config.js +8 -0
- package/dist/_internal/shared/listing-types/live/ctas.d.ts +1 -0
- package/dist/_internal/shared/listing-types/live/ctas.js +3 -0
- package/dist/_internal/shared/listing-types/live/og.d.ts +1 -0
- package/dist/_internal/shared/listing-types/live/og.js +1 -0
- package/dist/_internal/shared/listing-types/live/schema.d.ts +1 -0
- package/dist/_internal/shared/listing-types/live/schema.js +1 -0
- package/dist/_internal/shared/listing-types/live/seed-factory.d.ts +1 -0
- package/dist/_internal/shared/listing-types/live/seed-factory.js +1 -0
- package/dist/_internal/shared/media/limits.js +8 -0
- package/dist/client.d.ts +10 -5
- package/dist/client.js +16 -3
- package/dist/configs/next.js +7 -0
- package/dist/constants/api-endpoints.d.ts +6 -0
- package/dist/constants/api-endpoints.js +4 -0
- package/dist/core/hooks/useSyncManager.js +13 -1
- package/dist/core/unit-of-work.d.ts +1 -1
- package/dist/core/unit-of-work.js +2 -2
- package/dist/features/account/actions/address-actions.d.ts +1 -1
- package/dist/features/account/actions/address-actions.js +15 -7
- package/dist/features/account/schemas/firestore.d.ts +8 -43
- package/dist/features/account/schemas/firestore.js +8 -54
- package/dist/features/account/schemas/index.d.ts +6 -6
- package/dist/features/account/server.d.ts +1 -1
- package/dist/features/account/server.js +3 -1
- package/dist/features/addresses/index.d.ts +2 -0
- package/dist/features/addresses/index.js +2 -0
- package/dist/features/addresses/repository/addresses.repository.d.ts +29 -0
- package/dist/features/addresses/repository/addresses.repository.js +157 -0
- package/dist/features/addresses/schemas/firestore.d.ts +53 -0
- package/dist/features/addresses/schemas/firestore.js +68 -0
- package/dist/features/{bundles → addresses}/schemas/index.d.ts +0 -1
- package/dist/features/{bundles → addresses}/schemas/index.js +0 -1
- package/dist/features/addresses/server.d.ts +2 -0
- package/dist/features/addresses/server.js +2 -0
- package/dist/features/admin/components/AdminAllEventEntriesView.js +4 -3
- package/dist/features/admin/components/AdminBidsView.js +4 -3
- package/dist/features/admin/components/AdminBlogView.js +8 -3
- package/dist/features/admin/components/AdminBundleEditorView.d.ts +9 -0
- package/dist/features/admin/components/AdminBundleEditorView.js +209 -0
- package/dist/features/admin/components/AdminBundlesView.d.ts +9 -0
- package/dist/features/admin/components/AdminBundlesView.js +59 -0
- package/dist/features/admin/components/AdminCartsView.js +13 -3
- package/dist/features/admin/components/AdminContactView.js +4 -3
- package/dist/features/admin/components/AdminCouponsView.js +32 -13
- package/dist/features/admin/components/AdminNewsletterView.js +4 -3
- package/dist/features/admin/components/AdminOrdersView.js +15 -7
- package/dist/features/admin/components/AdminPayoutsView.js +4 -3
- package/dist/features/admin/components/AdminPrizeDrawsView.d.ts +4 -0
- package/dist/features/admin/components/AdminPrizeDrawsView.js +135 -0
- package/dist/features/admin/components/AdminProductsView.js +6 -5
- package/dist/features/admin/components/AdminReviewsView.js +5 -4
- package/dist/features/admin/components/AdminStoresView.js +4 -3
- package/dist/features/admin/components/AdminUsersView.js +15 -5
- package/dist/features/admin/components/AdminWishlistsView.js +10 -1
- package/dist/features/admin/components/DataTable.d.ts +5 -1
- package/dist/features/admin/components/DataTable.js +24 -20
- package/dist/features/admin/components/index.d.ts +6 -0
- package/dist/features/admin/components/index.js +5 -0
- package/dist/features/admin/constants/filter-tabs.d.ts +435 -0
- package/dist/features/admin/constants/filter-tabs.js +216 -0
- package/dist/features/admin/hooks/useAdminListingData.d.ts +1 -0
- package/dist/features/admin/hooks/useAdminListingData.js +1 -0
- package/dist/features/admin/schemas/firestore.d.ts +15 -0
- package/dist/features/admin/schemas/firestore.js +18 -0
- package/dist/features/admin/types/product.types.d.ts +2 -2
- package/dist/features/auctions/components/AuctionCard.d.ts +4 -1
- package/dist/features/auctions/components/AuctionCard.js +5 -3
- package/dist/features/auctions/components/AuctionDetailPageView.js +1 -1
- package/dist/features/auctions/components/MarketplaceAuctionCard.d.ts +2 -2
- package/dist/features/auctions/components/PlaceBidFormClient.js +12 -2
- package/dist/features/auctions/schemas/index.d.ts +2 -2
- package/dist/features/auth/index.d.ts +1 -0
- package/dist/features/auth/index.js +1 -0
- package/dist/features/auth/role-predicates.d.ts +16 -0
- package/dist/features/auth/role-predicates.js +15 -0
- package/dist/features/blog/components/BlogFeaturedCard.d.ts +4 -1
- package/dist/features/blog/components/BlogFeaturedCard.js +5 -3
- package/dist/features/cart/actions/cart-actions.d.ts +1 -0
- package/dist/features/cart/actions/cart-actions.js +16 -0
- package/dist/features/cart/components/CartView.d.ts +19 -1
- package/dist/features/cart/components/CartView.js +2 -2
- package/dist/features/cart/components/ShippingPicker.d.ts +13 -0
- package/dist/features/cart/components/ShippingPicker.js +48 -0
- package/dist/features/cart/components/index.d.ts +3 -1
- package/dist/features/cart/components/index.js +1 -0
- package/dist/features/cart/hooks/useCartCount.js +7 -1
- package/dist/features/cart/repository/cart.repository.d.ts +1 -0
- package/dist/features/cart/repository/cart.repository.js +35 -0
- package/dist/features/cart/schemas/firestore.d.ts +27 -2
- package/dist/features/categories/components/BundleAddToCartCta.d.ts +16 -0
- package/dist/features/categories/components/BundleAddToCartCta.js +54 -0
- package/dist/features/categories/components/BundleBuyNowCta.d.ts +8 -0
- package/dist/features/categories/components/BundleBuyNowCta.js +37 -0
- package/dist/features/categories/components/BundleDetailView.d.ts +22 -0
- package/dist/features/categories/components/BundleDetailView.js +31 -0
- package/dist/features/categories/components/BundleDynamicRuleEditor.d.ts +18 -0
- package/dist/features/categories/components/BundleDynamicRuleEditor.js +60 -0
- package/dist/features/categories/components/BundleItemsPicker.d.ts +26 -0
- package/dist/features/categories/components/BundleItemsPicker.js +135 -0
- package/dist/features/categories/components/BundlesListView.d.ts +13 -0
- package/dist/features/categories/components/BundlesListView.js +27 -0
- package/dist/features/categories/components/index.d.ts +12 -0
- package/dist/features/categories/components/index.js +9 -0
- package/dist/features/checkout/actions/checkout-actions.js +10 -3
- package/dist/features/events/components/AdminEventEditorView.js +108 -2
- package/dist/features/events/components/AdminEventsView.js +16 -4
- package/dist/features/events/components/EventCard.d.ts +4 -1
- package/dist/features/events/components/EventCard.js +7 -3
- package/dist/features/events/components/EventRaffleWinnerView.d.ts +21 -0
- package/dist/features/events/components/EventRaffleWinnerView.js +18 -0
- package/dist/features/events/components/SpinWheelView.d.ts +27 -0
- package/dist/features/events/components/SpinWheelView.js +64 -0
- package/dist/features/events/components/index.d.ts +4 -0
- package/dist/features/events/components/index.js +2 -0
- package/dist/features/events/schemas/firestore.d.ts +27 -1
- package/dist/features/events/schemas/firestore.js +7 -0
- package/dist/features/events/types/index.d.ts +27 -1
- package/dist/features/homepage/components/FeaturedBundlesSection.d.ts +16 -0
- package/dist/features/homepage/components/FeaturedBundlesSection.js +24 -0
- package/dist/features/homepage/components/MarketplaceHomepageView.js +4 -1
- package/dist/features/homepage/components/WhatsAppCommunitySection.js +2 -2
- package/dist/features/homepage/lib/section-renderer.d.ts +2 -0
- package/dist/features/homepage/lib/section-renderer.js +5 -5
- package/dist/features/layout/NavbarLayout.d.ts +3 -1
- package/dist/features/layout/NavbarLayout.js +32 -3
- package/dist/features/layout/TitleBarLayout.d.ts +6 -3
- package/dist/features/layout/TitleBarLayout.js +22 -7
- package/dist/features/media/upload/MediaUploadField.d.ts +15 -1
- package/dist/features/media/upload/MediaUploadField.js +22 -1
- package/dist/features/orders/components/MarketplaceOrderCard.js +4 -2
- package/dist/features/orders/components/OrderSiblingPayments.d.ts +8 -0
- package/dist/features/orders/components/OrderSiblingPayments.js +16 -0
- package/dist/features/orders/components/RefundHistoryTable.d.ts +6 -0
- package/dist/features/orders/components/RefundHistoryTable.js +23 -0
- package/dist/features/orders/components/RefundRequestView.d.ts +8 -0
- package/dist/features/orders/components/RefundRequestView.js +42 -0
- package/dist/features/orders/components/index.d.ts +6 -0
- package/dist/features/orders/components/index.js +3 -0
- package/dist/features/orders/index.d.ts +1 -0
- package/dist/features/orders/index.js +2 -0
- package/dist/features/orders/repository/orders.repository.d.ts +20 -1
- package/dist/features/orders/repository/orders.repository.js +30 -1
- package/dist/features/orders/schemas/firestore.d.ts +63 -13
- package/dist/features/orders/schemas/firestore.js +5 -5
- package/dist/features/orders/schemas/index.d.ts +4 -4
- package/dist/features/orders/types/index.d.ts +12 -2
- package/dist/features/orders/utils/bundle-grouping.d.ts +48 -0
- package/dist/features/orders/utils/bundle-grouping.js +54 -0
- package/dist/features/orders/utils/order-splitter.d.ts +9 -10
- package/dist/features/orders/utils/order-splitter.js +24 -30
- package/dist/features/payments/repository/payout.repository.d.ts +17 -1
- package/dist/features/payments/repository/payout.repository.js +47 -0
- package/dist/features/payments/schemas/firestore.d.ts +26 -0
- package/dist/features/pre-orders/components/PreorderCard.d.ts +4 -1
- package/dist/features/pre-orders/components/PreorderCard.js +8 -6
- package/dist/features/products/actions/product-actions.d.ts +1 -1
- package/dist/features/products/actions/product-actions.js +1 -1
- package/dist/features/products/components/CompareOverlay.d.ts +2 -2
- package/dist/features/products/components/CompareOverlay.js +4 -4
- package/dist/features/products/components/InteractiveProductCard.js +7 -12
- package/dist/features/products/components/NonRefundableConsentModal.d.ts +1 -1
- package/dist/features/products/components/NonRefundableConsentModal.js +0 -10
- package/dist/features/products/components/ProductGrid.js +28 -12
- package/dist/features/products/components/ShowGroupSection.js +3 -3
- package/dist/features/products/components/SublistingCarouselSection.js +2 -2
- package/dist/features/products/components/index.d.ts +0 -4
- package/dist/features/products/components/index.js +5 -2
- package/dist/features/products/index.d.ts +1 -1
- package/dist/features/products/index.js +3 -1
- package/dist/features/products/repository/products.repository.js +4 -0
- package/dist/features/products/schemas/catalog-product.d.ts +70 -0
- package/dist/features/products/schemas/catalog-product.js +50 -0
- package/dist/features/products/schemas/firestore.d.ts +110 -2
- package/dist/features/products/schemas/firestore.js +30 -0
- package/dist/features/products/schemas/index.d.ts +8 -8
- package/dist/features/products/types/index.d.ts +1 -1
- package/dist/features/products/utils/listing-type.d.ts +9 -0
- package/dist/features/products/utils/listing-type.js +4 -0
- package/dist/features/promotions/actions/coupon-actions.d.ts +2 -2
- package/dist/features/promotions/actions/coupon-actions.js +1 -1
- package/dist/features/promotions/components/CouponCard.d.ts +28 -10
- package/dist/features/promotions/components/CouponCard.js +116 -14
- package/dist/features/promotions/hooks/useCouponValidate.d.ts +1 -1
- package/dist/features/promotions/repository/coupons.repository.d.ts +1 -1
- package/dist/features/reviews/schemas/index.d.ts +2 -2
- package/dist/features/search/schemas/index.d.ts +2 -2
- package/dist/features/search/types/index.d.ts +2 -2
- package/dist/features/seller/components/SellerAuctionsView.js +4 -5
- package/dist/features/seller/components/SellerBidsView.js +5 -13
- package/dist/features/seller/components/SellerCouponsView.js +31 -67
- package/dist/features/seller/components/SellerOffersView.js +4 -5
- package/dist/features/seller/components/SellerOrdersView.js +4 -5
- package/dist/features/seller/components/SellerPayoutsView.js +4 -5
- package/dist/features/seller/components/SellerPreOrdersView.d.ts +4 -0
- package/dist/features/seller/components/SellerPreOrdersView.js +141 -0
- package/dist/features/seller/components/SellerPrizeDrawsView.d.ts +4 -0
- package/dist/features/seller/components/SellerPrizeDrawsView.js +138 -0
- package/dist/features/seller/components/SellerProductsView.js +4 -8
- package/dist/features/seller/components/index.d.ts +4 -0
- package/dist/features/seller/components/index.js +2 -0
- package/dist/features/seller/schemas/index.d.ts +2 -2
- package/dist/features/stores/actions/store-address-actions.d.ts +10 -6
- package/dist/features/stores/actions/store-address-actions.js +8 -7
- package/dist/features/stores/components/InteractiveStoreCard.js +3 -10
- package/dist/features/stores/components/StoreDetailLayoutView.js +20 -5
- package/dist/features/stores/schemas/firestore.d.ts +45 -38
- package/dist/features/stores/schemas/firestore.js +2 -49
- package/dist/features/stores/server.d.ts +0 -1
- package/dist/features/stores/server.js +2 -1
- package/dist/features/wishlist/hooks/useWishlistCount.d.ts +7 -9
- package/dist/features/wishlist/hooks/useWishlistCount.js +67 -86
- package/dist/features/wishlist/types/index.d.ts +1 -1
- package/dist/index.d.ts +56 -9
- package/dist/index.js +66 -11
- package/dist/next/routing/route-map.d.ts +6 -0
- package/dist/next/routing/route-map.js +4 -0
- package/dist/providers/db-firebase/admin.d.ts +6 -2
- package/dist/providers/db-firebase/admin.js +23 -0
- package/dist/repositories/index.d.ts +1 -2
- package/dist/repositories/index.js +5 -2
- package/dist/security/authorization.d.ts +2 -1
- package/dist/security/authorization.js +3 -2
- package/dist/seed/actions/demo-seed-actions.d.ts +1 -1
- package/dist/seed/bids-seed-data.d.ts +2 -2
- package/dist/seed/bids-seed-data.js +77 -2
- package/dist/seed/cart-seed-data.d.ts +10 -10
- package/dist/seed/cart-seed-data.js +15 -15
- package/dist/seed/events-seed-data.js +77 -0
- package/dist/seed/manifest.js +16 -8
- package/dist/seed/orders-seed-data.js +41 -2
- package/dist/seed/payouts-seed-data.js +18 -2
- package/dist/seed/stores-seed-data.js +55 -0
- package/dist/server-entry.d.ts +1 -0
- package/dist/server-entry.js +2 -0
- package/dist/server.d.ts +4 -0
- package/dist/server.js +8 -0
- package/dist/tailwind-utilities.css +1 -1
- package/dist/ui/components/FilterChipGroup.d.ts +39 -0
- package/dist/ui/components/FilterChipGroup.js +15 -0
- package/dist/ui/components/HorizontalScroller.js +32 -7
- package/dist/ui/components/HorizontalScroller.style.css +6 -0
- package/dist/ui/components/SiteLogo.js +1 -1
- package/dist/ui/index.d.ts +2 -0
- package/dist/ui/index.js +2 -0
- package/dist/utils/id-generators.d.ts +11 -0
- package/dist/utils/id-generators.js +16 -0
- package/package.json +1 -1
- package/dist/_internal/shared/features/bundles/config.d.ts +0 -6
- package/dist/_internal/shared/features/bundles/config.js +0 -6
- package/dist/_internal/shared/schema-versions.d.ts +0 -76
- package/dist/_internal/shared/schema-versions.js +0 -82
- package/dist/features/account/migrations.d.ts +0 -2
- package/dist/features/account/migrations.js +0 -10
- package/dist/features/admin/migrations.d.ts +0 -2
- package/dist/features/admin/migrations.js +0 -10
- package/dist/features/auctions/migrations.d.ts +0 -2
- package/dist/features/auctions/migrations.js +0 -10
- package/dist/features/auth/migrations.d.ts +0 -2
- package/dist/features/auth/migrations.js +0 -10
- package/dist/features/blog/migrations.d.ts +0 -2
- package/dist/features/blog/migrations.js +0 -10
- package/dist/features/brands/actions/brand-actions.d.ts +0 -2
- package/dist/features/brands/actions/brand-actions.js +0 -5
- package/dist/features/brands/index.d.ts +0 -3
- package/dist/features/brands/index.js +0 -3
- package/dist/features/brands/migrations.d.ts +0 -2
- package/dist/features/brands/migrations.js +0 -10
- package/dist/features/brands/repository/brands.repository.d.ts +0 -13
- package/dist/features/brands/repository/brands.repository.js +0 -60
- package/dist/features/brands/schemas/index.d.ts +0 -33
- package/dist/features/brands/schemas/index.js +0 -15
- package/dist/features/brands/server.d.ts +0 -7
- package/dist/features/brands/server.js +0 -7
- package/dist/features/bundles/components/AdminBundleEditorView.d.ts +0 -8
- package/dist/features/bundles/components/AdminBundleEditorView.js +0 -7
- package/dist/features/bundles/components/BundleDetailPageView.d.ts +0 -9
- package/dist/features/bundles/components/BundleDetailPageView.js +0 -45
- package/dist/features/bundles/components/BundleForm.d.ts +0 -12
- package/dist/features/bundles/components/BundleForm.js +0 -126
- package/dist/features/bundles/components/BundleItemsPicker.d.ts +0 -9
- package/dist/features/bundles/components/BundleItemsPicker.js +0 -77
- package/dist/features/bundles/components/BundlesByCategoryListing.d.ts +0 -6
- package/dist/features/bundles/components/BundlesByCategoryListing.js +0 -50
- package/dist/features/bundles/components/BundlesListingView.d.ts +0 -17
- package/dist/features/bundles/components/BundlesListingView.js +0 -50
- package/dist/features/bundles/components/FeaturedBundlesSection.d.ts +0 -5
- package/dist/features/bundles/components/FeaturedBundlesSection.js +0 -55
- package/dist/features/bundles/components/SellerBundleCreateView.d.ts +0 -8
- package/dist/features/bundles/components/SellerBundleCreateView.js +0 -7
- package/dist/features/bundles/components/SellerBundleEditView.d.ts +0 -9
- package/dist/features/bundles/components/SellerBundleEditView.js +0 -7
- package/dist/features/bundles/components/index.d.ts +0 -18
- package/dist/features/bundles/components/index.js +0 -9
- package/dist/features/bundles/constants/index.d.ts +0 -32
- package/dist/features/bundles/constants/index.js +0 -35
- package/dist/features/bundles/index.d.ts +0 -2
- package/dist/features/bundles/index.js +0 -2
- package/dist/features/bundles/migrations.d.ts +0 -2
- package/dist/features/bundles/migrations.js +0 -10
- package/dist/features/bundles/repository/bundles.repository.d.ts +0 -36
- package/dist/features/bundles/repository/bundles.repository.js +0 -148
- package/dist/features/bundles/repository/index.d.ts +0 -1
- package/dist/features/bundles/repository/index.js +0 -1
- package/dist/features/bundles/schemas/firestore.d.ts +0 -88
- package/dist/features/bundles/schemas/firestore.js +0 -29
- package/dist/features/bundles/schemas/zod.d.ts +0 -377
- package/dist/features/bundles/schemas/zod.js +0 -71
- package/dist/features/cart/migrations.d.ts +0 -2
- package/dist/features/cart/migrations.js +0 -10
- package/dist/features/categories/migrations.d.ts +0 -2
- package/dist/features/categories/migrations.js +0 -10
- package/dist/features/events/migrations.d.ts +0 -2
- package/dist/features/events/migrations.js +0 -10
- package/dist/features/faq/migrations.d.ts +0 -2
- package/dist/features/faq/migrations.js +0 -10
- package/dist/features/grouped/migrations.d.ts +0 -2
- package/dist/features/grouped/migrations.js +0 -10
- package/dist/features/history/migrations.d.ts +0 -2
- package/dist/features/history/migrations.js +0 -10
- package/dist/features/messages/migrations.d.ts +0 -2
- package/dist/features/messages/migrations.js +0 -10
- package/dist/features/orders/migrations.d.ts +0 -2
- package/dist/features/orders/migrations.js +0 -10
- package/dist/features/payments/migrations.d.ts +0 -2
- package/dist/features/payments/migrations.js +0 -10
- package/dist/features/products/migrations.d.ts +0 -2
- package/dist/features/products/migrations.js +0 -10
- package/dist/features/products/repository/sublisting-categories.repository.d.ts +0 -16
- package/dist/features/products/repository/sublisting-categories.repository.js +0 -126
- package/dist/features/products/schemas/sublisting-categories.d.ts +0 -45
- package/dist/features/products/schemas/sublisting-categories.js +0 -16
- package/dist/features/promotions/migrations.d.ts +0 -2
- package/dist/features/promotions/migrations.js +0 -10
- package/dist/features/reviews/migrations.d.ts +0 -2
- package/dist/features/reviews/migrations.js +0 -10
- package/dist/features/scams/migrations.d.ts +0 -2
- package/dist/features/scams/migrations.js +0 -10
- package/dist/features/seller/migrations.d.ts +0 -2
- package/dist/features/seller/migrations.js +0 -10
- package/dist/features/stores/migrations.d.ts +0 -2
- package/dist/features/stores/migrations.js +0 -10
- package/dist/features/sublisting/migrations.d.ts +0 -2
- package/dist/features/sublisting/migrations.js +0 -10
- package/dist/features/sublisting/schemas/firestore.d.ts +0 -32
- package/dist/features/sublisting/schemas/firestore.js +0 -19
- package/dist/features/support/migrations.d.ts +0 -2
- package/dist/features/support/migrations.js +0 -10
- package/dist/features/wishlist/migrations.d.ts +0 -2
- package/dist/features/wishlist/migrations.js +0 -10
- package/dist/seed/_bundle-constants.d.ts +0 -14
- package/dist/seed/_bundle-constants.js +0 -14
- package/dist/seed/anime-figures-seed-data.d.ts +0 -8
- package/dist/seed/anime-figures-seed-data.js +0 -1033
- package/dist/seed/beyblade-seed-data.d.ts +0 -7
- package/dist/seed/beyblade-seed-data.js +0 -1129
- package/dist/seed/brands-seed-data.d.ts +0 -7
- package/dist/seed/brands-seed-data.js +0 -410
- package/dist/seed/bundles-seed-data.d.ts +0 -13
- package/dist/seed/bundles-seed-data.js +0 -229
- package/dist/seed/cosplay-accessories-seed-data.d.ts +0 -8
- package/dist/seed/cosplay-accessories-seed-data.js +0 -647
- package/dist/seed/hot-wheels-seed-data.d.ts +0 -7
- package/dist/seed/hot-wheels-seed-data.js +0 -1612
- package/dist/seed/letitrip-official-seed-data.d.ts +0 -8
- package/dist/seed/letitrip-official-seed-data.js +0 -399
- package/dist/seed/pokemon-carousel-slides-seed-data.d.ts +0 -8
- package/dist/seed/pokemon-carousel-slides-seed-data.js +0 -322
- package/dist/seed/pokemon-categories-seed-data.d.ts +0 -24
- package/dist/seed/pokemon-categories-seed-data.js +0 -547
- package/dist/seed/pokemon-coupons-seed-data.d.ts +0 -6
- package/dist/seed/pokemon-coupons-seed-data.js +0 -465
- package/dist/seed/pokemon-homepage-sections-seed-data.d.ts +0 -7
- package/dist/seed/pokemon-homepage-sections-seed-data.js +0 -241
- package/dist/seed/pokemon-products-seed-data.d.ts +0 -9
- package/dist/seed/pokemon-products-seed-data.js +0 -1791
- package/dist/seed/pokemon-seed-bundle.d.ts +0 -47
- package/dist/seed/pokemon-seed-bundle.js +0 -71
- package/dist/seed/pokemon-stores-seed-data.d.ts +0 -6
- package/dist/seed/pokemon-stores-seed-data.js +0 -179
- package/dist/seed/pokemon-users-seed-data.d.ts +0 -6
- package/dist/seed/pokemon-users-seed-data.js +0 -521
- package/dist/seed/products-seed-data.d.ts +0 -6
- package/dist/seed/products-seed-data.js +0 -2530
- package/dist/seed/retro-gaming-seed-data.d.ts +0 -8
- package/dist/seed/retro-gaming-seed-data.js +0 -801
- package/dist/seed/server.d.ts +0 -2
- package/dist/seed/server.js +0 -7
- package/dist/seed/sublisting-categories-seed-data.d.ts +0 -7
- package/dist/seed/sublisting-categories-seed-data.js +0 -159
- package/dist/seed/transformers-seed-data.d.ts +0 -7
- package/dist/seed/transformers-seed-data.js +0 -530
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Admin filter-chip tab sets (SB10-C completion, S8 2026-05-13).
|
|
3
|
+
*
|
|
4
|
+
* Match current view-filter values exactly so migrating an inline
|
|
5
|
+
* `STATUS_OPTIONS` array to one of these constants is a behaviour-preserving
|
|
6
|
+
* rename. The `ALL_TAB` sentinel collapses to an empty filter string when
|
|
7
|
+
* clicked.
|
|
8
|
+
*
|
|
9
|
+
* Each entry is a typed `{ id, label }` row so views render with one
|
|
10
|
+
* primitive and stay in sync when statuses are added.
|
|
11
|
+
*/
|
|
12
|
+
export const ALL_TAB = { id: "All", label: "All" };
|
|
13
|
+
/** Admin > Products — listing status filter chip set. */
|
|
14
|
+
export const ADMIN_PRODUCT_STATUS_TABS = [
|
|
15
|
+
ALL_TAB,
|
|
16
|
+
{ id: "pending", label: "Pending" },
|
|
17
|
+
{ id: "published", label: "Published" },
|
|
18
|
+
{ id: "draft", label: "Draft" },
|
|
19
|
+
{ id: "archived", label: "Archived" },
|
|
20
|
+
];
|
|
21
|
+
/** Admin > Products — listing-type filter chip set. Legacy label-as-id IDs
|
|
22
|
+
* preserved so the existing Sieve filter values keep matching. */
|
|
23
|
+
export const ADMIN_PRODUCT_LISTING_TYPE_TABS = [
|
|
24
|
+
ALL_TAB,
|
|
25
|
+
{ id: "Products", label: "Products" },
|
|
26
|
+
{ id: "Auctions", label: "Auctions" },
|
|
27
|
+
{ id: "Pre-orders", label: "Pre-orders" },
|
|
28
|
+
{ id: "Prize Draws", label: "Prize Draws" },
|
|
29
|
+
];
|
|
30
|
+
/** Admin > Blog — post status filter chip set. */
|
|
31
|
+
export const ADMIN_BLOG_STATUS_TABS = [
|
|
32
|
+
ALL_TAB,
|
|
33
|
+
{ id: "published", label: "Published" },
|
|
34
|
+
{ id: "draft", label: "Draft" },
|
|
35
|
+
{ id: "archived", label: "Archived" },
|
|
36
|
+
];
|
|
37
|
+
/** Admin > Users — account-state filter chip set. */
|
|
38
|
+
export const ADMIN_USER_STATUS_TABS = [
|
|
39
|
+
ALL_TAB,
|
|
40
|
+
{ id: "Active", label: "Active" },
|
|
41
|
+
{ id: "Disabled", label: "Disabled" },
|
|
42
|
+
];
|
|
43
|
+
/** Admin > Users — role filter chip set. */
|
|
44
|
+
export const ADMIN_USER_ROLE_TABS = [
|
|
45
|
+
ALL_TAB,
|
|
46
|
+
{ id: "admin", label: "Admin" },
|
|
47
|
+
{ id: "seller", label: "Seller" },
|
|
48
|
+
{ id: "buyer", label: "Buyer" },
|
|
49
|
+
{ id: "moderator", label: "Moderator" },
|
|
50
|
+
];
|
|
51
|
+
/** Admin > Stores — seller-onboarding state filter chip set. */
|
|
52
|
+
export const ADMIN_STORE_STATUS_TABS = [
|
|
53
|
+
ALL_TAB,
|
|
54
|
+
{ id: "active", label: "Active" },
|
|
55
|
+
{ id: "pending", label: "Pending" },
|
|
56
|
+
{ id: "suspended", label: "Suspended" },
|
|
57
|
+
{ id: "rejected", label: "Rejected" },
|
|
58
|
+
];
|
|
59
|
+
/** Admin > Payouts — payout state filter chip set. Uppercase IDs match the
|
|
60
|
+
* `PayoutDocument.status` enum on the server. */
|
|
61
|
+
export const ADMIN_PAYOUT_STATUS_TABS = [
|
|
62
|
+
ALL_TAB,
|
|
63
|
+
{ id: "PENDING", label: "Pending" },
|
|
64
|
+
{ id: "PROCESSING", label: "Processing" },
|
|
65
|
+
{ id: "PAID", label: "Paid" },
|
|
66
|
+
{ id: "FAILED", label: "Failed" },
|
|
67
|
+
];
|
|
68
|
+
/** Admin > Orders — order-state filter chip set. Uppercase IDs match the
|
|
69
|
+
* `OrderDocument.status` enum on the server. */
|
|
70
|
+
export const ADMIN_ORDER_STATUS_TABS = [
|
|
71
|
+
ALL_TAB,
|
|
72
|
+
{ id: "PENDING", label: "Pending" },
|
|
73
|
+
{ id: "PROCESSING", label: "Processing" },
|
|
74
|
+
{ id: "SHIPPED", label: "Shipped" },
|
|
75
|
+
{ id: "DELIVERED", label: "Delivered" },
|
|
76
|
+
{ id: "CANCELLED", label: "Cancelled" },
|
|
77
|
+
{ id: "REFUNDED", label: "Refunded" },
|
|
78
|
+
{ id: "RETURN_REQUESTED", label: "Return Requested" },
|
|
79
|
+
];
|
|
80
|
+
/** Admin > Reviews — moderation state filter chip set. */
|
|
81
|
+
export const ADMIN_REVIEW_STATUS_TABS = [
|
|
82
|
+
ALL_TAB,
|
|
83
|
+
{ id: "approved", label: "Approved" },
|
|
84
|
+
{ id: "pending", label: "Pending" },
|
|
85
|
+
{ id: "rejected", label: "Rejected" },
|
|
86
|
+
];
|
|
87
|
+
/** Admin > Reviews — star-rating filter chip set. */
|
|
88
|
+
export const ADMIN_REVIEW_RATING_TABS = [
|
|
89
|
+
ALL_TAB,
|
|
90
|
+
{ id: "5", label: "5★" },
|
|
91
|
+
{ id: "4", label: "4★" },
|
|
92
|
+
{ id: "3", label: "3★" },
|
|
93
|
+
{ id: "2", label: "2★" },
|
|
94
|
+
{ id: "1", label: "1★" },
|
|
95
|
+
];
|
|
96
|
+
/** Admin > Bids — bid-state filter chip set. */
|
|
97
|
+
export const ADMIN_BID_STATUS_TABS = [
|
|
98
|
+
ALL_TAB,
|
|
99
|
+
{ id: "active", label: "Active" },
|
|
100
|
+
{ id: "outbid", label: "Outbid" },
|
|
101
|
+
{ id: "won", label: "Won" },
|
|
102
|
+
{ id: "cancelled", label: "Cancelled" },
|
|
103
|
+
];
|
|
104
|
+
/** Admin > Contact — submission triage state filter chip set. */
|
|
105
|
+
export const ADMIN_CONTACT_STATUS_TABS = [
|
|
106
|
+
ALL_TAB,
|
|
107
|
+
{ id: "new", label: "New" },
|
|
108
|
+
{ id: "read", label: "Read" },
|
|
109
|
+
{ id: "resolved", label: "Resolved" },
|
|
110
|
+
];
|
|
111
|
+
/** Admin > Newsletter — subscription state filter chip set. */
|
|
112
|
+
export const ADMIN_NEWSLETTER_STATUS_TABS = [
|
|
113
|
+
ALL_TAB,
|
|
114
|
+
{ id: "active", label: "Active" },
|
|
115
|
+
{ id: "unsubscribed", label: "Unsubscribed" },
|
|
116
|
+
];
|
|
117
|
+
/** Admin > Event Entries — entry-state filter chip set. Uppercase IDs match
|
|
118
|
+
* the canonical `EventEntryDocument.status` enum. */
|
|
119
|
+
export const ADMIN_EVENT_ENTRY_STATUS_TABS = [
|
|
120
|
+
ALL_TAB,
|
|
121
|
+
{ id: "CONFIRMED", label: "Confirmed" },
|
|
122
|
+
{ id: "WAITLISTED", label: "Waitlisted" },
|
|
123
|
+
{ id: "CANCELLED", label: "Cancelled" },
|
|
124
|
+
];
|
|
125
|
+
/** Admin > Events — event-state filter chip set. */
|
|
126
|
+
export const ADMIN_EVENT_STATUS_TABS = [
|
|
127
|
+
ALL_TAB,
|
|
128
|
+
{ id: "published", label: "Published" },
|
|
129
|
+
{ id: "draft", label: "Draft" },
|
|
130
|
+
{ id: "active", label: "Active" },
|
|
131
|
+
{ id: "ended", label: "Ended" },
|
|
132
|
+
];
|
|
133
|
+
/** Admin > Carts — cart-ownership filter chip set. */
|
|
134
|
+
export const ADMIN_CART_OWNERSHIP_TABS = [
|
|
135
|
+
ALL_TAB,
|
|
136
|
+
{ id: "guest", label: "Guest" },
|
|
137
|
+
{ id: "auth", label: "Authenticated" },
|
|
138
|
+
];
|
|
139
|
+
/** Admin > Coupons — coupon-type filter chip set. Matches the
|
|
140
|
+
* `CouponDocument.type` discriminator. */
|
|
141
|
+
export const ADMIN_COUPON_TYPE_TABS = [
|
|
142
|
+
ALL_TAB,
|
|
143
|
+
{ id: "percentage", label: "Percentage" },
|
|
144
|
+
{ id: "fixed", label: "Fixed" },
|
|
145
|
+
{ id: "free_shipping", label: "Free Shipping" },
|
|
146
|
+
{ id: "buy_x_get_y", label: "Buy X Get Y" },
|
|
147
|
+
];
|
|
148
|
+
// ---------------------------------------------------------------------------
|
|
149
|
+
// Seller-dashboard filter-chip tab sets
|
|
150
|
+
// ---------------------------------------------------------------------------
|
|
151
|
+
/** Empty-sentinel variant for views (like SellerBidsView) that drive the
|
|
152
|
+
* filter URL with `""` instead of `"All"` so the `"" == no filter` invariant
|
|
153
|
+
* stays a single shape across queries. */
|
|
154
|
+
export const EMPTY_TAB = { id: "", label: "All" };
|
|
155
|
+
/** Seller > Products — listing-state filter chip set. */
|
|
156
|
+
export const SELLER_PRODUCT_STATUS_TABS = [
|
|
157
|
+
ALL_TAB,
|
|
158
|
+
{ id: "active", label: "Active" },
|
|
159
|
+
{ id: "draft", label: "Draft" },
|
|
160
|
+
{ id: "archived", label: "Archived" },
|
|
161
|
+
{ id: "sold", label: "Sold" },
|
|
162
|
+
];
|
|
163
|
+
/** Seller > Auctions — auction-state filter chip set. */
|
|
164
|
+
export const SELLER_AUCTION_STATUS_TABS = [
|
|
165
|
+
ALL_TAB,
|
|
166
|
+
{ id: "active", label: "Active" },
|
|
167
|
+
{ id: "draft", label: "Draft" },
|
|
168
|
+
{ id: "ended", label: "Ended" },
|
|
169
|
+
{ id: "cancelled", label: "Cancelled" },
|
|
170
|
+
];
|
|
171
|
+
/** Seller > Pre-orders — pre-order-state filter chip set. */
|
|
172
|
+
export const SELLER_PRE_ORDER_STATUS_TABS = [
|
|
173
|
+
ALL_TAB,
|
|
174
|
+
{ id: "active", label: "Active" },
|
|
175
|
+
{ id: "draft", label: "Draft" },
|
|
176
|
+
{ id: "archived", label: "Archived" },
|
|
177
|
+
{ id: "cancelled", label: "Cancelled" },
|
|
178
|
+
];
|
|
179
|
+
/** Seller > Prize Draws — draw-state filter chip set. */
|
|
180
|
+
export const SELLER_PRIZE_DRAW_STATUS_TABS = [
|
|
181
|
+
ALL_TAB,
|
|
182
|
+
{ id: "active", label: "Active" },
|
|
183
|
+
{ id: "draft", label: "Draft" },
|
|
184
|
+
{ id: "ended", label: "Ended" },
|
|
185
|
+
{ id: "cancelled", label: "Cancelled" },
|
|
186
|
+
];
|
|
187
|
+
/** Seller > Orders — order-state filter chip set. Subset of
|
|
188
|
+
* `ADMIN_ORDER_STATUS_TABS` — sellers don't see `RETURN_REQUESTED` until
|
|
189
|
+
* the buyer initiates one through support. */
|
|
190
|
+
export const SELLER_ORDER_STATUS_TABS = [
|
|
191
|
+
ALL_TAB,
|
|
192
|
+
{ id: "PENDING", label: "Pending" },
|
|
193
|
+
{ id: "PROCESSING", label: "Processing" },
|
|
194
|
+
{ id: "SHIPPED", label: "Shipped" },
|
|
195
|
+
{ id: "DELIVERED", label: "Delivered" },
|
|
196
|
+
{ id: "CANCELLED", label: "Cancelled" },
|
|
197
|
+
{ id: "REFUNDED", label: "Refunded" },
|
|
198
|
+
];
|
|
199
|
+
/** Seller > Offers — offer-state filter chip set. */
|
|
200
|
+
export const SELLER_OFFER_STATUS_TABS = [
|
|
201
|
+
ALL_TAB,
|
|
202
|
+
{ id: "pending", label: "Pending" },
|
|
203
|
+
{ id: "accepted", label: "Accepted" },
|
|
204
|
+
{ id: "rejected", label: "Rejected" },
|
|
205
|
+
{ id: "expired", label: "Expired" },
|
|
206
|
+
];
|
|
207
|
+
/** Seller > Bids — bid-state filter chip set. Uses the empty-sentinel
|
|
208
|
+
* variant (see `EMPTY_TAB`). */
|
|
209
|
+
export const SELLER_BID_STATUS_TABS = [
|
|
210
|
+
EMPTY_TAB,
|
|
211
|
+
{ id: "active", label: "Active" },
|
|
212
|
+
{ id: "outbid", label: "Outbid" },
|
|
213
|
+
{ id: "won", label: "Won" },
|
|
214
|
+
{ id: "lost", label: "Lost" },
|
|
215
|
+
{ id: "cancelled", label: "Cancelled" },
|
|
216
|
+
];
|
|
@@ -280,6 +280,21 @@ export interface SiteSettingsDocument {
|
|
|
280
280
|
sellerRegistration: boolean;
|
|
281
281
|
preOrders: boolean;
|
|
282
282
|
seedPanel: boolean;
|
|
283
|
+
listingTypes?: {
|
|
284
|
+
standard?: boolean;
|
|
285
|
+
auction?: boolean;
|
|
286
|
+
"pre-order"?: boolean;
|
|
287
|
+
"prize-draw"?: boolean;
|
|
288
|
+
classified?: boolean;
|
|
289
|
+
"digital-code"?: boolean;
|
|
290
|
+
live?: boolean;
|
|
291
|
+
};
|
|
292
|
+
categoryTypes?: {
|
|
293
|
+
category?: boolean;
|
|
294
|
+
sublisting?: boolean;
|
|
295
|
+
brand?: boolean;
|
|
296
|
+
bundle?: boolean;
|
|
297
|
+
};
|
|
283
298
|
};
|
|
284
299
|
legalPages: {
|
|
285
300
|
termsOfService: string;
|
|
@@ -156,6 +156,24 @@ export const DEFAULT_SITE_SETTINGS_DATA = {
|
|
|
156
156
|
sellerRegistration: true,
|
|
157
157
|
preOrders: false,
|
|
158
158
|
seedPanel: true,
|
|
159
|
+
// SB-UNI-X4 2026-05-13 — Phase 1 types enabled by default; Phase 2 types
|
|
160
|
+
// (classified / digital-code / live) gated until per-type Phase 3 + 5
|
|
161
|
+
// surfaces ship. Admin Feature Flags UI lets the operator flip them.
|
|
162
|
+
listingTypes: {
|
|
163
|
+
standard: true,
|
|
164
|
+
auction: true,
|
|
165
|
+
"pre-order": true,
|
|
166
|
+
"prize-draw": true,
|
|
167
|
+
classified: false,
|
|
168
|
+
"digital-code": false,
|
|
169
|
+
live: false,
|
|
170
|
+
},
|
|
171
|
+
categoryTypes: {
|
|
172
|
+
category: true,
|
|
173
|
+
sublisting: true,
|
|
174
|
+
brand: true,
|
|
175
|
+
bundle: true,
|
|
176
|
+
},
|
|
159
177
|
},
|
|
160
178
|
shipping: {
|
|
161
179
|
estimatedDays: 5,
|
|
@@ -47,8 +47,8 @@ export interface AdminProduct {
|
|
|
47
47
|
insurance?: boolean;
|
|
48
48
|
insuranceCost?: number;
|
|
49
49
|
shippingPaidBy?: "seller" | "buyer";
|
|
50
|
-
/** Canonical listing-kind discriminator (SB1-G Phase 4
|
|
51
|
-
listingType?: "standard" | "auction" | "pre-order" | "prize-draw";
|
|
50
|
+
/** Canonical listing-kind discriminator (SB1-G Phase 4 — booleans removed). */
|
|
51
|
+
listingType?: "standard" | "auction" | "pre-order" | "prize-draw" | "classified" | "digital-code" | "live";
|
|
52
52
|
auctionEndDate?: string;
|
|
53
53
|
startingBid?: number;
|
|
54
54
|
currentBid?: number;
|
|
@@ -21,6 +21,9 @@ interface AuctionCardProps {
|
|
|
21
21
|
};
|
|
22
22
|
onBid?: (auction: AuctionItem) => void;
|
|
23
23
|
className?: string;
|
|
24
|
+
selectable?: boolean;
|
|
25
|
+
isSelected?: boolean;
|
|
26
|
+
onSelect?: (id: string, selected: boolean) => void;
|
|
24
27
|
}
|
|
25
|
-
export declare function AuctionCard({ auction, labels, onBid, className, }: AuctionCardProps): import("react/jsx-runtime").JSX.Element;
|
|
28
|
+
export declare function AuctionCard({ auction, labels, onBid, className, selectable, isSelected, onSelect, }: AuctionCardProps): import("react/jsx-runtime").JSX.Element;
|
|
26
29
|
export {};
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { useState, useEffect } from "react";
|
|
4
|
-
import { Article, Button, Div, Heading, Row, Span, Text } from "../../../ui";
|
|
4
|
+
import { Article, BaseListingCard, Button, Div, Heading, Row, Span, Text } from "../../../ui";
|
|
5
5
|
import { formatCurrency } from "../../../utils/number.formatter";
|
|
6
6
|
import { getDefaultCurrency } from "../../../core/baseline-resolver";
|
|
7
7
|
import { THEME_CONSTANTS } from "../../../tokens";
|
|
8
|
+
import { useLongPress } from "../../../react/hooks/useLongPress";
|
|
8
9
|
function useCountdown(endsAt) {
|
|
9
10
|
const [msLeft, setMsLeft] = useState(() => new Date(endsAt).getTime() - Date.now());
|
|
10
11
|
useEffect(() => {
|
|
@@ -29,8 +30,9 @@ export function AuctionCountdown({ endsAt, className = "", labels = {}, }) {
|
|
|
29
30
|
const pad = (n) => String(n).padStart(2, "0");
|
|
30
31
|
return (_jsxs(Row, { className: `gap-1 text-sm font-mono ${className}`, children: [_jsx(Span, { className: "rounded bg-gray-900 dark:bg-slate-700 px-1.5 py-0.5 text-white", children: pad(countdown.h) }), _jsx(Span, { className: "text-gray-400 dark:text-zinc-500", children: ":" }), _jsx(Span, { className: "rounded bg-gray-900 dark:bg-slate-700 px-1.5 py-0.5 text-white", children: pad(countdown.m) }), _jsx(Span, { className: "text-gray-400 dark:text-zinc-500", children: ":" }), _jsx(Span, { className: "rounded bg-gray-900 dark:bg-slate-700 px-1.5 py-0.5 text-white", children: pad(countdown.s) })] }));
|
|
31
32
|
}
|
|
32
|
-
export function AuctionCard({ auction, labels = {}, onBid, className = "", }) {
|
|
33
|
+
export function AuctionCard({ auction, labels = {}, onBid, className = "", selectable = false, isSelected = false, onSelect, }) {
|
|
33
34
|
const hasEnded = new Date(auction.auctionEndDate) <= new Date();
|
|
34
35
|
const displayBid = auction.currentBid ?? auction.startingBid;
|
|
35
|
-
|
|
36
|
+
const longPress = useLongPress(() => onSelect?.(auction.id, !isSelected));
|
|
37
|
+
return (_jsxs(Article, { className: `group relative rounded-xl border bg-white dark:bg-slate-900 overflow-hidden shadow-sm hover:shadow-md transition-shadow ${isSelected ? "border-primary outline outline-2 outline-primary" : "border-gray-200 dark:border-slate-700"} ${className}`, onMouseDown: onSelect && !isSelected ? longPress.onMouseDown : undefined, onMouseUp: onSelect && !isSelected ? longPress.onMouseUp : undefined, onMouseLeave: onSelect && !isSelected ? longPress.onMouseLeave : undefined, onTouchStart: onSelect && !isSelected ? longPress.onTouchStart : undefined, onTouchEnd: onSelect && !isSelected ? longPress.onTouchEnd : undefined, children: [onSelect && (_jsx(BaseListingCard.Checkbox, { selected: isSelected, onSelect: (e) => { e.preventDefault(); onSelect(auction.id, !isSelected); }, label: isSelected ? "Deselect auction" : "Select auction", position: "top-2 right-2", className: selectable || isSelected ? "opacity-100" : "opacity-0 group-hover:opacity-100 transition-opacity" })), auction.mainImage && (_jsxs(Div, { className: "aspect-square overflow-hidden relative", children: [_jsx(Div, { role: "img", "aria-label": auction.title, className: "h-full w-full bg-center bg-cover", style: { backgroundImage: `url(${auction.mainImage})` } }), _jsx(Span, { className: "absolute top-2 left-2 rounded-full bg-orange-500 px-2 py-0.5 text-xs font-bold text-white", children: "AUCTION" })] })), _jsxs(Div, { className: "p-4", children: [_jsx(Heading, { level: 3, className: `font-semibold text-gray-900 dark:text-zinc-100 text-sm leading-snug mb-2 ${THEME_CONSTANTS.utilities.textClamp2}`, children: auction.title }), _jsxs(Row, { justify: "between", className: "mb-2", children: [_jsxs(Div, { children: [_jsx(Text, { className: "text-xs text-gray-400 dark:text-zinc-500", children: labels.currentBid ?? "Current bid" }), _jsx(Text, { className: "text-base font-bold text-gray-900 dark:text-zinc-100", children: formatCurrency(displayBid, getDefaultCurrency()) })] }), _jsx(Div, { className: "text-right", children: _jsxs(Text, { className: "text-xs text-gray-400 dark:text-zinc-500", children: [auction.bidCount, " ", labels.bids ?? "bids"] }) })] }), _jsx(Div, { className: "mb-3", children: _jsx(AuctionCountdown, { endsAt: auction.auctionEndDate, labels: { ended: labels.ended } }) }), !hasEnded && onBid && (_jsx(Button, { type: "button", variant: "warning", onClick: () => onBid(auction), className: "w-full rounded-lg bg-orange-500 py-2 text-sm font-medium text-white hover:bg-orange-600 transition-colors", children: labels.placeBid ?? "Place Bid" }))] })] }));
|
|
36
38
|
}
|
|
@@ -133,7 +133,7 @@ export async function AuctionDetailPageView({ id, initialAuction, onPlaceBid, pr
|
|
|
133
133
|
bidderId: String(b.userId ?? b.bidderId ?? ""),
|
|
134
134
|
bidderName: (b.bidderName ?? b.userName),
|
|
135
135
|
amount: (typeof b.bidAmount === "number" ? b.bidAmount : typeof b.amount === "number" ? b.amount : 0),
|
|
136
|
-
placedAt: (b.createdAt ?? b.bidAt ?? ""),
|
|
136
|
+
placedAt: (b.bidDate ?? b.createdAt ?? b.bidAt ?? ""),
|
|
137
137
|
}));
|
|
138
138
|
return _jsx(CollapsibleBidHistory, { bids: bids, currency: currency });
|
|
139
139
|
}, renderRelated: () => {
|
|
@@ -11,8 +11,8 @@ export interface MarketplaceAuctionCardData {
|
|
|
11
11
|
url?: string;
|
|
12
12
|
thumbnailUrl?: string;
|
|
13
13
|
};
|
|
14
|
-
/** Canonical discriminator (SB1-G Phase 4). */
|
|
15
|
-
listingType?: "standard" | "auction" | "pre-order" | "prize-draw";
|
|
14
|
+
/** Canonical discriminator (SB1-G Phase 4 · SB-UNI-F 2026-05-13 union extension). */
|
|
15
|
+
listingType?: "standard" | "auction" | "pre-order" | "prize-draw" | "classified" | "digital-code" | "live";
|
|
16
16
|
auctionEndDate?: string | Date;
|
|
17
17
|
startingBid?: number;
|
|
18
18
|
currentBid?: number;
|
|
@@ -20,12 +20,22 @@ export function PlaceBidFormClient({ productId, currentBid, startingBid, minBidI
|
|
|
20
20
|
setSuccess(false);
|
|
21
21
|
startTransition(async () => {
|
|
22
22
|
try {
|
|
23
|
-
await onPlaceBid({ productId, bidAmount: amount });
|
|
23
|
+
const result = await onPlaceBid({ productId, bidAmount: amount });
|
|
24
|
+
if (result &&
|
|
25
|
+
typeof result === "object" &&
|
|
26
|
+
"ok" in result &&
|
|
27
|
+
result.ok === false) {
|
|
28
|
+
const msg = result.error;
|
|
29
|
+
setError(msg || "Failed to place bid. Please try again.");
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
24
32
|
setSuccess(true);
|
|
25
33
|
setBidAmount(String(amount + minBidIncrement));
|
|
26
34
|
}
|
|
27
35
|
catch (err) {
|
|
28
|
-
setError(err instanceof Error
|
|
36
|
+
setError(err instanceof Error && err.message
|
|
37
|
+
? err.message
|
|
38
|
+
: "Failed to place bid. Please try again.");
|
|
29
39
|
}
|
|
30
40
|
});
|
|
31
41
|
}
|
|
@@ -65,8 +65,8 @@ export declare const auctionItemSchema: z.ZodObject<{
|
|
|
65
65
|
status: "draft" | "published" | "archived" | "sold";
|
|
66
66
|
title: string;
|
|
67
67
|
price: number;
|
|
68
|
-
featured: boolean;
|
|
69
68
|
listingType: "auction";
|
|
69
|
+
featured: boolean;
|
|
70
70
|
slug: string;
|
|
71
71
|
auctionEndDate: string;
|
|
72
72
|
startingBid: number;
|
|
@@ -94,8 +94,8 @@ export declare const auctionItemSchema: z.ZodObject<{
|
|
|
94
94
|
status: "draft" | "published" | "archived" | "sold";
|
|
95
95
|
title: string;
|
|
96
96
|
price: number;
|
|
97
|
-
featured: boolean;
|
|
98
97
|
listingType: "auction";
|
|
98
|
+
featured: boolean;
|
|
99
99
|
slug: string;
|
|
100
100
|
auctionEndDate: string;
|
|
101
101
|
startingBid: number;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { UserRole } from "./types";
|
|
2
|
+
export declare const isAdminUser: (input?: {
|
|
3
|
+
role?: UserRole;
|
|
4
|
+
}) => boolean;
|
|
5
|
+
export declare const isSellerUser: (input?: {
|
|
6
|
+
role?: UserRole;
|
|
7
|
+
}) => boolean;
|
|
8
|
+
export declare const isModeratorUser: (input?: {
|
|
9
|
+
role?: UserRole;
|
|
10
|
+
}) => boolean;
|
|
11
|
+
export declare const isEmployeeUser: (input?: {
|
|
12
|
+
role?: UserRole;
|
|
13
|
+
}) => boolean;
|
|
14
|
+
export declare const isBuyerUser: (input?: {
|
|
15
|
+
role?: UserRole;
|
|
16
|
+
}) => boolean;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Canonical user-role predicates — mirror of the listing-type accessors in
|
|
3
|
+
* `features/products/utils/listing-type.ts`. Read the canonical role
|
|
4
|
+
* discriminator off an `AuthUser`/`UserDocument`-shaped object and return a
|
|
5
|
+
* boolean. Undefined input falls back to `"user"` so legacy payloads classify
|
|
6
|
+
* safely without a separate guard. SB-UNI-E 2026-05-13.
|
|
7
|
+
*/
|
|
8
|
+
function normalizeRole(input) {
|
|
9
|
+
return input?.role ?? "user";
|
|
10
|
+
}
|
|
11
|
+
export const isAdminUser = (input) => normalizeRole(input) === "admin";
|
|
12
|
+
export const isSellerUser = (input) => normalizeRole(input) === "seller";
|
|
13
|
+
export const isModeratorUser = (input) => normalizeRole(input) === "moderator";
|
|
14
|
+
export const isEmployeeUser = (input) => normalizeRole(input) === "employee";
|
|
15
|
+
export const isBuyerUser = (input) => normalizeRole(input) === "user";
|
|
@@ -7,5 +7,8 @@ export interface BlogFeaturedCardProps {
|
|
|
7
7
|
readTime?: string;
|
|
8
8
|
};
|
|
9
9
|
className?: string;
|
|
10
|
+
selectable?: boolean;
|
|
11
|
+
isSelected?: boolean;
|
|
12
|
+
onSelect?: (id: string, selected: boolean) => void;
|
|
10
13
|
}
|
|
11
|
-
export declare function BlogFeaturedCard({ post, href, labels, className, }: BlogFeaturedCardProps): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export declare function BlogFeaturedCard({ post, href, labels, className, selectable, isSelected, onSelect, }: BlogFeaturedCardProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Article, Div, Heading, Row, Span, Text, TextLink } from "../../../ui";
|
|
2
|
+
import { Article, BaseListingCard, Div, Heading, Row, Span, Text, TextLink } from "../../../ui";
|
|
3
3
|
import { THEME_CONSTANTS } from "../../../tokens";
|
|
4
4
|
import { getMediaUrl } from "../../media/types/index";
|
|
5
5
|
import { getDefaultLocale } from "../../../core/baseline-resolver";
|
|
6
6
|
import { safeDisplayName } from "../../../security";
|
|
7
|
+
import { useLongPress } from "../../../react/hooks/useLongPress";
|
|
7
8
|
const CATEGORY_BADGE = {
|
|
8
9
|
news: "bg-blue-100 text-blue-800 dark:bg-blue-900/40 dark:text-blue-300",
|
|
9
10
|
tips: "bg-emerald-100 text-emerald-800 dark:bg-emerald-900/40 dark:text-emerald-300",
|
|
@@ -11,7 +12,8 @@ const CATEGORY_BADGE = {
|
|
|
11
12
|
updates: "bg-purple-100 text-purple-800 dark:bg-purple-900/40 dark:text-purple-300",
|
|
12
13
|
community: "bg-orange-100 text-orange-800 dark:bg-orange-900/40 dark:text-orange-300",
|
|
13
14
|
};
|
|
14
|
-
export function BlogFeaturedCard({ post, href, labels = {}, className = "", }) {
|
|
15
|
+
export function BlogFeaturedCard({ post, href, labels = {}, className = "", selectable = false, isSelected = false, onSelect, }) {
|
|
16
|
+
const longPress = useLongPress(() => onSelect?.(post.id, !isSelected));
|
|
15
17
|
const safeTitle = post.title?.trim() || "Untitled post";
|
|
16
18
|
const coverImageUrl = getMediaUrl(post.coverImage);
|
|
17
19
|
const date = post.publishedAt
|
|
@@ -21,5 +23,5 @@ export function BlogFeaturedCard({ post, href, labels = {}, className = "", }) {
|
|
|
21
23
|
day: "numeric",
|
|
22
24
|
})
|
|
23
25
|
: "";
|
|
24
|
-
return (
|
|
26
|
+
return (_jsxs(Article, { className: `group relative flex h-full flex-col overflow-hidden rounded-xl border border-neutral-200 dark:border-slate-700 bg-white dark:bg-slate-900 shadow-sm hover:shadow-md transition-shadow duration-200 ${isSelected ? "ring-2 ring-primary outline outline-2 outline-primary" : ""} ${className}`, onMouseDown: onSelect && !isSelected ? longPress.onMouseDown : undefined, onMouseUp: onSelect && !isSelected ? longPress.onMouseUp : undefined, onMouseLeave: onSelect && !isSelected ? longPress.onMouseLeave : undefined, onTouchStart: onSelect && !isSelected ? longPress.onTouchStart : undefined, onTouchEnd: onSelect && !isSelected ? longPress.onTouchEnd : undefined, children: [onSelect && (_jsx(BaseListingCard.Checkbox, { selected: isSelected, onSelect: (e) => { e.preventDefault(); onSelect(post.id, !isSelected); }, label: isSelected ? "Deselect post" : "Select post", position: "top-2 left-2", className: selectable || isSelected ? "opacity-100" : "opacity-0 group-hover:opacity-100 transition-opacity" })), _jsxs(TextLink, { href: href, className: "flex h-full flex-col", children: [_jsx(Div, { className: "aspect-video overflow-hidden flex-shrink-0", children: coverImageUrl ? (_jsx(Div, { role: "img", "aria-label": safeTitle, className: "h-full w-full bg-cover bg-center transition-transform duration-300 group-hover:scale-105", style: { backgroundImage: `url(${coverImageUrl})` } })) : (_jsx(Div, { role: "img", "aria-label": safeTitle, className: "h-full w-full bg-gradient-to-br from-zinc-200 via-zinc-100 to-zinc-300 dark:from-slate-800 dark:via-slate-700 dark:to-slate-900" })) }), _jsxs(Div, { className: "flex flex-1 flex-col p-4", children: [_jsxs(Row, { className: "gap-1.5 mb-2 flex-wrap", children: [_jsx(Span, { className: `inline-block px-2 py-0.5 rounded-full text-xs font-medium capitalize ${CATEGORY_BADGE[post.category] ?? "bg-zinc-100 text-zinc-700"}`, children: post.category }), post.isFeatured && (_jsx(Span, { className: "bg-yellow-100 text-yellow-800 dark:bg-yellow-900/40 dark:text-yellow-300 px-2 py-0.5 rounded-full text-xs font-medium", children: labels.featuredBadge ?? "Featured" }))] }), _jsx(Heading, { level: 3, className: `font-semibold text-neutral-900 dark:text-zinc-100 text-base leading-snug mb-1 ${THEME_CONSTANTS.utilities.textClamp2}`, children: safeTitle }), post.excerpt && (_jsx(Text, { className: `text-neutral-500 dark:text-zinc-400 text-sm ${THEME_CONSTANTS.utilities.textClamp2} mb-3`, children: post.excerpt })), _jsxs(Row, { className: "mt-auto gap-3 text-xs text-neutral-400 dark:text-zinc-500 flex-wrap", children: [post.authorName && (_jsx(Span, { children: safeDisplayName(post.authorName, "Author") })), post.readTimeMinutes != null && (_jsxs(Span, { children: [post.readTimeMinutes, " ", labels.readTime ?? "min read"] })), date && _jsx(Span, { children: date })] })] })] })] }));
|
|
25
27
|
}
|
|
@@ -14,3 +14,4 @@ export declare function mergeGuestCart(userId: string, items: Array<{
|
|
|
14
14
|
quantity: number;
|
|
15
15
|
}>): Promise<void>;
|
|
16
16
|
export declare function getCart(userId: string): Promise<CartDocument | null>;
|
|
17
|
+
export declare function updateCartItemShipping(userId: string, itemId: string, providerId: string, feeInPaise: number): Promise<CartDocument>;
|
|
@@ -5,12 +5,20 @@
|
|
|
5
5
|
* are handled by the calling server action in the consumer.
|
|
6
6
|
*/
|
|
7
7
|
import { serverLogger } from "../../../monitoring";
|
|
8
|
+
import { ValidationError } from "../../../errors";
|
|
8
9
|
import { cartRepository } from "../repository/cart.repository";
|
|
9
10
|
import { productRepository } from "../../products/repository/products.repository";
|
|
10
11
|
import { normalizeListingType } from "../../products/utils/listing-type";
|
|
11
12
|
import { getDefaultCurrency } from "../../../core/baseline-resolver";
|
|
12
13
|
export async function addItemToCart(userId, input) {
|
|
13
14
|
serverLogger.debug("addItemToCart", { userId, productId: input.productId });
|
|
15
|
+
// SB-UNI-F 2026-05-13 — capability gate. Classified + live listings reject
|
|
16
|
+
// add-to-cart at the action layer. UI surfaces a chat-only / jurisdiction
|
|
17
|
+
// CTA for those types instead.
|
|
18
|
+
const { canAddToCart } = await import("../../../_internal/shared/listing-types/capabilities");
|
|
19
|
+
if (!canAddToCart(input.listingType)) {
|
|
20
|
+
throw new ValidationError(`Listings of type "${input.listingType}" cannot be added to the cart.`);
|
|
21
|
+
}
|
|
14
22
|
return cartRepository.addItem(userId, input);
|
|
15
23
|
}
|
|
16
24
|
export async function updateCartItem(userId, itemId, input) {
|
|
@@ -51,3 +59,11 @@ export async function mergeGuestCart(userId, items) {
|
|
|
51
59
|
export async function getCart(userId) {
|
|
52
60
|
return cartRepository.findByUserId(userId);
|
|
53
61
|
}
|
|
62
|
+
export async function updateCartItemShipping(userId, itemId, providerId, feeInPaise) {
|
|
63
|
+
if (!itemId || !providerId)
|
|
64
|
+
throw new ValidationError("itemId and providerId are required");
|
|
65
|
+
if (!Number.isFinite(feeInPaise) || feeInPaise < 0) {
|
|
66
|
+
throw new ValidationError("feeInPaise must be a non-negative number");
|
|
67
|
+
}
|
|
68
|
+
return cartRepository.updateItemShipping(userId, itemId, providerId, feeInPaise);
|
|
69
|
+
}
|
|
@@ -1,4 +1,15 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
+
/** Minimal shape of a per-store/per-type order group surfaced to the slot. */
|
|
3
|
+
export interface CartOrderGroup {
|
|
4
|
+
/** Unique key for this group (e.g. `${storeId}:${orderType}`). */
|
|
5
|
+
key: string;
|
|
6
|
+
storeId: string;
|
|
7
|
+
storeName: string;
|
|
8
|
+
orderType: string;
|
|
9
|
+
items: unknown[];
|
|
10
|
+
subtotalInPaise: number;
|
|
11
|
+
shippingFeeInPaise: number;
|
|
12
|
+
}
|
|
2
13
|
export interface CartViewProps {
|
|
3
14
|
labels?: {
|
|
4
15
|
title?: string;
|
|
@@ -6,6 +17,13 @@ export interface CartViewProps {
|
|
|
6
17
|
checkoutButton?: string;
|
|
7
18
|
};
|
|
8
19
|
renderItems: (isLoading: boolean) => React.ReactNode;
|
|
20
|
+
/**
|
|
21
|
+
* When provided, replaces `renderItems` + `renderPromoCode` with a
|
|
22
|
+
* per-group tabbed breakdown. Each group shows its own subtotal + shipping.
|
|
23
|
+
*/
|
|
24
|
+
renderGroups?: (groups: CartOrderGroup[], isLoading: boolean) => React.ReactNode;
|
|
25
|
+
/** Computed groups passed to `renderGroups`. Ignored when `renderGroups` is absent. */
|
|
26
|
+
groups?: CartOrderGroup[];
|
|
9
27
|
renderSummary?: () => React.ReactNode;
|
|
10
28
|
renderPromoCode?: () => React.ReactNode;
|
|
11
29
|
renderCheckoutButton?: (onCheckout: () => void, isLoading: boolean) => React.ReactNode;
|
|
@@ -14,4 +32,4 @@ export interface CartViewProps {
|
|
|
14
32
|
isLoading?: boolean;
|
|
15
33
|
className?: string;
|
|
16
34
|
}
|
|
17
|
-
export declare function CartView({ labels, renderItems, renderSummary, renderPromoCode, renderCheckoutButton, renderEmpty, isEmpty, isLoading, className, }: CartViewProps): import("react/jsx-runtime").JSX.Element;
|
|
35
|
+
export declare function CartView({ labels, renderItems, renderGroups, groups, renderSummary, renderPromoCode, renderCheckoutButton, renderEmpty, isEmpty, isLoading, className, }: CartViewProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Div, Heading } from "../../../ui";
|
|
3
|
-
export function CartView({ labels = {}, renderItems, renderSummary, renderPromoCode, renderCheckoutButton, renderEmpty, isEmpty = false, isLoading = false, className = "", }) {
|
|
3
|
+
export function CartView({ labels = {}, renderItems, renderGroups, groups = [], renderSummary, renderPromoCode, renderCheckoutButton, renderEmpty, isEmpty = false, isLoading = false, className = "", }) {
|
|
4
4
|
if (isEmpty && renderEmpty)
|
|
5
5
|
return _jsx(_Fragment, { children: renderEmpty() });
|
|
6
|
-
return (_jsxs(Div, { className: className, children: [labels.title && (_jsx(Heading, { level: 1, className: "text-2xl font-bold mb-6", children: labels.title })), _jsxs(Div, { className: "flex flex-col gap-6 lg:flex-row lg:gap-8", children: [_jsxs(Div, { className: "flex-1", children: [renderItems(isLoading), renderPromoCode?.()] }), _jsxs(Div, { className: "w-full lg:w-80", children: [renderSummary?.(), renderCheckoutButton?.(() => { }, isLoading)] })] })] }));
|
|
6
|
+
return (_jsxs(Div, { className: className, children: [labels.title && (_jsx(Heading, { level: 1, className: "text-2xl font-bold mb-6", children: labels.title })), _jsxs(Div, { className: "flex flex-col gap-6 lg:flex-row lg:gap-8", children: [_jsxs(Div, { className: "flex-1", children: [renderGroups ? renderGroups(groups, isLoading) : renderItems(isLoading), !renderGroups && renderPromoCode?.(), renderGroups && renderPromoCode?.()] }), _jsxs(Div, { className: "w-full lg:w-80", children: [renderSummary?.(), renderCheckoutButton?.(() => { }, isLoading)] })] })] }));
|
|
7
7
|
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ShippingProviderConfig } from "../../stores/schemas/firestore";
|
|
2
|
+
export interface ShippingPickerProps {
|
|
3
|
+
providers: ShippingProviderConfig[];
|
|
4
|
+
/** Currently persisted provider id (from CartItemDocument.chosenShippingProviderId). */
|
|
5
|
+
selectedProviderId?: string;
|
|
6
|
+
/** Order subtotal in paise — used to evaluate freeAboveInPaise + percentOfOrder rules. */
|
|
7
|
+
subtotalInPaise?: number;
|
|
8
|
+
/** Called when the buyer picks (or changes) a provider. */
|
|
9
|
+
onPickProvider: (providerId: string, feeInPaise: number) => void | Promise<void>;
|
|
10
|
+
isLoading?: boolean;
|
|
11
|
+
className?: string;
|
|
12
|
+
}
|
|
13
|
+
export declare function ShippingPicker({ providers, selectedProviderId, subtotalInPaise, onPickProvider, isLoading, className, }: ShippingPickerProps): import("react/jsx-runtime").JSX.Element;
|