@mohasinac/appkit 3.2.20 → 3.3.1
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.d.ts +2 -1
- package/dist/_internal/client/features/digital-code/CodeRevealPanel.d.ts +2 -1
- package/dist/_internal/client/features/digital-code/DigitalCodeDetailView.d.ts +2 -1
- package/dist/_internal/client/features/layout/DashboardLayoutClient.d.ts +1 -1
- package/dist/_internal/client/features/layout/RoleGuard.d.ts +1 -1
- package/dist/_internal/client/features/live/LiveItemDetailView.d.ts +1 -1
- package/dist/_internal/client/features/lottery/LotteryAdminEditView.d.ts +2 -1
- package/dist/_internal/client/features/lottery/LotteryAdminSlotView.d.ts +2 -1
- package/dist/_internal/client/features/lottery/LotteryDetailView.d.ts +2 -1
- package/dist/_internal/client/features/lottery/LotteryEntriesView.d.ts +2 -1
- package/dist/_internal/client/features/lottery/LotteryListView.d.ts +2 -1
- package/dist/_internal/client/features/lottery/LotteryPullForm.d.ts +2 -1
- package/dist/_internal/client/features/lottery/LotterySlotGrid.d.ts +2 -1
- package/dist/_internal/client/features/lottery/PrizeDrawLotteryDetailView.d.ts +2 -1
- package/dist/_internal/client/features/tour/TourProvider.d.ts +1 -1
- package/dist/_internal/client/i18n/LabelsProvider.d.ts +1 -1
- package/dist/_internal/client/scaffolds/AppShell.d.ts +1 -1
- package/dist/_internal/client/scaffolds/DashboardScaffold.d.ts +1 -1
- package/dist/_internal/client/theme/ThemeProvider.d.ts +1 -1
- package/dist/_internal/server/features/checkout/actions.d.ts +2 -0
- package/dist/_internal/server/features/checkout/actions.js +239 -190
- 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/autoPayoutEligibility.js +8 -11
- package/dist/_internal/server/jobs/core/emiInstallmentReminder.d.ts +8 -0
- package/dist/_internal/server/jobs/core/emiInstallmentReminder.js +78 -0
- package/dist/_internal/server/jobs/core/weeklyPayoutEligibility.d.ts +2 -2
- package/dist/_internal/server/jobs/core/weeklyPayoutEligibility.js +15 -10
- package/dist/_internal/server/jobs/handlers/emiInstallmentReminder.d.ts +2 -0
- package/dist/_internal/server/jobs/handlers/emiInstallmentReminder.js +2 -0
- package/dist/_internal/server/jobs/handlers/index.d.ts +1 -0
- package/dist/_internal/server/jobs/handlers/index.js +2 -0
- package/dist/_internal/server/providers/index.d.ts +4 -4
- package/dist/_internal/server/providers/index.js +4 -4
- package/dist/_internal/server/providers/payment/razorpay-mock.d.ts +3 -2
- package/dist/_internal/server/providers/payment/razorpay-mock.js +3 -1
- package/dist/_internal/server/providers/resolve.d.ts +10 -13
- package/dist/_internal/server/providers/resolve.js +9 -15
- package/dist/_internal/shared/actions/action-registry.js +28 -0
- package/dist/_internal/shared/checkout/rules/_defaults.js +1 -0
- package/dist/_internal/shared/checkout/rules/_registry.js +4 -0
- package/dist/_internal/shared/checkout/rules/art.rule.d.ts +9 -0
- package/dist/_internal/shared/checkout/rules/art.rule.js +5 -0
- package/dist/_internal/shared/checkout/rules/auction.rule.js +1 -0
- package/dist/_internal/shared/checkout/rules/classified.rule.js +1 -0
- package/dist/_internal/shared/checkout/rules/index.d.ts +2 -0
- package/dist/_internal/shared/checkout/rules/index.js +2 -0
- package/dist/_internal/shared/checkout/rules/stickers.rule.d.ts +9 -0
- package/dist/_internal/shared/checkout/rules/stickers.rule.js +5 -0
- package/dist/_internal/shared/checkout/rules/types.d.ts +6 -0
- package/dist/_internal/shared/features/checkout/config.d.ts +16 -1
- package/dist/_internal/shared/features/checkout/config.js +16 -1
- package/dist/_internal/shared/features/emi/schedule.d.ts +63 -0
- package/dist/_internal/shared/features/emi/schedule.js +62 -0
- package/dist/_internal/shared/fees/calculator.d.ts +53 -0
- package/dist/_internal/shared/fees/calculator.js +40 -0
- package/dist/_internal/shared/listing-types/_registry.d.ts +22 -66
- package/dist/_internal/shared/listing-types/_registry.js +19 -2
- package/dist/_internal/shared/listing-types/art/config.d.ts +15 -0
- package/dist/_internal/shared/listing-types/art/config.js +14 -0
- package/dist/_internal/shared/listing-types/art/ctas.d.ts +1 -0
- package/dist/_internal/shared/listing-types/art/ctas.js +3 -0
- package/dist/_internal/shared/listing-types/art/og.d.ts +1 -0
- package/dist/_internal/shared/listing-types/art/og.js +1 -0
- package/dist/_internal/shared/listing-types/art/schema.d.ts +2 -0
- package/dist/_internal/shared/listing-types/art/schema.js +3 -0
- package/dist/_internal/shared/listing-types/art/seed-factory.d.ts +1 -0
- package/dist/_internal/shared/listing-types/art/seed-factory.js +1 -0
- package/dist/_internal/shared/listing-types/auction/config.d.ts +8 -0
- package/dist/_internal/shared/listing-types/auction/config.js +6 -0
- package/dist/_internal/shared/listing-types/capabilities.js +17 -0
- package/dist/_internal/shared/listing-types/classified/config.d.ts +8 -0
- package/dist/_internal/shared/listing-types/classified/config.js +6 -0
- package/dist/_internal/shared/listing-types/digital-code/config.d.ts +8 -0
- package/dist/_internal/shared/listing-types/digital-code/config.js +6 -0
- package/dist/_internal/shared/listing-types/live/config.d.ts +8 -0
- package/dist/_internal/shared/listing-types/live/config.js +6 -0
- package/dist/_internal/shared/listing-types/pre-order/config.d.ts +8 -0
- package/dist/_internal/shared/listing-types/pre-order/config.js +6 -0
- package/dist/_internal/shared/listing-types/prize-draw/config.d.ts +8 -0
- package/dist/_internal/shared/listing-types/prize-draw/config.js +6 -0
- package/dist/_internal/shared/listing-types/standard/config.d.ts +8 -0
- package/dist/_internal/shared/listing-types/standard/config.js +6 -0
- package/dist/_internal/shared/listing-types/stickers/config.d.ts +15 -0
- package/dist/_internal/shared/listing-types/stickers/config.js +14 -0
- package/dist/_internal/shared/listing-types/stickers/ctas.d.ts +1 -0
- package/dist/_internal/shared/listing-types/stickers/ctas.js +3 -0
- package/dist/_internal/shared/listing-types/stickers/og.d.ts +1 -0
- package/dist/_internal/shared/listing-types/stickers/og.js +1 -0
- package/dist/_internal/shared/listing-types/stickers/schema.d.ts +2 -0
- package/dist/_internal/shared/listing-types/stickers/schema.js +3 -0
- package/dist/_internal/shared/listing-types/stickers/seed-factory.d.ts +1 -0
- package/dist/_internal/shared/listing-types/stickers/seed-factory.js +1 -0
- package/dist/client.d.ts +7 -2
- package/dist/client.js +4 -2
- package/dist/constants/field-names.d.ts +2 -6
- package/dist/constants/field-names.js +2 -6
- package/dist/contracts/index.d.ts +4 -2
- package/dist/contracts/index.js +6 -0
- package/dist/contracts/payment.d.ts +14 -9
- package/dist/contracts/payment.js +11 -1
- package/dist/contracts/shipping.d.ts +14 -9
- package/dist/contracts/shipping.js +11 -1
- package/dist/features/about/components/AboutView.d.ts +1 -1
- package/dist/features/about/components/FAQPageView.d.ts +1 -1
- package/dist/features/about/components/FeesView.d.ts +1 -1
- package/dist/features/about/components/HelpPageView.d.ts +1 -1
- package/dist/features/about/components/HowAuctionsWorkView.d.ts +1 -1
- package/dist/features/about/components/HowCheckoutWorksView.d.ts +1 -1
- package/dist/features/about/components/HowOffersWorkView.d.ts +1 -1
- package/dist/features/about/components/HowOrdersWorkView.d.ts +1 -1
- package/dist/features/about/components/HowPayoutsWorkView.d.ts +1 -1
- package/dist/features/about/components/HowPreOrdersWorkView.d.ts +1 -1
- package/dist/features/about/components/HowReviewsWorkView.d.ts +1 -1
- package/dist/features/about/components/PolicyPageView.d.ts +1 -1
- package/dist/features/about/components/PublicProfileView.d.ts +1 -1
- package/dist/features/about/components/PublicProfileView.js +3 -6
- package/dist/features/about/components/SecurityPrivacyView.d.ts +1 -1
- package/dist/features/about/components/ShippingPolicyView.d.ts +1 -1
- package/dist/features/about/components/TrackOrderView.d.ts +1 -1
- package/dist/features/about/components/UnauthorizedView.d.ts +1 -1
- package/dist/features/account/components/AddressBook.d.ts +2 -2
- package/dist/features/account/components/AddressFilters.d.ts +1 -1
- package/dist/features/account/components/AddressForm.d.ts +1 -1
- package/dist/features/account/components/AddressInlineSelect.d.ts +2 -1
- package/dist/features/account/components/AddressSelectorCreate.d.ts +1 -1
- package/dist/features/account/components/AddressesIndexListing.d.ts +2 -1
- package/dist/features/account/components/BecomeSellerView.d.ts +1 -1
- package/dist/features/account/components/BuyerAccountGuideView.d.ts +2 -1
- package/dist/features/account/components/BuyerAuctionsGuideView.d.ts +2 -1
- package/dist/features/account/components/BuyerOrdersGuideView.d.ts +2 -1
- package/dist/features/account/components/BuyerShoppingGuideView.d.ts +2 -1
- package/dist/features/account/components/ChatList.d.ts +1 -1
- package/dist/features/account/components/ChatWindow.d.ts +1 -1
- package/dist/features/account/components/MessagesView.d.ts +1 -1
- package/dist/features/account/components/NotificationBell.d.ts +1 -1
- package/dist/features/account/components/NotificationPreferencesPanel.d.ts +1 -1
- package/dist/features/account/components/OrderDetailView.d.ts +1 -1
- package/dist/features/account/components/ProfileView.d.ts +1 -1
- package/dist/features/account/components/UserAccountHubView.d.ts +1 -1
- package/dist/features/account/components/UserAddressesView.d.ts +1 -1
- package/dist/features/account/components/UserNotificationsView.d.ts +1 -1
- package/dist/features/account/components/UserOffersPanel.d.ts +1 -1
- package/dist/features/account/components/UserOffersView.d.ts +1 -1
- package/dist/features/account/components/UserOrderTrackView.d.ts +1 -1
- package/dist/features/account/components/UserOrdersView.d.ts +1 -1
- package/dist/features/account/components/UserReturnsView.d.ts +1 -1
- package/dist/features/account/components/UserSettingsView.d.ts +1 -1
- package/dist/features/account/components/UserSidebar.d.ts +1 -1
- package/dist/features/account/components/UserSupportView.d.ts +2 -1
- package/dist/features/admin/components/AdminAdEditorView.d.ts +2 -1
- package/dist/features/admin/components/AdminAddressBookView.d.ts +11 -0
- package/dist/features/admin/components/AdminAddressBookView.js +30 -0
- package/dist/features/admin/components/AdminAddressClustersView.d.ts +1 -1
- package/dist/features/admin/components/AdminAddressEditorView.d.ts +2 -1
- package/dist/features/admin/components/AdminAddressesView.d.ts +1 -1
- package/dist/features/admin/components/AdminAdsView.d.ts +1 -1
- package/dist/features/admin/components/AdminAllEventEntriesView.d.ts +2 -1
- package/dist/features/admin/components/AdminAnalyticsGuideView.d.ts +2 -1
- package/dist/features/admin/components/AdminAnalyticsView.d.ts +1 -1
- package/dist/features/admin/components/AdminArtView.d.ts +4 -0
- package/dist/features/admin/components/AdminArtView.js +45 -0
- package/dist/features/admin/components/AdminBidsView.d.ts +2 -1
- package/dist/features/admin/components/AdminBlogEditorView.d.ts +2 -1
- package/dist/features/admin/components/AdminBlogView.d.ts +2 -1
- package/dist/features/admin/components/AdminBrandEditorView.d.ts +2 -1
- package/dist/features/admin/components/AdminBrandsView.d.ts +2 -1
- package/dist/features/admin/components/AdminBundleEditorView.d.ts +14 -1
- package/dist/features/admin/components/AdminBundlesView.d.ts +2 -1
- package/dist/features/admin/components/AdminCarouselEditorView.d.ts +2 -1
- package/dist/features/admin/components/AdminCarouselView.d.ts +2 -1
- package/dist/features/admin/components/AdminCartsView.d.ts +2 -1
- package/dist/features/admin/components/AdminCatalogGuideView.d.ts +2 -1
- package/dist/features/admin/components/AdminCategoriesView.d.ts +2 -1
- package/dist/features/admin/components/AdminCategoryEditorView.d.ts +2 -1
- package/dist/features/admin/components/AdminClassifiedView.d.ts +2 -1
- package/dist/features/admin/components/AdminContactEditorView.d.ts +2 -1
- package/dist/features/admin/components/AdminContactView.d.ts +2 -1
- package/dist/features/admin/components/AdminContentGuideView.d.ts +2 -1
- package/dist/features/admin/components/AdminCouponEditorView.d.ts +2 -1
- package/dist/features/admin/components/AdminCouponsView.d.ts +2 -1
- package/dist/features/admin/components/AdminDashboardView.d.ts +1 -1
- package/dist/features/admin/components/AdminDigitalCodesView.d.ts +2 -1
- package/dist/features/admin/components/AdminEmployeeEditorView.d.ts +2 -1
- package/dist/features/admin/components/AdminFaqEditorView.d.ts +2 -1
- package/dist/features/admin/components/AdminFaqsView.d.ts +2 -1
- package/dist/features/admin/components/AdminFeatureEditorView.d.ts +2 -1
- package/dist/features/admin/components/AdminFeatureFlagsView.d.ts +1 -1
- package/dist/features/admin/components/AdminFeaturesView.d.ts +2 -1
- package/dist/features/admin/components/AdminFilterBar.d.ts +1 -1
- package/dist/features/admin/components/AdminFulfillmentView.d.ts +2 -1
- package/dist/features/admin/components/AdminGroupedListingsView.d.ts +2 -1
- package/dist/features/admin/components/AdminGuideHubView.d.ts +2 -1
- package/dist/features/admin/components/AdminHistoryView.d.ts +2 -1
- package/dist/features/admin/components/AdminLiveView.d.ts +2 -1
- package/dist/features/admin/components/AdminMediaView.d.ts +1 -1
- package/dist/features/admin/components/AdminNavEditorView.d.ts +2 -1
- package/dist/features/admin/components/AdminNavigationView.d.ts +2 -1
- package/dist/features/admin/components/AdminNewsletterView.d.ts +2 -1
- package/dist/features/admin/components/AdminNotificationsView.d.ts +2 -1
- package/dist/features/admin/components/AdminOrderEditorView.d.ts +2 -1
- package/dist/features/admin/components/AdminOrdersGuideView.d.ts +2 -1
- package/dist/features/admin/components/AdminOrdersView.d.ts +2 -1
- package/dist/features/admin/components/AdminPageHeader.d.ts +1 -1
- package/dist/features/admin/components/AdminPaymentClustersView.d.ts +1 -1
- package/dist/features/admin/components/AdminPaymentMethodsView.d.ts +1 -1
- package/dist/features/admin/components/AdminPayoutsView.d.ts +2 -1
- package/dist/features/admin/components/AdminPrizeDrawsView.d.ts +2 -1
- package/dist/features/admin/components/AdminProductEditorView.d.ts +2 -1
- package/dist/features/admin/components/AdminProductsView.d.ts +2 -1
- package/dist/features/admin/components/AdminReturnRequestsView.d.ts +1 -1
- package/dist/features/admin/components/AdminReviewsView.d.ts +2 -1
- package/dist/features/admin/components/AdminScammerEditorView.d.ts +2 -1
- package/dist/features/admin/components/AdminScammersView.d.ts +2 -1
- package/dist/features/admin/components/AdminSectionsView.d.ts +1 -1
- package/dist/features/admin/components/AdminSessionsManager.d.ts +1 -1
- package/dist/features/admin/components/AdminSessionsView.d.ts +2 -1
- package/dist/features/admin/components/AdminSidebar.d.ts +1 -1
- package/dist/features/admin/components/AdminSiteConfigGuideView.d.ts +2 -1
- package/dist/features/admin/components/AdminSiteConfigGuideView.js +1 -1
- package/dist/features/admin/components/AdminSiteSettingsView.d.ts +2 -1
- package/dist/features/admin/components/AdminSiteSettingsView.js +14 -9
- package/dist/features/admin/components/AdminSiteView.d.ts +1 -1
- package/dist/features/admin/components/AdminStickersView.d.ts +4 -0
- package/dist/features/admin/components/AdminStickersView.js +45 -0
- package/dist/features/admin/components/AdminStoreAddressesView.d.ts +1 -1
- package/dist/features/admin/components/AdminStoreEditorView.d.ts +2 -1
- package/dist/features/admin/components/AdminStoresGuideView.d.ts +2 -1
- package/dist/features/admin/components/AdminStoresView.d.ts +2 -1
- package/dist/features/admin/components/AdminSublistingCategoriesView.d.ts +2 -1
- package/dist/features/admin/components/AdminSublistingCategoryEditorView.d.ts +2 -1
- package/dist/features/admin/components/AdminSupportTicketDetailView.d.ts +2 -1
- package/dist/features/admin/components/AdminSupportTicketsView.d.ts +2 -1
- package/dist/features/admin/components/AdminTeamGuideView.d.ts +2 -1
- package/dist/features/admin/components/AdminTeamView.d.ts +2 -1
- package/dist/features/admin/components/AdminTopBar.d.ts +1 -1
- package/dist/features/admin/components/AdminTrustGuideView.d.ts +2 -1
- package/dist/features/admin/components/AdminUserEditorView.d.ts +2 -1
- package/dist/features/admin/components/AdminUsersGuideView.d.ts +2 -1
- package/dist/features/admin/components/AdminUsersView.d.ts +2 -1
- package/dist/features/admin/components/AdminViewCards.d.ts +2 -1
- package/dist/features/admin/components/AdminWishlistsView.d.ts +2 -1
- package/dist/features/admin/components/BrandQuickCreateForm.d.ts +2 -1
- package/dist/features/admin/components/CategoryQuickCreateForm.d.ts +2 -1
- package/dist/features/admin/components/DashboardStats.d.ts +1 -1
- package/dist/features/admin/components/DataListingView.d.ts +1 -1
- package/dist/features/admin/components/DataTable.d.ts +1 -1
- package/dist/features/admin/components/DemoSeedView.d.ts +1 -1
- package/dist/features/admin/components/DrawerFormFooter.d.ts +1 -1
- package/dist/features/admin/components/QuickActionsPanel.d.ts +1 -1
- package/dist/features/admin/components/QuickEditMenu.d.ts +1 -1
- package/dist/features/admin/components/analytics/AdminAnalyticsCharts.d.ts +3 -2
- package/dist/features/admin/components/analytics/AdminStatCard.d.ts +1 -1
- package/dist/features/admin/components/analytics/AdminTopProductsTable.d.ts +1 -1
- package/dist/features/admin/components/index.d.ts +6 -0
- package/dist/features/admin/components/index.js +4 -0
- package/dist/features/admin/schemas/firestore.d.ts +19 -11
- package/dist/features/admin/schemas/firestore.js +12 -2
- package/dist/features/auctions/components/AuctionBidsTable.d.ts +1 -1
- package/dist/features/auctions/components/AuctionDetailPageView.d.ts +1 -1
- package/dist/features/auctions/components/AuctionFilters.d.ts +1 -1
- package/dist/features/auctions/components/AuctionsListView.d.ts +1 -1
- package/dist/features/auctions/components/CollapsibleBidHistory.d.ts +2 -1
- package/dist/features/auctions/components/MarketplaceAuctionCard.d.ts +4 -3
- package/dist/features/auctions/components/MarketplaceAuctionGrid.d.ts +1 -1
- package/dist/features/auctions/components/PlaceBidFormClient.d.ts +3 -2
- package/dist/features/auth/components/AuthStatusPanel.d.ts +1 -1
- package/dist/features/auth/components/ForgotPasswordView.d.ts +1 -1
- package/dist/features/auth/components/Guards.d.ts +2 -2
- package/dist/features/auth/components/LoginForm.d.ts +1 -1
- package/dist/features/auth/components/OAuthLoadingView.d.ts +1 -1
- package/dist/features/auth/components/RegisterForm.d.ts +1 -1
- package/dist/features/auth/components/ResetPasswordView.d.ts +1 -1
- package/dist/features/auth/components/SocialAuthButtons.d.ts +1 -1
- package/dist/features/auth/components/VerifyEmailView.d.ts +1 -1
- package/dist/features/auth/hooks/useAuth.js +35 -9
- package/dist/features/auth/schemas/firestore.d.ts +2 -6
- package/dist/features/before-after/components/BeforeAfterGallery.d.ts +1 -1
- package/dist/features/before-after/components/BeforeAfterSlider.d.ts +2 -1
- package/dist/features/blog/components/BlogFeaturedCard.d.ts +2 -1
- package/dist/features/blog/components/BlogFilters.d.ts +1 -1
- package/dist/features/blog/components/BlogIndexListing.d.ts +2 -1
- package/dist/features/blog/components/BlogIndexPageView.d.ts +2 -1
- package/dist/features/blog/components/BlogListView.d.ts +4 -3
- package/dist/features/blog/components/BlogPostForm.d.ts +1 -1
- package/dist/features/blog/components/BlogPostView.d.ts +1 -1
- package/dist/features/cart/components/CartDrawer.d.ts +2 -2
- package/dist/features/cart/components/CartSummary.d.ts +1 -1
- package/dist/features/cart/components/CartView.d.ts +1 -1
- package/dist/features/cart/components/CheckoutAddressStep.d.ts +1 -1
- package/dist/features/cart/components/CheckoutOtpModal.d.ts +1 -1
- package/dist/features/cart/components/CheckoutSuccessView.d.ts +1 -1
- package/dist/features/cart/components/CheckoutView.d.ts +1 -1
- package/dist/features/cart/components/ShippingPicker.d.ts +9 -1
- package/dist/features/cart/schemas/firestore.d.ts +3 -2
- package/dist/features/categories/components/BrandDetailPageView.d.ts +2 -1
- package/dist/features/categories/components/BrandDetailTabs.d.ts +2 -1
- package/dist/features/categories/components/BreadcrumbTrail.d.ts +2 -1
- package/dist/features/categories/components/BundleBuyNowCta.d.ts +9 -1
- package/dist/features/categories/components/BundleCollage.d.ts +10 -1
- package/dist/features/categories/components/BundleDetailView.d.ts +2 -1
- package/dist/features/categories/components/BundleDynamicRuleEditor.d.ts +15 -1
- package/dist/features/categories/components/BundleItemsPicker.d.ts +15 -1
- package/dist/features/categories/components/BundlesListView.d.ts +2 -1
- package/dist/features/categories/components/CategoriesIndexListing.d.ts +2 -1
- package/dist/features/categories/components/CategoriesIndexPageView.d.ts +2 -1
- package/dist/features/categories/components/CategoryBundlesListing.d.ts +2 -1
- package/dist/features/categories/components/CategoryDetailPageView.d.ts +2 -1
- package/dist/features/categories/components/CategoryDetailTabs.d.ts +2 -1
- package/dist/features/categories/components/CategoryFilters.d.ts +1 -1
- package/dist/features/categories/components/CategoryForm.d.ts +1 -1
- package/dist/features/categories/components/CategoryGrid.d.ts +3 -2
- package/dist/features/categories/components/CategoryProductsListing.d.ts +2 -1
- package/dist/features/categories/components/CategoryProductsView.d.ts +1 -1
- package/dist/features/categories/components/CategorySelectorCreate.d.ts +1 -1
- package/dist/features/categories/components/CategorySortSelect.d.ts +1 -1
- package/dist/features/categories/components/CategoryStoresListing.d.ts +2 -1
- package/dist/features/categories/components/CategoryTableColumns.d.ts +3 -3
- package/dist/features/categories/components/CategoryTree.d.ts +1 -1
- package/dist/features/categories/components/ConcernCard.d.ts +1 -1
- package/dist/features/categories/components/ConcernGrid.d.ts +1 -1
- package/dist/features/checkout/components/CheckoutStepper.d.ts +2 -1
- package/dist/features/classified/components/ClassifiedFilters.d.ts +1 -1
- package/dist/features/classified/components/ClassifiedIndexListing.d.ts +2 -1
- package/dist/features/classified/components/ClassifiedListView.d.ts +1 -1
- package/dist/features/collections/components/CollectionCard.d.ts +3 -2
- package/dist/features/consultation/components/ConsultationForm.d.ts +2 -1
- package/dist/features/consultation/schemas/index.d.ts +2 -2
- package/dist/features/contact/components/ContactForm.d.ts +2 -1
- package/dist/features/contact/components/ContactInfoSidebar.d.ts +1 -1
- package/dist/features/contact/components/ContactPageView.d.ts +2 -1
- package/dist/features/copilot/components/AdminCopilotView.d.ts +1 -1
- package/dist/features/corporate/components/CorporateInquiryForm.d.ts +2 -1
- package/dist/features/digital-codes/components/DigitalCodeFilters.d.ts +1 -1
- package/dist/features/digital-codes/components/DigitalCodesIndexListing.d.ts +2 -1
- package/dist/features/digital-codes/components/DigitalCodesListView.d.ts +1 -1
- package/dist/features/email/primitives.d.ts +11 -11
- package/dist/features/events/components/AdminEventEditorView.d.ts +2 -1
- package/dist/features/events/components/AdminEventEntriesView.d.ts +1 -1
- package/dist/features/events/components/AdminEventsView.d.ts +2 -1
- package/dist/features/events/components/EventBanner.d.ts +2 -1
- package/dist/features/events/components/EventCard.d.ts +1 -1
- package/dist/features/events/components/EventDetailView.d.ts +1 -1
- package/dist/features/events/components/EventFilters.d.ts +1 -1
- package/dist/features/events/components/EventFormDrawer.d.ts +1 -1
- package/dist/features/events/components/EventLeaderboard.d.ts +1 -1
- package/dist/features/events/components/EventOfferCard.d.ts +2 -1
- package/dist/features/events/components/EventParticipateView.d.ts +1 -1
- package/dist/features/events/components/EventPollWidget.d.ts +1 -1
- package/dist/features/events/components/EventRaffleEntryForm.d.ts +2 -1
- package/dist/features/events/components/EventRaffleWinnerView.d.ts +1 -1
- package/dist/features/events/components/EventRafflesSection.d.ts +1 -1
- package/dist/features/events/components/EventSaleBanner.d.ts +2 -1
- package/dist/features/events/components/EventStatusBadge.d.ts +1 -1
- package/dist/features/events/components/EventsIndexListing.d.ts +2 -1
- package/dist/features/events/components/EventsListPageView.d.ts +2 -1
- package/dist/features/events/components/EventsListView.d.ts +2 -1
- package/dist/features/events/components/SpinWheelView.d.ts +1 -1
- package/dist/features/faq/components/ContactCTA.d.ts +1 -1
- package/dist/features/faq/components/FAQAccordion.d.ts +2 -2
- package/dist/features/faq/components/FAQCategorySidebar.d.ts +1 -1
- package/dist/features/faq/components/FAQHelpfulButtons.d.ts +1 -1
- package/dist/features/faq/components/FAQPageContent.d.ts +1 -1
- package/dist/features/faq/components/FAQSortDropdown.d.ts +1 -1
- package/dist/features/faq/components/RelatedFAQs.d.ts +1 -1
- package/dist/features/filters/AsyncFacetSection.d.ts +2 -1
- package/dist/features/filters/FilterFacetSection.d.ts +1 -1
- package/dist/features/filters/FilterPanel.d.ts +1 -1
- package/dist/features/filters/RangeFilter.d.ts +1 -1
- package/dist/features/filters/SwitchFilter.d.ts +1 -1
- package/dist/features/forms/Checkbox.d.ts +1 -1
- package/dist/features/forms/Radio.d.ts +2 -1
- package/dist/features/forms/Select.d.ts +1 -1
- package/dist/features/forms/Slider.d.ts +2 -1
- package/dist/features/forms/Toggle.d.ts +2 -1
- package/dist/features/homepage/components/AdSlot.d.ts +1 -1
- package/dist/features/homepage/components/AdvertisementBanner.d.ts +2 -1
- package/dist/features/homepage/components/AnnouncementBar.d.ts +2 -1
- package/dist/features/homepage/components/BeforeAfterCard.d.ts +1 -1
- package/dist/features/homepage/components/BlogArticlesSection.d.ts +2 -1
- package/dist/features/homepage/components/BrandsSection.d.ts +1 -1
- package/dist/features/homepage/components/CTABannerSection.d.ts +2 -1
- package/dist/features/homepage/components/CharacterHotspot.d.ts +1 -1
- package/dist/features/homepage/components/CharacterHotspotForm.d.ts +2 -1
- package/dist/features/homepage/components/CollectionCardsSection.d.ts +1 -1
- package/dist/features/homepage/components/CustomCardsSection.d.ts +2 -1
- package/dist/features/homepage/components/CustomerReviewsSection.d.ts +1 -1
- package/dist/features/homepage/components/EventsSection.d.ts +2 -1
- package/dist/features/homepage/components/FAQSection.d.ts +2 -1
- package/dist/features/homepage/components/FeaturedAuctionsSection.d.ts +2 -1
- package/dist/features/homepage/components/FeaturedBundlesSection.d.ts +2 -1
- package/dist/features/homepage/components/FeaturedPreOrdersSection.d.ts +2 -1
- package/dist/features/homepage/components/FeaturedProductsSection.d.ts +1 -1
- package/dist/features/homepage/components/FeaturedResultsSection.d.ts +1 -1
- package/dist/features/homepage/components/FeaturedStoresSection.d.ts +2 -1
- package/dist/features/homepage/components/GoogleReviewsSection.d.ts +2 -1
- package/dist/features/homepage/components/HeroBanner.d.ts +1 -1
- package/dist/features/homepage/components/HeroCarousel.d.ts +2 -1
- package/dist/features/homepage/components/HeroSection.d.ts +1 -1
- package/dist/features/homepage/components/HomepageCustomerReviewsSection.d.ts +2 -1
- package/dist/features/homepage/components/HomepageSkeleton.d.ts +1 -1
- package/dist/features/homepage/components/HomepageView.d.ts +1 -1
- package/dist/features/homepage/components/HowItWorksInfoView.d.ts +1 -1
- package/dist/features/homepage/components/HowItWorksSection.d.ts +1 -1
- package/dist/features/homepage/components/MarketplaceHomepageView.d.ts +1 -1
- package/dist/features/homepage/components/NewsletterBanner.d.ts +2 -1
- package/dist/features/homepage/components/NewsletterSection.d.ts +1 -1
- package/dist/features/homepage/components/PromoGrid.d.ts +1 -1
- package/dist/features/homepage/components/SectionCarousel.d.ts +1 -1
- package/dist/features/homepage/components/SecurityHighlightsSection.d.ts +1 -1
- package/dist/features/homepage/components/ShopByCategorySection.d.ts +1 -1
- package/dist/features/homepage/components/SiteFeaturesSection.d.ts +2 -1
- package/dist/features/homepage/components/SocialFeedSection.d.ts +1 -1
- package/dist/features/homepage/components/SocialPostCard.d.ts +1 -1
- package/dist/features/homepage/components/StatsCounterSection.d.ts +1 -1
- package/dist/features/homepage/components/TestimonialsCarousel.d.ts +1 -1
- package/dist/features/homepage/components/TrustBadges.d.ts +2 -1
- package/dist/features/homepage/components/TrustFeaturesSection.d.ts +1 -1
- package/dist/features/homepage/components/TrustIndicatorsSection.d.ts +2 -1
- package/dist/features/homepage/components/WelcomeSection.d.ts +2 -1
- package/dist/features/homepage/components/WhatsAppCommunitySection.d.ts +2 -1
- package/dist/features/layout/AppLayoutShell.d.ts +1 -1
- package/dist/features/layout/AutoBreadcrumbs.d.ts +1 -1
- package/dist/features/layout/BackToTop.d.ts +2 -2
- package/dist/features/layout/BottomActions.d.ts +1 -1
- package/dist/features/layout/BottomActionsContext.d.ts +1 -1
- package/dist/features/layout/BottomNavItem.d.ts +1 -1
- package/dist/features/layout/BottomNavLayout.d.ts +1 -1
- package/dist/features/layout/BottomNavbar.d.ts +1 -1
- package/dist/features/layout/BottomSheet.d.ts +1 -1
- package/dist/features/layout/Breadcrumbs.d.ts +2 -2
- package/dist/features/layout/DashboardNavContext.d.ts +1 -1
- package/dist/features/layout/FooterLayout.d.ts +1 -1
- package/dist/features/layout/LayoutClient.d.ts +1 -1
- package/dist/features/layout/LocaleSwitcher.d.ts +1 -1
- package/dist/features/layout/MainNavbar.d.ts +1 -1
- package/dist/features/layout/NavItem.d.ts +1 -1
- package/dist/features/layout/NavbarLayout.d.ts +1 -1
- package/dist/features/layout/NavbarWithSettings.d.ts +1 -1
- package/dist/features/layout/TitleBar.d.ts +1 -1
- package/dist/features/layout/TitleBarLayout.d.ts +1 -1
- package/dist/features/live/components/LiveItemFilters.d.ts +1 -1
- package/dist/features/live/components/LiveItemsIndexListing.d.ts +2 -1
- package/dist/features/live/components/LiveItemsListView.d.ts +1 -1
- package/dist/features/loyalty/components/CoinsDisplay.d.ts +3 -2
- package/dist/features/loyalty/schemas/index.d.ts +6 -6
- package/dist/features/media/AvatarUpload.d.ts +2 -1
- package/dist/features/media/MediaAudio.d.ts +1 -1
- package/dist/features/media/MediaAvatar.d.ts +1 -1
- package/dist/features/media/MediaImage.d.ts +1 -1
- package/dist/features/media/MediaLightbox.d.ts +2 -1
- package/dist/features/media/MediaPickerModal.d.ts +2 -1
- package/dist/features/media/MediaVideo.d.ts +1 -1
- package/dist/features/media/components/MediaSlider.d.ts +2 -1
- package/dist/features/media/modals/ImageCropModal.d.ts +8 -1
- package/dist/features/media/modals/ImageEditor.d.ts +8 -1
- package/dist/features/media/modals/VideoThumbnailSelector.d.ts +1 -1
- package/dist/features/media/modals/VideoTrimModal.d.ts +1 -1
- package/dist/features/media/upload/CameraCapture.d.ts +1 -1
- package/dist/features/media/upload/ImageUpload.d.ts +1 -1
- package/dist/features/media/upload/MediaUploadField.d.ts +1 -1
- package/dist/features/media/upload/MediaUploadList.d.ts +1 -1
- package/dist/features/orders/components/MarketplaceOrderCard.d.ts +1 -1
- package/dist/features/orders/components/OrderFilters.d.ts +1 -1
- package/dist/features/orders/components/OrderSiblingPayments.d.ts +10 -1
- package/dist/features/orders/components/OrdersList.d.ts +2 -2
- package/dist/features/orders/components/RefundHistoryTable.d.ts +2 -1
- package/dist/features/orders/components/RefundRequestView.d.ts +13 -1
- package/dist/features/orders/repository/orders.repository.d.ts +20 -2
- package/dist/features/orders/repository/orders.repository.js +34 -5
- package/dist/features/orders/schemas/firestore.d.ts +33 -7
- package/dist/features/orders/schemas/firestore.js +1 -1
- package/dist/features/orders/schemas/index.d.ts +176 -31
- package/dist/features/orders/schemas/index.js +20 -6
- package/dist/features/orders/types/index.d.ts +3 -3
- package/dist/features/payments/repository/payout.repository.js +2 -2
- package/dist/features/payments/schemas/firestore.d.ts +3 -3
- package/dist/features/payments/schemas/firestore.js +2 -2
- package/dist/features/payments/schemas/index.d.ts +5 -5
- package/dist/features/payments/schemas/index.js +2 -2
- package/dist/features/pre-orders/components/MarketplacePreorderCard.d.ts +1 -1
- package/dist/features/pre-orders/components/PreOrderActionsClient.d.ts +2 -1
- package/dist/features/pre-orders/components/PreOrderBadge.d.ts +2 -2
- package/dist/features/pre-orders/components/PreOrderDetailPageView.d.ts +1 -1
- package/dist/features/pre-orders/components/PreOrderFilters.d.ts +1 -1
- package/dist/features/pre-orders/components/PreOrdersIndexListing.d.ts +2 -1
- package/dist/features/pre-orders/components/PreOrdersListView.d.ts +1 -1
- package/dist/features/pre-orders/components/PreorderCard.d.ts +2 -1
- package/dist/features/products/api/[id]/route.js +4 -1
- package/dist/features/products/api/route.js +4 -1
- package/dist/features/products/columns/productTableColumns.d.ts +2 -1
- package/dist/features/products/components/AuctionDetailView.d.ts +1 -1
- package/dist/features/products/components/AuctionsIndexListing.d.ts +2 -1
- package/dist/features/products/components/BidHistory.d.ts +1 -1
- package/dist/features/products/components/CompareOverlay.d.ts +1 -1
- package/dist/features/products/components/CompareOverlay.js +7 -9
- package/dist/features/products/components/CustomFieldsEditor.d.ts +2 -1
- package/dist/features/products/components/CustomSectionTabContent.d.ts +2 -1
- package/dist/features/products/components/CustomSectionsEditor.d.ts +2 -1
- package/dist/features/products/components/FeatureBadge.d.ts +2 -2
- package/dist/features/products/components/GroupSettingsPanel.d.ts +2 -1
- package/dist/features/products/components/InteractiveProductCard.d.ts +2 -1
- package/dist/features/products/components/MakeOfferButton.d.ts +2 -1
- package/dist/features/products/components/MakeOfferForm.d.ts +1 -1
- package/dist/features/products/components/MarketplaceBundleCard.d.ts +1 -1
- package/dist/features/products/components/MarketplacePrizeDrawCard.d.ts +1 -1
- package/dist/features/products/components/NonRefundableConsentModal.d.ts +14 -1
- package/dist/features/products/components/PlaceBidForm.d.ts +1 -1
- package/dist/features/products/components/PreOrderDetailView.d.ts +1 -1
- package/dist/features/products/components/PrizeDrawCollage.d.ts +2 -1
- package/dist/features/products/components/PrizeDrawDetailPageView.d.ts +1 -1
- package/dist/features/products/components/PrizeDrawEntryActions.d.ts +1 -1
- package/dist/features/products/components/PrizeDrawItemsEditor.d.ts +1 -1
- package/dist/features/products/components/PrizeDrawsIndexListing.d.ts +1 -1
- package/dist/features/products/components/PrizeDrawsListingView.d.ts +1 -1
- package/dist/features/products/components/PrizeDrawsSection.d.ts +1 -1
- package/dist/features/products/components/PrizeRevealModal.d.ts +1 -1
- package/dist/features/products/components/ProductCardMetadataSection.d.ts +2 -1
- package/dist/features/products/components/ProductDetailActions.d.ts +1 -1
- package/dist/features/products/components/ProductDetailPageView.d.ts +3 -1
- package/dist/features/products/components/ProductDetailPageView.js +2 -2
- package/dist/features/products/components/ProductDetailView.d.ts +1 -1
- package/dist/features/products/components/ProductFeatureBadges.d.ts +1 -1
- package/dist/features/products/components/ProductFeaturesContext.d.ts +1 -1
- package/dist/features/products/components/ProductFeaturesSelector.d.ts +2 -1
- package/dist/features/products/components/ProductFilters.d.ts +1 -1
- package/dist/features/products/components/ProductForm.d.ts +1 -1
- package/dist/features/products/components/ProductForm.js +18 -7
- package/dist/features/products/components/ProductGalleryClient.d.ts +2 -1
- package/dist/features/products/components/ProductGradingTab.d.ts +2 -1
- package/dist/features/products/components/ProductGrid.d.ts +2 -2
- package/dist/features/products/components/ProductGrid.js +7 -12
- package/dist/features/products/components/ProductInfo.d.ts +1 -1
- package/dist/features/products/components/ProductTabs.d.ts +1 -1
- package/dist/features/products/components/ProductTabsShell.d.ts +1 -1
- package/dist/features/products/components/ProductsIndexListing.d.ts +2 -1
- package/dist/features/products/components/ProductsIndexPageView.d.ts +2 -1
- package/dist/features/products/components/ProductsView.d.ts +1 -1
- package/dist/features/products/components/RelatedProducts.d.ts +1 -1
- package/dist/features/products/components/RelatedProductsCarousel.d.ts +2 -1
- package/dist/features/products/components/ShareButton.d.ts +1 -1
- package/dist/features/products/components/ShowGroupSection.d.ts +2 -1
- package/dist/features/products/components/ShowGroupSection.js +3 -5
- package/dist/features/products/components/SublistingCarouselSection.d.ts +2 -1
- package/dist/features/products/components/SublistingCarouselSection.js +3 -6
- package/dist/features/products/components/SublistingCategorySelect.d.ts +2 -1
- package/dist/features/products/constants/listing-tabs.d.ts +32 -0
- package/dist/features/products/constants/listing-tabs.js +8 -0
- package/dist/features/products/index.d.ts +1 -1
- package/dist/features/products/index.js +3 -1
- package/dist/features/products/schemas/firestore.d.ts +20 -1
- package/dist/features/products/schemas/firestore.js +2 -0
- package/dist/features/products/schemas/index.d.ts +48 -0
- package/dist/features/products/schemas/index.js +9 -0
- package/dist/features/products/schemas/product-features.d.ts +1 -1
- package/dist/features/products/types/index.d.ts +5 -3
- package/dist/features/products/utils/listing-type.d.ts +6 -0
- package/dist/features/products/utils/listing-type.js +3 -0
- package/dist/features/promotions/components/CouponCard.d.ts +1 -1
- package/dist/features/promotions/components/CouponsIndexListing.d.ts +2 -1
- package/dist/features/promotions/components/PromotionsView.d.ts +3 -3
- package/dist/features/reviews/api/[id]/route.js +5 -4
- package/dist/features/reviews/components/ReviewDetailPageView.d.ts +2 -1
- package/dist/features/reviews/components/ReviewDetailShell.d.ts +2 -1
- package/dist/features/reviews/components/ReviewFilters.d.ts +1 -1
- package/dist/features/reviews/components/ReviewModal.d.ts +1 -1
- package/dist/features/reviews/components/ReviewSummary.d.ts +2 -1
- package/dist/features/reviews/components/ReviewsIndexListing.d.ts +2 -1
- package/dist/features/reviews/components/ReviewsIndexPageView.d.ts +2 -1
- package/dist/features/reviews/components/ReviewsList.d.ts +3 -2
- package/dist/features/scams/components/ScamAwarenessModal.d.ts +2 -1
- package/dist/features/scams/components/ScamProfileView.d.ts +2 -1
- package/dist/features/scams/components/ScamRegistryView.d.ts +2 -1
- package/dist/features/search/components/Search.d.ts +2 -1
- package/dist/features/search/components/SearchFiltersRow.d.ts +1 -1
- package/dist/features/search/components/SearchResultsSection.d.ts +1 -1
- package/dist/features/search/components/SearchView.d.ts +1 -1
- package/dist/features/seller/actions/seller-actions.d.ts +29 -14
- package/dist/features/seller/actions/seller-actions.js +101 -27
- package/dist/features/seller/components/BarcodeField.d.ts +2 -1
- package/dist/features/seller/components/BrandInlineSelect.d.ts +2 -1
- package/dist/features/seller/components/CategoryInlineSelect.d.ts +2 -1
- package/dist/features/seller/components/CouponInlineSelect.d.ts +2 -1
- package/dist/features/seller/components/FulfillmentView.d.ts +2 -1
- package/dist/features/seller/components/GroupInlineSelect.d.ts +2 -1
- package/dist/features/seller/components/PhysicalLocationModal.d.ts +2 -1
- package/dist/features/seller/components/PrintCenterView.d.ts +2 -1
- package/dist/features/seller/components/ProductInlineSelect.d.ts +2 -1
- package/dist/features/seller/components/QuickProductForm.d.ts +2 -1
- package/dist/features/seller/components/SellerAddressesView.d.ts +2 -1
- package/dist/features/seller/components/SellerAnalyticsAlertsView.d.ts +2 -1
- package/dist/features/seller/components/SellerAnalyticsView.d.ts +1 -1
- package/dist/features/seller/components/SellerArtView.d.ts +8 -0
- package/dist/features/seller/components/SellerArtView.js +114 -0
- package/dist/features/seller/components/SellerAuctionsView.d.ts +1 -1
- package/dist/features/seller/components/SellerBidsView.d.ts +2 -1
- package/dist/features/seller/components/SellerBundlesView.d.ts +2 -1
- package/dist/features/seller/components/SellerClassifiedView.d.ts +2 -1
- package/dist/features/seller/components/SellerCouponEditorView.d.ts +1 -1
- package/dist/features/seller/components/SellerCouponsView.d.ts +2 -1
- package/dist/features/seller/components/SellerCreateProductView.d.ts +1 -1
- package/dist/features/seller/components/SellerDashboardView.d.ts +1 -1
- package/dist/features/seller/components/SellerDigitalCodesView.d.ts +2 -1
- package/dist/features/seller/components/SellerEditProductView.d.ts +1 -1
- package/dist/features/seller/components/SellerFeaturesView.d.ts +2 -1
- package/dist/features/seller/components/SellerGoogleReviewsView.d.ts +2 -1
- package/dist/features/seller/components/SellerGroupedListingsView.d.ts +2 -1
- package/dist/features/seller/components/SellerGuideView.d.ts +1 -1
- package/dist/features/seller/components/SellerLiveView.d.ts +2 -1
- package/dist/features/seller/components/SellerOffersPanel.d.ts +2 -1
- package/dist/features/seller/components/SellerOffersView.d.ts +2 -1
- package/dist/features/seller/components/SellerOrdersView.d.ts +2 -1
- package/dist/features/seller/components/SellerOrdersView.js +38 -1
- package/dist/features/seller/components/SellerPayoutHistoryTable.d.ts +1 -1
- package/dist/features/seller/components/SellerPayoutMethodsView.d.ts +2 -1
- package/dist/features/seller/components/SellerPayoutRequestView.d.ts +1 -1
- package/dist/features/seller/components/SellerPayoutSettingsView.d.ts +1 -1
- package/dist/features/seller/components/SellerPayoutSettingsView.js +4 -1
- package/dist/features/seller/components/SellerPayoutStats.d.ts +1 -1
- package/dist/features/seller/components/SellerPayoutsView.d.ts +2 -1
- package/dist/features/seller/components/SellerPreOrdersView.d.ts +2 -1
- package/dist/features/seller/components/SellerPrizeDrawsView.d.ts +2 -1
- package/dist/features/seller/components/SellerProductShell.d.ts +6 -2
- package/dist/features/seller/components/SellerProductShell.js +69 -59
- package/dist/features/seller/components/SellerProductsCards.d.ts +2 -1
- package/dist/features/seller/components/SellerProductsFilterDrawer.d.ts +2 -1
- package/dist/features/seller/components/SellerProductsView.d.ts +2 -1
- package/dist/features/seller/components/SellerReviewsView.d.ts +1 -1
- package/dist/features/seller/components/SellerShippingConfigsView.d.ts +2 -1
- package/dist/features/seller/components/SellerShippingView.d.ts +1 -1
- package/dist/features/seller/components/SellerShippingView.js +6 -25
- package/dist/features/seller/components/SellerSidebar.d.ts +1 -1
- package/dist/features/seller/components/SellerStickersView.d.ts +8 -0
- package/dist/features/seller/components/SellerStickersView.js +114 -0
- package/dist/features/seller/components/SellerStoreCategoriesView.d.ts +2 -1
- package/dist/features/seller/components/SellerStoreSetupView.d.ts +1 -1
- package/dist/features/seller/components/SellerStoreView.d.ts +1 -1
- package/dist/features/seller/components/SellerStorefrontView.d.ts +1 -1
- package/dist/features/seller/components/SellerTemplatesView.d.ts +2 -1
- package/dist/features/seller/components/SellersListView.d.ts +2 -1
- package/dist/features/seller/components/SublistingInlineSelect.d.ts +2 -1
- package/dist/features/seller/components/analytics/SellerAnalyticsStats.d.ts +2 -1
- package/dist/features/seller/components/analytics/SellerRevenueChart.d.ts +2 -1
- package/dist/features/seller/components/analytics/SellerTopProducts.d.ts +1 -1
- package/dist/features/seller/components/index.d.ts +4 -0
- package/dist/features/seller/components/index.js +2 -0
- package/dist/features/seller/messages/en.json +1 -1
- package/dist/features/seller/schemas/index.d.ts +7 -7
- package/dist/features/seller/schemas/index.js +1 -1
- package/dist/features/seller/types/index.d.ts +1 -1
- package/dist/features/shell/FormShell.d.ts +1 -1
- package/dist/features/shell/QuickFormDrawer.d.ts +1 -1
- package/dist/features/shell/StepForm.d.ts +3 -3
- package/dist/features/shell/field-groups/ImageFieldGroup.d.ts +2 -2
- package/dist/features/shell/field-groups/SeoFieldGroup.d.ts +2 -2
- package/dist/features/shell/field-groups/StatusFieldGroup.d.ts +2 -2
- package/dist/features/shell/field-groups/TitleDescriptionGroup.d.ts +2 -2
- package/dist/features/site-settings/components/ActionPermissionsManager.d.ts +2 -1
- package/dist/features/site-settings/components/NavPermissionsManager.d.ts +2 -1
- package/dist/features/site-settings/components/ThemeManagerView.d.ts +15 -1
- package/dist/features/stores/components/InteractiveStoreCard.d.ts +1 -1
- package/dist/features/stores/components/StoreAboutView.d.ts +1 -1
- package/dist/features/stores/components/StoreAddressSelectorCreate.d.ts +1 -1
- package/dist/features/stores/components/StoreAuctionsListing.d.ts +2 -1
- package/dist/features/stores/components/StoreAuctionsPageView.d.ts +2 -1
- package/dist/features/stores/components/StoreAuctionsView.d.ts +1 -1
- package/dist/features/stores/components/StoreBundlesPageView.d.ts +2 -1
- package/dist/features/stores/components/StoreCapabilitiesGuideView.d.ts +2 -1
- package/dist/features/stores/components/StoreClassifiedsListing.d.ts +2 -1
- package/dist/features/stores/components/StoreClassifiedsPageView.d.ts +2 -1
- package/dist/features/stores/components/StoreDetailLayoutView.d.ts +2 -1
- package/dist/features/stores/components/StoreDetailLayoutView.js +18 -2
- package/dist/features/stores/components/StoreDigitalCodesListing.d.ts +2 -1
- package/dist/features/stores/components/StoreDigitalCodesPageView.d.ts +2 -1
- package/dist/features/stores/components/StoreFilters.d.ts +1 -1
- package/dist/features/stores/components/StoreFinanceGuideView.d.ts +2 -1
- package/dist/features/stores/components/StoreGuideHubView.d.ts +2 -1
- package/dist/features/stores/components/StoreHeader.d.ts +1 -1
- package/dist/features/stores/components/StoreListingsGuideView.d.ts +2 -1
- package/dist/features/stores/components/StoreLiveItemsListing.d.ts +2 -1
- package/dist/features/stores/components/StoreLiveItemsPageView.d.ts +2 -1
- package/dist/features/stores/components/StoreNavTabs.d.ts +1 -1
- package/dist/features/stores/components/StoreOrdersGuideView.d.ts +2 -1
- package/dist/features/stores/components/StorePreOrdersListing.d.ts +2 -1
- package/dist/features/stores/components/StorePreOrdersPageView.d.ts +2 -1
- package/dist/features/stores/components/StorePrizeDrawsPageView.d.ts +2 -1
- package/dist/features/stores/components/StoreProductsListing.d.ts +2 -1
- package/dist/features/stores/components/StoreProductsPageView.d.ts +2 -1
- package/dist/features/stores/components/StoreProductsView.d.ts +1 -1
- package/dist/features/stores/components/StoreReviewsListing.d.ts +2 -1
- package/dist/features/stores/components/StoreReviewsPageView.d.ts +2 -1
- package/dist/features/stores/components/StoreReviewsView.d.ts +1 -1
- package/dist/features/stores/components/StoreScopedSearch.d.ts +2 -1
- package/dist/features/stores/components/StoreSettingsGuideView.d.ts +2 -1
- package/dist/features/stores/components/StoresIndexListing.d.ts +2 -1
- package/dist/features/stores/components/StoresIndexPageView.d.ts +2 -1
- package/dist/features/stores/schemas/firestore.d.ts +7 -1
- package/dist/features/stores/schemas/index.d.ts +19 -16
- package/dist/features/stores/schemas/index.js +1 -1
- package/dist/features/whatsapp-bot/components/SellerWhatsAppSettingsView.d.ts +2 -1
- package/dist/features/whatsapp-bot/components/WhatsAppChatButton.d.ts +2 -1
- package/dist/features/wishlist/components/WishlistPage.d.ts +2 -2
- package/dist/features/wishlist/components/WishlistToggleButton.d.ts +1 -1
- package/dist/features/wishlist/components/WishlistView.d.ts +1 -1
- package/dist/index.d.ts +21 -36
- package/dist/index.js +27 -39
- package/dist/next/ErrorBoundary.d.ts +1 -1
- package/dist/next/components/ErrorView.d.ts +1 -1
- package/dist/next/components/GlobalError.d.ts +1 -1
- package/dist/next/components/NotFoundView.d.ts +1 -1
- package/dist/next/components/UnauthorizedView.d.ts +1 -1
- package/dist/next/routing/route-map.d.ts +22 -0
- package/dist/next/routing/route-map.js +10 -0
- package/dist/providers/payment-manual/index.d.ts +40 -0
- package/dist/providers/payment-manual/index.js +91 -0
- package/dist/providers/payment-razorpay/index.d.ts +4 -2
- package/dist/providers/payment-razorpay/index.js +4 -1
- package/dist/providers/shipping-manual/index.d.ts +22 -0
- package/dist/providers/shipping-manual/index.js +47 -0
- package/dist/providers.d.ts +2 -2
- package/dist/providers.js +5 -3
- package/dist/react/ErrorBoundary.d.ts +1 -1
- package/dist/react/contexts/SessionContext.d.ts +1 -1
- package/dist/schemas/registry.d.ts +129 -70
- package/dist/schemas/registry.js +0 -4
- package/dist/security/pii-encrypt.js +0 -7
- package/dist/security/pii-redact.js +0 -1
- package/dist/seed/conversations-seed-data.js +2 -2
- package/dist/seed/faq-seed-data.js +7 -7
- package/dist/seed/grouped-listings-seed-data.d.ts +2 -0
- package/dist/seed/index.d.ts +2 -0
- package/dist/seed/index.js +2 -0
- package/dist/seed/manifest.js +20 -16
- package/dist/seed/payouts-seed-data.js +5 -5
- package/dist/seed/products-art-seed-data.d.ts +11 -0
- package/dist/seed/products-art-seed-data.js +125 -0
- package/dist/seed/products-preorders-seed-data.d.ts +2 -0
- package/dist/seed/products-stickers-seed-data.d.ts +11 -0
- package/dist/seed/products-stickers-seed-data.js +125 -0
- package/dist/seed/site-settings-seed-data.js +13 -4
- package/dist/seed/stores-seed-data.js +11 -11
- package/dist/server.d.ts +7 -15
- package/dist/server.js +17 -42
- package/dist/ui/DataTable.d.ts +1 -1
- package/dist/ui/components/Accordion.d.ts +2 -2
- package/dist/ui/components/ActiveFilterChips.d.ts +2 -1
- package/dist/ui/components/Alert.d.ts +1 -1
- package/dist/ui/components/Anchor.d.ts +1 -1
- package/dist/ui/components/Avatar.d.ts +2 -2
- package/dist/ui/components/AvatarDisplay.d.ts +2 -1
- package/dist/ui/components/BackgroundRenderer.d.ts +1 -1
- package/dist/ui/components/Badge.d.ts +1 -1
- package/dist/ui/components/BaseListingCard.d.ts +5 -5
- package/dist/ui/components/Breadcrumb.d.ts +1 -1
- package/dist/ui/components/BulkActionBar.d.ts +1 -1
- package/dist/ui/components/Button.d.ts +1 -1
- package/dist/ui/components/Card.d.ts +4 -4
- package/dist/ui/components/Checkbox.d.ts +1 -1
- package/dist/ui/components/ConfirmDeleteModal.d.ts +1 -1
- package/dist/ui/components/CountdownDisplay.d.ts +1 -1
- package/dist/ui/components/DateInput.d.ts +1 -1
- package/dist/ui/components/DescriptionField.d.ts +1 -1
- package/dist/ui/components/DetailPageGallery.d.ts +2 -2
- package/dist/ui/components/DetailPageHero.d.ts +2 -2
- package/dist/ui/components/DetailPageTabs.d.ts +2 -2
- package/dist/ui/components/DetailViewShell.d.ts +2 -2
- package/dist/ui/components/Details.d.ts +2 -2
- package/dist/ui/components/Dialog.d.ts +1 -1
- package/dist/ui/components/Divider.d.ts +1 -1
- package/dist/ui/components/Dropdown.d.ts +5 -5
- package/dist/ui/components/DynamicBgDiv.d.ts +1 -1
- package/dist/ui/components/EmptyState.d.ts +1 -1
- package/dist/ui/components/FallbackShell.d.ts +1 -1
- package/dist/ui/components/Fieldset.d.ts +2 -2
- package/dist/ui/components/FilterChipGroup.d.ts +2 -1
- package/dist/ui/components/FilterDrawer.d.ts +1 -1
- package/dist/ui/components/FlowDiagram.d.ts +1 -1
- package/dist/ui/components/Form.d.ts +4 -4
- package/dist/ui/components/FormActionBar.d.ts +2 -1
- package/dist/ui/components/FormField.d.ts +2 -1
- package/dist/ui/components/FormGrid.d.ts +3 -2
- package/dist/ui/components/HorizontalRule.d.ts +1 -1
- package/dist/ui/components/HorizontalScroller.d.ts +1 -1
- package/dist/ui/components/HotspotMarker.d.ts +1 -1
- package/dist/ui/components/IconBox.d.ts +1 -1
- package/dist/ui/components/IconButton.d.ts +1 -1
- package/dist/ui/components/Iframe.d.ts +1 -1
- package/dist/ui/components/ImageGallery.d.ts +2 -1
- package/dist/ui/components/ItemRow.d.ts +1 -1
- package/dist/ui/components/Kbd.d.ts +1 -1
- package/dist/ui/components/Layout.d.ts +4 -4
- package/dist/ui/components/ListingFilterDrawer.d.ts +1 -1
- package/dist/ui/components/ListingLayout.d.ts +1 -1
- package/dist/ui/components/ListingToolbar.d.ts +1 -1
- package/dist/ui/components/LoginRequiredModal.d.ts +2 -1
- package/dist/ui/components/Menu.d.ts +5 -5
- package/dist/ui/components/Modal.d.ts +1 -1
- package/dist/ui/components/Motion.d.ts +14 -14
- package/dist/ui/components/NavbarChevron.d.ts +1 -1
- package/dist/ui/components/NavigationLoader.d.ts +1 -1
- package/dist/ui/components/OtpInput.d.ts +1 -1
- package/dist/ui/components/PageLoader.d.ts +1 -1
- package/dist/ui/components/PaginatedSelect.d.ts +2 -2
- package/dist/ui/components/Pagination.d.ts +2 -1
- package/dist/ui/components/PasswordStrengthIndicator.d.ts +2 -1
- package/dist/ui/components/PriceDisplay.d.ts +1 -1
- package/dist/ui/components/Progress.d.ts +3 -2
- package/dist/ui/components/ProgressBarFill.d.ts +1 -1
- package/dist/ui/components/Quote.d.ts +1 -1
- package/dist/ui/components/Radio.d.ts +2 -2
- package/dist/ui/components/RatingDisplay.d.ts +1 -1
- package/dist/ui/components/Responsive.d.ts +2 -2
- package/dist/ui/components/ResponsiveView.d.ts +1 -1
- package/dist/ui/components/RichTextEditor.d.ts +2 -1
- package/dist/ui/components/RoleBadge.d.ts +2 -1
- package/dist/ui/components/RowActionMenu.d.ts +1 -1
- package/dist/ui/components/Scrim.d.ts +1 -1
- package/dist/ui/components/Select.d.ts +1 -1
- package/dist/ui/components/Semantic.d.ts +21 -21
- package/dist/ui/components/SettingsSection.d.ts +3 -2
- package/dist/ui/components/SideDrawer.d.ts +1 -1
- package/dist/ui/components/SideModal.d.ts +1 -1
- package/dist/ui/components/SiteLogo.d.ts +1 -1
- package/dist/ui/components/Skeleton.d.ts +2 -1
- package/dist/ui/components/SkipToMain.d.ts +2 -1
- package/dist/ui/components/Slider.d.ts +1 -1
- package/dist/ui/components/SlottedListingView.d.ts +2 -2
- package/dist/ui/components/SortDropdown.d.ts +1 -1
- package/dist/ui/components/Spinner.d.ts +1 -1
- package/dist/ui/components/StackedViewShell.d.ts +2 -2
- package/dist/ui/components/StarRating.d.ts +1 -1
- package/dist/ui/components/StatsGrid.d.ts +1 -1
- package/dist/ui/components/StatusBadge.d.ts +1 -1
- package/dist/ui/components/StepperNav.d.ts +1 -1
- package/dist/ui/components/StickyToolbar.d.ts +1 -1
- package/dist/ui/components/SummaryCard.d.ts +1 -1
- package/dist/ui/components/TabStrip.d.ts +2 -1
- package/dist/ui/components/TablePagination.d.ts +2 -1
- package/dist/ui/components/Tabs.d.ts +4 -4
- package/dist/ui/components/TagInput.d.ts +2 -1
- package/dist/ui/components/TextLink.d.ts +1 -1
- package/dist/ui/components/Toast.d.ts +1 -1
- package/dist/ui/components/Toggle.d.ts +1 -1
- package/dist/ui/components/Tooltip.d.ts +1 -1
- package/dist/ui/components/Typography.d.ts +4 -4
- package/dist/ui/components/UnsavedChangesModal.d.ts +1 -1
- package/dist/ui/components/VacationBanner.d.ts +2 -1
- package/dist/ui/components/ViewToggle.d.ts +1 -1
- package/dist/ui/forms/ColorPickerField.d.ts +1 -1
- package/dist/ui/forms/FieldCheckbox.d.ts +2 -1
- package/dist/ui/forms/FieldInput.d.ts +1 -1
- package/dist/ui/forms/FieldSelect.d.ts +2 -1
- package/dist/ui/forms/FieldTextarea.d.ts +1 -1
- package/dist/ui/forms/FormShell.d.ts +2 -2
- package/dist/ui/rich-text/RichText.d.ts +1 -1
- package/dist/ui/rich-text/RichTextRenderer.d.ts +2 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Core: weekly Saturday sweep — converts delivered
|
|
3
|
-
*
|
|
2
|
+
* Core: weekly Saturday sweep — converts delivered orders with
|
|
3
|
+
* `payoutStatus=eligible` into pending payout documents grouped by seller.
|
|
4
4
|
*/
|
|
5
5
|
import type { JobContext } from "../runtime/types";
|
|
6
6
|
export declare function runWeeklyPayoutEligibility(ctx: JobContext): Promise<void>;
|
|
@@ -1,20 +1,22 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Core: weekly Saturday sweep — converts delivered
|
|
3
|
-
*
|
|
2
|
+
* Core: weekly Saturday sweep — converts delivered orders with
|
|
3
|
+
* `payoutStatus=eligible` into pending payout documents grouped by seller.
|
|
4
4
|
*/
|
|
5
|
-
import { storeRepository, userRepository, orderRepository, payoutRepository, } from "../../../../repositories";
|
|
5
|
+
import { storeRepository, userRepository, orderRepository, payoutRepository, siteSettingsRepository, } from "../../../../repositories";
|
|
6
6
|
import { BATCH_LIMIT } from "../handlers/messages";
|
|
7
7
|
import { getDefaultCurrency } from "../../../../core";
|
|
8
|
-
|
|
8
|
+
import { computePayoutDeduction } from "../../../shared/fees/calculator";
|
|
9
9
|
export async function runWeeklyPayoutEligibility(ctx) {
|
|
10
10
|
if (ctx.env("FEATURE_PAYOUTS") !== "true") {
|
|
11
11
|
ctx.logger.info("FEATURE_PAYOUTS disabled — skipping weekly payout eligibility");
|
|
12
12
|
return;
|
|
13
13
|
}
|
|
14
14
|
ctx.logger.info("Starting weekly payout eligibility sweep");
|
|
15
|
-
const
|
|
15
|
+
const siteSettings = await siteSettingsRepository.getSingleton();
|
|
16
|
+
const commissions = siteSettings.commissions;
|
|
17
|
+
const eligible = await orderRepository.getEligibleForPayoutSweep();
|
|
16
18
|
if (eligible.length === 0) {
|
|
17
|
-
ctx.logger.info("No eligible
|
|
19
|
+
ctx.logger.info("No eligible delivered orders found");
|
|
18
20
|
return;
|
|
19
21
|
}
|
|
20
22
|
ctx.logger.info(`Found ${eligible.length} eligible order(s) — grouping by seller`);
|
|
@@ -40,8 +42,7 @@ export async function runWeeklyPayoutEligibility(ctx) {
|
|
|
40
42
|
continue;
|
|
41
43
|
}
|
|
42
44
|
const grossAmount = orders.reduce((sum, o) => sum + (o.data.totalPrice ?? 0), 0);
|
|
43
|
-
const platformFee =
|
|
44
|
-
const netAmount = Math.round((grossAmount - platformFee) * 100) / 100;
|
|
45
|
+
const { platformFee, gatewayFee, gstOnFee, netAmount } = computePayoutDeduction(grossAmount, commissions);
|
|
45
46
|
const payoutInput = {
|
|
46
47
|
storeId,
|
|
47
48
|
sellerName: (seller.displayName ?? seller.email ?? store.ownerId),
|
|
@@ -50,7 +51,11 @@ export async function runWeeklyPayoutEligibility(ctx) {
|
|
|
50
51
|
amount: netAmount,
|
|
51
52
|
grossAmount,
|
|
52
53
|
platformFee,
|
|
53
|
-
platformFeeRate:
|
|
54
|
+
platformFeeRate: commissions.platformFeePercent / 100,
|
|
55
|
+
gatewayFee,
|
|
56
|
+
gatewayFeeRate: (commissions.gatewayFeePercent ?? 0) / 100,
|
|
57
|
+
gstAmount: gstOnFee,
|
|
58
|
+
gstRate: commissions.gstPercent / 100,
|
|
54
59
|
currency: defaultCurrency,
|
|
55
60
|
status: "pending",
|
|
56
61
|
paymentMethod: seller.payoutDetails?.method === "upi" ? "upi" : "bank_transfer",
|
|
@@ -63,7 +68,7 @@ export async function runWeeklyPayoutEligibility(ctx) {
|
|
|
63
68
|
bankName: seller.payoutDetails.bankAccount.bankName,
|
|
64
69
|
}
|
|
65
70
|
: undefined,
|
|
66
|
-
notes: `Automated weekly payout — ${orders.length}
|
|
71
|
+
notes: `Automated weekly payout — ${orders.length} delivered order(s)`,
|
|
67
72
|
requestedAt: new Date(),
|
|
68
73
|
};
|
|
69
74
|
const { id: payoutId } = await payoutRepository.create(payoutInput);
|
|
@@ -47,3 +47,4 @@ export { onUserBanChangeHandler } from "./onUserBanChange";
|
|
|
47
47
|
export { onScamReportCreateHandler } from "./onScamReportCreate";
|
|
48
48
|
export { onScamReportUpdateHandler } from "./onScamReportUpdate";
|
|
49
49
|
export { draftPruneHandler } from "./draftPrune";
|
|
50
|
+
export { emiInstallmentReminderHandler } from "./emiInstallmentReminder";
|
|
@@ -55,3 +55,5 @@ export { onScamReportCreateHandler } from "./onScamReportCreate";
|
|
|
55
55
|
export { onScamReportUpdateHandler } from "./onScamReportUpdate";
|
|
56
56
|
// SB-UNI-Y-1 — 30-day draft prune
|
|
57
57
|
export { draftPruneHandler } from "./draftPrune";
|
|
58
|
+
// EMI — installment reminder + overdue-flagging sweep
|
|
59
|
+
export { emiInstallmentReminderHandler } from "./emiInstallmentReminder";
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Public surface for the provider resolver + mocks.
|
|
3
3
|
*
|
|
4
|
-
* Real provider implementations remain in `appkit/src/providers/{payment-razorpay,shipping-
|
|
4
|
+
* Real provider implementations remain in `appkit/src/providers/{payment-razorpay,payment-manual,shipping-manual}/`
|
|
5
5
|
* because they are independently consumable per-package. This barrel only
|
|
6
6
|
* exposes the resolver entry points and the in-process mock implementations
|
|
7
|
-
* Track H requires.
|
|
7
|
+
* Track H requires. Shipping has no mock — the manual shipping provider
|
|
8
|
+
* makes no external API calls, so there's nothing to mock.
|
|
8
9
|
*/
|
|
9
|
-
export { resolvePaymentProvider,
|
|
10
|
+
export { resolvePaymentProvider, type PaymentResolutionFactories, type ProviderResolutionContext, } from "./resolve";
|
|
10
11
|
export { MockRazorpayProvider, type MockWebhookEvent, type MockWebhookPayload, type WebhookSink, } from "./payment/razorpay-mock";
|
|
11
|
-
export { MockShiprocketProvider, type ShipmentEvent, type ShipmentEventSink, } from "./shipping/shiprocket-mock";
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Public surface for the provider resolver + mocks.
|
|
3
3
|
*
|
|
4
|
-
* Real provider implementations remain in `appkit/src/providers/{payment-razorpay,shipping-
|
|
4
|
+
* Real provider implementations remain in `appkit/src/providers/{payment-razorpay,payment-manual,shipping-manual}/`
|
|
5
5
|
* because they are independently consumable per-package. This barrel only
|
|
6
6
|
* exposes the resolver entry points and the in-process mock implementations
|
|
7
|
-
* Track H requires.
|
|
7
|
+
* Track H requires. Shipping has no mock — the manual shipping provider
|
|
8
|
+
* makes no external API calls, so there's nothing to mock.
|
|
8
9
|
*/
|
|
9
|
-
export { resolvePaymentProvider,
|
|
10
|
+
export { resolvePaymentProvider, } from "./resolve";
|
|
10
11
|
export { MockRazorpayProvider, } from "./payment/razorpay-mock";
|
|
11
|
-
export { MockShiprocketProvider, } from "./shipping/shiprocket-mock";
|
|
@@ -20,7 +20,8 @@
|
|
|
20
20
|
* payment.captured / payment.failed / order.paid event without leaving
|
|
21
21
|
* the process. Registered via `setWebhookSink(fn)`.
|
|
22
22
|
*/
|
|
23
|
-
import
|
|
23
|
+
import { IPaymentProvider } from "../../../../contracts";
|
|
24
|
+
import type { PaymentCapture, PaymentOrder, Refund } from "../../../../contracts";
|
|
24
25
|
import type { JsonValue } from "../../../../schemas/types";
|
|
25
26
|
export type MockWebhookEvent = "payment.captured" | "payment.failed" | "order.paid";
|
|
26
27
|
export interface MockWebhookPayload {
|
|
@@ -31,7 +32,7 @@ export interface MockWebhookPayload {
|
|
|
31
32
|
readonly currency: string;
|
|
32
33
|
}
|
|
33
34
|
export type WebhookSink = (rawBody: string, signature: string, payload: MockWebhookPayload) => Promise<void> | void;
|
|
34
|
-
export declare class MockRazorpayProvider
|
|
35
|
+
export declare class MockRazorpayProvider extends IPaymentProvider {
|
|
35
36
|
readonly name: "razorpay-mock";
|
|
36
37
|
private readonly orders;
|
|
37
38
|
private readonly captures;
|
|
@@ -21,9 +21,11 @@
|
|
|
21
21
|
* the process. Registered via `setWebhookSink(fn)`.
|
|
22
22
|
*/
|
|
23
23
|
import { createHmac, randomBytes, timingSafeEqual } from "node:crypto";
|
|
24
|
+
import { IPaymentProvider } from "../../../../contracts";
|
|
24
25
|
const MOCK_WEBHOOK_SECRET = "appkit-mock-razorpay-webhook-secret-v1";
|
|
25
|
-
export class MockRazorpayProvider {
|
|
26
|
+
export class MockRazorpayProvider extends IPaymentProvider {
|
|
26
27
|
constructor() {
|
|
28
|
+
super(...arguments);
|
|
27
29
|
this.name = "razorpay-mock";
|
|
28
30
|
this.orders = new Map();
|
|
29
31
|
this.captures = new Map();
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* `resolvePaymentProvider`
|
|
3
|
-
*
|
|
2
|
+
* `resolvePaymentProvider` — decide between the real adapter and the
|
|
3
|
+
* in-process mock based on site-settings feature flags.
|
|
4
4
|
*
|
|
5
|
-
* Resolution rule (single explicit boolean
|
|
5
|
+
* Resolution rule (single explicit boolean, no implicit fallback):
|
|
6
6
|
*
|
|
7
|
-
* 1. Read `siteSettings.featureFlags.useMockPayment
|
|
8
|
-
* `featureFlags.useMockShipping`.
|
|
7
|
+
* 1. Read `siteSettings.featureFlags.useMockPayment`.
|
|
9
8
|
* 2. If the flag is `true` and `process.env.NODE_ENV !== "production"` →
|
|
10
9
|
* return the mock provider.
|
|
11
10
|
* 3. If the flag is `true` and `process.env.NODE_ENV === "production"` →
|
|
@@ -15,15 +14,18 @@
|
|
|
15
14
|
*
|
|
16
15
|
* The resolver is intentionally provider-agnostic (it accepts factories so
|
|
17
16
|
* the consumer's `providers.config.ts` controls instantiation), keeping this
|
|
18
|
-
* file zero-dep on Razorpay
|
|
17
|
+
* file zero-dep on the Razorpay SDK chain.
|
|
18
|
+
*
|
|
19
|
+
* Shipping has no equivalent resolver: the manual shipping provider makes no
|
|
20
|
+
* external API calls, so there is nothing to mock — `providers.config.ts`
|
|
21
|
+
* registers `ManualShippingProvider` directly.
|
|
19
22
|
*/
|
|
20
|
-
import type { IPaymentProvider
|
|
23
|
+
import type { IPaymentProvider } from "../../../contracts";
|
|
21
24
|
export interface ProviderResolutionContext {
|
|
22
25
|
readonly nodeEnv: string;
|
|
23
26
|
readonly siteSettings: {
|
|
24
27
|
readonly featureFlags?: {
|
|
25
28
|
readonly useMockPayment?: boolean;
|
|
26
|
-
readonly useMockShipping?: boolean;
|
|
27
29
|
};
|
|
28
30
|
};
|
|
29
31
|
}
|
|
@@ -31,9 +33,4 @@ export interface PaymentResolutionFactories {
|
|
|
31
33
|
readonly real: () => Promise<IPaymentProvider> | IPaymentProvider;
|
|
32
34
|
readonly mock: () => Promise<IPaymentProvider> | IPaymentProvider;
|
|
33
35
|
}
|
|
34
|
-
export interface ShippingResolutionFactories {
|
|
35
|
-
readonly real: () => Promise<IShippingProvider> | IShippingProvider;
|
|
36
|
-
readonly mock: () => Promise<IShippingProvider> | IShippingProvider;
|
|
37
|
-
}
|
|
38
36
|
export declare function resolvePaymentProvider(ctx: ProviderResolutionContext, factories: PaymentResolutionFactories): Promise<IPaymentProvider>;
|
|
39
|
-
export declare function resolveShippingProvider(ctx: ProviderResolutionContext, factories: ShippingResolutionFactories): Promise<IShippingProvider>;
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* `resolvePaymentProvider`
|
|
3
|
-
*
|
|
2
|
+
* `resolvePaymentProvider` — decide between the real adapter and the
|
|
3
|
+
* in-process mock based on site-settings feature flags.
|
|
4
4
|
*
|
|
5
|
-
* Resolution rule (single explicit boolean
|
|
5
|
+
* Resolution rule (single explicit boolean, no implicit fallback):
|
|
6
6
|
*
|
|
7
|
-
* 1. Read `siteSettings.featureFlags.useMockPayment
|
|
8
|
-
* `featureFlags.useMockShipping`.
|
|
7
|
+
* 1. Read `siteSettings.featureFlags.useMockPayment`.
|
|
9
8
|
* 2. If the flag is `true` and `process.env.NODE_ENV !== "production"` →
|
|
10
9
|
* return the mock provider.
|
|
11
10
|
* 3. If the flag is `true` and `process.env.NODE_ENV === "production"` →
|
|
@@ -15,7 +14,11 @@
|
|
|
15
14
|
*
|
|
16
15
|
* The resolver is intentionally provider-agnostic (it accepts factories so
|
|
17
16
|
* the consumer's `providers.config.ts` controls instantiation), keeping this
|
|
18
|
-
* file zero-dep on Razorpay
|
|
17
|
+
* file zero-dep on the Razorpay SDK chain.
|
|
18
|
+
*
|
|
19
|
+
* Shipping has no equivalent resolver: the manual shipping provider makes no
|
|
20
|
+
* external API calls, so there is nothing to mock — `providers.config.ts`
|
|
21
|
+
* registers `ManualShippingProvider` directly.
|
|
19
22
|
*/
|
|
20
23
|
export async function resolvePaymentProvider(ctx, factories) {
|
|
21
24
|
const want = ctx.siteSettings.featureFlags?.useMockPayment === true;
|
|
@@ -26,12 +29,3 @@ export async function resolvePaymentProvider(ctx, factories) {
|
|
|
26
29
|
}
|
|
27
30
|
return want ? await factories.mock() : await factories.real();
|
|
28
31
|
}
|
|
29
|
-
export async function resolveShippingProvider(ctx, factories) {
|
|
30
|
-
const want = ctx.siteSettings.featureFlags?.useMockShipping === true;
|
|
31
|
-
if (want && ctx.nodeEnv === "production") {
|
|
32
|
-
throw new Error("[providers] siteSettings.featureFlags.useMockShipping is TRUE in production. " +
|
|
33
|
-
"The mock shipping provider must never run in production. Set the flag to false " +
|
|
34
|
-
"in Admin → Site Settings, or unset NODE_ENV=production for the deploy.");
|
|
35
|
-
}
|
|
36
|
-
return want ? await factories.mock() : await factories.real();
|
|
37
|
-
}
|
|
@@ -429,6 +429,20 @@ export const ACTIONS = {
|
|
|
429
429
|
kind: "primary",
|
|
430
430
|
permissions: ["seller", "admin"],
|
|
431
431
|
},
|
|
432
|
+
"mark-installment-paid": {
|
|
433
|
+
id: "store.mark-installment-paid",
|
|
434
|
+
label: "Mark installment paid",
|
|
435
|
+
ariaLabel: "Mark this EMI installment as paid",
|
|
436
|
+
description: "Record collection of one EMI installment after verifying the buyer's manual transfer proof.",
|
|
437
|
+
kind: "primary",
|
|
438
|
+
permissions: ["seller", "admin"],
|
|
439
|
+
confirmation: {
|
|
440
|
+
title: "Mark this installment as paid?",
|
|
441
|
+
body: "This confirms the buyer's payment was received and verified. The order becomes eligible to ship once every installment is marked paid.",
|
|
442
|
+
confirmLabel: "Mark paid",
|
|
443
|
+
confirmKind: "primary",
|
|
444
|
+
},
|
|
445
|
+
},
|
|
432
446
|
"request-payout": {
|
|
433
447
|
id: "store.request-payout",
|
|
434
448
|
label: "Request payout",
|
|
@@ -1019,6 +1033,20 @@ export const ACTIONS = {
|
|
|
1019
1033
|
kind: "primary",
|
|
1020
1034
|
permissions: ["admin", "moderator"],
|
|
1021
1035
|
},
|
|
1036
|
+
"mark-installment-paid": {
|
|
1037
|
+
id: "admin.mark-installment-paid",
|
|
1038
|
+
label: "Mark installment paid",
|
|
1039
|
+
ariaLabel: "Mark this EMI installment as paid",
|
|
1040
|
+
description: "Record collection of one EMI installment after verifying the buyer's manual transfer proof.",
|
|
1041
|
+
kind: "primary",
|
|
1042
|
+
permissions: ["admin", "moderator"],
|
|
1043
|
+
confirmation: {
|
|
1044
|
+
title: "Mark this installment as paid?",
|
|
1045
|
+
body: "This confirms the buyer's payment was received and verified. The order becomes eligible to ship once every installment is marked paid.",
|
|
1046
|
+
confirmLabel: "Mark paid",
|
|
1047
|
+
confirmKind: "primary",
|
|
1048
|
+
},
|
|
1049
|
+
},
|
|
1022
1050
|
"cancel-order": {
|
|
1023
1051
|
id: "admin.cancel-order",
|
|
1024
1052
|
label: "Cancel Orders",
|
|
@@ -3,6 +3,7 @@ import { STANDARD_MAX_QTY_PER_LINE } from "./_limits";
|
|
|
3
3
|
export const DEFAULT_LISTING_RULE = {
|
|
4
4
|
purchaseable: true,
|
|
5
5
|
cartEligible: true,
|
|
6
|
+
cartIneligibleHint: "This listing type cannot be added to the cart.",
|
|
6
7
|
requiresShippingAddress: true,
|
|
7
8
|
requiresConsentOtp: true,
|
|
8
9
|
nonRefundable: false,
|
|
@@ -17,6 +17,8 @@ import { bundleRule } from "./bundle.rule";
|
|
|
17
17
|
import { classifiedRule } from "./classified.rule";
|
|
18
18
|
import { digitalCodeRule } from "./digital-code.rule";
|
|
19
19
|
import { liveRule } from "./live.rule";
|
|
20
|
+
import { artRule } from "./art.rule";
|
|
21
|
+
import { stickersRule } from "./stickers.rule";
|
|
20
22
|
export const CHECKOUT_RULES = {
|
|
21
23
|
standard: standardRule,
|
|
22
24
|
auction: auctionRule,
|
|
@@ -25,6 +27,8 @@ export const CHECKOUT_RULES = {
|
|
|
25
27
|
classified: classifiedRule,
|
|
26
28
|
"digital-code": digitalCodeRule,
|
|
27
29
|
live: liveRule,
|
|
30
|
+
art: artRule,
|
|
31
|
+
stickers: stickersRule,
|
|
28
32
|
};
|
|
29
33
|
export const CATEGORY_CHECKOUT_RULES = {
|
|
30
34
|
bundle: bundleRule,
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Art listing rule — printed-only artwork, standard-like checkout.
|
|
3
|
+
*
|
|
4
|
+
* No bespoke checkout behavior: cart/order grouping, stock decrement, and
|
|
5
|
+
* refund policy all follow the standard defaults. The listing type only
|
|
6
|
+
* changes presentation (PDP badges, seller form fields) via `pluginFor()`.
|
|
7
|
+
*/
|
|
8
|
+
import type { ListingCheckoutRule } from "./types";
|
|
9
|
+
export declare const artRule: ListingCheckoutRule;
|
|
@@ -3,6 +3,7 @@ export const auctionRule = {
|
|
|
3
3
|
...DEFAULT_LISTING_RULE,
|
|
4
4
|
orderType: "auction",
|
|
5
5
|
cartEligible: false, // bid-only; add-to-cart is blocked at the action layer
|
|
6
|
+
cartIneligibleHint: "Place a bid on the auction page instead.",
|
|
6
7
|
maxQuantityPerLine: 1,
|
|
7
8
|
canMergeWithSameProduct: false,
|
|
8
9
|
refundPolicy: { full: true, partial: false, partialGranularity: "none" },
|
|
@@ -4,6 +4,7 @@ export const classifiedRule = {
|
|
|
4
4
|
orderType: "standard", // placeholder — classified never reaches order creation
|
|
5
5
|
purchaseable: false,
|
|
6
6
|
cartEligible: false,
|
|
7
|
+
cartIneligibleHint: 'Use "Contact Seller" to arrange a meetup.',
|
|
7
8
|
requiresShippingAddress: false,
|
|
8
9
|
requiresConsentOtp: false,
|
|
9
10
|
};
|
|
@@ -10,3 +10,5 @@ export { bundleRule } from "./bundle.rule";
|
|
|
10
10
|
export { classifiedRule } from "./classified.rule";
|
|
11
11
|
export { digitalCodeRule } from "./digital-code.rule";
|
|
12
12
|
export { liveRule } from "./live.rule";
|
|
13
|
+
export { artRule } from "./art.rule";
|
|
14
|
+
export { stickersRule } from "./stickers.rule";
|
|
@@ -10,3 +10,5 @@ export { bundleRule } from "./bundle.rule";
|
|
|
10
10
|
export { classifiedRule } from "./classified.rule";
|
|
11
11
|
export { digitalCodeRule } from "./digital-code.rule";
|
|
12
12
|
export { liveRule } from "./live.rule";
|
|
13
|
+
export { artRule } from "./art.rule";
|
|
14
|
+
export { stickersRule } from "./stickers.rule";
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Stickers listing rule — printed-only sticker sheets/packs, standard-like checkout.
|
|
3
|
+
*
|
|
4
|
+
* No bespoke checkout behavior: cart/order grouping, stock decrement, and
|
|
5
|
+
* refund policy all follow the standard defaults. The listing type only
|
|
6
|
+
* changes presentation (PDP badges, seller form fields) via `pluginFor()`.
|
|
7
|
+
*/
|
|
8
|
+
import type { ListingCheckoutRule } from "./types";
|
|
9
|
+
export declare const stickersRule: ListingCheckoutRule;
|
|
@@ -43,6 +43,12 @@ export interface ListingCheckoutRule {
|
|
|
43
43
|
* (direct-checkout-only via CategoryCheckoutRule).
|
|
44
44
|
*/
|
|
45
45
|
cartEligible: boolean;
|
|
46
|
+
/**
|
|
47
|
+
* Buyer-facing hint appended to the "cannot add to cart" error when
|
|
48
|
+
* `cartEligible` is false — tells them what to do instead (place a bid,
|
|
49
|
+
* contact seller, etc). Ignored when `cartEligible` is true.
|
|
50
|
+
*/
|
|
51
|
+
cartIneligibleHint: string;
|
|
46
52
|
/** OrderType assigned to orders created from this listing type. */
|
|
47
53
|
orderType: OrderType;
|
|
48
54
|
/**
|
|
@@ -1,8 +1,23 @@
|
|
|
1
1
|
export declare const CHECKOUT_DEFAULT_COMMISSIONS: {
|
|
2
2
|
readonly codDepositPercent: 10;
|
|
3
|
+
readonly codHandlingFeeMinInPaise: 20000;
|
|
4
|
+
readonly codHandlingFeePercent: 10;
|
|
3
5
|
readonly sellerShippingFixed: 50;
|
|
4
6
|
readonly platformShippingPercent: 10;
|
|
5
7
|
readonly platformShippingFixedMin: 50;
|
|
6
8
|
};
|
|
7
|
-
export declare const CHECKOUT_PAYMENT_METHODS: readonly ["cash", "cod", "online", "upi_manual", "admin_bypass"];
|
|
9
|
+
export declare const CHECKOUT_PAYMENT_METHODS: readonly ["cash", "cod", "online", "upi_manual", "admin_bypass", "emi"];
|
|
8
10
|
export type CheckoutPaymentMethod = (typeof CHECKOUT_PAYMENT_METHODS)[number];
|
|
11
|
+
export declare const CHECKOUT_DEFAULT_EMI_SETTINGS: {
|
|
12
|
+
readonly enabled: false;
|
|
13
|
+
/** ₹10,000 in paise — a seller's cart subtotal must exceed this for EMI to appear. */
|
|
14
|
+
readonly minOrderValueInPaise: 1000000;
|
|
15
|
+
readonly tenureOptions: readonly [2, 3, 4, 5, 6];
|
|
16
|
+
readonly tokenPercent: 10;
|
|
17
|
+
/** Day of the month (1–10) the first (and every) installment is due. */
|
|
18
|
+
readonly billingDay: 5;
|
|
19
|
+
/** Extra % of principal per month of tenure — the buyer's cost for spreading payment. */
|
|
20
|
+
readonly surchargePercentPerMonth: 1;
|
|
21
|
+
/** Share of the surcharge that goes to the seller; the rest is the platform's cut. */
|
|
22
|
+
readonly surchargeSellerSharePercent: 50;
|
|
23
|
+
};
|
|
@@ -1,7 +1,22 @@
|
|
|
1
1
|
export const CHECKOUT_DEFAULT_COMMISSIONS = {
|
|
2
2
|
codDepositPercent: 10,
|
|
3
|
+
codHandlingFeeMinInPaise: 20000,
|
|
4
|
+
codHandlingFeePercent: 10,
|
|
3
5
|
sellerShippingFixed: 50,
|
|
4
6
|
platformShippingPercent: 10,
|
|
5
7
|
platformShippingFixedMin: 50,
|
|
6
8
|
};
|
|
7
|
-
export const CHECKOUT_PAYMENT_METHODS = ["cash", "cod", "online", "upi_manual", "admin_bypass"];
|
|
9
|
+
export const CHECKOUT_PAYMENT_METHODS = ["cash", "cod", "online", "upi_manual", "admin_bypass", "emi"];
|
|
10
|
+
export const CHECKOUT_DEFAULT_EMI_SETTINGS = {
|
|
11
|
+
enabled: false,
|
|
12
|
+
/** ₹10,000 in paise — a seller's cart subtotal must exceed this for EMI to appear. */
|
|
13
|
+
minOrderValueInPaise: 1000000,
|
|
14
|
+
tenureOptions: [2, 3, 4, 5, 6],
|
|
15
|
+
tokenPercent: 10,
|
|
16
|
+
/** Day of the month (1–10) the first (and every) installment is due. */
|
|
17
|
+
billingDay: 5,
|
|
18
|
+
/** Extra % of principal per month of tenure — the buyer's cost for spreading payment. */
|
|
19
|
+
surchargePercentPerMonth: 1,
|
|
20
|
+
/** Share of the surcharge that goes to the seller; the rest is the platform's cut. */
|
|
21
|
+
surchargeSellerSharePercent: 50,
|
|
22
|
+
};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* EMI (installment) eligibility + schedule computation — pure functions,
|
|
3
|
+
* no I/O. Consumed by checkout (buyer-facing quote + order creation) and by
|
|
4
|
+
* the seller/admin installment-collection UI (schedule display).
|
|
5
|
+
*
|
|
6
|
+
* Eligibility: a per-seller checkout group qualifies for EMI when the
|
|
7
|
+
* site-wide flag, the seller's own opt-in, AND the subtotal threshold are
|
|
8
|
+
* all satisfied — matching the existing COD deposit pattern of gating on
|
|
9
|
+
* `siteSettings.payment.codEnabled`.
|
|
10
|
+
*
|
|
11
|
+
* Schedule: the buyer pays `tokenPercent`% up front (the "token"), then the
|
|
12
|
+
* remaining principal plus a surcharge (the buyer's cost for spreading
|
|
13
|
+
* payment across `tenureMonths`, split between platform and seller per
|
|
14
|
+
* `surchargeSellerSharePercent`) across equal monthly installments, each
|
|
15
|
+
* due on `billingDay` (1–10) of the month, starting the month after
|
|
16
|
+
* purchase. All money amounts are in paise (integer).
|
|
17
|
+
*/
|
|
18
|
+
export interface EmiSettings {
|
|
19
|
+
enabled: boolean;
|
|
20
|
+
minOrderValueInPaise: number;
|
|
21
|
+
tenureOptions: readonly number[];
|
|
22
|
+
tokenPercent: number;
|
|
23
|
+
/** Day of month (1–10) each installment is due. */
|
|
24
|
+
billingDay: number;
|
|
25
|
+
surchargePercentPerMonth: number;
|
|
26
|
+
surchargeSellerSharePercent: number;
|
|
27
|
+
}
|
|
28
|
+
export type EmiIneligibleReason = "site_disabled" | "seller_disabled" | "below_minimum" | "invalid_tenure";
|
|
29
|
+
export type EmiEligibility = {
|
|
30
|
+
eligible: true;
|
|
31
|
+
} | {
|
|
32
|
+
eligible: false;
|
|
33
|
+
reason: EmiIneligibleReason;
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* `settings.enabled` is the site-wide toggle (`siteSettings.emi.enabled`).
|
|
37
|
+
* `sellerEmiEnabled` is the seller's own opt-in (`StoreDocument.emiEnabled`).
|
|
38
|
+
* Both must be true, in addition to the subtotal threshold.
|
|
39
|
+
*/
|
|
40
|
+
export declare function checkEmiEligibility(sellerSubtotal: number, sellerEmiEnabled: boolean, settings: Pick<EmiSettings, "enabled" | "minOrderValueInPaise">): EmiEligibility;
|
|
41
|
+
export interface EmiInstallmentPlan {
|
|
42
|
+
index: number;
|
|
43
|
+
dueDate: Date;
|
|
44
|
+
/** Paise. */
|
|
45
|
+
amount: number;
|
|
46
|
+
}
|
|
47
|
+
export interface EmiScheduleResult {
|
|
48
|
+
/** Down payment collected at checkout, in paise. */
|
|
49
|
+
tokenAmount: number;
|
|
50
|
+
/** Total surcharge across the whole tenure, in paise. */
|
|
51
|
+
surchargeAmount: number;
|
|
52
|
+
surchargeSellerShare: number;
|
|
53
|
+
surchargePlatformShare: number;
|
|
54
|
+
installments: EmiInstallmentPlan[];
|
|
55
|
+
/** Sum of all installment amounts — what's still owed after the token. */
|
|
56
|
+
remainingBalance: number;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* `purchaseDate` defaults to now; the first installment always falls in the
|
|
60
|
+
* calendar month AFTER purchase, regardless of which day of the current
|
|
61
|
+
* month the purchase happens on.
|
|
62
|
+
*/
|
|
63
|
+
export declare function computeEmiSchedule(sellerSubtotal: number, tenureMonths: number, settings: Pick<EmiSettings, "tokenPercent" | "billingDay" | "surchargePercentPerMonth" | "surchargeSellerSharePercent">, purchaseDate?: Date): EmiScheduleResult;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* EMI (installment) eligibility + schedule computation — pure functions,
|
|
3
|
+
* no I/O. Consumed by checkout (buyer-facing quote + order creation) and by
|
|
4
|
+
* the seller/admin installment-collection UI (schedule display).
|
|
5
|
+
*
|
|
6
|
+
* Eligibility: a per-seller checkout group qualifies for EMI when the
|
|
7
|
+
* site-wide flag, the seller's own opt-in, AND the subtotal threshold are
|
|
8
|
+
* all satisfied — matching the existing COD deposit pattern of gating on
|
|
9
|
+
* `siteSettings.payment.codEnabled`.
|
|
10
|
+
*
|
|
11
|
+
* Schedule: the buyer pays `tokenPercent`% up front (the "token"), then the
|
|
12
|
+
* remaining principal plus a surcharge (the buyer's cost for spreading
|
|
13
|
+
* payment across `tenureMonths`, split between platform and seller per
|
|
14
|
+
* `surchargeSellerSharePercent`) across equal monthly installments, each
|
|
15
|
+
* due on `billingDay` (1–10) of the month, starting the month after
|
|
16
|
+
* purchase. All money amounts are in paise (integer).
|
|
17
|
+
*/
|
|
18
|
+
/**
|
|
19
|
+
* `settings.enabled` is the site-wide toggle (`siteSettings.emi.enabled`).
|
|
20
|
+
* `sellerEmiEnabled` is the seller's own opt-in (`StoreDocument.emiEnabled`).
|
|
21
|
+
* Both must be true, in addition to the subtotal threshold.
|
|
22
|
+
*/
|
|
23
|
+
export function checkEmiEligibility(sellerSubtotal, sellerEmiEnabled, settings) {
|
|
24
|
+
if (!settings.enabled)
|
|
25
|
+
return { eligible: false, reason: "site_disabled" };
|
|
26
|
+
if (!sellerEmiEnabled)
|
|
27
|
+
return { eligible: false, reason: "seller_disabled" };
|
|
28
|
+
if (sellerSubtotal <= settings.minOrderValueInPaise)
|
|
29
|
+
return { eligible: false, reason: "below_minimum" };
|
|
30
|
+
return { eligible: true };
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* `purchaseDate` defaults to now; the first installment always falls in the
|
|
34
|
+
* calendar month AFTER purchase, regardless of which day of the current
|
|
35
|
+
* month the purchase happens on.
|
|
36
|
+
*/
|
|
37
|
+
export function computeEmiSchedule(sellerSubtotal, tenureMonths, settings, purchaseDate = new Date()) {
|
|
38
|
+
const tokenAmount = Math.round(sellerSubtotal * (settings.tokenPercent / 100));
|
|
39
|
+
const principalRemaining = sellerSubtotal - tokenAmount;
|
|
40
|
+
const surchargeAmount = Math.round(principalRemaining * (settings.surchargePercentPerMonth / 100) * tenureMonths);
|
|
41
|
+
const surchargeSellerShare = Math.round(surchargeAmount * (settings.surchargeSellerSharePercent / 100));
|
|
42
|
+
const surchargePlatformShare = surchargeAmount - surchargeSellerShare;
|
|
43
|
+
const totalToInstall = principalRemaining + surchargeAmount;
|
|
44
|
+
const baseInstallment = Math.floor(totalToInstall / tenureMonths);
|
|
45
|
+
const remainder = totalToInstall - baseInstallment * tenureMonths;
|
|
46
|
+
const billingDay = Math.min(Math.max(settings.billingDay, 1), 10);
|
|
47
|
+
const installments = [];
|
|
48
|
+
for (let i = 1; i <= tenureMonths; i++) {
|
|
49
|
+
const dueDate = new Date(Date.UTC(purchaseDate.getUTCFullYear(), purchaseDate.getUTCMonth() + i, billingDay));
|
|
50
|
+
// Last installment absorbs the rounding remainder so the sum is exact.
|
|
51
|
+
const amount = i === tenureMonths ? baseInstallment + remainder : baseInstallment;
|
|
52
|
+
installments.push({ index: i, dueDate, amount });
|
|
53
|
+
}
|
|
54
|
+
return {
|
|
55
|
+
tokenAmount,
|
|
56
|
+
surchargeAmount,
|
|
57
|
+
surchargeSellerShare,
|
|
58
|
+
surchargePlatformShare,
|
|
59
|
+
installments,
|
|
60
|
+
remainingBalance: totalToInstall,
|
|
61
|
+
};
|
|
62
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared fee calculator — single source of truth for platform commission,
|
|
3
|
+
* gateway fee, GST, and COD handling fee math. Replaces the ~5 duplicated
|
|
4
|
+
* (and in the payout case, inconsistent) formulas that used to live
|
|
5
|
+
* separately in checkout actions, refund actions, and the two payout
|
|
6
|
+
* eligibility jobs.
|
|
7
|
+
*
|
|
8
|
+
* Two distinct fee shapes:
|
|
9
|
+
* - `computeCheckoutFees` — what the BUYER pays on top of the subtotal
|
|
10
|
+
* (platform fee + GST on that fee). The gateway fee is absorbed by the
|
|
11
|
+
* platform, never passed through to the buyer.
|
|
12
|
+
* - `computePayoutDeduction` — what's deducted from the SELLER's payout
|
|
13
|
+
* (platform fee + gateway fee + GST on the platform fee).
|
|
14
|
+
*
|
|
15
|
+
* All money amounts are in paise (integer).
|
|
16
|
+
*/
|
|
17
|
+
export interface FeeCommissionRates {
|
|
18
|
+
platformFeePercent: number;
|
|
19
|
+
gstPercent: number;
|
|
20
|
+
/** Rupee floor (not paise) — matches the existing `minimumTransactionFee` doc convention. */
|
|
21
|
+
minimumTransactionFee?: number;
|
|
22
|
+
gatewayFeePercent?: number;
|
|
23
|
+
}
|
|
24
|
+
export interface CheckoutFees {
|
|
25
|
+
/** Platform commission in paise. */
|
|
26
|
+
platformFee: number;
|
|
27
|
+
/** GST on the platform fee, in paise. */
|
|
28
|
+
gstOnFee: number;
|
|
29
|
+
/** platformFee + gstOnFee, floored at minimumTransactionFee. */
|
|
30
|
+
totalFee: number;
|
|
31
|
+
}
|
|
32
|
+
export declare function computeCheckoutFees(subtotal: number, commissions: FeeCommissionRates): CheckoutFees;
|
|
33
|
+
export interface PayoutDeduction {
|
|
34
|
+
/** Platform commission in paise. */
|
|
35
|
+
platformFee: number;
|
|
36
|
+
/** Payment gateway cost, absorbed by the platform from the seller's share, in paise. */
|
|
37
|
+
gatewayFee: number;
|
|
38
|
+
/** GST on the platform fee, in paise. */
|
|
39
|
+
gstOnFee: number;
|
|
40
|
+
/** platformFee + gatewayFee + gstOnFee. */
|
|
41
|
+
totalDeduction: number;
|
|
42
|
+
/** grossAmount - totalDeduction, floored at 0. */
|
|
43
|
+
netAmount: number;
|
|
44
|
+
}
|
|
45
|
+
export declare function computePayoutDeduction(grossAmount: number, commissions: FeeCommissionRates): PayoutDeduction;
|
|
46
|
+
export interface CodHandlingFeeRates {
|
|
47
|
+
/** Optional so existing `siteSettings` documents saved before this field existed don't produce NaN — falls back to ₹200 (20000 paise). */
|
|
48
|
+
codHandlingFeeMinInPaise?: number;
|
|
49
|
+
/** Optional for the same reason — falls back to 10%. */
|
|
50
|
+
codHandlingFeePercent?: number;
|
|
51
|
+
}
|
|
52
|
+
/** COD handling fee charged to the buyer: max(fixed floor, subtotal × percent). */
|
|
53
|
+
export declare function computeCodHandlingFee(subtotal: number, rates: CodHandlingFeeRates): number;
|