@mohasinac/appkit 4.13.1 → 4.15.0
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.js +14 -5
- package/dist/_internal/client/features/lottery/LotteryAdminEditView.d.ts +3 -0
- package/dist/_internal/client/features/lottery/LotteryAdminEditView.js +6 -0
- package/dist/_internal/client/features/lottery/LotteryDetailView.d.ts +8 -0
- package/dist/_internal/client/features/lottery/LotteryDetailView.js +4 -1
- package/dist/_internal/client/features/lottery/LotteryListView.d.ts +7 -0
- package/dist/_internal/client/features/lottery/LotteryListView.js +1 -1
- package/dist/_internal/client/features/lottery/PrizeDrawLotteryDetailView.js +4 -1
- package/dist/_internal/client/features/lottery/slot-collage-items.d.ts +15 -0
- package/dist/_internal/client/features/lottery/slot-collage-items.js +13 -0
- package/dist/_internal/server/features/auctions/actions.js +8 -2
- package/dist/_internal/server/features/bundles/data.d.ts +16 -0
- package/dist/_internal/server/features/bundles/data.js +26 -0
- package/dist/_internal/server/features/bundles/index.d.ts +1 -1
- package/dist/_internal/server/features/bundles/index.js +1 -1
- package/dist/_internal/server/features/cart/service.d.ts +3 -3
- package/dist/_internal/server/features/checkout/actions.js +25 -0
- package/dist/_internal/server/features/checkout/locked-lines.d.ts +38 -0
- package/dist/_internal/server/features/checkout/locked-lines.js +171 -0
- package/dist/_internal/server/features/checkout/source-context.d.ts +5 -0
- package/dist/_internal/server/features/checkout/source-context.js +157 -0
- package/dist/_internal/server/features/homepage/index.d.ts +0 -1
- package/dist/_internal/server/features/homepage/index.js +7 -1
- package/dist/_internal/server/features/lottery/adapters.js +4 -0
- package/dist/_internal/server/features/offers/adapters.d.ts +103 -0
- package/dist/_internal/server/features/offers/adapters.js +88 -0
- package/dist/_internal/server/features/offers/index.d.ts +2 -0
- package/dist/_internal/server/features/offers/index.js +1 -0
- package/dist/_internal/server/features/orders/adapters.js +24 -0
- package/dist/_internal/server/features/products/data.js +15 -37
- package/dist/_internal/server/features/products/index.d.ts +1 -1
- package/dist/_internal/server/features/products/index.js +1 -1
- package/dist/_internal/server/features/products/list-public.d.ts +46 -20
- package/dist/_internal/server/features/products/list-public.js +266 -90
- package/dist/_internal/server/features/products/listing-tab-counts.d.ts +44 -0
- package/dist/_internal/server/features/products/listing-tab-counts.js +97 -0
- package/dist/_internal/server/features/site-settings/adapters.d.ts +51 -0
- package/dist/_internal/server/features/site-settings/adapters.js +75 -0
- package/dist/_internal/server/features/site-settings/index.d.ts +1 -0
- package/dist/_internal/server/features/site-settings/index.js +1 -0
- package/dist/_internal/server/features/stores/adapters.d.ts +56 -0
- package/dist/_internal/server/features/stores/adapters.js +91 -0
- package/dist/_internal/server/features/stores/index.d.ts +1 -0
- package/dist/_internal/server/features/stores/index.js +1 -0
- package/dist/_internal/server/jobs/core/auctionSettlement.js +56 -2
- package/dist/_internal/server/jobs/core/offerExpiry.js +55 -19
- package/dist/_internal/server/jobs/core/paymentReviewAutoApprove.d.ts +5 -0
- package/dist/_internal/server/jobs/core/paymentReviewAutoApprove.js +33 -1
- package/dist/_internal/server/jobs/handlers/messages.d.ts +7 -0
- package/dist/_internal/server/jobs/handlers/messages.js +10 -0
- package/dist/_internal/shared/actions/action-registry.js +17 -1
- package/dist/_internal/shared/checkout/lanes.d.ts +25 -0
- package/dist/_internal/shared/checkout/lanes.js +26 -0
- package/dist/_internal/shared/features/auctions/config.d.ts +27 -0
- package/dist/_internal/shared/features/auctions/config.js +27 -0
- package/dist/_internal/shared/features/auctions/schema.d.ts +14 -2
- package/dist/_internal/shared/features/auctions/schema.js +13 -1
- package/dist/_internal/shared/features/blog/schema.d.ts +2 -2
- package/dist/_internal/shared/features/cart/schema.d.ts +20 -15
- package/dist/_internal/shared/features/cart/schema.js +15 -0
- package/dist/_internal/shared/features/categories/bundle-schemas.d.ts +32 -32
- package/dist/_internal/shared/features/emi/schedule.d.ts +24 -3
- package/dist/_internal/shared/features/emi/schedule.js +20 -5
- package/dist/_internal/shared/features/events/schema.d.ts +2 -2
- package/dist/_internal/shared/features/homepage/section-gate.d.ts +14 -0
- package/dist/_internal/shared/features/homepage/section-gate.js +51 -0
- package/dist/_internal/shared/features/offers/config.d.ts +30 -0
- package/dist/_internal/shared/features/offers/config.js +59 -0
- package/dist/_internal/shared/features/orders/schema.d.ts +8 -8
- package/dist/_internal/shared/features/products/schema.d.ts +30 -30
- package/dist/_internal/shared/features/products/to-product-item.js +6 -0
- package/dist/_internal/shared/features/reviews/schema.d.ts +2 -2
- package/dist/_internal/shared/features/site-settings/fees.d.ts +60 -0
- package/dist/_internal/shared/features/site-settings/fees.js +39 -0
- package/dist/_internal/shared/features/site-settings/types.d.ts +40 -0
- package/dist/_internal/shared/features/site-settings/types.js +1 -0
- package/dist/_internal/shared/history/history.d.ts +88 -0
- package/dist/_internal/shared/history/history.js +198 -0
- package/dist/_internal/shared/history/index.d.ts +4 -0
- package/dist/_internal/shared/history/index.js +2 -0
- package/dist/_internal/shared/history/types.d.ts +61 -0
- package/dist/_internal/shared/history/types.js +6 -0
- package/dist/_internal/shared/listing-types/_registry.d.ts +54 -1
- package/dist/_internal/shared/listing-types/_registry.js +67 -0
- package/dist/_internal/shared/listing-types/art/config.d.ts +3 -0
- package/dist/_internal/shared/listing-types/art/config.js +5 -0
- package/dist/_internal/shared/listing-types/auction/config.d.ts +13 -0
- package/dist/_internal/shared/listing-types/auction/config.js +21 -0
- package/dist/_internal/shared/listing-types/availability.d.ts +79 -0
- package/dist/_internal/shared/listing-types/availability.js +104 -0
- package/dist/_internal/shared/listing-types/capabilities.d.ts +15 -0
- package/dist/_internal/shared/listing-types/capabilities.js +12 -0
- package/dist/_internal/shared/listing-types/classified/config.d.ts +3 -0
- package/dist/_internal/shared/listing-types/classified/config.js +5 -0
- package/dist/_internal/shared/listing-types/digital-code/config.d.ts +11 -0
- package/dist/_internal/shared/listing-types/digital-code/config.js +22 -2
- package/dist/_internal/shared/listing-types/live/config.d.ts +3 -0
- package/dist/_internal/shared/listing-types/live/config.js +5 -0
- package/dist/_internal/shared/listing-types/pre-order/config.d.ts +3 -0
- package/dist/_internal/shared/listing-types/pre-order/config.js +19 -0
- package/dist/_internal/shared/listing-types/prize-draw/config.d.ts +11 -0
- package/dist/_internal/shared/listing-types/prize-draw/config.js +15 -0
- package/dist/_internal/shared/listing-types/standard/config.d.ts +3 -0
- package/dist/_internal/shared/listing-types/standard/config.js +5 -0
- package/dist/_internal/shared/listing-types/stickers/config.d.ts +3 -0
- package/dist/_internal/shared/listing-types/stickers/config.js +5 -0
- package/dist/client.d.ts +20 -7
- package/dist/client.js +22 -4
- package/dist/constants/api-endpoints.d.ts +6 -0
- package/dist/constants/api-endpoints.js +2 -0
- package/dist/constants/field-names.d.ts +57 -8
- package/dist/constants/field-names.js +101 -8
- package/dist/constants/table-keys.d.ts +17 -0
- package/dist/constants/table-keys.js +17 -0
- package/dist/errors/error-codes.d.ts +13 -1
- package/dist/errors/error-codes.js +13 -1
- package/dist/errors/error-display-map.js +12 -3
- package/dist/errors/messages.d.ts +10 -2
- package/dist/errors/messages.js +10 -2
- package/dist/features/about/components/AboutView.d.ts +3 -0
- package/dist/features/about/components/AboutView.js +3 -2
- package/dist/features/about/components/PolicyPageView.d.ts +2 -1
- package/dist/features/about/components/PolicyPageView.js +61 -23
- package/dist/features/about/components/PublicProfileView.js +5 -0
- package/dist/features/about/schemas/firestore.d.ts +3 -0
- package/dist/features/account/components/UserBidsView.js +12 -4
- package/dist/features/account/components/UserOrdersView.js +7 -0
- package/dist/features/account/components/UserReturnsView.d.ts +3 -0
- package/dist/features/account/components/UserReturnsView.js +17 -1
- package/dist/features/account/components/index.d.ts +0 -2
- package/dist/features/account/components/index.js +0 -1
- package/dist/features/account/schemas/index.d.ts +2 -2
- package/dist/features/account/types/index.d.ts +21 -2
- package/dist/features/addresses/schemas/index.d.ts +4 -4
- package/dist/features/admin/components/AdminArtView.js +8 -3
- package/dist/features/admin/components/AdminAuditLogView.js +1 -0
- package/dist/features/admin/components/AdminBidsView.js +15 -2
- package/dist/features/admin/components/AdminBlogEditorView.js +65 -33
- package/dist/features/admin/components/AdminClassifiedView.js +8 -3
- package/dist/features/admin/components/AdminDigitalCodesView.js +8 -3
- package/dist/features/admin/components/AdminFeatureEditorView.js +35 -6
- package/dist/features/admin/components/AdminFeatureFlagsView.js +1 -0
- package/dist/features/admin/components/AdminLiveView.js +8 -3
- package/dist/features/admin/components/AdminNavEditorView.js +15 -5
- package/dist/features/admin/components/AdminNewsletterView.js +18 -2
- package/dist/features/admin/components/AdminOffersView.d.ts +4 -0
- package/dist/features/admin/components/AdminOffersView.js +230 -0
- package/dist/features/admin/components/AdminOrdersView.js +10 -1
- package/dist/features/admin/components/AdminPaymentMethodsView.js +24 -4
- package/dist/features/admin/components/AdminPrizeDrawsView.js +5 -0
- package/dist/features/admin/components/AdminProductsView.js +16 -29
- package/dist/features/admin/components/AdminScammerEditorView.d.ts +2 -1
- package/dist/features/admin/components/AdminScammerEditorView.js +3 -13
- package/dist/features/admin/components/AdminScammersView.js +3 -8
- package/dist/features/admin/components/AdminSectionsView.js +32 -23
- package/dist/features/admin/components/AdminSessionsView.js +17 -2
- package/dist/features/admin/components/AdminSiteSettingsView.js +31 -13
- package/dist/features/admin/components/AdminSiteView.js +6 -2
- package/dist/features/admin/components/AdminStickersView.js +8 -3
- package/dist/features/admin/components/ViewAuditLogEntryModal.js +1 -0
- package/dist/features/admin/components/index.d.ts +2 -0
- package/dist/features/admin/components/index.js +1 -0
- package/dist/features/admin/components/sections/adminSectionsTypes.d.ts +4 -2
- package/dist/features/admin/components/sections/adminSectionsTypes.js +45 -27
- package/dist/features/admin/constants/filter-tabs.d.ts +89 -0
- package/dist/features/admin/constants/filter-tabs.js +56 -0
- package/dist/features/admin/schemas/firestore.d.ts +122 -3
- package/dist/features/admin/schemas/firestore.js +1 -0
- package/dist/features/admin/schemas/homepage-section-form.d.ts +22 -0
- package/dist/features/admin/schemas/homepage-section-form.js +68 -0
- package/dist/features/admin/schemas/nav-item-form.d.ts +74 -0
- package/dist/features/admin/schemas/nav-item-form.js +72 -0
- package/dist/features/auctions/actions/bid-actions.d.ts +20 -5
- package/dist/features/auctions/actions/bid-actions.js +93 -20
- package/dist/features/auctions/components/AuctionBidsTable.d.ts +10 -1
- package/dist/features/auctions/components/AuctionBidsTable.js +22 -4
- package/dist/features/auctions/components/AuctionDetailPageView.js +11 -6
- package/dist/features/auctions/components/AuctionsListView.js +5 -6
- package/dist/features/auctions/components/MarketplaceAuctionCard.d.ts +7 -0
- package/dist/features/auctions/components/MarketplaceAuctionCard.js +19 -2
- package/dist/features/auctions/components/PlaceBidFormClient.d.ts +1 -2
- package/dist/features/auctions/components/PlaceBidFormClient.js +8 -4
- package/dist/features/auctions/components/bid-detail-fields.d.ts +29 -0
- package/dist/features/auctions/components/bid-detail-fields.js +103 -0
- package/dist/features/auctions/repository/bid.repository.d.ts +13 -0
- package/dist/features/auctions/repository/bid.repository.js +23 -0
- package/dist/features/auctions/schemas/firestore.d.ts +17 -0
- package/dist/features/auctions/schemas/index.d.ts +12 -12
- package/dist/features/audit-log/schemas/firestore.d.ts +14 -0
- package/dist/features/audit-log/schemas/firestore.js +7 -0
- package/dist/features/auth/permissions/constants.d.ts +1 -1
- package/dist/features/auth/permissions/constants.js +10 -1
- package/dist/features/blog/actions/blog-actions.d.ts +7 -7
- package/dist/features/blog/schemas/blog-form.d.ts +80 -0
- package/dist/features/blog/schemas/blog-form.js +100 -0
- package/dist/features/blog/schemas/index.d.ts +6 -6
- package/dist/features/cart/repository/cart.repository.js +1 -0
- package/dist/features/cart/schemas/firestore.d.ts +15 -0
- package/dist/features/catalogue/schemas/validation.d.ts +4 -4
- package/dist/features/categories/components/BrandDetailPageView.js +23 -40
- package/dist/features/categories/components/BrandDetailTabs.d.ts +7 -7
- package/dist/features/categories/components/BrandDetailTabs.js +8 -12
- package/dist/features/categories/components/BundleCollage.js +1 -1
- package/dist/features/categories/components/CategoryDetailPageView.js +53 -57
- package/dist/features/categories/components/CategoryDetailTabs.d.ts +10 -8
- package/dist/features/categories/components/CategoryDetailTabs.js +11 -16
- package/dist/features/categories/components/CategoryProductsListing.js +11 -1
- package/dist/features/categories/components/ConcernCard.js +7 -1
- package/dist/features/categories/schemas/firestore.d.ts +13 -0
- package/dist/features/categories/schemas/index.d.ts +26 -26
- package/dist/features/classified/components/ClassifiedDetailPageView.d.ts +16 -1
- package/dist/features/classified/components/ClassifiedDetailPageView.js +23 -3
- package/dist/features/events/components/AdminEventEditorView.js +32 -54
- package/dist/features/events/components/AdminEventEntriesView.js +22 -3
- package/dist/features/events/components/AdminEventsView.js +15 -11
- package/dist/features/events/components/EventFilters.d.ts +9 -1
- package/dist/features/events/components/EventFilters.js +45 -21
- package/dist/features/events/components/EventsIndexListing.d.ts +6 -1
- package/dist/features/events/components/EventsIndexListing.js +2 -2
- package/dist/features/events/components/EventsListPageView.js +13 -4
- package/dist/features/events/repository/events.repository.d.ts +17 -0
- package/dist/features/events/repository/events.repository.js +27 -0
- package/dist/features/events/schemas/event-form.d.ts +113 -0
- package/dist/features/events/schemas/event-form.js +82 -0
- package/dist/features/events/schemas/firestore.d.ts +12 -0
- package/dist/features/events/schemas/firestore.js +12 -0
- package/dist/features/events/schemas/index.d.ts +50 -50
- package/dist/features/events/types/index.d.ts +11 -0
- package/dist/features/events/types/index.js +57 -1
- package/dist/features/faq/actions/faq-actions.d.ts +12 -12
- package/dist/features/faq/schemas/index.d.ts +8 -8
- package/dist/features/filters/FilterFacetSection.d.ts +7 -1
- package/dist/features/filters/FilterFacetSection.js +11 -3
- package/dist/features/grouped/schemas/grouped-listing-form.d.ts +101 -0
- package/dist/features/grouped/schemas/grouped-listing-form.js +89 -0
- package/dist/features/grouped/schemas/index.d.ts +4 -4
- package/dist/features/homepage/actions/homepage-section-actions.d.ts +11 -3
- package/dist/features/homepage/actions/homepage-section-actions.js +33 -1
- package/dist/features/homepage/components/AnnouncementBar.d.ts +7 -1
- package/dist/features/homepage/components/AnnouncementBar.js +3 -3
- package/dist/features/homepage/components/MarketplaceHomepageView.js +20 -6
- package/dist/features/homepage/hooks/homepage-query.d.ts +16 -0
- package/dist/features/homepage/hooks/homepage-query.js +45 -0
- package/dist/features/homepage/hooks/useFeaturedAuctions.d.ts +10 -0
- package/dist/features/homepage/hooks/useFeaturedAuctions.js +28 -8
- package/dist/features/homepage/hooks/useFeaturedPreOrders.js +17 -8
- package/dist/features/homepage/hooks/useFeaturedProducts.js +15 -8
- package/dist/features/homepage/schemas/index.d.ts +33 -2
- package/dist/features/homepage/schemas/index.js +24 -0
- package/dist/features/layout/AppLayoutShell.d.ts +11 -1
- package/dist/features/layout/AppLayoutShell.js +15 -14
- package/dist/features/layout/BackToTop.d.ts +9 -0
- package/dist/features/layout/BackToTop.js +10 -1
- package/dist/features/layout/BottomActions.js +28 -25
- package/dist/features/layout/BottomChrome.d.ts +34 -0
- package/dist/features/layout/BottomChrome.js +55 -0
- package/dist/features/layout/BottomNavLayout.d.ts +6 -0
- package/dist/features/layout/BottomNavLayout.js +7 -1
- package/dist/features/layout/BottomNavbar.js +15 -2
- package/dist/features/layout/FooterLayout.js +11 -1
- package/dist/features/layout/NavbarLayout.js +1 -1
- package/dist/features/layout/TitleBarLayout.d.ts +7 -0
- package/dist/features/layout/TitleBarLayout.js +28 -5
- package/dist/features/layout/index.d.ts +2 -0
- package/dist/features/layout/index.js +1 -0
- package/dist/features/lottery/types/index.d.ts +3 -0
- package/dist/features/media/MediaPickerModal.js +5 -1
- package/dist/features/messages/schemas/index.d.ts +2 -2
- package/dist/features/orders/components/OrderScopeTabs.d.ts +20 -0
- package/dist/features/orders/components/OrderScopeTabs.js +31 -0
- package/dist/features/orders/components/OrderStatusTimeline.d.ts +5 -1
- package/dist/features/orders/components/OrderStatusTimeline.js +39 -20
- package/dist/features/orders/constants/order-scope.d.ts +48 -0
- package/dist/features/orders/constants/order-scope.js +111 -0
- package/dist/features/orders/repository/orders.repository.d.ts +54 -7
- package/dist/features/orders/repository/orders.repository.js +121 -22
- package/dist/features/orders/schemas/firestore.d.ts +152 -0
- package/dist/features/orders/schemas/firestore.js +30 -0
- package/dist/features/orders/schemas/index.d.ts +18 -18
- package/dist/features/orders/types/index.d.ts +35 -7
- package/dist/features/pre-orders/components/PreOrdersIndexListing.js +14 -9
- package/dist/features/pre-orders/components/PreOrdersListView.js +6 -5
- package/dist/features/pre-orders/schemas/index.d.ts +1 -1
- package/dist/features/products/actions/product-actions.d.ts +14 -0
- package/dist/features/products/actions/product-actions.js +49 -11
- package/dist/features/products/api/route.d.ts +12 -0
- package/dist/features/products/api/route.js +42 -100
- package/dist/features/products/components/ArtStickersListView.js +2 -2
- package/dist/features/products/components/AuctionsIndexListing.js +13 -11
- package/dist/features/products/components/AvailabilityTabs.d.ts +11 -0
- package/dist/features/products/components/AvailabilityTabs.js +47 -0
- package/dist/features/products/components/GroupSettingsPanel.js +5 -1
- package/dist/features/products/components/MakeOfferButton.js +48 -49
- package/dist/features/products/components/PrizeDrawCollage.d.ts +20 -4
- package/dist/features/products/components/PrizeDrawCollage.js +9 -1
- package/dist/features/products/components/PrizeDrawsIndexListing.js +14 -12
- package/dist/features/products/components/PrizeDrawsListingView.js +2 -2
- package/dist/features/products/components/PrizeDrawsSection.d.ts +7 -1
- package/dist/features/products/components/PrizeDrawsSection.js +23 -18
- package/dist/features/products/components/ProductDetailPageView.d.ts +4 -1
- package/dist/features/products/components/ProductDetailPageView.js +18 -4
- package/dist/features/products/components/ProductForm.js +5 -2
- package/dist/features/products/components/ProductGrid.js +6 -1
- package/dist/features/products/components/ProductsIndexListing.js +22 -32
- package/dist/features/products/components/ProductsIndexPageView.js +6 -9
- package/dist/features/products/components/index.d.ts +2 -2
- package/dist/features/products/components/index.js +1 -1
- package/dist/features/products/config/listing-type-listing-config.d.ts +20 -0
- package/dist/features/products/config/listing-type-listing-config.js +22 -10
- package/dist/features/products/constants/action-defs.d.ts +2 -0
- package/dist/features/products/constants/action-defs.js +6 -0
- package/dist/features/products/hooks/useAvailabilityScope.d.ts +13 -0
- package/dist/features/products/hooks/useAvailabilityScope.js +19 -0
- package/dist/features/products/hooks/useProducts.d.ts +5 -0
- package/dist/features/products/hooks/useProducts.js +13 -2
- package/dist/features/products/repository/products.repository.d.ts +31 -2
- package/dist/features/products/repository/products.repository.js +53 -21
- package/dist/features/products/schemas/firestore.d.ts +17 -3
- package/dist/features/products/schemas/firestore.js +7 -2
- package/dist/features/products/schemas/index.d.ts +64 -64
- package/dist/features/products/schemas/product-features.validators.d.ts +79 -6
- package/dist/features/products/schemas/product-features.validators.js +63 -0
- package/dist/features/products/types/index.d.ts +16 -1
- package/dist/features/promotions/schemas/index.d.ts +2 -2
- package/dist/features/reviews/schemas/index.d.ts +16 -16
- package/dist/features/scams/constants/scammer-status-display.d.ts +28 -0
- package/dist/features/scams/constants/scammer-status-display.js +79 -0
- package/dist/features/search/schemas/index.d.ts +4 -4
- package/dist/features/seller/actions/offer-actions.js +57 -4
- package/dist/features/seller/components/OfferPhaseTimeline.d.ts +59 -0
- package/dist/features/seller/components/OfferPhaseTimeline.js +107 -0
- package/dist/features/seller/components/SellerArtView.js +5 -0
- package/dist/features/seller/components/SellerAuctionsView.js +13 -15
- package/dist/features/seller/components/SellerBidsView.js +11 -4
- package/dist/features/seller/components/SellerClassifiedView.js +5 -0
- package/dist/features/seller/components/SellerCouponEditorView.js +17 -17
- package/dist/features/seller/components/SellerDigitalCodesView.js +5 -0
- package/dist/features/seller/components/SellerLiveView.js +5 -0
- package/dist/features/seller/components/SellerOffersView.js +2 -1
- package/dist/features/seller/components/SellerOrdersView.js +31 -9
- package/dist/features/seller/components/SellerPayoutSettingsView.js +56 -31
- package/dist/features/seller/components/SellerPreOrdersView.js +5 -0
- package/dist/features/seller/components/SellerPrizeDrawsView.js +14 -16
- package/dist/features/seller/components/SellerProductShell.js +7 -1
- package/dist/features/seller/components/SellerProductsView.js +11 -8
- package/dist/features/seller/components/SellerStickersView.js +5 -0
- package/dist/features/seller/components/index.d.ts +0 -2
- package/dist/features/seller/components/index.js +0 -1
- package/dist/features/seller/repository/offer.repository.d.ts +142 -24
- package/dist/features/seller/repository/offer.repository.js +165 -26
- package/dist/features/seller/schemas/coupon-form.d.ts +72 -0
- package/dist/features/seller/schemas/coupon-form.js +116 -0
- package/dist/features/seller/schemas/firestore.d.ts +56 -2
- package/dist/features/seller/schemas/firestore.js +27 -0
- package/dist/features/seller/schemas/index.d.ts +2 -2
- package/dist/features/seller/schemas/offer-forms.d.ts +46 -0
- package/dist/features/seller/schemas/offer-forms.js +42 -0
- package/dist/features/seller/server.d.ts +0 -1
- package/dist/features/seller/server.js +0 -1
- package/dist/features/shell/SectionForm.d.ts +99 -0
- package/dist/features/shell/SectionForm.js +128 -0
- package/dist/features/shell/build-sections.d.ts +63 -0
- package/dist/features/shell/build-sections.js +207 -0
- package/dist/features/shell/entity-form.d.ts +109 -0
- package/dist/features/shell/entity-form.js +96 -0
- package/dist/features/shell/field-ui-meta.d.ts +115 -0
- package/dist/features/shell/field-ui-meta.js +324 -0
- package/dist/features/shell/index.d.ts +8 -0
- package/dist/features/shell/index.js +4 -0
- package/dist/features/status-history/components/StatusTimeline.d.ts +74 -0
- package/dist/features/status-history/components/StatusTimeline.js +46 -0
- package/dist/features/status-history/index.d.ts +11 -0
- package/dist/features/status-history/index.js +10 -0
- package/dist/features/store-extensions/components/ReviewDecisionModal.d.ts +27 -0
- package/dist/features/store-extensions/components/ReviewDecisionModal.js +82 -0
- package/dist/features/store-extensions/index.d.ts +12 -0
- package/dist/features/store-extensions/index.js +12 -0
- package/dist/features/store-extensions/schemas/admin-notification-form.d.ts +36 -0
- package/dist/features/store-extensions/schemas/admin-notification-form.js +114 -0
- package/dist/features/store-extensions/schemas/analytics-forms.d.ts +57 -0
- package/dist/features/store-extensions/schemas/analytics-forms.js +158 -0
- package/dist/features/store-extensions/schemas/custom-role-form.d.ts +85 -0
- package/dist/features/store-extensions/schemas/custom-role-form.js +118 -0
- package/dist/features/store-extensions/schemas/firestore.d.ts +21 -1
- package/dist/features/store-extensions/schemas/firestore.js +60 -0
- package/dist/features/store-extensions/schemas/google-config-form.d.ts +53 -0
- package/dist/features/store-extensions/schemas/google-config-form.js +105 -0
- package/dist/features/store-extensions/schemas/item-request-create-form.d.ts +28 -0
- package/dist/features/store-extensions/schemas/item-request-create-form.js +80 -0
- package/dist/features/store-extensions/schemas/listing-template-form.d.ts +78 -0
- package/dist/features/store-extensions/schemas/listing-template-form.js +87 -0
- package/dist/features/store-extensions/schemas/moderation-review-form.d.ts +49 -0
- package/dist/features/store-extensions/schemas/moderation-review-form.js +101 -0
- package/dist/features/store-extensions/schemas/payout-method-form.d.ts +153 -0
- package/dist/features/store-extensions/schemas/payout-method-form.js +155 -0
- package/dist/features/store-extensions/schemas/report-create-form.d.ts +25 -0
- package/dist/features/store-extensions/schemas/report-create-form.js +79 -0
- package/dist/features/store-extensions/schemas/report-review-form.d.ts +47 -0
- package/dist/features/store-extensions/schemas/report-review-form.js +111 -0
- package/dist/features/store-extensions/schemas/shipping-config-form.d.ts +148 -0
- package/dist/features/store-extensions/schemas/shipping-config-form.js +104 -0
- package/dist/features/store-extensions/schemas/store-category-form.d.ts +54 -0
- package/dist/features/store-extensions/schemas/store-category-form.js +73 -0
- package/dist/features/stores/api/[storeSlug]/route.js +2 -25
- package/dist/features/stores/components/StoreAuctionsListing.js +15 -1
- package/dist/features/stores/components/StoreClassifiedsListing.js +12 -2
- package/dist/features/stores/components/StoreDetailLayoutView.js +24 -71
- package/dist/features/stores/components/StoreDigitalCodesListing.js +12 -2
- package/dist/features/stores/components/StoreLiveItemsListing.js +12 -2
- package/dist/features/stores/components/StorePreOrdersListing.js +12 -1
- package/dist/features/stores/components/StoreProductsListing.js +11 -1
- package/dist/features/stores/repository/store.repository.js +6 -0
- package/dist/features/stores/schemas/index.d.ts +6 -6
- package/dist/features/support/schemas/index.d.ts +4 -4
- package/dist/features/tester/actions/checklist-item-actions.d.ts +4 -4
- package/dist/features/tester/seed-data/offers-tester-seed-data.js +119 -3
- package/dist/features/tester/seed-data/products-tester-seed-data.js +131 -1
- package/dist/features/tester/seed-data/tester-checklist-seed-data.js +431 -1
- package/dist/features/wishlist/hooks/useWishlistWithGuest.d.ts +1 -1
- package/dist/index.d.ts +25 -12
- package/dist/index.js +26 -11
- package/dist/next/routing/route-map.d.ts +23 -3
- package/dist/next/routing/route-map.js +14 -2
- package/dist/providers/db-firebase/base.repository.d.ts +30 -0
- package/dist/providers/db-firebase/base.repository.js +50 -1
- package/dist/providers/db-firebase/index.d.ts +1 -1
- package/dist/providers/db-firebase/index.js +1 -1
- package/dist/providers/db-firebase/sieve.d.ts +25 -0
- package/dist/providers/db-firebase/sieve.js +52 -18
- package/dist/react/hooks/useUrlTable.js +10 -1
- package/dist/schemas/firestore-value.d.ts +8 -0
- package/dist/schemas/firestore-value.js +44 -0
- package/dist/schemas/index.d.ts +1 -1
- package/dist/schemas/index.js +1 -1
- package/dist/schemas/registry.d.ts +702 -69
- package/dist/schemas/registry.js +64 -1
- package/dist/seed/_helpers/category-forest.d.ts +2 -0
- package/dist/seed/_helpers/category-forest.js +309 -0
- package/dist/seed/_helpers/category-tree.d.ts +27 -0
- package/dist/seed/_helpers/category-tree.js +103 -0
- package/dist/seed/bids-seed-data.js +30 -0
- package/dist/seed/catalogue-seed-data.js +12 -12
- package/dist/seed/categories-seed-data.js +177 -162
- package/dist/seed/events-seed-data.js +61 -10
- package/dist/seed/homepage-sections-seed-data.js +5 -1
- package/dist/seed/offers-seed-data.js +244 -34
- package/dist/seed/orders-seed-data.js +336 -1
- package/dist/seed/products-art-seed-data.js +50 -12
- package/dist/seed/products-auctions-seed-data.js +138 -18
- package/dist/seed/products-classifieds-seed-data.js +80 -16
- package/dist/seed/products-digital-codes-seed-data.js +66 -18
- package/dist/seed/products-live-items-seed-data.js +64 -13
- package/dist/seed/products-preorders-seed-data.d.ts +0 -1
- package/dist/seed/products-preorders-seed-data.js +52 -13
- package/dist/seed/products-prize-draws-seed-data.js +63 -14
- package/dist/seed/products-standard-seed-data.js +99 -26
- package/dist/seed/products-stickers-seed-data.js +47 -12
- package/dist/seed/reviews-seed-data.js +6 -1
- package/dist/seed/site-settings-seed-data.d.ts +1 -38
- package/dist/seed/site-settings-seed-data.js +38 -76
- package/dist/seed/stores-seed-data.js +71 -1
- package/dist/seed/users-seed-data.js +15 -5
- package/dist/server-entry.d.ts +1 -2
- package/dist/server-entry.js +4 -3
- package/dist/server.d.ts +6 -3
- package/dist/server.js +13 -4
- package/dist/styles.css +78 -12
- package/dist/tailwind-utilities.css +1 -1
- package/dist/ui/components/Button.style.css +19 -4
- package/dist/ui/components/CollapsibleSection.d.ts +17 -1
- package/dist/ui/components/CollapsibleSection.js +6 -2
- package/dist/ui/components/FilterChipGroup.d.ts +25 -1
- package/dist/ui/components/FilterChipGroup.js +21 -4
- package/dist/ui/components/HandMode.style.css +47 -0
- package/dist/ui/components/Layout.d.ts +9 -2
- package/dist/ui/components/Layout.js +1 -1
- package/dist/ui/components/ListingLayout.js +8 -8
- package/dist/ui/components/ListingLayout.style.css +8 -7
- package/dist/ui/components/RecordDetailModal.d.ts +10 -1
- package/dist/ui/components/RecordDetailModal.js +2 -2
- package/dist/ui/components/StickyToolbar.d.ts +3 -1
- package/dist/ui/components/StickyToolbar.js +62 -20
- package/dist/ui/components/bottom-chrome-slot.d.ts +21 -0
- package/dist/ui/components/bottom-chrome-slot.js +29 -0
- package/dist/ui/components/index.style.css +3 -0
- package/dist/ui/forms/FormShell.d.ts +43 -13
- package/dist/ui/forms/FormShell.js +22 -11
- package/dist/ui/forms/index.d.ts +1 -1
- package/dist/ui/index.d.ts +1 -1
- package/package.json +2 -1
- package/scripts/node-esm-loader.mjs +65 -0
- package/scripts/seed-cli-loader.mjs +6 -49
- package/scripts/seed-cli.mjs +1 -1
|
@@ -15,13 +15,12 @@ export interface PlaceBidFormClientProps {
|
|
|
15
15
|
isEnded: boolean;
|
|
16
16
|
auctionEndDate: Date | null;
|
|
17
17
|
buyNowPrice: number | null;
|
|
18
|
-
bidsHaveStarted?: boolean;
|
|
19
18
|
bidCount: number;
|
|
20
19
|
tags?: string[];
|
|
21
20
|
onPlaceBid: (input: PlaceBidInput) => Promise<unknown>;
|
|
22
21
|
onBuyNow?: () => Promise<unknown>;
|
|
23
22
|
}
|
|
24
|
-
export declare function PlaceBidFormClient({ productId, currentBid: ssrCurrentBid, startingBid, tiers, minBidIncrementOverride, currency, isEnded, auctionEndDate, buyNowPrice,
|
|
23
|
+
export declare function PlaceBidFormClient({ productId, currentBid: ssrCurrentBid, startingBid, tiers, minBidIncrementOverride, currency, isEnded, auctionEndDate, buyNowPrice, bidCount: ssrBidCount, tags, onPlaceBid, onBuyNow, }: PlaceBidFormClientProps): React.JSX.Element;
|
|
25
24
|
/**
|
|
26
25
|
* `PlaceBidModalButton` — opens a modal that hosts the same PlaceBidFormClient.
|
|
27
26
|
*
|
|
@@ -10,7 +10,8 @@ import { FieldInput } from "../../../ui/forms/FieldInput";
|
|
|
10
10
|
import { applyZodIssues } from "../../../ui/forms/FormShell";
|
|
11
11
|
import { placeBidSchema } from "../schemas/bid-input";
|
|
12
12
|
import { useLiveAuctionBid } from "../hooks/useLiveAuctionBid";
|
|
13
|
-
import {
|
|
13
|
+
import { AUCTION_BUYOUT_WINDOW_MINUTES } from "../../../_internal/shared/checkout/lanes";
|
|
14
|
+
import { BID_PRESET_MULTIPLIERS, isBuyNowAvailable, resolveMinBid, resolveMinBidIncrement, } from "../../../_internal/shared/features/auctions/config";
|
|
14
15
|
import { normalizeError } from "../../../errors/normalize";
|
|
15
16
|
const __P = {
|
|
16
17
|
p5: "p-[var(--appkit-space-5)]",
|
|
@@ -22,7 +23,7 @@ const BID_ERROR_DISPLAY = {
|
|
|
22
23
|
BID_SELF_BID: "You cannot bid on your own listing.",
|
|
23
24
|
BID_USER_BANNED: "Your account is currently restricted from bidding. Contact support.",
|
|
24
25
|
};
|
|
25
|
-
export function PlaceBidFormClient({ productId, currentBid: ssrCurrentBid, startingBid, tiers, minBidIncrementOverride, currency, isEnded, auctionEndDate, buyNowPrice,
|
|
26
|
+
export function PlaceBidFormClient({ productId, currentBid: ssrCurrentBid, startingBid, tiers, minBidIncrementOverride, currency, isEnded, auctionEndDate, buyNowPrice, bidCount: ssrBidCount, tags = [], onPlaceBid, onBuyNow, }) {
|
|
26
27
|
const router = useRouter();
|
|
27
28
|
// Live-updates while the bid card is open — reflects other bidders'
|
|
28
29
|
// activity on this auction, not just the bidder's own submission.
|
|
@@ -97,7 +98,10 @@ export function PlaceBidFormClient({ productId, currentBid: ssrCurrentBid, start
|
|
|
97
98
|
// presetAmount is derived from currentBid/minBidIncrement, both in deps.
|
|
98
99
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
99
100
|
}, [currentBid, minBidIncrement, stepMul]);
|
|
100
|
-
|
|
101
|
+
// `currentBid` here is the LIVE SSE price, so the button hides itself the
|
|
102
|
+
// moment another bidder passes the buyout price — without a page reload, and
|
|
103
|
+
// without this component owning a second copy of the rule.
|
|
104
|
+
const buyNowAvailable = isBuyNowAvailable({ buyNowPrice, currentBid, isEnded }) && !!onBuyNow;
|
|
101
105
|
const schema = placeBidSchema(minBid, formatCurrency(minBid, currency));
|
|
102
106
|
async function submitBid(amount, setFieldError) {
|
|
103
107
|
try {
|
|
@@ -205,7 +209,7 @@ export function PlaceBidFormClient({ productId, currentBid: ssrCurrentBid, start
|
|
|
205
209
|
return applyZodIssues(parsed.error.issues, setFieldError);
|
|
206
210
|
setSuccess(false);
|
|
207
211
|
startTransition(() => submitBid(parsed.data.bidAmount, setFieldError));
|
|
208
|
-
}, children: isEnded ? "Auction Ended" : "Place Bid" }), buyNowAvailable && (_jsx(Button, { variant: "secondary", size: "md", className: "w-full", type: "button", disabled: isBuyNowPending || isPending, isLoading: isBuyNowPending, onClick: handleBuyNow, children: `Buy Now — ${formatCurrency(buyNowPrice, currency)}` }))] })) }), tags.length > 0 && (_jsx(Div, { border: "default", className: "border-t", padding: "t-md", children: _jsx(Row, { wrap: true, gap: "xs", children: tags.map((tag) => (_jsx(Span, { rounded: "full", padding: "pill-sm-tall", surface: "subtle", color: "muted", size: "xs", children: tag }, tag))) }) }))] }));
|
|
212
|
+
}, children: isEnded ? "Auction Ended" : "Place Bid" }), buyNowAvailable && (_jsxs(_Fragment, { children: [_jsx(Button, { variant: "secondary", size: "md", className: "w-full", type: "button", disabled: isBuyNowPending || isPending, isLoading: isBuyNowPending, onClick: handleBuyNow, children: `Buy Now — ${formatCurrency(buyNowPrice, currency)}` }), _jsxs(Text, { align: "center", size: "xs", color: "muted", children: ["Skips the bidding. The auction stays live until you pay \u2014 complete checkout within ", AUCTION_BUYOUT_WINDOW_MINUTES, " minutes."] })] }))] })) }), tags.length > 0 && (_jsx(Div, { border: "default", className: "border-t", padding: "t-md", children: _jsx(Row, { wrap: true, gap: "xs", children: tags.map((tag) => (_jsx(Span, { rounded: "full", padding: "pill-sm-tall", surface: "subtle", color: "muted", size: "xs", children: tag }, tag))) }) }))] }));
|
|
209
213
|
}
|
|
210
214
|
/**
|
|
211
215
|
* `PlaceBidModalButton` — opens a modal that hosts the same PlaceBidFormClient.
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { BidDocument } from "../schemas/firestore";
|
|
2
|
+
/** Which portal is looking. Decides whether bidder identity is shown. */
|
|
3
|
+
export type BidDetailViewer = "buyer" | "seller" | "admin";
|
|
4
|
+
type FieldRow = {
|
|
5
|
+
label: string;
|
|
6
|
+
value: string;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* A bid's status as a badge.
|
|
10
|
+
*
|
|
11
|
+
* `forfeited` is deliberately distinguished from `cancelled`: a forfeited bid
|
|
12
|
+
* WON and then let the payment window lapse, which is the seller's problem and
|
|
13
|
+
* the buyer's fault; a cancelled one never won anything. Collapsing them would
|
|
14
|
+
* hide exactly the distinction a support query is about.
|
|
15
|
+
*/
|
|
16
|
+
export declare function bidStatusBadge(status: string | undefined): {
|
|
17
|
+
label: string;
|
|
18
|
+
tone: string;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* The scalar rows for a bid's detail modal.
|
|
22
|
+
*
|
|
23
|
+
* `bidderName` appears only for seller and admin. A buyer opening their OWN
|
|
24
|
+
* bid does not need to be told their own name, and the same component is used
|
|
25
|
+
* by all three, so gating here rather than at each call site is what stops a
|
|
26
|
+
* future copy-paste showing one buyer another's identity.
|
|
27
|
+
*/
|
|
28
|
+
export declare function buildBidDetailFields(bid: BidDocument, viewer: BidDetailViewer): FieldRow[];
|
|
29
|
+
export {};
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* WHY: All three bid listings — buyer, seller and admin — were dead ends. A
|
|
3
|
+
* bid could be SEEN in a list and never opened, so the amount, the
|
|
4
|
+
* auction it belongs to, when it was placed and whether it was outbid,
|
|
5
|
+
* won or forfeited were only ever visible as a table row. `bid` is also
|
|
6
|
+
* one of the three `relatedType` values with no per-record page in ANY
|
|
7
|
+
* role, so a bid notification had nowhere to link.
|
|
8
|
+
* WHAT: The `<RecordDetailModal>` field list for a bid, built once.
|
|
9
|
+
*
|
|
10
|
+
* ## One builder, three portals
|
|
11
|
+
*
|
|
12
|
+
* The three views differ only in whether they may show the bidder's identity:
|
|
13
|
+
* a buyer sees their own bid, a seller sees who bid on their auction, and an
|
|
14
|
+
* admin sees everything. Writing the field list three times would be three
|
|
15
|
+
* chances to leak a bidder's name into the buyer view or to forget a field in
|
|
16
|
+
* one portal — the shape of Root Cause #38, one layer up.
|
|
17
|
+
*
|
|
18
|
+
* `maskPublicBid` already exists for the PUBLIC bid history and is unchanged;
|
|
19
|
+
* this is the dashboard equivalent, where the viewer is authenticated and the
|
|
20
|
+
* question is which role they hold.
|
|
21
|
+
*
|
|
22
|
+
* EXPORTS:
|
|
23
|
+
* buildBidDetailFields, bidStatusBadge, type BidDetailViewer
|
|
24
|
+
*
|
|
25
|
+
* @tag domain:auctions
|
|
26
|
+
* @tag layer:feature-util
|
|
27
|
+
* @tag pattern:none
|
|
28
|
+
* @tag access:isomorphic
|
|
29
|
+
* @tag consumers:UserBidsView,SellerBidsView,AdminBidsView
|
|
30
|
+
* @tag sideEffects:none
|
|
31
|
+
*/
|
|
32
|
+
const money = (amount, currency = "INR") => amount == null
|
|
33
|
+
? "—"
|
|
34
|
+
: new Intl.NumberFormat("en-IN", { style: "currency", currency, maximumFractionDigits: 2 }).format(amount);
|
|
35
|
+
const when = (value) => {
|
|
36
|
+
if (!value)
|
|
37
|
+
return "—";
|
|
38
|
+
const d = value instanceof Date ? value : new Date(String(value));
|
|
39
|
+
return Number.isNaN(d.getTime()) ? "—" : d.toLocaleString();
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* A bid's status as a badge.
|
|
43
|
+
*
|
|
44
|
+
* `forfeited` is deliberately distinguished from `cancelled`: a forfeited bid
|
|
45
|
+
* WON and then let the payment window lapse, which is the seller's problem and
|
|
46
|
+
* the buyer's fault; a cancelled one never won anything. Collapsing them would
|
|
47
|
+
* hide exactly the distinction a support query is about.
|
|
48
|
+
*/
|
|
49
|
+
export function bidStatusBadge(status) {
|
|
50
|
+
switch (status) {
|
|
51
|
+
case "won":
|
|
52
|
+
return { label: "Won", tone: "success" };
|
|
53
|
+
case "active":
|
|
54
|
+
return { label: "Leading", tone: "info" };
|
|
55
|
+
case "outbid":
|
|
56
|
+
return { label: "Outbid", tone: "warning" };
|
|
57
|
+
case "forfeited":
|
|
58
|
+
return { label: "Forfeited — payment window lapsed", tone: "danger" };
|
|
59
|
+
case "cancelled":
|
|
60
|
+
return { label: "Cancelled", tone: "default" };
|
|
61
|
+
case "lost":
|
|
62
|
+
return { label: "Lost", tone: "default" };
|
|
63
|
+
default:
|
|
64
|
+
return { label: status ?? "Unknown", tone: "default" };
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* The scalar rows for a bid's detail modal.
|
|
69
|
+
*
|
|
70
|
+
* `bidderName` appears only for seller and admin. A buyer opening their OWN
|
|
71
|
+
* bid does not need to be told their own name, and the same component is used
|
|
72
|
+
* by all three, so gating here rather than at each call site is what stops a
|
|
73
|
+
* future copy-paste showing one buyer another's identity.
|
|
74
|
+
*/
|
|
75
|
+
export function buildBidDetailFields(bid, viewer) {
|
|
76
|
+
const rows = [
|
|
77
|
+
{ label: "Auction", value: bid.productTitle || bid.productId },
|
|
78
|
+
{ label: "Bid amount", value: money(bid.bidAmount, bid.currency) },
|
|
79
|
+
];
|
|
80
|
+
// Only meaningful when the bid raised a previous one.
|
|
81
|
+
if (bid.previousBidAmount != null) {
|
|
82
|
+
rows.push({ label: "Previous high bid", value: money(bid.previousBidAmount, bid.currency) });
|
|
83
|
+
}
|
|
84
|
+
if (bid.autoMaxBid != null) {
|
|
85
|
+
rows.push({ label: "Auto-bid limit", value: money(bid.autoMaxBid, bid.currency) });
|
|
86
|
+
}
|
|
87
|
+
rows.push({ label: "Placed", value: when(bid.bidDate ?? bid.createdAt) });
|
|
88
|
+
if (viewer !== "buyer") {
|
|
89
|
+
rows.push({ label: "Bidder", value: bid.userName || bid.userId });
|
|
90
|
+
}
|
|
91
|
+
// A buyout is a real bid, not a bid-free purchase — surfacing it here is
|
|
92
|
+
// what makes "why is there no ladder on this auction" answerable.
|
|
93
|
+
if (bid.isBuyout) {
|
|
94
|
+
rows.push({ label: "Placed via", value: "Buy Now" });
|
|
95
|
+
}
|
|
96
|
+
// The order this bid became. Present only once the win was actually paid,
|
|
97
|
+
// which is exactly the question "did they ever pay?" asks.
|
|
98
|
+
if (bid.orderId) {
|
|
99
|
+
rows.push({ label: "Order", value: bid.orderId });
|
|
100
|
+
}
|
|
101
|
+
rows.push({ label: "Bid ID", value: bid.id });
|
|
102
|
+
return rows;
|
|
103
|
+
}
|
|
@@ -66,6 +66,19 @@ export declare class BidRepository extends BaseRepository<BidDocument> {
|
|
|
66
66
|
*/
|
|
67
67
|
markForfeited(bidId: string): Promise<void>;
|
|
68
68
|
markLost(batch: WriteBatch, ref: DocumentReference): void;
|
|
69
|
+
/**
|
|
70
|
+
* Batched "everyone else lost", for callers that are not already inside a
|
|
71
|
+
* batch of their own — a Buy Now purchase ends the auction outside the
|
|
72
|
+
* settlement job, and the losing bids can be any number, so this writes them
|
|
73
|
+
* in Firestore-batch chunks rather than one round-trip per bid.
|
|
74
|
+
*/
|
|
75
|
+
markManyLost(refs: readonly DocumentReference[]): Promise<void>;
|
|
76
|
+
/**
|
|
77
|
+
* A pending Buy Now claim that never became a sale. Not `forfeited` — that
|
|
78
|
+
* status means "won, then defaulted", and a lapsed claim never won anything;
|
|
79
|
+
* the auction it was placed against carried on untouched.
|
|
80
|
+
*/
|
|
81
|
+
markCancelled(bidId: string): Promise<void>;
|
|
69
82
|
markOutbid(batch: WriteBatch, ref: DocumentReference): void;
|
|
70
83
|
markWinning(batch: WriteBatch, ref: DocumentReference): void;
|
|
71
84
|
/**
|
|
@@ -148,6 +148,29 @@ export class BidRepository extends BaseRepository {
|
|
|
148
148
|
updatedAt: new Date(),
|
|
149
149
|
});
|
|
150
150
|
}
|
|
151
|
+
/**
|
|
152
|
+
* Batched "everyone else lost", for callers that are not already inside a
|
|
153
|
+
* batch of their own — a Buy Now purchase ends the auction outside the
|
|
154
|
+
* settlement job, and the losing bids can be any number, so this writes them
|
|
155
|
+
* in Firestore-batch chunks rather than one round-trip per bid.
|
|
156
|
+
*/
|
|
157
|
+
async markManyLost(refs) {
|
|
158
|
+
const CHUNK = 400; // under Firestore's 500-write batch limit, with headroom
|
|
159
|
+
for (let i = 0; i < refs.length; i += CHUNK) {
|
|
160
|
+
const batch = this.db.batch();
|
|
161
|
+
for (const ref of refs.slice(i, i + CHUNK))
|
|
162
|
+
this.markLost(batch, ref);
|
|
163
|
+
await batch.commit();
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* A pending Buy Now claim that never became a sale. Not `forfeited` — that
|
|
168
|
+
* status means "won, then defaulted", and a lapsed claim never won anything;
|
|
169
|
+
* the auction it was placed against carried on untouched.
|
|
170
|
+
*/
|
|
171
|
+
async markCancelled(bidId) {
|
|
172
|
+
await this.update(bidId, { status: "cancelled", isWinning: false, updatedAt: new Date() });
|
|
173
|
+
}
|
|
151
174
|
markOutbid(batch, ref) {
|
|
152
175
|
batch.update(ref, {
|
|
153
176
|
status: "outbid",
|
|
@@ -35,6 +35,23 @@ export interface BidDocument extends BaseDocument {
|
|
|
35
35
|
* a dead status badge.
|
|
36
36
|
*/
|
|
37
37
|
orderId?: string;
|
|
38
|
+
/**
|
|
39
|
+
* True when this bid was created by Buy Now rather than by a buyer typing an
|
|
40
|
+
* amount. Its `bidAmount` is the listing's `buyNowPrice`.
|
|
41
|
+
*
|
|
42
|
+
* A buyout bid starts `active` like any other, but is NOT an ordinary bid in
|
|
43
|
+
* two respects and both are load-bearing:
|
|
44
|
+
* 1. **Auction settlement must ignore it.** A pending buyout sits at the BIN
|
|
45
|
+
* price, so it would otherwise win by default the moment the auction's
|
|
46
|
+
* clock ran out — awarding the item to someone who explicitly did not
|
|
47
|
+
* complete their purchase in time.
|
|
48
|
+
* 2. **It never moves `product.currentBid`.** A pending claim is not a
|
|
49
|
+
* public price, and inflating the visible bid to the BIN price would make
|
|
50
|
+
* `isBuyNowAvailable` false for everybody else, silently making the
|
|
51
|
+
* buyout single-occupancy. Concurrency is settled by the transaction in
|
|
52
|
+
* `claimAuctionForCheckout`, not by blocking the second buyer up front.
|
|
53
|
+
*/
|
|
54
|
+
isBuyout?: boolean;
|
|
38
55
|
}
|
|
39
56
|
export declare const BID_COLLECTION: "bids";
|
|
40
57
|
export declare const BID_INDEXED_FIELDS: readonly ["productId", "userId", "status", "isWinning", "bidDate", "createdAt"];
|
|
@@ -67,19 +67,20 @@ export declare const auctionItemSchema: z.ZodObject<{
|
|
|
67
67
|
title: string;
|
|
68
68
|
createdAt: string;
|
|
69
69
|
updatedAt: string;
|
|
70
|
-
featured: boolean;
|
|
71
|
-
listingType: "auction";
|
|
72
70
|
slug: string;
|
|
73
71
|
price: number;
|
|
72
|
+
sellerId: string;
|
|
73
|
+
featured: boolean;
|
|
74
|
+
listingType: "auction";
|
|
74
75
|
auctionEndDate: string;
|
|
75
76
|
startingBid: number;
|
|
76
77
|
bidCount: number;
|
|
77
|
-
sellerId: string;
|
|
78
78
|
storeId?: string | undefined;
|
|
79
79
|
description?: string | undefined;
|
|
80
80
|
mainImage?: string | undefined;
|
|
81
81
|
images?: string[] | undefined;
|
|
82
82
|
currentBid?: number | undefined;
|
|
83
|
+
storeSlug?: string | undefined;
|
|
83
84
|
media?: {
|
|
84
85
|
type: "video" | "image" | "file";
|
|
85
86
|
url: string;
|
|
@@ -89,7 +90,6 @@ export declare const auctionItemSchema: z.ZodObject<{
|
|
|
89
90
|
youtubeId?: string | undefined;
|
|
90
91
|
duration?: number | undefined;
|
|
91
92
|
}[] | undefined;
|
|
92
|
-
storeSlug?: string | undefined;
|
|
93
93
|
}, {
|
|
94
94
|
currency: string;
|
|
95
95
|
status: "draft" | "published" | "archived" | "sold";
|
|
@@ -97,19 +97,20 @@ export declare const auctionItemSchema: z.ZodObject<{
|
|
|
97
97
|
title: string;
|
|
98
98
|
createdAt: string;
|
|
99
99
|
updatedAt: string;
|
|
100
|
-
featured: boolean;
|
|
101
|
-
listingType: "auction";
|
|
102
100
|
slug: string;
|
|
103
101
|
price: number;
|
|
102
|
+
sellerId: string;
|
|
103
|
+
featured: boolean;
|
|
104
|
+
listingType: "auction";
|
|
104
105
|
auctionEndDate: string;
|
|
105
106
|
startingBid: number;
|
|
106
107
|
bidCount: number;
|
|
107
|
-
sellerId: string;
|
|
108
108
|
storeId?: string | undefined;
|
|
109
109
|
description?: string | undefined;
|
|
110
110
|
mainImage?: string | undefined;
|
|
111
111
|
images?: string[] | undefined;
|
|
112
112
|
currentBid?: number | undefined;
|
|
113
|
+
storeSlug?: string | undefined;
|
|
113
114
|
media?: {
|
|
114
115
|
type: "video" | "image" | "file";
|
|
115
116
|
url: string;
|
|
@@ -119,7 +120,6 @@ export declare const auctionItemSchema: z.ZodObject<{
|
|
|
119
120
|
youtubeId?: string | undefined;
|
|
120
121
|
duration?: number | undefined;
|
|
121
122
|
}[] | undefined;
|
|
122
|
-
storeSlug?: string | undefined;
|
|
123
123
|
}>;
|
|
124
124
|
export declare const bidRecordSchema: z.ZodObject<{
|
|
125
125
|
id: z.ZodString;
|
|
@@ -134,18 +134,18 @@ export declare const bidRecordSchema: z.ZodObject<{
|
|
|
134
134
|
currency: string;
|
|
135
135
|
id: string;
|
|
136
136
|
amount: number;
|
|
137
|
-
auctionId: string;
|
|
138
137
|
bidderId: string;
|
|
139
138
|
isWinning: boolean;
|
|
139
|
+
auctionId: string;
|
|
140
140
|
placedAt: string;
|
|
141
141
|
bidderDisplayName?: string | undefined;
|
|
142
142
|
}, {
|
|
143
143
|
currency: string;
|
|
144
144
|
id: string;
|
|
145
145
|
amount: number;
|
|
146
|
-
auctionId: string;
|
|
147
146
|
bidderId: string;
|
|
148
147
|
isWinning: boolean;
|
|
148
|
+
auctionId: string;
|
|
149
149
|
placedAt: string;
|
|
150
150
|
bidderDisplayName?: string | undefined;
|
|
151
151
|
}>;
|
|
@@ -159,12 +159,12 @@ export declare const auctionListParamsSchema: z.ZodObject<{
|
|
|
159
159
|
sort?: string | undefined;
|
|
160
160
|
page?: number | undefined;
|
|
161
161
|
pageSize?: number | undefined;
|
|
162
|
-
filters?: string | undefined;
|
|
163
162
|
storeSlug?: string | undefined;
|
|
163
|
+
filters?: string | undefined;
|
|
164
164
|
}, {
|
|
165
165
|
sort?: string | undefined;
|
|
166
166
|
page?: number | undefined;
|
|
167
167
|
pageSize?: number | undefined;
|
|
168
|
-
filters?: string | undefined;
|
|
169
168
|
storeSlug?: string | undefined;
|
|
169
|
+
filters?: string | undefined;
|
|
170
170
|
}>;
|
|
@@ -23,6 +23,13 @@ export declare const AdminAuditActionValues: {
|
|
|
23
23
|
readonly PAYOUT_MARK_PAID: "payout_mark_paid";
|
|
24
24
|
readonly STORE_STATUS_CHANGE: "store_status_change";
|
|
25
25
|
readonly USER_ROLE_CHANGE: "user_role_change";
|
|
26
|
+
/**
|
|
27
|
+
* Admin cancelled an offer. The store keeps sole authority to accept,
|
|
28
|
+
* counter and decline; cancelling is the ONE write an admin may make, and
|
|
29
|
+
* it is an escalation — reason required, and recorded both here and in the
|
|
30
|
+
* offer's own `statusHistory`.
|
|
31
|
+
*/
|
|
32
|
+
readonly OFFER_CANCEL: "offer_cancel";
|
|
26
33
|
};
|
|
27
34
|
export type AdminAuditAction = (typeof AdminAuditActionValues)[keyof typeof AdminAuditActionValues];
|
|
28
35
|
export interface AdminAuditLogDocument extends BaseDocument {
|
|
@@ -55,5 +62,12 @@ export declare const ADMIN_AUDIT_LOG_FIELDS: {
|
|
|
55
62
|
readonly PAYOUT_MARK_PAID: "payout_mark_paid";
|
|
56
63
|
readonly STORE_STATUS_CHANGE: "store_status_change";
|
|
57
64
|
readonly USER_ROLE_CHANGE: "user_role_change";
|
|
65
|
+
/**
|
|
66
|
+
* Admin cancelled an offer. The store keeps sole authority to accept,
|
|
67
|
+
* counter and decline; cancelling is the ONE write an admin may make, and
|
|
68
|
+
* it is an escalation — reason required, and recorded both here and in the
|
|
69
|
+
* offer's own `statusHistory`.
|
|
70
|
+
*/
|
|
71
|
+
readonly OFFER_CANCEL: "offer_cancel";
|
|
58
72
|
};
|
|
59
73
|
};
|
|
@@ -21,6 +21,13 @@ export const AdminAuditActionValues = {
|
|
|
21
21
|
PAYOUT_MARK_PAID: "payout_mark_paid",
|
|
22
22
|
STORE_STATUS_CHANGE: "store_status_change",
|
|
23
23
|
USER_ROLE_CHANGE: "user_role_change",
|
|
24
|
+
/**
|
|
25
|
+
* Admin cancelled an offer. The store keeps sole authority to accept,
|
|
26
|
+
* counter and decline; cancelling is the ONE write an admin may make, and
|
|
27
|
+
* it is an escalation — reason required, and recorded both here and in the
|
|
28
|
+
* offer's own `statusHistory`.
|
|
29
|
+
*/
|
|
30
|
+
OFFER_CANCEL: "offer_cancel",
|
|
24
31
|
};
|
|
25
32
|
export const ADMIN_AUDIT_LOG_FIELDS = {
|
|
26
33
|
ACTOR_UID: "actorUid",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
* Permission naming: admin:resource:action
|
|
12
12
|
* Ban action naming: plain verb phrase — write_reviews, place_bids, etc.
|
|
13
13
|
*/
|
|
14
|
-
export type Permission = "admin:dashboard:view" | "admin:users:read" | "admin:users:write" | "admin:users:delete" | "admin:user-bans:read" | "admin:user-bans:write" | "admin:products:read" | "admin:products:write" | "admin:products:delete" | "admin:orders:read" | "admin:orders:write" | "admin:returns:read" | "admin:returns:write" | "admin:stores:read" | "admin:stores:write" | "admin:store-addresses:read" | "admin:addresses:read" | "admin:addresses:write" | "admin:analytics:view" | "admin:payouts:read" | "admin:payouts:write" | "admin:audit-log:read" | "admin:categories:read" | "admin:categories:write" | "admin:categories:delete" | "admin:brands:read" | "admin:brands:write" | "admin:brands:delete" | "admin:coupons:read" | "admin:coupons:write" | "admin:coupons:delete" | "admin:deals:read" | "admin:deals:write" | "admin:featured:read" | "admin:featured:write" | "admin:reviews:read" | "admin:reviews:write" | "admin:reviews:delete" | "admin:blog:read" | "admin:blog:write" | "admin:blog:delete" | "admin:blog:publish" | "admin:bids:read" | "admin:bids:write" | "admin:media:read" | "admin:media:write" | "admin:media:delete" | "admin:site:read" | "admin:site:write" | "admin:settings:write" | "admin:navigation:read" | "admin:navigation:write" | "admin:sections:read" | "admin:sections:write" | "admin:carousel:read" | "admin:carousel:write" | "admin:carousel:delete" | "admin:ads:read" | "admin:ads:write" | "admin:ads:delete" | "admin:faqs:read" | "admin:faqs:write" | "admin:faqs:delete" | "admin:tester-checklist:read" | "admin:tester-checklist:write" | "admin:tester-checklist:delete" | "admin:tester-feedback:read" | "admin:tester-feedback:write" | "admin:newsletter:read" | "admin:newsletter:write" | "admin:contact:read" | "admin:events:read" | "admin:events:write" | "admin:events:delete" | "admin:event-entries:read" | "admin:event-entries:write" | "admin:support-tickets:read" | "admin:support-tickets:write" | "admin:shipments:read" | "admin:shipments:write" | "admin:catalogue:read" | "admin:catalogue:write" | "admin:support-tickets:assign" | "admin:support-tickets:close" | "admin:scammers:read" | "admin:scammers:write" | "admin:scammers:verify" | "admin:scammers:delete" | "admin:sessions:read" | "admin:sessions:delete" | "admin:notifications:read" | "admin:notifications:write" | "admin:carts:read" | "admin:wishlists:read" | "admin:feature-flags:read" | "admin:feature-flags:write" | "admin:copilot:view" | "admin:team:read" | "admin:team:write" | "admin:maintenance:view-server-errors" | "admin:maintenance:view-client-errors" | "admin:maintenance:view-function-errors" | "admin:maintenance:view-cloud-logs" | "admin:maintenance:view-payment-rollbacks" | "admin:maintenance:run-analysis" | "admin:maintenance:purge-errors";
|
|
14
|
+
export type Permission = "admin:dashboard:view" | "admin:users:read" | "admin:users:write" | "admin:users:delete" | "admin:user-bans:read" | "admin:user-bans:write" | "admin:products:read" | "admin:products:write" | "admin:products:delete" | "admin:orders:read" | "admin:orders:write" | "admin:returns:read" | "admin:returns:write" | "admin:stores:read" | "admin:stores:write" | "admin:store-addresses:read" | "admin:addresses:read" | "admin:addresses:write" | "admin:analytics:view" | "admin:payouts:read" | "admin:payouts:write" | "admin:audit-log:read" | "admin:categories:read" | "admin:categories:write" | "admin:categories:delete" | "admin:brands:read" | "admin:brands:write" | "admin:brands:delete" | "admin:coupons:read" | "admin:coupons:write" | "admin:coupons:delete" | "admin:deals:read" | "admin:deals:write" | "admin:featured:read" | "admin:featured:write" | "admin:reviews:read" | "admin:reviews:write" | "admin:reviews:delete" | "admin:blog:read" | "admin:blog:write" | "admin:blog:delete" | "admin:blog:publish" | "admin:bids:read" | "admin:bids:write" | "admin:offers:read" | "admin:offers:write" | "admin:media:read" | "admin:media:write" | "admin:media:delete" | "admin:site:read" | "admin:site:write" | "admin:settings:write" | "admin:navigation:read" | "admin:navigation:write" | "admin:sections:read" | "admin:sections:write" | "admin:carousel:read" | "admin:carousel:write" | "admin:carousel:delete" | "admin:ads:read" | "admin:ads:write" | "admin:ads:delete" | "admin:faqs:read" | "admin:faqs:write" | "admin:faqs:delete" | "admin:tester-checklist:read" | "admin:tester-checklist:write" | "admin:tester-checklist:delete" | "admin:tester-feedback:read" | "admin:tester-feedback:write" | "admin:newsletter:read" | "admin:newsletter:write" | "admin:contact:read" | "admin:events:read" | "admin:events:write" | "admin:events:delete" | "admin:event-entries:read" | "admin:event-entries:write" | "admin:support-tickets:read" | "admin:support-tickets:write" | "admin:shipments:read" | "admin:shipments:write" | "admin:catalogue:read" | "admin:catalogue:write" | "admin:support-tickets:assign" | "admin:support-tickets:close" | "admin:scammers:read" | "admin:scammers:write" | "admin:scammers:verify" | "admin:scammers:delete" | "admin:sessions:read" | "admin:sessions:delete" | "admin:notifications:read" | "admin:notifications:write" | "admin:carts:read" | "admin:wishlists:read" | "admin:feature-flags:read" | "admin:feature-flags:write" | "admin:copilot:view" | "admin:team:read" | "admin:team:write" | "admin:maintenance:view-server-errors" | "admin:maintenance:view-client-errors" | "admin:maintenance:view-function-errors" | "admin:maintenance:view-cloud-logs" | "admin:maintenance:view-payment-rollbacks" | "admin:maintenance:run-analysis" | "admin:maintenance:purge-errors";
|
|
15
15
|
/**
|
|
16
16
|
* Granular user actions that can be soft-banned individually.
|
|
17
17
|
* A user may have multiple simultaneous soft bans of different types.
|
|
@@ -161,6 +161,7 @@ export const PERMISSION_GROUPS = {
|
|
|
161
161
|
"admin:carts:read",
|
|
162
162
|
"admin:wishlists:read",
|
|
163
163
|
"admin:bids:read",
|
|
164
|
+
"admin:offers:read",
|
|
164
165
|
],
|
|
165
166
|
customer_support: [
|
|
166
167
|
"admin:dashboard:view",
|
|
@@ -212,6 +213,8 @@ export const PERMISSION_GROUPS = {
|
|
|
212
213
|
"admin:reviews:delete",
|
|
213
214
|
"admin:bids:read",
|
|
214
215
|
"admin:bids:write",
|
|
216
|
+
"admin:offers:read",
|
|
217
|
+
"admin:offers:write",
|
|
215
218
|
"admin:sessions:read",
|
|
216
219
|
"admin:sessions:delete",
|
|
217
220
|
"admin:carts:read",
|
|
@@ -226,6 +229,8 @@ export const PERMISSION_GROUPS = {
|
|
|
226
229
|
"admin:dashboard:view",
|
|
227
230
|
"admin:bids:read",
|
|
228
231
|
"admin:bids:write",
|
|
232
|
+
"admin:offers:read",
|
|
233
|
+
"admin:offers:write",
|
|
229
234
|
"admin:products:read",
|
|
230
235
|
"admin:orders:read",
|
|
231
236
|
"admin:users:read",
|
|
@@ -280,6 +285,7 @@ export const ROUTE_PERMISSION_MAP = {
|
|
|
280
285
|
"/admin/reviews": "admin:reviews:read",
|
|
281
286
|
"/admin/blog": "admin:blog:read",
|
|
282
287
|
"/admin/bids": "admin:bids:read",
|
|
288
|
+
"/admin/offers": "admin:offers:read",
|
|
283
289
|
"/admin/media": "admin:media:read",
|
|
284
290
|
"/admin/site": "admin:site:read",
|
|
285
291
|
"/admin/settings": "admin:settings:write",
|
|
@@ -357,7 +363,10 @@ export const PERMISSION_DOMAINS = [
|
|
|
357
363
|
{ label: "Dashboard", prefix: "admin:dashboard:" },
|
|
358
364
|
{ label: "Users & Bans", prefix: "admin:users:|admin:user-bans:" },
|
|
359
365
|
{ label: "Products", prefix: "admin:products:" },
|
|
360
|
-
|
|
366
|
+
// Offers sit with Orders, not with Content where Bids live: an offer is a
|
|
367
|
+
// commerce-pipeline object that ends in an order, and the permissions
|
|
368
|
+
// catalogue should group it where an operator would look for it.
|
|
369
|
+
{ label: "Orders & Returns", prefix: "admin:orders:|admin:returns:|admin:offers:" },
|
|
361
370
|
{ label: "Stores", prefix: "admin:stores:|admin:store-addresses:" },
|
|
362
371
|
{ label: "Finance", prefix: "admin:analytics:|admin:payouts:" },
|
|
363
372
|
{ label: "Catalog", prefix: "admin:categories:|admin:brands:|admin:coupons:|admin:deals:|admin:featured:" },
|
|
@@ -72,8 +72,8 @@ export declare const createBlogPostSchema: z.ZodObject<{
|
|
|
72
72
|
status: "draft" | "published" | "archived";
|
|
73
73
|
title: string;
|
|
74
74
|
content: string;
|
|
75
|
-
category: "news" | "tips" | "guides" | "updates" | "community";
|
|
76
75
|
slug: string;
|
|
76
|
+
category: "news" | "tips" | "guides" | "updates" | "community";
|
|
77
77
|
tags: string[];
|
|
78
78
|
isFeatured: boolean;
|
|
79
79
|
excerpt: string;
|
|
@@ -108,13 +108,13 @@ export declare const createBlogPostSchema: z.ZodObject<{
|
|
|
108
108
|
}, {
|
|
109
109
|
title: string;
|
|
110
110
|
content: string;
|
|
111
|
-
category: "news" | "tips" | "guides" | "updates" | "community";
|
|
112
111
|
slug: string;
|
|
112
|
+
category: "news" | "tips" | "guides" | "updates" | "community";
|
|
113
113
|
excerpt: string;
|
|
114
114
|
status?: "draft" | "published" | "archived" | undefined;
|
|
115
115
|
tags?: string[] | undefined;
|
|
116
|
-
isFeatured?: boolean | undefined;
|
|
117
116
|
publishedAt?: string | undefined;
|
|
117
|
+
isFeatured?: boolean | undefined;
|
|
118
118
|
coverImage?: string | {
|
|
119
119
|
type: "video" | "image" | "file";
|
|
120
120
|
url: string;
|
|
@@ -211,11 +211,11 @@ export declare const updateBlogPostSchema: z.ZodObject<{
|
|
|
211
211
|
status?: "draft" | "published" | "archived" | undefined;
|
|
212
212
|
title?: string | undefined;
|
|
213
213
|
content?: string | undefined;
|
|
214
|
-
category?: "news" | "tips" | "guides" | "updates" | "community" | undefined;
|
|
215
214
|
slug?: string | undefined;
|
|
215
|
+
category?: "news" | "tips" | "guides" | "updates" | "community" | undefined;
|
|
216
216
|
tags?: string[] | undefined;
|
|
217
|
-
isFeatured?: boolean | undefined;
|
|
218
217
|
publishedAt?: string | undefined;
|
|
218
|
+
isFeatured?: boolean | undefined;
|
|
219
219
|
excerpt?: string | undefined;
|
|
220
220
|
coverImage?: {
|
|
221
221
|
type: "video" | "image" | "file";
|
|
@@ -248,11 +248,11 @@ export declare const updateBlogPostSchema: z.ZodObject<{
|
|
|
248
248
|
status?: "draft" | "published" | "archived" | undefined;
|
|
249
249
|
title?: string | undefined;
|
|
250
250
|
content?: string | undefined;
|
|
251
|
-
category?: "news" | "tips" | "guides" | "updates" | "community" | undefined;
|
|
252
251
|
slug?: string | undefined;
|
|
252
|
+
category?: "news" | "tips" | "guides" | "updates" | "community" | undefined;
|
|
253
253
|
tags?: string[] | undefined;
|
|
254
|
-
isFeatured?: boolean | undefined;
|
|
255
254
|
publishedAt?: string | undefined;
|
|
255
|
+
isFeatured?: boolean | undefined;
|
|
256
256
|
excerpt?: string | undefined;
|
|
257
257
|
coverImage?: string | {
|
|
258
258
|
type: "video" | "image" | "file";
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/**
|
|
3
|
+
* The blog form's own schema. Distinct from `blogPostSchema` (blog/schemas),
|
|
4
|
+
* which requires an `id` this draft cannot have before its first save and
|
|
5
|
+
* models `coverImage` as a `MediaField` where the form holds a plain URL.
|
|
6
|
+
*
|
|
7
|
+
* ## Why `.passthrough()` is gone
|
|
8
|
+
*
|
|
9
|
+
* It used to name FOUR of the draft's fourteen fields and rely on passthrough
|
|
10
|
+
* to keep the other ten alive. That is the single most dangerous shape in this
|
|
11
|
+
* codebase — `z.object()` strips unknown keys, so the moment anyone tightened
|
|
12
|
+
* it, ten fields would vanish on the next save with no error. Verified safe to
|
|
13
|
+
* remove here: every one of the fourteen is now named, and the save payload
|
|
14
|
+
* (below) maps each explicitly rather than spreading the draft, so there is no
|
|
15
|
+
* extra key for passthrough to have been protecting.
|
|
16
|
+
*
|
|
17
|
+
* ## Section, row and control come from the field itself
|
|
18
|
+
*
|
|
19
|
+
* 🛑 `annotate()` must be the OUTERMOST call — it keys a WeakMap by schema
|
|
20
|
+
* instance and every zod wrapper returns a new one, so
|
|
21
|
+
* `annotate(z.string(), …).optional()` silently loses the metadata and drops
|
|
22
|
+
* the field into the "advanced" fallback. `audit-field-ui-meta` blocks it.
|
|
23
|
+
*/
|
|
24
|
+
export declare const blogDraftSchema: z.ZodObject<{
|
|
25
|
+
title: z.ZodString;
|
|
26
|
+
/**
|
|
27
|
+
* NO `blog-` prefix. Surfaced by `roundtrip-diff` in W4: the schema demanded
|
|
28
|
+
* `/^blog-/`, and **all 20 stored posts fail it** — every seeded post holds
|
|
29
|
+
* the bare slug (`spot-genuine-takara-tomy-beyblade`) while only the
|
|
30
|
+
* DOCUMENT ID carries the prefix (`generateBlogPostId` adds it).
|
|
31
|
+
*
|
|
32
|
+
* `BlogRepository.findBySlug` queries this field directly, so the public URL
|
|
33
|
+
* is the bare slug. The regex therefore broke the editor from both ends:
|
|
34
|
+
* opening any existing post flagged its slug invalid, and "fixing" it to
|
|
35
|
+
* satisfy the rule would rewrite the stored slug and 404 the live URL.
|
|
36
|
+
*/
|
|
37
|
+
slug: z.ZodString;
|
|
38
|
+
excerpt: z.ZodString;
|
|
39
|
+
content: z.ZodString;
|
|
40
|
+
coverImage: z.ZodString;
|
|
41
|
+
youtubeId: z.ZodString;
|
|
42
|
+
category: z.ZodEnum<["news", "tips", "guides", "updates", "community"]>;
|
|
43
|
+
tags: z.ZodArray<z.ZodString, "many">;
|
|
44
|
+
metaTitle: z.ZodString;
|
|
45
|
+
metaDescription: z.ZodUnion<[z.ZodString, z.ZodLiteral<"">]>;
|
|
46
|
+
status: z.ZodEnum<["draft", "published", "archived"]>;
|
|
47
|
+
publishedAt: z.ZodString;
|
|
48
|
+
authorName: z.ZodString;
|
|
49
|
+
isFeatured: z.ZodBoolean;
|
|
50
|
+
}, "strip", z.ZodTypeAny, {
|
|
51
|
+
status: "draft" | "published" | "archived";
|
|
52
|
+
title: string;
|
|
53
|
+
content: string;
|
|
54
|
+
youtubeId: string;
|
|
55
|
+
slug: string;
|
|
56
|
+
category: "news" | "tips" | "guides" | "updates" | "community";
|
|
57
|
+
tags: string[];
|
|
58
|
+
publishedAt: string;
|
|
59
|
+
isFeatured: boolean;
|
|
60
|
+
excerpt: string;
|
|
61
|
+
coverImage: string;
|
|
62
|
+
authorName: string;
|
|
63
|
+
metaTitle: string;
|
|
64
|
+
metaDescription: string;
|
|
65
|
+
}, {
|
|
66
|
+
status: "draft" | "published" | "archived";
|
|
67
|
+
title: string;
|
|
68
|
+
content: string;
|
|
69
|
+
youtubeId: string;
|
|
70
|
+
slug: string;
|
|
71
|
+
category: "news" | "tips" | "guides" | "updates" | "community";
|
|
72
|
+
tags: string[];
|
|
73
|
+
publishedAt: string;
|
|
74
|
+
isFeatured: boolean;
|
|
75
|
+
excerpt: string;
|
|
76
|
+
coverImage: string;
|
|
77
|
+
authorName: string;
|
|
78
|
+
metaTitle: string;
|
|
79
|
+
metaDescription: string;
|
|
80
|
+
}>;
|