@mohasinac/appkit 3.4.7 → 3.5.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/classified/ClassifiedDetailView.js +1 -1
- package/dist/_internal/client/features/digital-code/CodeRevealPanel.js +1 -1
- package/dist/_internal/client/features/digital-code/DigitalCodeDetailView.js +1 -1
- package/dist/_internal/client/features/filters/filter-load-options.js +10 -9
- package/dist/_internal/client/features/layout/DashboardLayoutClient.d.ts +6 -1
- package/dist/_internal/client/features/layout/DashboardLayoutClient.js +11 -4
- package/dist/_internal/client/features/live/LiveItemDetailView.js +2 -2
- package/dist/_internal/client/features/maintenance/views/AnalysisRunnerView.js +10 -3
- package/dist/_internal/client/features/maintenance/views/ServerErrorsListView.js +2 -2
- package/dist/_internal/client/scaffolds/DashboardScaffold.js +3 -1
- package/dist/_internal/server/features/checkout/actions.d.ts +16 -0
- package/dist/_internal/server/features/checkout/actions.js +149 -35
- package/dist/_internal/server/features/checkout/bundle-expansion.d.ts +31 -0
- package/dist/_internal/server/features/checkout/bundle-expansion.js +41 -0
- package/dist/_internal/server/features/lottery/actions.js +14 -4
- package/dist/_internal/server/features/maintenance/analyze.js +4 -2
- package/dist/_internal/server/features/orders/actions.js +9 -0
- package/dist/_internal/server/features/orders/adapters.js +19 -0
- package/dist/_internal/server/features/seo/robots.js +1 -1
- package/dist/_internal/server/functions/firestore.d.ts +47 -1
- package/dist/_internal/server/functions/firestore.js +56 -1
- package/dist/_internal/server/functions/scheduled.d.ts +2 -1
- package/dist/_internal/server/functions/scheduled.js +9 -1
- package/dist/_internal/server/jobs/core/catalogueImageStalenessReminder.d.ts +10 -0
- package/dist/_internal/server/jobs/core/catalogueImageStalenessReminder.js +49 -0
- package/dist/_internal/server/jobs/core/cleanupRtdbEvents.js +32 -0
- package/dist/_internal/server/jobs/core/hardBanCascade.d.ts +26 -0
- package/dist/_internal/server/jobs/core/hardBanCascade.js +179 -0
- package/dist/_internal/server/jobs/core/index.d.ts +4 -1
- package/dist/_internal/server/jobs/core/index.js +4 -1
- package/dist/_internal/server/jobs/core/jobRunners.d.ts +28 -0
- package/dist/_internal/server/jobs/core/jobRunners.js +37 -0
- package/dist/_internal/server/jobs/core/onCatalogueSubmittedForApproval.d.ts +15 -0
- package/dist/_internal/server/jobs/core/onCatalogueSubmittedForApproval.js +38 -0
- package/dist/_internal/server/jobs/core/onJobCreated.d.ts +22 -0
- package/dist/_internal/server/jobs/core/onJobCreated.js +59 -0
- package/dist/_internal/server/jobs/core/weeklyPayoutEligibility.d.ts +6 -1
- package/dist/_internal/server/jobs/core/weeklyPayoutEligibility.js +5 -2
- package/dist/_internal/server/jobs/handlers/catalogueImageStalenessReminder.d.ts +2 -0
- package/dist/_internal/server/jobs/handlers/catalogueImageStalenessReminder.js +2 -0
- package/dist/_internal/server/jobs/handlers/index.d.ts +6 -0
- package/dist/_internal/server/jobs/handlers/index.js +8 -0
- package/dist/_internal/server/jobs/handlers/onCatalogueSubmittedForApproval.d.ts +12 -0
- package/dist/_internal/server/jobs/handlers/onCatalogueSubmittedForApproval.js +20 -0
- package/dist/_internal/server/jobs/handlers/onJobCreated.d.ts +3 -0
- package/dist/_internal/server/jobs/handlers/onJobCreated.js +9 -0
- package/dist/_internal/server/jobs/handlers/onShipmentAllocationSync.d.ts +25 -0
- package/dist/_internal/server/jobs/handlers/onShipmentAllocationSync.js +71 -0
- package/dist/_internal/server/jobs/handlers/onShipmentDeleted.d.ts +14 -0
- package/dist/_internal/server/jobs/handlers/onShipmentDeleted.js +23 -0
- package/dist/_internal/server/jobs/handlers/onShipmentItemWrite.d.ts +17 -0
- package/dist/_internal/server/jobs/handlers/onShipmentItemWrite.js +26 -0
- package/dist/_internal/server/jobs/handlers/weeklyPayoutEligibility.js +3 -1
- package/dist/_internal/shared/actions/action-registry.d.ts +1 -1
- package/dist/_internal/shared/actions/action-registry.js +136 -0
- package/dist/_internal/shared/features/blog/schema.d.ts +8 -8
- package/dist/_internal/shared/features/brands/schema.d.ts +4 -4
- package/dist/_internal/shared/features/categories/bundle-schemas.d.ts +8 -8
- package/dist/_internal/shared/features/events/schema.d.ts +4 -4
- package/dist/_internal/shared/features/products/schema.d.ts +8 -8
- package/dist/_internal/shared/features/promotions/schema.d.ts +4 -4
- package/dist/_internal/shared/features/reviews/schema.d.ts +4 -4
- package/dist/client/api/useFeatureFlags.d.ts +22 -0
- package/dist/client/api/useFeatureFlags.js +27 -0
- package/dist/client/observability/reportClientError.js +3 -2
- package/dist/client.d.ts +4 -2
- package/dist/client.js +2 -1
- package/dist/configs/next.js +1 -0
- package/dist/constants/api-endpoints.d.ts +279 -3
- package/dist/constants/api-endpoints.js +130 -2
- package/dist/core/hooks/useSyncManager.js +5 -4
- package/dist/errors/conflict-error.d.ts +4 -0
- package/dist/errors/conflict-error.js +6 -0
- package/dist/errors/index.d.ts +1 -0
- package/dist/errors/index.js +1 -0
- package/dist/features/about/components/FeesView.js +2 -2
- package/dist/features/about/components/HelpPageView.js +2 -2
- package/dist/features/about/components/HowAuctionsWorkView.js +2 -2
- package/dist/features/about/components/HowCheckoutWorksView.js +2 -2
- package/dist/features/about/components/HowEmiWorksView.js +2 -2
- package/dist/features/about/components/HowOffersWorkView.js +3 -3
- package/dist/features/about/components/HowOrdersWorkView.js +3 -3
- package/dist/features/about/components/HowPayoutsWorkView.js +2 -2
- package/dist/features/about/components/HowPreOrdersWorkView.js +2 -2
- package/dist/features/about/components/HowReviewsWorkView.js +2 -2
- package/dist/features/about/components/PublicProfileView.d.ts +8 -1
- package/dist/features/about/components/PublicProfileView.js +11 -9
- package/dist/features/about/components/SecurityPrivacyView.js +2 -2
- package/dist/features/about/components/UnauthorizedView.js +2 -2
- package/dist/features/account/components/AddressBook.js +1 -1
- package/dist/features/account/components/AddressesIndexListing.js +1 -1
- package/dist/features/account/components/NotificationBell.js +5 -5
- package/dist/features/account/components/NotificationPreferencesPanel.js +5 -2
- package/dist/features/account/components/UserOffersPanel.js +5 -4
- package/dist/features/account/components/UserSidebar.js +2 -2
- package/dist/features/account/components/UserSupportView.js +3 -3
- package/dist/features/account/schemas/index.d.ts +12 -12
- package/dist/features/addresses/schemas/index.d.ts +6 -6
- package/dist/features/admin/components/AdminAdEditorView.js +3 -3
- package/dist/features/admin/components/AdminAddressEditorView.js +3 -3
- package/dist/features/admin/components/AdminAdsView.js +3 -3
- package/dist/features/admin/components/AdminBlogEditorView.js +1 -1
- package/dist/features/admin/components/AdminBlogView.js +12 -15
- package/dist/features/admin/components/AdminBrandEditorView.js +1 -1
- package/dist/features/admin/components/AdminBrandsView.js +12 -13
- package/dist/features/admin/components/AdminBundleEditorView.js +5 -4
- package/dist/features/admin/components/AdminBundlesView.js +32 -23
- package/dist/features/admin/components/AdminCarouselEditorView.js +5 -5
- package/dist/features/admin/components/AdminCarouselView.js +2 -2
- package/dist/features/admin/components/AdminCatalogGuideView.js +1 -1
- package/dist/features/admin/components/AdminCategoriesView.js +12 -13
- package/dist/features/admin/components/AdminCategoryEditorView.js +2 -2
- package/dist/features/admin/components/AdminContactEditorView.js +2 -2
- package/dist/features/admin/components/AdminCouponEditorView.d.ts +10 -1
- package/dist/features/admin/components/AdminCouponEditorView.js +7 -2
- package/dist/features/admin/components/AdminCouponsView.js +32 -27
- package/dist/features/admin/components/AdminEmployeeEditorView.js +3 -3
- package/dist/features/admin/components/AdminFaqEditorView.js +1 -1
- package/dist/features/admin/components/AdminFaqsView.js +20 -20
- package/dist/features/admin/components/AdminFeatureEditorView.js +5 -5
- package/dist/features/admin/components/AdminFeaturesView.js +9 -10
- package/dist/features/admin/components/AdminFilterBar.js +1 -1
- package/dist/features/admin/components/AdminFulfillmentView.js +4 -4
- package/dist/features/admin/components/AdminGuideHubView.js +2 -2
- package/dist/features/admin/components/AdminMediaView.js +3 -2
- package/dist/features/admin/components/AdminNavigationView.js +1 -1
- package/dist/features/admin/components/AdminOrderEditorView.js +3 -3
- package/dist/features/admin/components/AdminOrdersView.js +21 -30
- package/dist/features/admin/components/AdminPageHeader.js +3 -3
- package/dist/features/admin/components/AdminPayoutsView.js +8 -8
- package/dist/features/admin/components/AdminPrizeDrawsView.js +8 -9
- package/dist/features/admin/components/AdminProductEditorView.d.ts +9 -1
- package/dist/features/admin/components/AdminProductEditorView.js +7 -4
- package/dist/features/admin/components/AdminProductsView.js +30 -41
- package/dist/features/admin/components/AdminReviewsView.js +14 -17
- package/dist/features/admin/components/AdminScammerEditorView.js +5 -5
- package/dist/features/admin/components/AdminSectionsView.js +3 -3
- package/dist/features/admin/components/AdminSessionsView.js +8 -10
- package/dist/features/admin/components/AdminSidebar.js +2 -2
- package/dist/features/admin/components/AdminSiteSettingsView.js +10 -3
- package/dist/features/admin/components/AdminStoreEditorView.js +4 -5
- package/dist/features/admin/components/AdminStoresView.js +18 -13
- package/dist/features/admin/components/AdminSupportTicketDetailView.js +7 -7
- package/dist/features/admin/components/AdminTeamView.js +9 -5
- package/dist/features/admin/components/AdminUsersView.js +19 -15
- package/dist/features/admin/components/AdminViewCards.js +5 -5
- package/dist/features/admin/components/DashboardStats.js +1 -1
- package/dist/features/admin/components/DataListingView.js +2 -2
- package/dist/features/admin/components/DataTable.js +2 -2
- package/dist/features/admin/components/DrawerFormFooter.js +1 -1
- package/dist/features/admin/components/analytics/AdminAnalyticsCharts.js +2 -2
- package/dist/features/admin/components/analytics/AdminStatCard.js +1 -1
- package/dist/features/admin/hooks/useAdminListing.d.ts +3 -2
- package/dist/features/admin/hooks/useAdminListing.js +8 -2
- package/dist/features/admin/permission-map.js +2 -0
- package/dist/features/admin/schemas/firestore.d.ts +7 -0
- package/dist/features/admin/schemas/firestore.js +4 -0
- package/dist/features/auctions/components/AuctionBidsTable.js +1 -1
- package/dist/features/auctions/components/AuctionDetailPageView.js +7 -7
- package/dist/features/auctions/components/MarketplaceAuctionCard.js +3 -3
- package/dist/features/auctions/components/MarketplaceAuctionGrid.js +4 -4
- package/dist/features/auctions/components/PlaceBidFormClient.js +1 -1
- package/dist/features/auctions/schemas/index.d.ts +16 -16
- package/dist/features/auth/permissions/constants.d.ts +1 -1
- package/dist/features/auth/permissions/constants.js +2 -0
- package/dist/features/auth/schemas/index.d.ts +6 -6
- package/dist/features/before-after/schemas/index.d.ts +3 -3
- package/dist/features/blog/actions/blog-actions.d.ts +32 -32
- package/dist/features/blog/components/BlogFeaturedCard.js +2 -2
- package/dist/features/blog/components/BlogIndexListing.js +2 -2
- package/dist/features/blog/components/BlogListView.js +4 -4
- package/dist/features/blog/components/BlogPostView.js +4 -4
- package/dist/features/blog/schemas/index.d.ts +77 -77
- package/dist/features/cart/components/CartDrawer.js +2 -2
- package/dist/features/catalogue/actions/approve-catalogue-listing.d.ts +12 -0
- package/dist/features/catalogue/actions/approve-catalogue-listing.js +50 -0
- package/dist/features/catalogue/actions/list-from-catalogue.d.ts +17 -0
- package/dist/features/catalogue/actions/list-from-catalogue.js +50 -0
- package/dist/features/catalogue/actions/submit-for-approval.d.ts +8 -0
- package/dist/features/catalogue/actions/submit-for-approval.js +30 -0
- package/dist/features/catalogue/components/AdminCatalogueApprovalsView.d.ts +2 -0
- package/dist/features/catalogue/components/AdminCatalogueApprovalsView.js +53 -0
- package/dist/features/catalogue/components/CatalogueItemEditorView.d.ts +7 -0
- package/dist/features/catalogue/components/CatalogueItemEditorView.js +79 -0
- package/dist/features/catalogue/components/PublicCatalogueView.d.ts +5 -0
- package/dist/features/catalogue/components/PublicCatalogueView.js +22 -0
- package/dist/features/catalogue/components/UserCatalogueView.d.ts +12 -0
- package/dist/features/catalogue/components/UserCatalogueView.js +51 -0
- package/dist/features/catalogue/index.d.ts +12 -0
- package/dist/features/catalogue/index.js +9 -0
- package/dist/features/catalogue/repository/catalogue.repository.d.ts +39 -0
- package/dist/features/catalogue/repository/catalogue.repository.js +68 -0
- package/dist/features/catalogue/schemas/firestore.d.ts +47 -0
- package/dist/features/catalogue/schemas/firestore.js +22 -0
- package/dist/features/catalogue/schemas/index.d.ts +2 -0
- package/dist/features/catalogue/schemas/index.js +2 -0
- package/dist/features/catalogue/schemas/validation.d.ts +71 -0
- package/dist/features/catalogue/schemas/validation.js +25 -0
- package/dist/features/catalogue/utils/freshness.d.ts +10 -0
- package/dist/features/catalogue/utils/freshness.js +15 -0
- package/dist/features/catalogue/utils/product-from-item.d.ts +15 -0
- package/dist/features/catalogue/utils/product-from-item.js +34 -0
- package/dist/features/categories/components/BrandDetailPageView.js +1 -1
- package/dist/features/categories/components/BrandDetailTabs.js +2 -2
- package/dist/features/categories/components/BundleCollage.js +2 -2
- package/dist/features/categories/components/BundleItemsPicker.js +3 -2
- package/dist/features/categories/components/CategoriesIndexListing.js +8 -6
- package/dist/features/categories/components/CategoryBundlesListing.js +10 -4
- package/dist/features/categories/components/CategoryDetailPageView.js +1 -1
- package/dist/features/categories/components/CategoryDetailTabs.js +2 -2
- package/dist/features/categories/components/CategoryGrid.js +3 -3
- package/dist/features/categories/components/CategoryProductsListing.js +1 -1
- package/dist/features/categories/components/CategorySortSelect.js +1 -1
- package/dist/features/categories/components/CategoryStoresListing.js +1 -1
- package/dist/features/categories/components/CategoryTableColumns.js +1 -1
- package/dist/features/categories/components/CategoryTree.js +2 -2
- package/dist/features/categories/components/ConcernCard.js +1 -1
- package/dist/features/categories/hooks/useCategories.js +1 -1
- package/dist/features/categories/schemas/index.d.ts +32 -32
- package/dist/features/classified/components/ClassifiedFilters.js +2 -2
- package/dist/features/classified/components/ClassifiedIndexListing.js +9 -3
- package/dist/features/collections/schemas/index.d.ts +2 -2
- package/dist/features/consultation/components/ConsultationForm.js +1 -1
- package/dist/features/consultation/schemas/index.d.ts +10 -10
- package/dist/features/contact/components/ContactForm.js +4 -4
- package/dist/features/contact/components/ContactInfoSidebar.js +1 -1
- package/dist/features/contact/components/ContactPageView.js +2 -1
- package/dist/features/copilot/components/AdminCopilotView.js +5 -4
- package/dist/features/corporate/schemas/index.d.ts +2 -2
- package/dist/features/digital-codes/components/DigitalCodesIndexListing.js +3 -3
- package/dist/features/events/components/AdminEventEditorView.js +4 -4
- package/dist/features/events/components/AdminEventEntriesView.js +2 -2
- package/dist/features/events/components/AdminEventsView.js +8 -8
- package/dist/features/events/components/EventBanner.js +1 -1
- package/dist/features/events/components/EventCard.js +3 -3
- package/dist/features/events/components/EventLeaderboard.js +1 -1
- package/dist/features/events/components/EventOfferCard.js +1 -1
- package/dist/features/events/components/EventPollWidget.js +6 -5
- package/dist/features/events/components/EventRaffleEntryForm.js +1 -1
- package/dist/features/events/components/EventRaffleWinnerView.js +5 -5
- package/dist/features/events/components/EventRafflesSection.js +1 -1
- package/dist/features/events/components/EventSaleBanner.js +1 -1
- package/dist/features/events/components/EventsIndexListing.js +4 -2
- package/dist/features/events/components/EventsListView.js +2 -2
- package/dist/features/events/components/SpinWheelView.js +11 -5
- package/dist/features/events/schemas/index.d.ts +100 -100
- package/dist/features/faq/actions/faq-actions.d.ts +6 -6
- package/dist/features/faq/components/ContactCTA.js +3 -3
- package/dist/features/faq/components/FAQCategorySidebar.js +2 -2
- package/dist/features/faq/components/FAQHelpfulButtons.js +3 -3
- package/dist/features/faq/schemas/index.d.ts +12 -12
- package/dist/features/filters/AsyncFacetSection.js +4 -4
- package/dist/features/filters/FilterFacetSection.js +8 -8
- package/dist/features/filters/RangeFilter.js +2 -2
- package/dist/features/filters/SwitchFilter.js +1 -1
- package/dist/features/forms/Checkbox.js +2 -8
- package/dist/features/forms/Input.js +2 -1
- package/dist/features/forms/Radio.js +3 -3
- package/dist/features/forms/Select.d.ts +1 -1
- package/dist/features/forms/Select.js +3 -2
- package/dist/features/forms/Slider.js +5 -11
- package/dist/features/forms/Textarea.js +2 -1
- package/dist/features/grouped/schemas/index.d.ts +6 -6
- package/dist/features/homepage/actions/homepage-section-actions.d.ts +4 -4
- package/dist/features/homepage/components/AdvertisementBanner.js +4 -4
- package/dist/features/homepage/components/AnnouncementBar.js +3 -3
- package/dist/features/homepage/components/BeforeAfterCard.js +1 -1
- package/dist/features/homepage/components/BrandsSection.js +9 -9
- package/dist/features/homepage/components/CTABannerSection.js +1 -1
- package/dist/features/homepage/components/CharacterHotspot.js +4 -4
- package/dist/features/homepage/components/CharacterHotspotForm.js +15 -13
- package/dist/features/homepage/components/CollectionCardsSection.js +1 -1
- package/dist/features/homepage/components/CustomCardsSection.js +6 -6
- package/dist/features/homepage/components/CustomerReviewsSection.js +2 -2
- package/dist/features/homepage/components/FAQSection.js +2 -2
- package/dist/features/homepage/components/FeaturedBundlesSection.js +3 -3
- package/dist/features/homepage/components/FeaturedResultsSection.js +2 -2
- package/dist/features/homepage/components/GoogleReviewsSection.js +6 -6
- package/dist/features/homepage/components/HeroBanner.js +1 -1
- package/dist/features/homepage/components/HeroCarousel.js +5 -4
- package/dist/features/homepage/components/HeroSection.js +1 -7
- package/dist/features/homepage/components/HomepageSkeleton.js +1 -1
- package/dist/features/homepage/components/HowItWorksInfoView.js +1 -1
- package/dist/features/homepage/components/HowItWorksSection.js +2 -2
- package/dist/features/homepage/components/NewsletterBanner.js +2 -2
- package/dist/features/homepage/components/NewsletterSection.js +1 -1
- package/dist/features/homepage/components/PromoGrid.js +1 -1
- package/dist/features/homepage/components/SectionCarousel.js +6 -6
- package/dist/features/homepage/components/SecurityHighlightsSection.js +2 -2
- package/dist/features/homepage/components/ShopByCategorySection.js +10 -10
- package/dist/features/homepage/components/SiteFeaturesSection.js +2 -2
- package/dist/features/homepage/components/SocialFeedSection.js +5 -5
- package/dist/features/homepage/components/SocialPostCard.js +1 -1
- package/dist/features/homepage/components/StatsCounterSection.js +1 -1
- package/dist/features/homepage/components/TestimonialsCarousel.js +1 -1
- package/dist/features/homepage/components/TrustBadges.js +1 -1
- package/dist/features/homepage/components/TrustFeaturesSection.js +2 -2
- package/dist/features/homepage/components/TrustIndicatorsSection.js +2 -2
- package/dist/features/homepage/components/WelcomeSection.js +2 -2
- package/dist/features/homepage/components/WhatsAppCommunitySection.js +1 -1
- package/dist/features/homepage/hooks/useActiveAd.js +2 -1
- package/dist/features/homepage/schemas/firestore.d.ts +10 -0
- package/dist/features/homepage/schemas/index.d.ts +116 -116
- package/dist/features/jobs/actions/enqueue-job.d.ts +24 -0
- package/dist/features/jobs/actions/enqueue-job.js +44 -0
- package/dist/features/jobs/repository/jobs.repository.d.ts +21 -0
- package/dist/features/jobs/repository/jobs.repository.js +48 -0
- package/dist/features/jobs/schemas/firestore.d.ts +54 -0
- package/dist/features/jobs/schemas/firestore.js +24 -0
- package/dist/features/layout/AppLayoutShell.js +17 -11
- package/dist/features/layout/AutoBreadcrumbs.js +1 -1
- package/dist/features/layout/BackToTop.js +2 -2
- package/dist/features/layout/BottomActions.js +7 -7
- package/dist/features/layout/BottomNavItem.js +2 -2
- package/dist/features/layout/BottomNavLayout.js +13 -4
- package/dist/features/layout/BottomNavbar.d.ts +9 -1
- package/dist/features/layout/BottomNavbar.js +12 -5
- package/dist/features/layout/BottomSheet.js +1 -1
- package/dist/features/layout/Breadcrumbs.js +1 -1
- package/dist/features/layout/FooterLayout.js +2 -2
- package/dist/features/layout/NavItem.js +3 -3
- package/dist/features/layout/NavbarLayout.js +6 -6
- package/dist/features/layout/SidebarLayout.d.ts +3 -0
- package/dist/features/layout/SidebarLayout.js +3 -3
- package/dist/features/layout/TitleBarLayout.js +4 -4
- package/dist/features/live/components/LiveItemFilters.js +2 -2
- package/dist/features/live/components/LiveItemsIndexListing.js +3 -3
- package/dist/features/lottery/types/index.d.ts +3 -1
- package/dist/features/lottery/types/index.js +16 -3
- package/dist/features/loyalty/components/CoinsDisplay.js +2 -2
- package/dist/features/media/MediaImage.d.ts +6 -1
- package/dist/features/media/MediaImage.js +10 -4
- package/dist/features/media/MediaLightbox.js +1 -1
- package/dist/features/media/MediaPickerModal.js +4 -3
- package/dist/features/media/MediaVideo.js +1 -1
- package/dist/features/media/modals/ImageCropModal.js +1 -1
- package/dist/features/media/modals/ImageEditor.js +1 -1
- package/dist/features/media/repository/media-assets.repository.d.ts +9 -0
- package/dist/features/media/types/index.d.ts +4 -4
- package/dist/features/media/upload/MediaUploadField.js +3 -3
- package/dist/features/media/upload/MediaUploadList.js +1 -1
- package/dist/features/messages/hooks/useConversation.js +4 -3
- package/dist/features/messages/hooks/useConversations.js +2 -1
- package/dist/features/messages/schemas/index.d.ts +6 -6
- package/dist/features/orders/components/MarketplaceOrderCard.js +1 -1
- package/dist/features/orders/components/OrderPaymentSummary.d.ts +16 -0
- package/dist/features/orders/components/OrderPaymentSummary.js +32 -0
- package/dist/features/orders/components/OrderSiblingPayments.js +1 -1
- package/dist/features/orders/components/OrdersList.d.ts +7 -2
- package/dist/features/orders/components/OrdersList.js +5 -5
- package/dist/features/orders/components/RefundHistoryTable.js +1 -1
- package/dist/features/orders/components/RefundRequestView.js +1 -1
- package/dist/features/orders/components/index.d.ts +2 -0
- package/dist/features/orders/components/index.js +1 -0
- package/dist/features/orders/repository/orders.repository.d.ts +8 -0
- package/dist/features/orders/repository/orders.repository.js +24 -0
- package/dist/features/orders/schemas/firestore.d.ts +59 -0
- package/dist/features/orders/schemas/firestore.js +5 -0
- package/dist/features/orders/schemas/index.d.ts +91 -40
- package/dist/features/orders/schemas/index.js +10 -0
- package/dist/features/orders/types/index.d.ts +15 -0
- package/dist/features/payments/schemas/index.d.ts +12 -12
- package/dist/features/pre-orders/components/MarketplacePreorderCard.js +5 -5
- package/dist/features/pre-orders/components/PreOrderActionsClient.js +1 -1
- package/dist/features/pre-orders/components/PreOrderBadge.js +1 -1
- package/dist/features/pre-orders/components/PreOrderDetailPageView.js +7 -7
- package/dist/features/pre-orders/components/PreOrdersIndexListing.js +3 -3
- package/dist/features/pre-orders/schemas/index.d.ts +12 -12
- package/dist/features/products/columns/productTableColumns.js +2 -2
- package/dist/features/products/components/AuctionsIndexListing.js +3 -3
- package/dist/features/products/components/CompareOverlay.js +15 -10
- package/dist/features/products/components/CustomFieldsEditor.js +2 -2
- package/dist/features/products/components/CustomSectionsEditor.js +3 -3
- package/dist/features/products/components/FeatureBadge.js +2 -2
- package/dist/features/products/components/GroupSettingsPanel.js +5 -4
- package/dist/features/products/components/MakeOfferButton.js +4 -4
- package/dist/features/products/components/MarketplaceBundleCard.js +3 -2
- package/dist/features/products/components/MarketplacePrizeDrawCard.js +1 -1
- package/dist/features/products/components/PrizeDrawCollage.js +6 -6
- package/dist/features/products/components/PrizeDrawDetailPageView.js +5 -5
- package/dist/features/products/components/PrizeDrawEntryActions.js +1 -1
- package/dist/features/products/components/PrizeDrawItemsEditor.js +4 -4
- package/dist/features/products/components/PrizeDrawsIndexListing.js +11 -4
- package/dist/features/products/components/PrizeDrawsSection.js +1 -1
- package/dist/features/products/components/PrizeRevealModal.js +9 -4
- package/dist/features/products/components/ProductDetailActions.js +2 -1
- package/dist/features/products/components/ProductDetailPageView.js +16 -16
- package/dist/features/products/components/ProductFeaturesSelector.js +5 -5
- package/dist/features/products/components/ProductForm.js +1 -1
- package/dist/features/products/components/ProductGalleryClient.js +5 -3
- package/dist/features/products/components/ProductGrid.js +11 -11
- package/dist/features/products/components/ProductTabs.js +2 -2
- package/dist/features/products/components/ProductTabsShell.js +2 -1
- package/dist/features/products/components/ProductsIndexListing.js +6 -1
- package/dist/features/products/components/ShareButton.js +2 -1
- package/dist/features/products/components/ShowGroupSection.js +9 -5
- package/dist/features/products/components/SublistingCarouselSection.js +8 -4
- package/dist/features/products/constants/action-defs.d.ts +10 -2
- package/dist/features/products/constants/action-defs.js +20 -2
- package/dist/features/products/schemas/firestore.d.ts +5 -0
- package/dist/features/products/schemas/index.d.ts +40 -40
- package/dist/features/products/schemas/product-features.validators.d.ts +14 -14
- package/dist/features/promotions/components/CouponCard.js +13 -7
- package/dist/features/promotions/components/CouponsIndexListing.js +4 -6
- package/dist/features/promotions/components/PromotionsView.js +2 -2
- package/dist/features/promotions/schemas/index.d.ts +26 -26
- package/dist/features/reviews/components/ReviewDetailPageView.js +1 -1
- package/dist/features/reviews/components/ReviewDetailShell.js +11 -11
- package/dist/features/reviews/components/ReviewModal.js +1 -1
- package/dist/features/reviews/components/ReviewsIndexListing.js +2 -2
- package/dist/features/reviews/components/ReviewsList.js +2 -2
- package/dist/features/reviews/schemas/index.d.ts +22 -22
- package/dist/features/scams/components/ScamAwarenessModal.js +2 -2
- package/dist/features/scams/components/ScamProfileView.js +3 -3
- package/dist/features/scams/components/ScamRegistryView.js +2 -2
- package/dist/features/scams/schemas/index.d.ts +20 -20
- package/dist/features/search/components/Search.js +9 -9
- package/dist/features/search/components/SearchFiltersRow.js +1 -1
- package/dist/features/search/components/SearchResultsSection.js +3 -3
- package/dist/features/search/components/SearchView.js +1 -1
- package/dist/features/search/hooks/useNavSuggestions.js +2 -1
- package/dist/features/search/hooks/useSearch.js +2 -2
- package/dist/features/search/schemas/index.d.ts +3 -3
- package/dist/features/seller/components/BrandInlineSelect.js +2 -2
- package/dist/features/seller/components/CategoryInlineSelect.js +2 -2
- package/dist/features/seller/components/QuickProductForm.js +1 -1
- package/dist/features/seller/components/SellerAddressesView.js +4 -4
- package/dist/features/seller/components/SellerAnalyticsAlertsView.js +3 -3
- package/dist/features/seller/components/SellerAnalyticsView.js +2 -2
- package/dist/features/seller/components/SellerArtView.js +11 -11
- package/dist/features/seller/components/SellerAuctionsView.js +11 -11
- package/dist/features/seller/components/SellerBidsView.js +3 -3
- package/dist/features/seller/components/SellerBundlesView.js +12 -12
- package/dist/features/seller/components/SellerClassifiedView.js +11 -11
- package/dist/features/seller/components/SellerCouponEditorView.js +2 -2
- package/dist/features/seller/components/SellerDigitalCodesView.js +11 -11
- package/dist/features/seller/components/SellerFeaturesView.js +4 -4
- package/dist/features/seller/components/SellerLiveView.js +11 -11
- package/dist/features/seller/components/SellerOffersPanel.js +3 -2
- package/dist/features/seller/components/SellerOrdersView.js +2 -2
- package/dist/features/seller/components/SellerPayoutMethodsView.js +1 -1
- package/dist/features/seller/components/SellerPayoutRequestView.js +6 -5
- package/dist/features/seller/components/SellerPayoutSettingsView.js +5 -4
- package/dist/features/seller/components/SellerPreOrdersView.js +1 -1
- package/dist/features/seller/components/SellerPrizeDrawsView.js +1 -1
- package/dist/features/seller/components/SellerProductShell.js +20 -6
- package/dist/features/seller/components/SellerProductsCards.js +3 -3
- package/dist/features/seller/components/SellerProductsView.js +4 -4
- package/dist/features/seller/components/SellerReviewsView.js +7 -6
- package/dist/features/seller/components/SellerShippingView.js +2 -1
- package/dist/features/seller/components/SellerSidebar.js +5 -5
- package/dist/features/seller/components/SellerStickersView.js +11 -11
- package/dist/features/seller/components/SellerTemplatesView.js +1 -1
- package/dist/features/seller/schemas/index.d.ts +20 -20
- package/dist/features/server-errors/schemas/index.d.ts +6 -6
- package/dist/features/shell/CommandPalette.d.ts +27 -0
- package/dist/features/shell/CommandPalette.js +92 -0
- package/dist/features/shell/FormShell.js +4 -3
- package/dist/features/shell/QuickFormDrawer.js +3 -2
- package/dist/features/shell/StepForm.js +2 -2
- package/dist/features/shell/index.d.ts +2 -0
- package/dist/features/shell/index.js +1 -0
- package/dist/features/shipments/components/AdminShipmentEditorView.d.ts +7 -0
- package/dist/features/shipments/components/AdminShipmentEditorView.js +123 -0
- package/dist/features/shipments/components/AdminShipmentLotItemsView.d.ts +6 -0
- package/dist/features/shipments/components/AdminShipmentLotItemsView.js +96 -0
- package/dist/features/shipments/components/AdminShipmentProjectionsView.d.ts +9 -0
- package/dist/features/shipments/components/AdminShipmentProjectionsView.js +44 -0
- package/dist/features/shipments/components/AdminShipmentsView.d.ts +8 -0
- package/dist/features/shipments/components/AdminShipmentsView.js +82 -0
- package/dist/features/shipments/components/ShipmentItemLinkModal.d.ts +15 -0
- package/dist/features/shipments/components/ShipmentItemLinkModal.js +37 -0
- package/dist/features/shipments/hooks/useShipments.d.ts +69 -0
- package/dist/features/shipments/hooks/useShipments.js +96 -0
- package/dist/features/shipments/index.d.ts +10 -0
- package/dist/features/shipments/index.js +7 -0
- package/dist/features/shipments/manifest.d.ts +2 -0
- package/dist/features/shipments/manifest.js +26 -0
- package/dist/features/shipments/repository/shipment-items.repository.d.ts +56 -0
- package/dist/features/shipments/repository/shipment-items.repository.js +78 -0
- package/dist/features/shipments/repository/shipment-lots.repository.d.ts +48 -0
- package/dist/features/shipments/repository/shipment-lots.repository.js +55 -0
- package/dist/features/shipments/repository/shipments.repository.d.ts +50 -0
- package/dist/features/shipments/repository/shipments.repository.js +77 -0
- package/dist/features/shipments/schemas/firestore.d.ts +150 -0
- package/dist/features/shipments/schemas/firestore.js +76 -0
- package/dist/features/shipments/schemas/index.d.ts +2 -0
- package/dist/features/shipments/schemas/index.js +2 -0
- package/dist/features/shipments/schemas/validation.d.ts +350 -0
- package/dist/features/shipments/schemas/validation.js +96 -0
- package/dist/features/shipments/utils/cost-allocation.d.ts +25 -0
- package/dist/features/shipments/utils/cost-allocation.js +83 -0
- package/dist/features/site-settings/components/ActionPermissionsManager.js +2 -2
- package/dist/features/stores/components/InteractiveStoreCard.js +2 -2
- package/dist/features/stores/components/StoreAboutView.js +1 -1
- package/dist/features/stores/components/StoreAuctionsListing.js +3 -3
- package/dist/features/stores/components/StoreAuctionsView.js +1 -1
- package/dist/features/stores/components/StoreCapabilitiesGuideView.js +1 -1
- package/dist/features/stores/components/StoreClassifiedsListing.js +2 -2
- package/dist/features/stores/components/StoreDetailLayoutView.js +1 -1
- package/dist/features/stores/components/StoreDigitalCodesListing.js +2 -2
- package/dist/features/stores/components/StoreFinanceGuideView.js +2 -2
- package/dist/features/stores/components/StoreGuideHubView.js +2 -2
- package/dist/features/stores/components/StoreHeader.js +4 -4
- package/dist/features/stores/components/StoreLiveItemsListing.js +2 -2
- package/dist/features/stores/components/StoreNavTabs.js +2 -2
- package/dist/features/stores/components/StoreOrdersGuideView.js +1 -1
- package/dist/features/stores/components/StorePreOrdersListing.js +3 -3
- package/dist/features/stores/components/StoreProductsListing.js +1 -1
- package/dist/features/stores/components/StoreReviewsListing.js +2 -2
- package/dist/features/stores/components/StoreReviewsView.js +1 -1
- package/dist/features/stores/components/StoreSettingsGuideView.js +1 -1
- package/dist/features/stores/components/StoresIndexListing.js +9 -3
- package/dist/features/stores/schemas/index.d.ts +10 -10
- package/dist/features/support/schemas/index.d.ts +22 -22
- package/dist/features/whatsapp-bot/components/SellerWhatsAppSettingsView.js +3 -3
- package/dist/features/whatsapp-bot/components/WhatsAppChatButton.js +1 -1
- package/dist/features/wishlist/hooks/useWishlistCount.js +1 -2
- package/dist/index.d.ts +44 -1
- package/dist/index.js +37 -1
- package/dist/next/routing/route-map.d.ts +18 -0
- package/dist/next/routing/route-map.js +9 -0
- package/dist/react/hooks/useVisualViewportInset.d.ts +1 -0
- package/dist/react/hooks/useVisualViewportInset.js +59 -0
- package/dist/react/index.d.ts +1 -0
- package/dist/react/index.js +1 -0
- package/dist/repositories/index.d.ts +5 -0
- package/dist/repositories/index.js +5 -0
- package/dist/schemas/registry.d.ts +398 -364
- package/dist/schemas/sieve.d.ts +2 -2
- package/dist/schemas/webhooks/google-oauth.d.ts +2 -2
- package/dist/schemas/webhooks/razorpay.d.ts +100 -100
- package/dist/seed/_helpers/media.js +1 -0
- package/dist/seed/actions/demo-seed-actions.d.ts +1 -1
- package/dist/seed/catalogue-seed-data.d.ts +2 -0
- package/dist/seed/catalogue-seed-data.js +112 -0
- package/dist/seed/grouped-listings-seed-data.d.ts +5 -0
- package/dist/seed/homepage-sections-seed-data.js +0 -1
- package/dist/seed/index.d.ts +2 -0
- package/dist/seed/index.js +2 -0
- package/dist/seed/manifest.js +6 -0
- package/dist/seed/products-preorders-seed-data.d.ts +5 -0
- package/dist/seed/shipments-seed-data.d.ts +5 -0
- package/dist/seed/shipments-seed-data.js +185 -0
- package/dist/server.d.ts +4 -0
- package/dist/server.js +5 -0
- package/dist/styles.css +75 -19
- package/dist/tailwind-utilities.css +1 -1
- package/dist/tokens/index.d.ts +0 -2
- package/dist/tokens/index.js +0 -2
- package/dist/tokens/tokens.css +12 -2
- package/dist/ui/DataTable.js +4 -3
- package/dist/ui/components/Button.d.ts +4 -1
- package/dist/ui/components/Button.js +11 -5
- package/dist/ui/components/Checkbox.d.ts +9 -1
- package/dist/ui/components/Checkbox.js +5 -2
- package/dist/ui/components/ClaimCouponButton.js +2 -1
- package/dist/ui/components/ConfirmDeleteModal.style.css +1 -1
- package/dist/ui/components/Drawer.style.css +13 -1
- package/dist/ui/components/Dropdown.style.css +2 -2
- package/dist/ui/components/FilterDrawer.d.ts +4 -1
- package/dist/ui/components/FilterDrawer.js +8 -2
- package/dist/ui/components/Form.d.ts +1 -1
- package/dist/ui/components/Form.js +2 -2
- package/dist/ui/components/FormActionBar.style.css +6 -1
- package/dist/ui/components/IconButton.d.ts +6 -1
- package/dist/ui/components/IconButton.js +5 -2
- package/dist/ui/components/IconButton.style.css +11 -0
- package/dist/ui/components/ImageGallery.style.css +2 -0
- package/dist/ui/components/ImageLightbox.style.css +1 -0
- package/dist/ui/components/ListingFilterDrawer.d.ts +4 -1
- package/dist/ui/components/ListingFilterDrawer.js +4 -3
- package/dist/ui/components/ListingLayout.style.css +2 -2
- package/dist/ui/components/Modal.style.css +1 -1
- package/dist/ui/components/Pagination.d.ts +5 -1
- package/dist/ui/components/Pagination.js +4 -2
- package/dist/ui/components/RowActionMenu.js +1 -1
- package/dist/ui/components/RowActionMenu.style.css +1 -1
- package/dist/ui/components/Select.d.ts +6 -1
- package/dist/ui/components/Select.js +18 -13
- package/dist/ui/components/Select.style.css +1 -1
- package/dist/ui/components/Semantic.d.ts +13 -0
- package/dist/ui/components/Semantic.js +16 -3
- package/dist/ui/components/SideDrawer.style.css +16 -4
- package/dist/ui/components/SideModal.style.css +1 -1
- package/dist/ui/components/StickyToolbar.d.ts +3 -2
- package/dist/ui/components/StickyToolbar.js +1 -1
- package/dist/ui/components/Textarea.d.ts +5 -0
- package/dist/ui/components/Textarea.js +8 -4
- package/dist/ui/components/Toast.style.css +3 -0
- package/dist/ui/components/Typography.js +69 -8
- package/dist/ui/components/UnsavedChangesModal.style.css +1 -1
- package/dist/ui/components/surface-tokens.d.ts +121 -113
- package/dist/ui/components/surface-tokens.js +110 -104
- package/dist/ui/forms/FormShell.d.ts +8 -27
- package/dist/ui/forms/FormShell.js +1 -194
- package/dist/ui/forms/index.d.ts +2 -2
- package/dist/ui/forms/index.js +1 -1
- package/dist/ui/index.d.ts +8 -4
- package/dist/ui/index.js +4 -2
- package/dist/utils/id-generators.d.ts +27 -0
- package/dist/utils/id-generators.js +45 -0
- package/dist/utils/number.formatter.d.ts +7 -0
- package/dist/utils/number.formatter.js +9 -0
- package/dist/validation/schemas.d.ts +5 -5
- package/package.json +1 -1
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Procurement Shipments Repository — header document only.
|
|
3
|
+
* Lots/items live in ShipmentLotsRepository / ShipmentItemsRepository.
|
|
4
|
+
*/
|
|
5
|
+
import { BaseRepository, prepareForFirestore, } from "../../../providers/db-firebase";
|
|
6
|
+
import { ConflictError } from "../../../errors";
|
|
7
|
+
import { SHIPMENT_COLLECTION, SHIPMENT_FIELDS, SHIPMENT_ITEM_COLLECTION, DEFAULT_SHIPMENT_TOTALS, createShipmentId, } from "../schemas/firestore";
|
|
8
|
+
export class ShipmentsRepository extends BaseRepository {
|
|
9
|
+
constructor() {
|
|
10
|
+
super(SHIPMENT_COLLECTION);
|
|
11
|
+
}
|
|
12
|
+
async findByShipmentNumber(shipmentNumber) {
|
|
13
|
+
return this.findOneBy(SHIPMENT_FIELDS.SHIPMENT_NUMBER, shipmentNumber);
|
|
14
|
+
}
|
|
15
|
+
async assertShipmentNumberAvailable(shipmentNumber, excludeId) {
|
|
16
|
+
const existing = await this.findByShipmentNumber(shipmentNumber);
|
|
17
|
+
if (existing && existing.id !== excludeId) {
|
|
18
|
+
throw new ConflictError(`Shipment number "${shipmentNumber}" is already in use`, "SHIPMENT_NUMBER_TAKEN");
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
async create(input) {
|
|
22
|
+
await this.assertShipmentNumberAvailable(input.shipmentNumber);
|
|
23
|
+
const id = createShipmentId({ supplierName: input.supplierName });
|
|
24
|
+
const data = {
|
|
25
|
+
...input,
|
|
26
|
+
totals: DEFAULT_SHIPMENT_TOTALS,
|
|
27
|
+
createdAt: new Date(),
|
|
28
|
+
updatedAt: new Date(),
|
|
29
|
+
};
|
|
30
|
+
await this.getCollection().doc(id).set(prepareForFirestore(data));
|
|
31
|
+
return { id, ...data };
|
|
32
|
+
}
|
|
33
|
+
async update(shipmentId, input) {
|
|
34
|
+
if (input.shipmentNumber) {
|
|
35
|
+
await this.assertShipmentNumberAvailable(input.shipmentNumber, shipmentId);
|
|
36
|
+
}
|
|
37
|
+
return super.update(shipmentId, input);
|
|
38
|
+
}
|
|
39
|
+
/** Cheap bounded existence check — any item under this shipment still linked to a product? */
|
|
40
|
+
async hasLinkedItems(shipmentId) {
|
|
41
|
+
const snap = await this.db
|
|
42
|
+
.collection(SHIPMENT_ITEM_COLLECTION)
|
|
43
|
+
.where("shipmentId", "==", shipmentId)
|
|
44
|
+
.where("linkedProductId", "!=", null)
|
|
45
|
+
.limit(1)
|
|
46
|
+
.get();
|
|
47
|
+
return !snap.empty;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Blocks deletion if any item is still linked to a product — unlink first.
|
|
51
|
+
* Cascade-deleting the shipment's lots/items themselves is handled by the
|
|
52
|
+
* onShipmentDeleted Firestore trigger (Function #3), not here — this keeps
|
|
53
|
+
* the route fast regardless of how many items the shipment had.
|
|
54
|
+
*/
|
|
55
|
+
async delete(shipmentId) {
|
|
56
|
+
const linked = await this.hasLinkedItems(shipmentId);
|
|
57
|
+
if (linked) {
|
|
58
|
+
throw new ConflictError(`Cannot delete shipment ${shipmentId}: one or more items are still linked to a product. Unlink first.`, "SHIPMENT_HAS_LINKED_ITEMS");
|
|
59
|
+
}
|
|
60
|
+
await super.delete(shipmentId);
|
|
61
|
+
}
|
|
62
|
+
async list(model) {
|
|
63
|
+
return this.sieveQuery(model, ShipmentsRepository.SIEVE_FIELDS, {
|
|
64
|
+
defaultPageSize: 20,
|
|
65
|
+
maxPageSize: 50,
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
ShipmentsRepository.SIEVE_FIELDS = {
|
|
70
|
+
id: { canFilter: true, canSort: false },
|
|
71
|
+
shipmentNumber: { canFilter: true, canSort: true },
|
|
72
|
+
supplierName: { canFilter: true, canSort: true },
|
|
73
|
+
status: { canFilter: true, canSort: true },
|
|
74
|
+
etaDate: { canFilter: true, canSort: true },
|
|
75
|
+
createdAt: { canFilter: true, canSort: true },
|
|
76
|
+
};
|
|
77
|
+
export const shipmentsRepository = new ShipmentsRepository();
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Procurement Shipments Firestore Document Types & Constants
|
|
3
|
+
*
|
|
4
|
+
* Three top-level collections (not embedded arrays — a lot can hold up to
|
|
5
|
+
* ~500 items and a shipment up to ~10 lots, which blows past Firestore's
|
|
6
|
+
* 1 MiB document limit if nested):
|
|
7
|
+
* procurementShipments — header + overall totals (persisted rollup)
|
|
8
|
+
* shipmentLots — one doc per lot, FK shipmentId
|
|
9
|
+
* shipmentItems — one doc per individually-tracked "main" item, FK lotId/shipmentId
|
|
10
|
+
*
|
|
11
|
+
* Totals are recomputed by a background Firestore-triggered Function
|
|
12
|
+
* cascade (see appkit/src/_internal/server/functions/firestore/on-shipment-*),
|
|
13
|
+
* never inline in a Vercel route or React component.
|
|
14
|
+
*/
|
|
15
|
+
import { type GenerateShipmentIdInput } from "../../../utils/id-generators";
|
|
16
|
+
import type { BaseDocument } from "../../../_internal/shared/types/base-document";
|
|
17
|
+
import type { MediaField } from "../../media/types";
|
|
18
|
+
import type { ListingType } from "../../products/types";
|
|
19
|
+
import type { ProductDocument } from "../../products/schemas/firestore";
|
|
20
|
+
export declare const SHIPMENT_COLLECTION: "procurementShipments";
|
|
21
|
+
export declare const SHIPMENT_LOT_COLLECTION: "shipmentLots";
|
|
22
|
+
export declare const SHIPMENT_ITEM_COLLECTION: "shipmentItems";
|
|
23
|
+
export type ShipmentStatus = "planning" | "ordered" | "in_transit" | "customs" | "received" | "processing" | "completed" | "cancelled";
|
|
24
|
+
export declare const MAX_ITEMS_PER_LOT = 500;
|
|
25
|
+
export declare const MAX_LOTS_PER_SHIPMENT = 10;
|
|
26
|
+
export interface ShipmentTotals {
|
|
27
|
+
lotsCostPaise: number;
|
|
28
|
+
customsTotalPaise: number;
|
|
29
|
+
shippingTotalPaise: number;
|
|
30
|
+
laborCostPaise: number;
|
|
31
|
+
totalShipmentCostPaise: number;
|
|
32
|
+
totalProjectedRevenuePaise: number;
|
|
33
|
+
projectedProfitPaise: number;
|
|
34
|
+
projectedProfitAfterLaborPaise: number;
|
|
35
|
+
projectedMarginPercent: number;
|
|
36
|
+
projectedRoiPercent: number;
|
|
37
|
+
totalWeightGrams: number;
|
|
38
|
+
totalItemCount: number;
|
|
39
|
+
lotCount: number;
|
|
40
|
+
estimatedProcessingDays: number;
|
|
41
|
+
}
|
|
42
|
+
export declare const DEFAULT_SHIPMENT_TOTALS: ShipmentTotals;
|
|
43
|
+
export interface ShipmentDocument extends BaseDocument {
|
|
44
|
+
shipmentNumber: string;
|
|
45
|
+
supplierName: string;
|
|
46
|
+
originCountry?: string;
|
|
47
|
+
status: ShipmentStatus;
|
|
48
|
+
trackingNumber?: string;
|
|
49
|
+
carrier?: string;
|
|
50
|
+
etaDate?: Date;
|
|
51
|
+
receivedDate?: Date;
|
|
52
|
+
notes?: string;
|
|
53
|
+
customsTotalPaise: number;
|
|
54
|
+
shippingTotalPaise: number;
|
|
55
|
+
laborHoursSpent?: number;
|
|
56
|
+
laborRatePaisePerHour?: number;
|
|
57
|
+
totals: ShipmentTotals;
|
|
58
|
+
totalsComputedAt?: Date;
|
|
59
|
+
createdBy: string;
|
|
60
|
+
}
|
|
61
|
+
export interface ShipmentLot extends BaseDocument {
|
|
62
|
+
shipmentId: string;
|
|
63
|
+
shipmentStatus: ShipmentStatus;
|
|
64
|
+
lotName: string;
|
|
65
|
+
supplierOrderRef?: string;
|
|
66
|
+
weightGrams: number;
|
|
67
|
+
purchaseCostPaise: number;
|
|
68
|
+
images: MediaField[];
|
|
69
|
+
remainderItemCount?: number;
|
|
70
|
+
remainderEstimatedValuePaise?: number;
|
|
71
|
+
itemCount: number;
|
|
72
|
+
mainItemsProjectedRevenuePaise: number;
|
|
73
|
+
customsAllocatedPaise: number;
|
|
74
|
+
shippingAllocatedPaise: number;
|
|
75
|
+
totalLandedCostPaise: number;
|
|
76
|
+
projectedRevenuePaise: number;
|
|
77
|
+
projectedProfitPaise: number;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Reused everywhere a "this will eventually become a real product" record is
|
|
81
|
+
* needed (ShipmentItem below, and Feature B's CatalogueItemDocument) — a
|
|
82
|
+
* Pick off the live ProductDocument, not a hand-duplicated field list, so
|
|
83
|
+
* (a) the eventual product-creation call is close to a literal field spread,
|
|
84
|
+
* and (b) a future ProductDocument field rename surfaces as a type error
|
|
85
|
+
* here instead of silently drifting.
|
|
86
|
+
*/
|
|
87
|
+
export type ProductDraftFields = Pick<ProductDocument, "title" | "mainImage" | "images" | "condition" | "categorySlugs" | "brandSlug" | "price">;
|
|
88
|
+
export interface ShipmentItem extends BaseDocument, Partial<Omit<ProductDraftFields, "title">> {
|
|
89
|
+
shipmentId: string;
|
|
90
|
+
lotId: string;
|
|
91
|
+
title: string;
|
|
92
|
+
quantity: number;
|
|
93
|
+
isForSelfUse: boolean;
|
|
94
|
+
notes?: string;
|
|
95
|
+
linkedProductId?: string | null;
|
|
96
|
+
linkedProductSlug?: string | null;
|
|
97
|
+
linkedProductListingType?: ListingType | null;
|
|
98
|
+
}
|
|
99
|
+
export declare const SHIPMENT_STATUS_VALUES: {
|
|
100
|
+
readonly PLANNING: "planning";
|
|
101
|
+
readonly ORDERED: "ordered";
|
|
102
|
+
readonly IN_TRANSIT: "in_transit";
|
|
103
|
+
readonly CUSTOMS: "customs";
|
|
104
|
+
readonly RECEIVED: "received";
|
|
105
|
+
readonly PROCESSING: "processing";
|
|
106
|
+
readonly COMPLETED: "completed";
|
|
107
|
+
readonly CANCELLED: "cancelled";
|
|
108
|
+
};
|
|
109
|
+
export declare const SHIPMENT_FIELDS: {
|
|
110
|
+
readonly ID: "id";
|
|
111
|
+
readonly SHIPMENT_NUMBER: "shipmentNumber";
|
|
112
|
+
readonly STATUS: "status";
|
|
113
|
+
readonly ETA_DATE: "etaDate";
|
|
114
|
+
readonly CREATED_AT: "createdAt";
|
|
115
|
+
readonly STATUS_VALUES: {
|
|
116
|
+
readonly PLANNING: "planning";
|
|
117
|
+
readonly ORDERED: "ordered";
|
|
118
|
+
readonly IN_TRANSIT: "in_transit";
|
|
119
|
+
readonly CUSTOMS: "customs";
|
|
120
|
+
readonly RECEIVED: "received";
|
|
121
|
+
readonly PROCESSING: "processing";
|
|
122
|
+
readonly COMPLETED: "completed";
|
|
123
|
+
readonly CANCELLED: "cancelled";
|
|
124
|
+
};
|
|
125
|
+
};
|
|
126
|
+
export declare const SHIPMENT_LOT_FIELDS: {
|
|
127
|
+
readonly ID: "id";
|
|
128
|
+
readonly SHIPMENT_ID: "shipmentId";
|
|
129
|
+
readonly SHIPMENT_STATUS: "shipmentStatus";
|
|
130
|
+
readonly PROJECTED_PROFIT_PAISE: "projectedProfitPaise";
|
|
131
|
+
readonly CREATED_AT: "createdAt";
|
|
132
|
+
};
|
|
133
|
+
export declare const SHIPMENT_ITEM_FIELDS: {
|
|
134
|
+
readonly ID: "id";
|
|
135
|
+
readonly SHIPMENT_ID: "shipmentId";
|
|
136
|
+
readonly LOT_ID: "lotId";
|
|
137
|
+
readonly LINKED_PRODUCT_ID: "linkedProductId";
|
|
138
|
+
readonly CREATED_AT: "createdAt";
|
|
139
|
+
};
|
|
140
|
+
export type ShipmentCreateInput = Omit<ShipmentDocument, "id" | "createdAt" | "updatedAt" | "totals" | "totalsComputedAt">;
|
|
141
|
+
export type ShipmentUpdateInput = Partial<Omit<ShipmentDocument, "id" | "createdAt" | "createdBy" | "totals" | "totalsComputedAt">>;
|
|
142
|
+
export type ShipmentLotCreateInput = Omit<ShipmentLot, "id" | "createdAt" | "updatedAt" | "shipmentId" | "shipmentStatus" | "itemCount" | "mainItemsProjectedRevenuePaise" | "customsAllocatedPaise" | "shippingAllocatedPaise" | "totalLandedCostPaise" | "projectedRevenuePaise" | "projectedProfitPaise">;
|
|
143
|
+
export type ShipmentLotUpdateInput = Partial<Omit<ShipmentLot, "id" | "createdAt" | "shipmentId">>;
|
|
144
|
+
export type ShipmentItemCreateInput = Omit<ShipmentItem, "id" | "createdAt" | "updatedAt" | "shipmentId" | "lotId">;
|
|
145
|
+
export type ShipmentItemUpdateInput = Partial<Omit<ShipmentItem, "id" | "createdAt" | "shipmentId" | "lotId">>;
|
|
146
|
+
export declare const shipmentQueryHelpers: {
|
|
147
|
+
readonly byStatus: (status: ShipmentStatus) => readonly ["status", "==", ShipmentStatus];
|
|
148
|
+
readonly notCancelled: () => readonly ["status", "!=", ShipmentStatus];
|
|
149
|
+
};
|
|
150
|
+
export declare function createShipmentId(input: GenerateShipmentIdInput): string;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Procurement Shipments Firestore Document Types & Constants
|
|
3
|
+
*
|
|
4
|
+
* Three top-level collections (not embedded arrays — a lot can hold up to
|
|
5
|
+
* ~500 items and a shipment up to ~10 lots, which blows past Firestore's
|
|
6
|
+
* 1 MiB document limit if nested):
|
|
7
|
+
* procurementShipments — header + overall totals (persisted rollup)
|
|
8
|
+
* shipmentLots — one doc per lot, FK shipmentId
|
|
9
|
+
* shipmentItems — one doc per individually-tracked "main" item, FK lotId/shipmentId
|
|
10
|
+
*
|
|
11
|
+
* Totals are recomputed by a background Firestore-triggered Function
|
|
12
|
+
* cascade (see appkit/src/_internal/server/functions/firestore/on-shipment-*),
|
|
13
|
+
* never inline in a Vercel route or React component.
|
|
14
|
+
*/
|
|
15
|
+
import { generateShipmentId, } from "../../../utils/id-generators";
|
|
16
|
+
export const SHIPMENT_COLLECTION = "procurementShipments";
|
|
17
|
+
export const SHIPMENT_LOT_COLLECTION = "shipmentLots";
|
|
18
|
+
export const SHIPMENT_ITEM_COLLECTION = "shipmentItems";
|
|
19
|
+
// Hard scale caps (architectural — 500 is Firestore's native batched-write limit).
|
|
20
|
+
export const MAX_ITEMS_PER_LOT = 500;
|
|
21
|
+
export const MAX_LOTS_PER_SHIPMENT = 10;
|
|
22
|
+
export const DEFAULT_SHIPMENT_TOTALS = {
|
|
23
|
+
lotsCostPaise: 0,
|
|
24
|
+
customsTotalPaise: 0,
|
|
25
|
+
shippingTotalPaise: 0,
|
|
26
|
+
laborCostPaise: 0,
|
|
27
|
+
totalShipmentCostPaise: 0,
|
|
28
|
+
totalProjectedRevenuePaise: 0,
|
|
29
|
+
projectedProfitPaise: 0,
|
|
30
|
+
projectedProfitAfterLaborPaise: 0,
|
|
31
|
+
projectedMarginPercent: 0,
|
|
32
|
+
projectedRoiPercent: 0,
|
|
33
|
+
totalWeightGrams: 0,
|
|
34
|
+
totalItemCount: 0,
|
|
35
|
+
lotCount: 0,
|
|
36
|
+
estimatedProcessingDays: 0,
|
|
37
|
+
};
|
|
38
|
+
export const SHIPMENT_STATUS_VALUES = {
|
|
39
|
+
PLANNING: "planning",
|
|
40
|
+
ORDERED: "ordered",
|
|
41
|
+
IN_TRANSIT: "in_transit",
|
|
42
|
+
CUSTOMS: "customs",
|
|
43
|
+
RECEIVED: "received",
|
|
44
|
+
PROCESSING: "processing",
|
|
45
|
+
COMPLETED: "completed",
|
|
46
|
+
CANCELLED: "cancelled",
|
|
47
|
+
};
|
|
48
|
+
export const SHIPMENT_FIELDS = {
|
|
49
|
+
ID: "id",
|
|
50
|
+
SHIPMENT_NUMBER: "shipmentNumber",
|
|
51
|
+
STATUS: "status",
|
|
52
|
+
ETA_DATE: "etaDate",
|
|
53
|
+
CREATED_AT: "createdAt",
|
|
54
|
+
STATUS_VALUES: SHIPMENT_STATUS_VALUES,
|
|
55
|
+
};
|
|
56
|
+
export const SHIPMENT_LOT_FIELDS = {
|
|
57
|
+
ID: "id",
|
|
58
|
+
SHIPMENT_ID: "shipmentId",
|
|
59
|
+
SHIPMENT_STATUS: "shipmentStatus",
|
|
60
|
+
PROJECTED_PROFIT_PAISE: "projectedProfitPaise",
|
|
61
|
+
CREATED_AT: "createdAt",
|
|
62
|
+
};
|
|
63
|
+
export const SHIPMENT_ITEM_FIELDS = {
|
|
64
|
+
ID: "id",
|
|
65
|
+
SHIPMENT_ID: "shipmentId",
|
|
66
|
+
LOT_ID: "lotId",
|
|
67
|
+
LINKED_PRODUCT_ID: "linkedProductId",
|
|
68
|
+
CREATED_AT: "createdAt",
|
|
69
|
+
};
|
|
70
|
+
export const shipmentQueryHelpers = {
|
|
71
|
+
byStatus: (status) => ["status", "==", status],
|
|
72
|
+
notCancelled: () => ["status", "!=", "cancelled"],
|
|
73
|
+
};
|
|
74
|
+
export function createShipmentId(input) {
|
|
75
|
+
return generateShipmentId(input);
|
|
76
|
+
}
|
|
@@ -0,0 +1,350 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const shipmentStatusSchema: z.ZodEnum<["planning", "ordered", "in_transit", "customs", "received", "processing", "completed", "cancelled"]>;
|
|
3
|
+
export declare const createShipmentSchema: z.ZodObject<{
|
|
4
|
+
shipmentNumber: z.ZodString;
|
|
5
|
+
supplierName: z.ZodString;
|
|
6
|
+
originCountry: z.ZodOptional<z.ZodString>;
|
|
7
|
+
status: z.ZodEnum<["planning", "ordered", "in_transit", "customs", "received", "processing", "completed", "cancelled"]>;
|
|
8
|
+
trackingNumber: z.ZodOptional<z.ZodString>;
|
|
9
|
+
carrier: z.ZodOptional<z.ZodString>;
|
|
10
|
+
etaDate: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodDate]>>;
|
|
11
|
+
receivedDate: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodDate]>>;
|
|
12
|
+
notes: z.ZodOptional<z.ZodString>;
|
|
13
|
+
customsTotalPaise: z.ZodNumber;
|
|
14
|
+
shippingTotalPaise: z.ZodNumber;
|
|
15
|
+
laborHoursSpent: z.ZodOptional<z.ZodNumber>;
|
|
16
|
+
laborRatePaisePerHour: z.ZodOptional<z.ZodNumber>;
|
|
17
|
+
}, "strip", z.ZodTypeAny, {
|
|
18
|
+
status: "received" | "cancelled" | "processing" | "ordered" | "completed" | "planning" | "in_transit" | "customs";
|
|
19
|
+
shipmentNumber: string;
|
|
20
|
+
supplierName: string;
|
|
21
|
+
customsTotalPaise: number;
|
|
22
|
+
shippingTotalPaise: number;
|
|
23
|
+
notes?: string | undefined;
|
|
24
|
+
trackingNumber?: string | undefined;
|
|
25
|
+
etaDate?: string | Date | undefined;
|
|
26
|
+
originCountry?: string | undefined;
|
|
27
|
+
carrier?: string | undefined;
|
|
28
|
+
receivedDate?: string | Date | undefined;
|
|
29
|
+
laborHoursSpent?: number | undefined;
|
|
30
|
+
laborRatePaisePerHour?: number | undefined;
|
|
31
|
+
}, {
|
|
32
|
+
status: "received" | "cancelled" | "processing" | "ordered" | "completed" | "planning" | "in_transit" | "customs";
|
|
33
|
+
shipmentNumber: string;
|
|
34
|
+
supplierName: string;
|
|
35
|
+
customsTotalPaise: number;
|
|
36
|
+
shippingTotalPaise: number;
|
|
37
|
+
notes?: string | undefined;
|
|
38
|
+
trackingNumber?: string | undefined;
|
|
39
|
+
etaDate?: string | Date | undefined;
|
|
40
|
+
originCountry?: string | undefined;
|
|
41
|
+
carrier?: string | undefined;
|
|
42
|
+
receivedDate?: string | Date | undefined;
|
|
43
|
+
laborHoursSpent?: number | undefined;
|
|
44
|
+
laborRatePaisePerHour?: number | undefined;
|
|
45
|
+
}>;
|
|
46
|
+
export declare const updateShipmentSchema: z.ZodObject<{
|
|
47
|
+
shipmentNumber: z.ZodOptional<z.ZodString>;
|
|
48
|
+
supplierName: z.ZodOptional<z.ZodString>;
|
|
49
|
+
originCountry: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
50
|
+
status: z.ZodOptional<z.ZodEnum<["planning", "ordered", "in_transit", "customs", "received", "processing", "completed", "cancelled"]>>;
|
|
51
|
+
trackingNumber: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
52
|
+
carrier: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
53
|
+
etaDate: z.ZodOptional<z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodDate]>>>;
|
|
54
|
+
receivedDate: z.ZodOptional<z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodDate]>>>;
|
|
55
|
+
notes: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
56
|
+
customsTotalPaise: z.ZodOptional<z.ZodNumber>;
|
|
57
|
+
shippingTotalPaise: z.ZodOptional<z.ZodNumber>;
|
|
58
|
+
laborHoursSpent: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
|
|
59
|
+
laborRatePaisePerHour: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
|
|
60
|
+
}, "strip", z.ZodTypeAny, {
|
|
61
|
+
status?: "received" | "cancelled" | "processing" | "ordered" | "completed" | "planning" | "in_transit" | "customs" | undefined;
|
|
62
|
+
notes?: string | undefined;
|
|
63
|
+
trackingNumber?: string | undefined;
|
|
64
|
+
shipmentNumber?: string | undefined;
|
|
65
|
+
etaDate?: string | Date | undefined;
|
|
66
|
+
supplierName?: string | undefined;
|
|
67
|
+
originCountry?: string | undefined;
|
|
68
|
+
carrier?: string | undefined;
|
|
69
|
+
receivedDate?: string | Date | undefined;
|
|
70
|
+
customsTotalPaise?: number | undefined;
|
|
71
|
+
shippingTotalPaise?: number | undefined;
|
|
72
|
+
laborHoursSpent?: number | undefined;
|
|
73
|
+
laborRatePaisePerHour?: number | undefined;
|
|
74
|
+
}, {
|
|
75
|
+
status?: "received" | "cancelled" | "processing" | "ordered" | "completed" | "planning" | "in_transit" | "customs" | undefined;
|
|
76
|
+
notes?: string | undefined;
|
|
77
|
+
trackingNumber?: string | undefined;
|
|
78
|
+
shipmentNumber?: string | undefined;
|
|
79
|
+
etaDate?: string | Date | undefined;
|
|
80
|
+
supplierName?: string | undefined;
|
|
81
|
+
originCountry?: string | undefined;
|
|
82
|
+
carrier?: string | undefined;
|
|
83
|
+
receivedDate?: string | Date | undefined;
|
|
84
|
+
customsTotalPaise?: number | undefined;
|
|
85
|
+
shippingTotalPaise?: number | undefined;
|
|
86
|
+
laborHoursSpent?: number | undefined;
|
|
87
|
+
laborRatePaisePerHour?: number | undefined;
|
|
88
|
+
}>;
|
|
89
|
+
export declare const createShipmentLotSchema: z.ZodObject<{
|
|
90
|
+
lotName: z.ZodString;
|
|
91
|
+
supplierOrderRef: z.ZodOptional<z.ZodString>;
|
|
92
|
+
weightGrams: z.ZodNumber;
|
|
93
|
+
purchaseCostPaise: z.ZodNumber;
|
|
94
|
+
images: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
95
|
+
url: z.ZodString;
|
|
96
|
+
type: z.ZodEnum<["image", "video", "file"]>;
|
|
97
|
+
alt: z.ZodOptional<z.ZodString>;
|
|
98
|
+
thumbnailUrl: z.ZodOptional<z.ZodString>;
|
|
99
|
+
source: z.ZodOptional<z.ZodEnum<["upload", "youtube", "external"]>>;
|
|
100
|
+
youtubeId: z.ZodOptional<z.ZodString>;
|
|
101
|
+
}, "strip", z.ZodTypeAny, {
|
|
102
|
+
type: "video" | "image" | "file";
|
|
103
|
+
url: string;
|
|
104
|
+
source?: "upload" | "youtube" | "external" | undefined;
|
|
105
|
+
alt?: string | undefined;
|
|
106
|
+
thumbnailUrl?: string | undefined;
|
|
107
|
+
youtubeId?: string | undefined;
|
|
108
|
+
}, {
|
|
109
|
+
type: "video" | "image" | "file";
|
|
110
|
+
url: string;
|
|
111
|
+
source?: "upload" | "youtube" | "external" | undefined;
|
|
112
|
+
alt?: string | undefined;
|
|
113
|
+
thumbnailUrl?: string | undefined;
|
|
114
|
+
youtubeId?: string | undefined;
|
|
115
|
+
}>, "many">>>;
|
|
116
|
+
remainderItemCount: z.ZodOptional<z.ZodNumber>;
|
|
117
|
+
remainderEstimatedValuePaise: z.ZodOptional<z.ZodNumber>;
|
|
118
|
+
}, "strip", z.ZodTypeAny, {
|
|
119
|
+
images: {
|
|
120
|
+
type: "video" | "image" | "file";
|
|
121
|
+
url: string;
|
|
122
|
+
source?: "upload" | "youtube" | "external" | undefined;
|
|
123
|
+
alt?: string | undefined;
|
|
124
|
+
thumbnailUrl?: string | undefined;
|
|
125
|
+
youtubeId?: string | undefined;
|
|
126
|
+
}[];
|
|
127
|
+
lotName: string;
|
|
128
|
+
weightGrams: number;
|
|
129
|
+
purchaseCostPaise: number;
|
|
130
|
+
supplierOrderRef?: string | undefined;
|
|
131
|
+
remainderItemCount?: number | undefined;
|
|
132
|
+
remainderEstimatedValuePaise?: number | undefined;
|
|
133
|
+
}, {
|
|
134
|
+
lotName: string;
|
|
135
|
+
weightGrams: number;
|
|
136
|
+
purchaseCostPaise: number;
|
|
137
|
+
images?: {
|
|
138
|
+
type: "video" | "image" | "file";
|
|
139
|
+
url: string;
|
|
140
|
+
source?: "upload" | "youtube" | "external" | undefined;
|
|
141
|
+
alt?: string | undefined;
|
|
142
|
+
thumbnailUrl?: string | undefined;
|
|
143
|
+
youtubeId?: string | undefined;
|
|
144
|
+
}[] | undefined;
|
|
145
|
+
supplierOrderRef?: string | undefined;
|
|
146
|
+
remainderItemCount?: number | undefined;
|
|
147
|
+
remainderEstimatedValuePaise?: number | undefined;
|
|
148
|
+
}>;
|
|
149
|
+
export declare const updateShipmentLotSchema: z.ZodObject<{
|
|
150
|
+
lotName: z.ZodOptional<z.ZodString>;
|
|
151
|
+
supplierOrderRef: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
152
|
+
weightGrams: z.ZodOptional<z.ZodNumber>;
|
|
153
|
+
purchaseCostPaise: z.ZodOptional<z.ZodNumber>;
|
|
154
|
+
images: z.ZodOptional<z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
155
|
+
url: z.ZodString;
|
|
156
|
+
type: z.ZodEnum<["image", "video", "file"]>;
|
|
157
|
+
alt: z.ZodOptional<z.ZodString>;
|
|
158
|
+
thumbnailUrl: z.ZodOptional<z.ZodString>;
|
|
159
|
+
source: z.ZodOptional<z.ZodEnum<["upload", "youtube", "external"]>>;
|
|
160
|
+
youtubeId: z.ZodOptional<z.ZodString>;
|
|
161
|
+
}, "strip", z.ZodTypeAny, {
|
|
162
|
+
type: "video" | "image" | "file";
|
|
163
|
+
url: string;
|
|
164
|
+
source?: "upload" | "youtube" | "external" | undefined;
|
|
165
|
+
alt?: string | undefined;
|
|
166
|
+
thumbnailUrl?: string | undefined;
|
|
167
|
+
youtubeId?: string | undefined;
|
|
168
|
+
}, {
|
|
169
|
+
type: "video" | "image" | "file";
|
|
170
|
+
url: string;
|
|
171
|
+
source?: "upload" | "youtube" | "external" | undefined;
|
|
172
|
+
alt?: string | undefined;
|
|
173
|
+
thumbnailUrl?: string | undefined;
|
|
174
|
+
youtubeId?: string | undefined;
|
|
175
|
+
}>, "many">>>>;
|
|
176
|
+
remainderItemCount: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
|
|
177
|
+
remainderEstimatedValuePaise: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
|
|
178
|
+
}, "strip", z.ZodTypeAny, {
|
|
179
|
+
images?: {
|
|
180
|
+
type: "video" | "image" | "file";
|
|
181
|
+
url: string;
|
|
182
|
+
source?: "upload" | "youtube" | "external" | undefined;
|
|
183
|
+
alt?: string | undefined;
|
|
184
|
+
thumbnailUrl?: string | undefined;
|
|
185
|
+
youtubeId?: string | undefined;
|
|
186
|
+
}[] | undefined;
|
|
187
|
+
lotName?: string | undefined;
|
|
188
|
+
supplierOrderRef?: string | undefined;
|
|
189
|
+
weightGrams?: number | undefined;
|
|
190
|
+
purchaseCostPaise?: number | undefined;
|
|
191
|
+
remainderItemCount?: number | undefined;
|
|
192
|
+
remainderEstimatedValuePaise?: number | undefined;
|
|
193
|
+
}, {
|
|
194
|
+
images?: {
|
|
195
|
+
type: "video" | "image" | "file";
|
|
196
|
+
url: string;
|
|
197
|
+
source?: "upload" | "youtube" | "external" | undefined;
|
|
198
|
+
alt?: string | undefined;
|
|
199
|
+
thumbnailUrl?: string | undefined;
|
|
200
|
+
youtubeId?: string | undefined;
|
|
201
|
+
}[] | undefined;
|
|
202
|
+
lotName?: string | undefined;
|
|
203
|
+
supplierOrderRef?: string | undefined;
|
|
204
|
+
weightGrams?: number | undefined;
|
|
205
|
+
purchaseCostPaise?: number | undefined;
|
|
206
|
+
remainderItemCount?: number | undefined;
|
|
207
|
+
remainderEstimatedValuePaise?: number | undefined;
|
|
208
|
+
}>;
|
|
209
|
+
export declare const createShipmentItemSchema: z.ZodEffects<z.ZodObject<{
|
|
210
|
+
title: z.ZodString;
|
|
211
|
+
quantity: z.ZodNumber;
|
|
212
|
+
isForSelfUse: z.ZodBoolean;
|
|
213
|
+
price: z.ZodOptional<z.ZodNumber>;
|
|
214
|
+
condition: z.ZodOptional<z.ZodEnum<["new", "like_new", "good", "fair", "poor", "used", "refurbished", "broken", "graded"]>>;
|
|
215
|
+
categorySlugs: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
216
|
+
brandSlug: z.ZodOptional<z.ZodString>;
|
|
217
|
+
notes: z.ZodOptional<z.ZodString>;
|
|
218
|
+
}, "strip", z.ZodTypeAny, {
|
|
219
|
+
title: string;
|
|
220
|
+
quantity: number;
|
|
221
|
+
isForSelfUse: boolean;
|
|
222
|
+
notes?: string | undefined;
|
|
223
|
+
categorySlugs?: string[] | undefined;
|
|
224
|
+
brandSlug?: string | undefined;
|
|
225
|
+
price?: number | undefined;
|
|
226
|
+
condition?: "new" | "used" | "refurbished" | "like_new" | "good" | "fair" | "poor" | "broken" | "graded" | undefined;
|
|
227
|
+
}, {
|
|
228
|
+
title: string;
|
|
229
|
+
quantity: number;
|
|
230
|
+
isForSelfUse: boolean;
|
|
231
|
+
notes?: string | undefined;
|
|
232
|
+
categorySlugs?: string[] | undefined;
|
|
233
|
+
brandSlug?: string | undefined;
|
|
234
|
+
price?: number | undefined;
|
|
235
|
+
condition?: "new" | "used" | "refurbished" | "like_new" | "good" | "fair" | "poor" | "broken" | "graded" | undefined;
|
|
236
|
+
}>, {
|
|
237
|
+
title: string;
|
|
238
|
+
quantity: number;
|
|
239
|
+
isForSelfUse: boolean;
|
|
240
|
+
notes?: string | undefined;
|
|
241
|
+
categorySlugs?: string[] | undefined;
|
|
242
|
+
brandSlug?: string | undefined;
|
|
243
|
+
price?: number | undefined;
|
|
244
|
+
condition?: "new" | "used" | "refurbished" | "like_new" | "good" | "fair" | "poor" | "broken" | "graded" | undefined;
|
|
245
|
+
}, {
|
|
246
|
+
title: string;
|
|
247
|
+
quantity: number;
|
|
248
|
+
isForSelfUse: boolean;
|
|
249
|
+
notes?: string | undefined;
|
|
250
|
+
categorySlugs?: string[] | undefined;
|
|
251
|
+
brandSlug?: string | undefined;
|
|
252
|
+
price?: number | undefined;
|
|
253
|
+
condition?: "new" | "used" | "refurbished" | "like_new" | "good" | "fair" | "poor" | "broken" | "graded" | undefined;
|
|
254
|
+
}>;
|
|
255
|
+
export declare const updateShipmentItemSchema: z.ZodObject<{
|
|
256
|
+
title: z.ZodOptional<z.ZodString>;
|
|
257
|
+
quantity: z.ZodOptional<z.ZodNumber>;
|
|
258
|
+
isForSelfUse: z.ZodOptional<z.ZodBoolean>;
|
|
259
|
+
price: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
|
|
260
|
+
condition: z.ZodOptional<z.ZodOptional<z.ZodEnum<["new", "like_new", "good", "fair", "poor", "used", "refurbished", "broken", "graded"]>>>;
|
|
261
|
+
categorySlugs: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
|
|
262
|
+
brandSlug: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
263
|
+
notes: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
264
|
+
} & {
|
|
265
|
+
linkedProductId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
266
|
+
linkedProductSlug: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
267
|
+
linkedProductListingType: z.ZodOptional<z.ZodNullable<z.ZodEnum<["standard", "auction", "pre-order", "prize-draw", "classified", "digital-code", "live", "art", "stickers"]>>>;
|
|
268
|
+
}, "strip", z.ZodTypeAny, {
|
|
269
|
+
title?: string | undefined;
|
|
270
|
+
notes?: string | undefined;
|
|
271
|
+
categorySlugs?: string[] | undefined;
|
|
272
|
+
brandSlug?: string | undefined;
|
|
273
|
+
price?: number | undefined;
|
|
274
|
+
condition?: "new" | "used" | "refurbished" | "like_new" | "good" | "fair" | "poor" | "broken" | "graded" | undefined;
|
|
275
|
+
quantity?: number | undefined;
|
|
276
|
+
isForSelfUse?: boolean | undefined;
|
|
277
|
+
linkedProductId?: string | null | undefined;
|
|
278
|
+
linkedProductSlug?: string | null | undefined;
|
|
279
|
+
linkedProductListingType?: "standard" | "auction" | "pre-order" | "prize-draw" | "classified" | "digital-code" | "live" | "art" | "stickers" | null | undefined;
|
|
280
|
+
}, {
|
|
281
|
+
title?: string | undefined;
|
|
282
|
+
notes?: string | undefined;
|
|
283
|
+
categorySlugs?: string[] | undefined;
|
|
284
|
+
brandSlug?: string | undefined;
|
|
285
|
+
price?: number | undefined;
|
|
286
|
+
condition?: "new" | "used" | "refurbished" | "like_new" | "good" | "fair" | "poor" | "broken" | "graded" | undefined;
|
|
287
|
+
quantity?: number | undefined;
|
|
288
|
+
isForSelfUse?: boolean | undefined;
|
|
289
|
+
linkedProductId?: string | null | undefined;
|
|
290
|
+
linkedProductSlug?: string | null | undefined;
|
|
291
|
+
linkedProductListingType?: "standard" | "auction" | "pre-order" | "prize-draw" | "classified" | "digital-code" | "live" | "art" | "stickers" | null | undefined;
|
|
292
|
+
}>;
|
|
293
|
+
/**
|
|
294
|
+
* Bulk paste-import payload — capped at MAX_ITEMS_PER_LOT (500), matching
|
|
295
|
+
* Firestore's native batched-write limit so the route can write the whole
|
|
296
|
+
* import in one WriteBatch with no chunking logic.
|
|
297
|
+
*/
|
|
298
|
+
export declare const bulkShipmentItemsSchema: z.ZodEffects<z.ZodArray<z.ZodObject<{
|
|
299
|
+
title: z.ZodString;
|
|
300
|
+
quantity: z.ZodNumber;
|
|
301
|
+
isForSelfUse: z.ZodBoolean;
|
|
302
|
+
price: z.ZodOptional<z.ZodNumber>;
|
|
303
|
+
condition: z.ZodOptional<z.ZodEnum<["new", "like_new", "good", "fair", "poor", "used", "refurbished", "broken", "graded"]>>;
|
|
304
|
+
categorySlugs: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
305
|
+
brandSlug: z.ZodOptional<z.ZodString>;
|
|
306
|
+
notes: z.ZodOptional<z.ZodString>;
|
|
307
|
+
}, "strip", z.ZodTypeAny, {
|
|
308
|
+
title: string;
|
|
309
|
+
quantity: number;
|
|
310
|
+
isForSelfUse: boolean;
|
|
311
|
+
notes?: string | undefined;
|
|
312
|
+
categorySlugs?: string[] | undefined;
|
|
313
|
+
brandSlug?: string | undefined;
|
|
314
|
+
price?: number | undefined;
|
|
315
|
+
condition?: "new" | "used" | "refurbished" | "like_new" | "good" | "fair" | "poor" | "broken" | "graded" | undefined;
|
|
316
|
+
}, {
|
|
317
|
+
title: string;
|
|
318
|
+
quantity: number;
|
|
319
|
+
isForSelfUse: boolean;
|
|
320
|
+
notes?: string | undefined;
|
|
321
|
+
categorySlugs?: string[] | undefined;
|
|
322
|
+
brandSlug?: string | undefined;
|
|
323
|
+
price?: number | undefined;
|
|
324
|
+
condition?: "new" | "used" | "refurbished" | "like_new" | "good" | "fair" | "poor" | "broken" | "graded" | undefined;
|
|
325
|
+
}>, "many">, {
|
|
326
|
+
title: string;
|
|
327
|
+
quantity: number;
|
|
328
|
+
isForSelfUse: boolean;
|
|
329
|
+
notes?: string | undefined;
|
|
330
|
+
categorySlugs?: string[] | undefined;
|
|
331
|
+
brandSlug?: string | undefined;
|
|
332
|
+
price?: number | undefined;
|
|
333
|
+
condition?: "new" | "used" | "refurbished" | "like_new" | "good" | "fair" | "poor" | "broken" | "graded" | undefined;
|
|
334
|
+
}[], {
|
|
335
|
+
title: string;
|
|
336
|
+
quantity: number;
|
|
337
|
+
isForSelfUse: boolean;
|
|
338
|
+
notes?: string | undefined;
|
|
339
|
+
categorySlugs?: string[] | undefined;
|
|
340
|
+
brandSlug?: string | undefined;
|
|
341
|
+
price?: number | undefined;
|
|
342
|
+
condition?: "new" | "used" | "refurbished" | "like_new" | "good" | "fair" | "poor" | "broken" | "graded" | undefined;
|
|
343
|
+
}[]>;
|
|
344
|
+
export type CreateShipmentInput = z.infer<typeof createShipmentSchema>;
|
|
345
|
+
export type UpdateShipmentInput = z.infer<typeof updateShipmentSchema>;
|
|
346
|
+
export type CreateShipmentLotInput = z.infer<typeof createShipmentLotSchema>;
|
|
347
|
+
export type UpdateShipmentLotInput = z.infer<typeof updateShipmentLotSchema>;
|
|
348
|
+
export type CreateShipmentItemInput = z.infer<typeof createShipmentItemSchema>;
|
|
349
|
+
export type UpdateShipmentItemInput = z.infer<typeof updateShipmentItemSchema>;
|
|
350
|
+
export type BulkShipmentItemsInput = z.infer<typeof bulkShipmentItemsSchema>;
|