@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
|
@@ -9,7 +9,7 @@ import { normalizeError } from "../../../errors/normalize";
|
|
|
9
9
|
const __O = {
|
|
10
10
|
hidden: "overflow-hidden",
|
|
11
11
|
};
|
|
12
|
-
const CLS_PDF_LINK = "text-sm underline break-all text-info dark:text-info";
|
|
12
|
+
const CLS_PDF_LINK = "text-[length:var(--appkit-text-sm)] underline break-all text-info dark:text-info";
|
|
13
13
|
function fileNameFromUrl(url) {
|
|
14
14
|
try {
|
|
15
15
|
const parts = new URL(url).pathname.split("/");
|
|
@@ -14,6 +14,7 @@ import { getClientRealtimeProvider } from "../../../contracts/client-realtime";
|
|
|
14
14
|
import { conversationPingPath, userConversationsPingPath, } from "../realtime";
|
|
15
15
|
import { normalizeError } from "../../../errors/normalize";
|
|
16
16
|
import { apiClient, ApiClientError } from "../../../http/ApiClient";
|
|
17
|
+
import { CONVERSATION_ENDPOINTS } from "../../../constants/api-endpoints";
|
|
17
18
|
/**
|
|
18
19
|
* @deprecated Re-exported for backwards compat — import `conversationPingPath`
|
|
19
20
|
* from `@mohasinac/appkit` instead.
|
|
@@ -24,9 +25,9 @@ export const CONVERSATIONS_PING_PATH = conversationPingPath;
|
|
|
24
25
|
* `userConversationsPingPath` from `@mohasinac/appkit` instead.
|
|
25
26
|
*/
|
|
26
27
|
export const CONVERSATIONS_PING_USER_PATH = userConversationsPingPath;
|
|
27
|
-
const DETAIL_ENDPOINT =
|
|
28
|
-
const SEND_ENDPOINT =
|
|
29
|
-
const READ_ENDPOINT =
|
|
28
|
+
const DETAIL_ENDPOINT = CONVERSATION_ENDPOINTS.BY_ID;
|
|
29
|
+
const SEND_ENDPOINT = CONVERSATION_ENDPOINTS.MESSAGES;
|
|
30
|
+
const READ_ENDPOINT = CONVERSATION_ENDPOINTS.READ;
|
|
30
31
|
async function fetchDetail(id) {
|
|
31
32
|
try {
|
|
32
33
|
return await apiClient.get(DETAIL_ENDPOINT(id));
|
|
@@ -9,7 +9,8 @@ import { getClientRealtimeProvider } from "../../../contracts/client-realtime";
|
|
|
9
9
|
import { userConversationsPingPath } from "../realtime";
|
|
10
10
|
import { normalizeError } from "../../../errors/normalize";
|
|
11
11
|
import { apiClient } from "../../../http/ApiClient";
|
|
12
|
-
|
|
12
|
+
import { CONVERSATION_ENDPOINTS } from "../../../constants/api-endpoints";
|
|
13
|
+
const LIST_ENDPOINT = CONVERSATION_ENDPOINTS.LIST;
|
|
13
14
|
async function fetchList() {
|
|
14
15
|
const data = await apiClient.get(LIST_ENDPOINT);
|
|
15
16
|
return data.items ?? [];
|
|
@@ -108,15 +108,15 @@ export declare const conversationFirestoreSchema: z.ZodObject<{
|
|
|
108
108
|
status: z.ZodEnum<["active", "archived", "blocked"]>;
|
|
109
109
|
}, "strip", z.ZodTypeAny, {
|
|
110
110
|
status: "archived" | "active" | "blocked";
|
|
111
|
-
|
|
111
|
+
id: string;
|
|
112
112
|
createdAt: string | Date | z.objectOutputType<{
|
|
113
113
|
toDate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodDate>;
|
|
114
114
|
}, z.ZodTypeAny, "passthrough">;
|
|
115
|
-
storeName: string;
|
|
116
|
-
id: string;
|
|
117
115
|
updatedAt: string | Date | z.objectOutputType<{
|
|
118
116
|
toDate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodDate>;
|
|
119
117
|
}, z.ZodTypeAny, "passthrough">;
|
|
118
|
+
storeId: string;
|
|
119
|
+
storeName: string;
|
|
120
120
|
messages: {
|
|
121
121
|
id: string;
|
|
122
122
|
body: string;
|
|
@@ -141,15 +141,15 @@ export declare const conversationFirestoreSchema: z.ZodObject<{
|
|
|
141
141
|
productTitle?: string | undefined;
|
|
142
142
|
}, {
|
|
143
143
|
status: "archived" | "active" | "blocked";
|
|
144
|
-
|
|
144
|
+
id: string;
|
|
145
145
|
createdAt: string | Date | z.objectInputType<{
|
|
146
146
|
toDate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodDate>;
|
|
147
147
|
}, z.ZodTypeAny, "passthrough">;
|
|
148
|
-
storeName: string;
|
|
149
|
-
id: string;
|
|
150
148
|
updatedAt: string | Date | z.objectInputType<{
|
|
151
149
|
toDate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodDate>;
|
|
152
150
|
}, z.ZodTypeAny, "passthrough">;
|
|
151
|
+
storeId: string;
|
|
152
|
+
storeName: string;
|
|
153
153
|
messages: {
|
|
154
154
|
id: string;
|
|
155
155
|
body: string;
|
|
@@ -6,7 +6,7 @@ import { BaseListingCard, Button, Caption, Row, Span, Stack, StatusBadge, Text,
|
|
|
6
6
|
import { formatCurrency, formatDate } from "../../../utils";
|
|
7
7
|
import { OrderStatusValues } from "../schemas";
|
|
8
8
|
import { useLongPress } from "../../../react/hooks/useLongPress";
|
|
9
|
-
const CLS_ACTION_BUTTON = "min-w-0 flex-1 px-2 text-xs";
|
|
9
|
+
const CLS_ACTION_BUTTON = "min-w-0 flex-1 px-[var(--appkit-space-2)] text-[length:var(--appkit-text-xs)]";
|
|
10
10
|
const STATUS_MAP = {
|
|
11
11
|
pending: "pending",
|
|
12
12
|
confirmed: "info",
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OrderPaymentSummary — the single place both admin and seller order-detail
|
|
3
|
+
* views render payment info from, regardless of how the buyer paid (manual
|
|
4
|
+
* cash/UPI proof, Razorpay, or COD). Reads `order.paymentRecord` when present;
|
|
5
|
+
* falls back to an adapter over the pre-existing legacy fields
|
|
6
|
+
* (`paymentMethod`/`paymentId`/`paymentProofUrl`/`paymentTransactionId`) for
|
|
7
|
+
* orders placed before Feature C shipped, so old orders keep rendering
|
|
8
|
+
* correctly instead of showing a blank/broken Payment section.
|
|
9
|
+
*/
|
|
10
|
+
import React from "react";
|
|
11
|
+
import type { OrderDocument } from "../schemas";
|
|
12
|
+
export interface OrderPaymentSummaryProps {
|
|
13
|
+
order: OrderDocument;
|
|
14
|
+
className?: string;
|
|
15
|
+
}
|
|
16
|
+
export declare function OrderPaymentSummary({ order, className }: OrderPaymentSummaryProps): React.JSX.Element;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { Badge, Div, Heading, Row, Stack, Text } from "../../../ui";
|
|
4
|
+
import { formatCurrency } from "../../../utils/number.formatter";
|
|
5
|
+
const METHOD_LABEL = {
|
|
6
|
+
manual: "Manual (Cash / UPI)",
|
|
7
|
+
razorpay: "Razorpay",
|
|
8
|
+
cod: "Cash on Delivery",
|
|
9
|
+
};
|
|
10
|
+
function legacyFallback(order) {
|
|
11
|
+
if (!order.paymentMethod)
|
|
12
|
+
return null;
|
|
13
|
+
const method = order.paymentMethod === "razorpay" || order.paymentMethod === "online"
|
|
14
|
+
? "razorpay"
|
|
15
|
+
: order.paymentMethod === "cod"
|
|
16
|
+
? "cod"
|
|
17
|
+
: "manual";
|
|
18
|
+
return {
|
|
19
|
+
method,
|
|
20
|
+
transactionId: order.paymentTransactionId ?? order.paymentId,
|
|
21
|
+
proofUrl: order.paymentProofUrl,
|
|
22
|
+
amountPaise: order.totalPrice,
|
|
23
|
+
verificationMethod: method === "razorpay" ? "webhook" : method === "cod" ? "cod_collection" : "manual_review",
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
export function OrderPaymentSummary({ order, className = "" }) {
|
|
27
|
+
const record = order.paymentRecord ?? legacyFallback(order);
|
|
28
|
+
if (!record) {
|
|
29
|
+
return (_jsx(Div, { className: className, rounded: "xl", padding: "md", surface: "muted", border: "default", children: _jsx(Text, { size: "sm", color: "muted", children: "No payment information recorded yet." }) }));
|
|
30
|
+
}
|
|
31
|
+
return (_jsxs(Div, { className: className, rounded: "xl", padding: "md", surface: "muted", border: "default", children: [_jsxs(Row, { justify: "between", align: "center", className: "mb-2", children: [_jsx(Heading, { level: 3, size: "sm", weight: "semibold", color: "muted", children: "Payment" }), _jsx(Badge, { variant: order.paymentStatus === "paid" ? "success" : "default", children: order.paymentStatus ?? "pending" })] }), _jsxs(Stack, { gap: "xs", children: [_jsxs(Row, { justify: "between", children: [_jsx(Text, { size: "sm", color: "muted", children: "Method" }), _jsx(Text, { size: "sm", weight: "medium", children: METHOD_LABEL[record.method] })] }), _jsxs(Row, { justify: "between", children: [_jsx(Text, { size: "sm", color: "muted", children: "Amount" }), _jsx(Text, { size: "sm", weight: "medium", children: formatCurrency(record.amountPaise / 100, order.currency ?? "INR") })] }), record.transactionId && (_jsxs(Row, { justify: "between", children: [_jsx(Text, { size: "sm", color: "muted", children: "Reference" }), _jsx(Text, { size: "sm", weight: "medium", children: record.transactionId })] })), record.paidAt && (_jsxs(Row, { justify: "between", children: [_jsx(Text, { size: "sm", color: "muted", children: "Paid at" }), _jsx(Text, { size: "sm", children: new Date(record.paidAt).toLocaleString() })] })), record.verifiedBy && (_jsxs(Row, { justify: "between", children: [_jsx(Text, { size: "sm", color: "muted", children: "Verified by" }), _jsx(Text, { size: "sm", children: record.verifiedBy })] })), record.gatewayRef?.paymentId && (_jsxs(Row, { justify: "between", children: [_jsx(Text, { size: "sm", color: "muted", children: "Gateway payment ID" }), _jsx(Text, { size: "sm", children: record.gatewayRef.paymentId })] }))] })] }));
|
|
32
|
+
}
|
|
@@ -11,6 +11,6 @@ export function OrderSiblingPayments({ siblings, currentOrderId, className = "",
|
|
|
11
11
|
return null;
|
|
12
12
|
return (_jsxs(Div, { className: `${className}`, rounded: "xl", padding: "md", surface: "muted", border: "default", children: [_jsx(Heading, { level: 3, className: "mb-3", color: "muted", size: "sm", weight: "semibold", children: REFUND_COPY.siblingPayments.heading(others.length) }), _jsx(Stack, { gap: "xs", children: others.map((o) => {
|
|
13
13
|
const href = String(ROUTES.USER.ORDER_DETAIL(o.id));
|
|
14
|
-
return (_jsxs(Row, { justify: "between", align: "center", gap: "sm", children: [_jsx(Link, { href: href, className: "text-sm font-medium text-[color:var(--appkit-color-primary)] hover:underline", children: o.id }), _jsxs(Row, { gap: "sm", align: "center", children: [_jsx(Text, { size: "xs", color: "muted", transform: "capitalize", children: o.status }), _jsx(Text, { size: "xs", weight: "semibold", children: formatCurrency(o.totalPrice / 100, o.currency ?? "INR") })] })] }, o.id));
|
|
14
|
+
return (_jsxs(Row, { justify: "between", align: "center", gap: "sm", children: [_jsx(Link, { href: href, className: "text-[length:var(--appkit-text-sm)] font-medium text-[color:var(--appkit-color-primary)] hover:underline", children: o.id }), _jsxs(Row, { gap: "sm", align: "center", children: [_jsx(Text, { size: "xs", color: "muted", transform: "capitalize", children: o.status }), _jsx(Text, { size: "xs", weight: "semibold", children: formatCurrency(o.totalPrice / 100, o.currency ?? "INR") })] })] }, o.id));
|
|
15
15
|
}) })] }));
|
|
16
16
|
}
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
+
import type React from "react";
|
|
1
2
|
import type { Order } from "../types";
|
|
2
3
|
interface OrderCardProps {
|
|
3
4
|
order: Order;
|
|
4
5
|
onClick?: (order: Order) => void;
|
|
5
6
|
labels?: Record<string, string>;
|
|
7
|
+
/** Optional quick-action slot (e.g. Track/Cancel) rendered in the card footer — click-reduction so buyers don't have to open the detail page for a single action. */
|
|
8
|
+
renderActions?: (order: Order) => React.ReactNode;
|
|
6
9
|
}
|
|
7
|
-
export declare function OrderCard({ order, onClick, labels }: OrderCardProps):
|
|
10
|
+
export declare function OrderCard({ order, onClick, labels, renderActions }: OrderCardProps): React.JSX.Element;
|
|
8
11
|
interface OrdersListProps {
|
|
9
12
|
orders: Order[];
|
|
10
13
|
isLoading?: boolean;
|
|
@@ -13,6 +16,8 @@ interface OrdersListProps {
|
|
|
13
16
|
currentPage?: number;
|
|
14
17
|
onPageChange?: (page: number) => void;
|
|
15
18
|
emptyLabel?: string;
|
|
19
|
+
/** Optional per-card quick-action slot (e.g. Track/Cancel) — see OrderCardProps.renderActions. */
|
|
20
|
+
renderActions?: (order: Order) => React.ReactNode;
|
|
16
21
|
}
|
|
17
|
-
export declare function OrdersList({ orders, isLoading, onOrderClick, totalPages, currentPage, onPageChange, emptyLabel, }: OrdersListProps):
|
|
22
|
+
export declare function OrdersList({ orders, isLoading, onOrderClick, totalPages, currentPage, onPageChange, emptyLabel, renderActions, }: OrdersListProps): React.JSX.Element;
|
|
18
23
|
export {};
|
|
@@ -3,7 +3,7 @@ import { Div, Pagination, Row, Span, Stack, Text } from "../../../ui";
|
|
|
3
3
|
import { MediaImage } from "../../media/MediaImage";
|
|
4
4
|
import { formatCurrency } from "../../../utils/number.formatter";
|
|
5
5
|
import { getDefaultLocale } from "../../../core/baseline-resolver";
|
|
6
|
-
const CLS_PRIZE_BADGE = "inline-flex items-center rounded-full bg-fuchsia-100 dark:bg-fuchsia-900/30 px-2
|
|
6
|
+
const CLS_PRIZE_BADGE = "inline-flex items-center rounded-full bg-fuchsia-100 dark:bg-fuchsia-900/30 px-[var(--appkit-space-2-5)] py-[var(--appkit-space-0-5)] text-fuchsia-700 dark:text-fuchsia-300";
|
|
7
7
|
const STATUS_COLORS = {
|
|
8
8
|
pending: "bg-warning-surface text-warning",
|
|
9
9
|
confirmed: "bg-info-surface text-info",
|
|
@@ -15,7 +15,7 @@ const STATUS_COLORS = {
|
|
|
15
15
|
return_requested: "bg-warning-surface text-warning",
|
|
16
16
|
returned: "bg-[var(--appkit-color-surface)] text-[var(--appkit-color-text-muted)] bg-[var(--appkit-color-surface-elevated)] text-[var(--appkit-color-text-muted)]",
|
|
17
17
|
};
|
|
18
|
-
export function OrderCard({ order, onClick, labels = {} }) {
|
|
18
|
+
export function OrderCard({ order, onClick, labels = {}, renderActions }) {
|
|
19
19
|
const date = order.createdAt
|
|
20
20
|
? new Date(order.createdAt).toLocaleDateString(getDefaultLocale(), {
|
|
21
21
|
year: "numeric",
|
|
@@ -35,14 +35,14 @@ export function OrderCard({ order, onClick, labels = {} }) {
|
|
|
35
35
|
.sort()[0];
|
|
36
36
|
return (_jsxs(Div, { padding: "5", role: onClick ? "button" : undefined, tabIndex: onClick ? 0 : undefined, onKeyDown: onClick
|
|
37
37
|
? (e) => (e.key === "Enter" || e.key === " ") && onClick(order)
|
|
38
|
-
: undefined, onClick: onClick ? () => onClick(order) : undefined, className: `border border-neutral-200 ${onClick ? "cursor-pointer transition hover:shadow-md" : ""}`, rounded: "xl", surface: "default", children: [_jsxs(Row, { wrap: true, align: "start", justify: "between", gap: "3", children: [_jsxs(Div, { children: [_jsxs(Text, { className: "text-[var(--appkit-color-text-muted)]", size: "xs", children: ["Order #", order.id.slice(-8).toUpperCase()] }), date && (_jsx(Text, { className: "mt-0.5", color: "faint", size: "xs", children: date }))] }), _jsx(Span, { size: "xs", weight: "semibold", className: `capitalize ${statusColor}`, rounded: "full", padding: "pill-md", children: labels[order.orderStatus] ?? order.orderStatus.replace(/_/g, " ") })] }), revealsRemaining > 0 && (_jsxs(Row, { gap: "sm", className: "mt-2", children: [_jsxs(Span, { size: "xs", weight: "semibold", className: CLS_PRIZE_BADGE, children: [revealsRemaining, " ", revealsRemaining === 1 ? "reveal" : "reveals", " pending"] }), earliestDeadline && (_jsxs(Span, { size: "xs", color: "muted", children: ["before ", new Date(earliestDeadline).toLocaleDateString(getDefaultLocale(), { month: "short", day: "numeric" })] }))] })), _jsxs(Row, { wrap: true, gap: "3", className: "mt-4", children: [order.items.slice(0, 3).map((item, i) => (_jsxs(Row, { gap: "sm", children: [item.image && (_jsx(Div, { className: "relative h-10 w-10 flex-shrink-0", rounded: "lg", overflow: "hidden", children: _jsx(MediaImage, { src: item.image, alt: item.title, size: "thumbnail" }) })), _jsxs(Div, { children: [_jsx(Text, { truncate: true, size: "sm", weight: "medium", color: "primary", children: item.title }), _jsxs(Text, { size: "xs", color: "faint", children: ["\u00D7", item.quantity] })] })] }, i))), order.items.length > 3 && (_jsxs(Span, { size: "xs", className: "self-center", color: "faint", children: ["+", order.items.length - 3, " more"] }))] }), _jsxs(Row, { justify: "between", className: "mt-4 border-t border-neutral-100", padding: "t-sm", children: [_jsxs(Span, { size: "sm", className: "text-[var(--appkit-color-text-muted)]", children: [order.currency ?? "", " Total"] }), _jsx(Span, { weight: "semibold", className: "text-[var(--appkit-color-text)]", children: formatCurrency(order.total, order.currency) })] })] }));
|
|
38
|
+
: undefined, onClick: onClick ? () => onClick(order) : undefined, className: `border border-neutral-200 ${onClick ? "cursor-pointer transition hover:shadow-md" : ""}`, rounded: "xl", surface: "default", children: [_jsxs(Row, { wrap: true, align: "start", justify: "between", gap: "3", children: [_jsxs(Div, { children: [_jsxs(Text, { className: "text-[var(--appkit-color-text-muted)]", size: "xs", children: ["Order #", order.id.slice(-8).toUpperCase()] }), date && (_jsx(Text, { className: "mt-0.5", color: "faint", size: "xs", children: date }))] }), _jsx(Span, { size: "xs", weight: "semibold", className: `capitalize ${statusColor}`, rounded: "full", padding: "pill-md", children: labels[order.orderStatus] ?? order.orderStatus.replace(/_/g, " ") })] }), revealsRemaining > 0 && (_jsxs(Row, { gap: "sm", className: "mt-2", children: [_jsxs(Span, { size: "xs", weight: "semibold", className: CLS_PRIZE_BADGE, children: [revealsRemaining, " ", revealsRemaining === 1 ? "reveal" : "reveals", " pending"] }), earliestDeadline && (_jsxs(Span, { size: "xs", color: "muted", children: ["before ", new Date(earliestDeadline).toLocaleDateString(getDefaultLocale(), { month: "short", day: "numeric" })] }))] })), _jsxs(Row, { wrap: true, gap: "3", className: "mt-4", children: [order.items.slice(0, 3).map((item, i) => (_jsxs(Row, { gap: "sm", children: [item.image && (_jsx(Div, { className: "relative h-10 w-10 flex-shrink-0", rounded: "lg", overflow: "hidden", children: _jsx(MediaImage, { src: item.image, alt: item.title, size: "thumbnail" }) })), _jsxs(Div, { children: [_jsx(Text, { truncate: true, size: "sm", weight: "medium", color: "primary", children: item.title }), _jsxs(Text, { size: "xs", color: "faint", children: ["\u00D7", item.quantity] })] })] }, i))), order.items.length > 3 && (_jsxs(Span, { size: "xs", className: "self-center", color: "faint", children: ["+", order.items.length - 3, " more"] }))] }), _jsxs(Row, { justify: "between", className: "mt-4 border-t border-neutral-100", padding: "t-sm", children: [_jsxs(Span, { size: "sm", className: "text-[var(--appkit-color-text-muted)]", children: [order.currency ?? "", " Total"] }), _jsx(Span, { weight: "semibold", className: "text-[var(--appkit-color-text)]", children: formatCurrency(order.total, order.currency) })] }), renderActions && (_jsx(Row, { justify: "end", gap: "sm", className: "mt-3", onClick: (e) => e.stopPropagation(), children: renderActions(order) }))] }));
|
|
39
39
|
}
|
|
40
|
-
export function OrdersList({ orders, isLoading, onOrderClick, totalPages = 1, currentPage = 1, onPageChange, emptyLabel = "No orders found", }) {
|
|
40
|
+
export function OrdersList({ orders, isLoading, onOrderClick, totalPages = 1, currentPage = 1, onPageChange, emptyLabel = "No orders found", renderActions, }) {
|
|
41
41
|
if (isLoading) {
|
|
42
42
|
return (_jsx(Stack, { gap: "md", children: Array.from({ length: 3 }).map((_, i) => (_jsxs(Div, { padding: "5", className: "animate-pulse border border-neutral-200", rounded: "xl", children: [_jsxs(Row, { justify: "between", children: [_jsxs(Stack, { gap: "xs", children: [_jsx(Div, { className: "h-3 w-20 bg-neutral-200", rounded: "default" }), _jsx(Div, { className: "h-3 w-16 bg-neutral-200", rounded: "default" })] }), _jsx(Div, { className: "h-6 w-20 bg-neutral-200", rounded: "full" })] }), _jsxs(Div, { layout: "flex", gap: "3", className: "mt-4", children: [_jsx(Div, { className: "h-10 w-10 bg-neutral-200", rounded: "lg" }), _jsx(Div, { className: "h-10 w-10 bg-neutral-200", rounded: "lg" })] })] }, i))) }));
|
|
43
43
|
}
|
|
44
44
|
if (orders.length === 0) {
|
|
45
45
|
return (_jsx(Text, { paddingY: "3xl", color: "muted", size: "sm", align: "center", children: emptyLabel }));
|
|
46
46
|
}
|
|
47
|
-
return (_jsxs(Stack, { gap: "lg", children: [_jsx(Stack, { gap: "md", children: orders.map((order) => (_jsx(OrderCard, { order: order, onClick: onOrderClick }, order.id))) }), totalPages > 1 && onPageChange && (_jsx(Row, { justify: "center", children: _jsx(Pagination, { currentPage: currentPage, totalPages: totalPages, onPageChange: onPageChange }) }))] }));
|
|
47
|
+
return (_jsxs(Stack, { gap: "lg", children: [_jsx(Stack, { gap: "md", children: orders.map((order) => (_jsx(OrderCard, { order: order, onClick: onOrderClick, renderActions: renderActions }, order.id))) }), totalPages > 1 && onPageChange && (_jsx(Row, { justify: "center", children: _jsx(Pagination, { currentPage: currentPage, totalPages: totalPages, onPageChange: onPageChange }) }))] }));
|
|
48
48
|
}
|
|
@@ -3,7 +3,7 @@ import { Badge, Div, Heading, Row, Stack, Text } from "../../../ui";
|
|
|
3
3
|
import { formatCurrency } from "../../../utils/number.formatter";
|
|
4
4
|
import { REFUND_COPY } from "../../../_internal/shared/features/orders/refund-copy";
|
|
5
5
|
const __P = {
|
|
6
|
-
p4: "p-4",
|
|
6
|
+
p4: "p-[var(--appkit-space-4)]",
|
|
7
7
|
};
|
|
8
8
|
function formatDate(d) {
|
|
9
9
|
const dt = d instanceof Date ? d : new Date(d);
|
|
@@ -17,7 +17,7 @@ import { REFUND_COPY } from "../../../_internal/shared/features/orders/refund-co
|
|
|
17
17
|
import { formatCurrency } from "../../../utils/number.formatter";
|
|
18
18
|
import { normalizeError } from "../../../errors/normalize";
|
|
19
19
|
const ACK_COUNT = REFUND_COPY.request.acknowledgments.length;
|
|
20
|
-
const CLS_WARN_PANEL = "rounded-xl border border-warning bg-warning-surface p-4 dark:border-warning";
|
|
20
|
+
const CLS_WARN_PANEL = "rounded-xl border border-warning bg-warning-surface p-[var(--appkit-space-4)] dark:border-warning";
|
|
21
21
|
export function RefundRequestView({ order, onSubmitRequest, isLoading = false, className = "", }) {
|
|
22
22
|
const [acknowledged, setAcknowledged] = useState(Array(ACK_COUNT).fill(false));
|
|
23
23
|
const [reason, setReason] = useState("");
|
|
@@ -4,6 +4,8 @@ export { OrderFilters, ORDER_FILTER_KEYS, ORDER_ADMIN_SORT_OPTIONS, ORDER_SELLER
|
|
|
4
4
|
export type { OrderFiltersProps, OrderFilterVariant } from "./OrderFilters";
|
|
5
5
|
export { OrderSiblingPayments } from "./OrderSiblingPayments";
|
|
6
6
|
export type { OrderSiblingPaymentsProps } from "./OrderSiblingPayments";
|
|
7
|
+
export { OrderPaymentSummary } from "./OrderPaymentSummary";
|
|
8
|
+
export type { OrderPaymentSummaryProps } from "./OrderPaymentSummary";
|
|
7
9
|
export { RefundHistoryTable } from "./RefundHistoryTable";
|
|
8
10
|
export type { RefundHistoryTableProps } from "./RefundHistoryTable";
|
|
9
11
|
export { RefundRequestView } from "./RefundRequestView";
|
|
@@ -2,5 +2,6 @@ export { OrderCard, OrdersList } from "./OrdersList";
|
|
|
2
2
|
export { MarketplaceOrderCard, } from "./MarketplaceOrderCard";
|
|
3
3
|
export { OrderFilters, ORDER_FILTER_KEYS, ORDER_ADMIN_SORT_OPTIONS, ORDER_SELLER_SORT_OPTIONS, ORDER_USER_SORT_OPTIONS, getOrderFilterKeys, getOrderSortOptions, } from "./OrderFilters";
|
|
4
4
|
export { OrderSiblingPayments } from "./OrderSiblingPayments";
|
|
5
|
+
export { OrderPaymentSummary } from "./OrderPaymentSummary";
|
|
5
6
|
export { RefundHistoryTable } from "./RefundHistoryTable";
|
|
6
7
|
export { RefundRequestView } from "./RefundRequestView";
|
|
@@ -19,6 +19,14 @@ declare class OrderRepository extends BaseRepository<OrderDocument> {
|
|
|
19
19
|
unassignWorker(orderId: string): Promise<OrderDocument>;
|
|
20
20
|
markPicked(orderId: string): Promise<OrderDocument>;
|
|
21
21
|
markPacked(orderId: string): Promise<OrderDocument>;
|
|
22
|
+
/**
|
|
23
|
+
* Payment Detail Parity (Feature C) — the COD counterpart to the manual
|
|
24
|
+
* proof-upload / Razorpay-webhook write paths. Seller or admin confirms
|
|
25
|
+
* the cash was physically collected; there is no external gateway to
|
|
26
|
+
* verify against, so `verifiedBy` is the acting user's uid and
|
|
27
|
+
* `verificationMethod` is always "cod_collection".
|
|
28
|
+
*/
|
|
29
|
+
markCodCollected(orderId: string, verifiedBy: string, note?: string): Promise<OrderDocument>;
|
|
22
30
|
findFulfillmentQueue(storeId: string): Promise<OrderDocument[]>;
|
|
23
31
|
updatePaymentStatus(orderId: string, paymentStatus: PaymentStatus, paymentId?: string): Promise<OrderDocument>;
|
|
24
32
|
cancelOrder(orderId: string, reason: string, refundAmount?: number): Promise<OrderDocument>;
|
|
@@ -87,6 +87,30 @@ class OrderRepository extends BaseRepository {
|
|
|
87
87
|
async markPacked(orderId) {
|
|
88
88
|
return this.update(orderId, { packedAt: new Date(), updatedAt: new Date() });
|
|
89
89
|
}
|
|
90
|
+
/**
|
|
91
|
+
* Payment Detail Parity (Feature C) — the COD counterpart to the manual
|
|
92
|
+
* proof-upload / Razorpay-webhook write paths. Seller or admin confirms
|
|
93
|
+
* the cash was physically collected; there is no external gateway to
|
|
94
|
+
* verify against, so `verifiedBy` is the acting user's uid and
|
|
95
|
+
* `verificationMethod` is always "cod_collection".
|
|
96
|
+
*/
|
|
97
|
+
async markCodCollected(orderId, verifiedBy, note) {
|
|
98
|
+
const order = await this.findById(orderId);
|
|
99
|
+
if (!order)
|
|
100
|
+
throw new NotFoundError(`Order ${orderId} not found`);
|
|
101
|
+
return this.update(orderId, {
|
|
102
|
+
paymentStatus: "paid",
|
|
103
|
+
paymentRecord: {
|
|
104
|
+
method: "cod",
|
|
105
|
+
transactionId: note,
|
|
106
|
+
amountPaise: order.totalPrice,
|
|
107
|
+
paidAt: new Date(),
|
|
108
|
+
verifiedBy,
|
|
109
|
+
verificationMethod: "cod_collection",
|
|
110
|
+
},
|
|
111
|
+
updatedAt: new Date(),
|
|
112
|
+
});
|
|
113
|
+
}
|
|
90
114
|
async findFulfillmentQueue(storeId) {
|
|
91
115
|
const snap = await this.db
|
|
92
116
|
.collection(this.collection)
|
|
@@ -45,6 +45,19 @@ export declare const PaymentMethodValues: {
|
|
|
45
45
|
readonly ADMIN_BYPASS: "admin_bypass";
|
|
46
46
|
readonly EMI: "emi";
|
|
47
47
|
};
|
|
48
|
+
/**
|
|
49
|
+
* Buyer-chosen policy for what happens when an item in the cart becomes
|
|
50
|
+
* unavailable between add-to-cart and checkout — either COD/UPI (stock
|
|
51
|
+
* validated in the checkout transaction) or Razorpay (stock validated after
|
|
52
|
+
* payment capture). "skip_items" ships whatever remains available; "cancel_order"
|
|
53
|
+
* rejects the whole checkout batch if anything is short.
|
|
54
|
+
*/
|
|
55
|
+
export type OutOfStockPolicy = "cancel_order" | "skip_items";
|
|
56
|
+
/** Runtime-accessible out-of-stock policy values — use instead of bare string literals. */
|
|
57
|
+
export declare const OutOfStockPolicyValues: {
|
|
58
|
+
readonly CANCEL_ORDER: "cancel_order";
|
|
59
|
+
readonly SKIP_ITEMS: "skip_items";
|
|
60
|
+
};
|
|
48
61
|
export type EmiInstallmentStatus = "pending" | "paid" | "overdue";
|
|
49
62
|
export interface EmiInstallment {
|
|
50
63
|
/** 1-based installment number. */
|
|
@@ -245,6 +258,52 @@ export interface OrderDocument extends BaseDocument {
|
|
|
245
258
|
paymentProofMimeType?: string;
|
|
246
259
|
/** When the buyer submitted the proof. */
|
|
247
260
|
paymentProofUploadedAt?: Date;
|
|
261
|
+
/**
|
|
262
|
+
* Same-shape payment record regardless of how the buyer paid — manual
|
|
263
|
+
* (cash/UPI proof), Razorpay (webhook-verified), or COD (collected on
|
|
264
|
+
* delivery). Additive: legacy fields above (`paymentProofUrl`,
|
|
265
|
+
* `paymentTransactionId`, `paymentId`, `paymentMethod`) are left in place
|
|
266
|
+
* for backward compatibility with pre-existing orders — `OrderPaymentSummary`
|
|
267
|
+
* falls back to them when `paymentRecord` is unset. Never renamed/removed.
|
|
268
|
+
*/
|
|
269
|
+
paymentRecord?: OrderPaymentRecord;
|
|
270
|
+
/**
|
|
271
|
+
* The buyer's chosen policy at checkout for what to do when a cart item is
|
|
272
|
+
* unavailable. Set on every order created by the same checkout call — one
|
|
273
|
+
* checkout call is one buyer decision, so a multi-store/bundle checkout's
|
|
274
|
+
* sibling orders all carry the same policy + the full session's dropped
|
|
275
|
+
* items (they aren't cleanly attributable to a single store/order).
|
|
276
|
+
*/
|
|
277
|
+
outOfStockPolicy?: OutOfStockPolicy;
|
|
278
|
+
/** Items from this checkout session that were dropped because they were unavailable ("skip_items" policy only). */
|
|
279
|
+
droppedItems?: {
|
|
280
|
+
productId: string;
|
|
281
|
+
productTitle: string;
|
|
282
|
+
requestedQty: number;
|
|
283
|
+
availableQty: number;
|
|
284
|
+
}[];
|
|
285
|
+
/** Set true only when an automatic partial refund (for dropped Razorpay items) failed and needs manual follow-up. */
|
|
286
|
+
refundPending?: boolean;
|
|
287
|
+
}
|
|
288
|
+
export type OrderPaymentRecordMethod = "manual" | "razorpay" | "cod";
|
|
289
|
+
export type OrderPaymentVerificationMethod = "manual_review" | "webhook" | "cod_collection";
|
|
290
|
+
export interface OrderPaymentRecord {
|
|
291
|
+
method: OrderPaymentRecordMethod;
|
|
292
|
+
/** UTR (manual) | razorpay_payment_id (razorpay) | collector note/ref (COD). */
|
|
293
|
+
transactionId?: string;
|
|
294
|
+
/** Manual proof upload | COD collection receipt photo (optional) | n/a for razorpay. */
|
|
295
|
+
proofUrl?: string;
|
|
296
|
+
amountPaise: number;
|
|
297
|
+
paidAt?: Date;
|
|
298
|
+
/** Admin/seller uid (manual/COD) | "razorpay-webhook" (razorpay, automatic). */
|
|
299
|
+
verifiedBy?: string;
|
|
300
|
+
verificationMethod: OrderPaymentVerificationMethod;
|
|
301
|
+
/** Razorpay audit trail only. */
|
|
302
|
+
gatewayRef?: {
|
|
303
|
+
orderId?: string;
|
|
304
|
+
paymentId?: string;
|
|
305
|
+
signature?: string;
|
|
306
|
+
};
|
|
248
307
|
}
|
|
249
308
|
export declare const ORDER_COLLECTION: "orders";
|
|
250
309
|
export declare const ORDER_INDEXED_FIELDS: readonly ["userId", "productId", "storeId", "status", "paymentStatus", "payoutStatus", "shippingMethod", "orderDate", "createdAt", "assignedWorkerId", "pickedAt", "packedAt"];
|
|
@@ -37,6 +37,11 @@ export const PaymentMethodValues = {
|
|
|
37
37
|
ADMIN_BYPASS: "admin_bypass",
|
|
38
38
|
EMI: "emi",
|
|
39
39
|
};
|
|
40
|
+
/** Runtime-accessible out-of-stock policy values — use instead of bare string literals. */
|
|
41
|
+
export const OutOfStockPolicyValues = {
|
|
42
|
+
CANCEL_ORDER: "cancel_order",
|
|
43
|
+
SKIP_ITEMS: "skip_items",
|
|
44
|
+
};
|
|
40
45
|
/** Runtime-accessible refund status values â€" use instead of bare string literals. */
|
|
41
46
|
export const RefundStatusValues = {
|
|
42
47
|
PENDING: "pending",
|