@mohasinac/appkit 3.8.1 → 3.9.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/live/LiveItemDetailView.js +2 -2
- package/dist/_internal/client/features/lottery/LotteryAdminEditView.d.ts +4 -4
- package/dist/_internal/client/features/lottery/LotteryAdminEditView.js +8 -8
- package/dist/_internal/client/features/lottery/LotteryAdminSlotView.d.ts +1 -1
- package/dist/_internal/client/features/lottery/LotteryAdminSlotView.js +2 -2
- package/dist/_internal/server/features/bundles/actions.js +2 -2
- package/dist/_internal/server/features/bundles/og.d.ts +1 -1
- package/dist/_internal/server/features/bundles/og.js +4 -5
- package/dist/_internal/server/features/checkout/actions.js +57 -21
- package/dist/_internal/server/features/checkout/stock-restore.d.ts +19 -0
- package/dist/_internal/server/features/checkout/stock-restore.js +80 -0
- package/dist/_internal/server/features/checkout/upi-resolution.d.ts +11 -0
- package/dist/_internal/server/features/checkout/upi-resolution.js +28 -0
- package/dist/_internal/server/features/classified/og.js +1 -1
- package/dist/_internal/server/features/digital-code/og.js +1 -1
- package/dist/_internal/server/features/item-requests/og.d.ts +2 -2
- package/dist/_internal/server/features/item-requests/og.js +4 -5
- package/dist/_internal/server/features/live/og.js +1 -1
- package/dist/_internal/server/features/lottery/adapters.d.ts +2 -2
- package/dist/_internal/server/features/lottery/adapters.js +1 -1
- package/dist/_internal/server/features/orders/actions.d.ts +28 -0
- package/dist/_internal/server/features/orders/actions.js +239 -4
- package/dist/_internal/server/features/orders/adapters.js +3 -0
- package/dist/_internal/server/features/payments/data.js +3 -2
- package/dist/_internal/server/features/payouts/actions.d.ts +2 -2
- package/dist/_internal/server/features/payouts/actions.js +4 -3
- package/dist/_internal/server/features/pre-orders/service.d.ts +1 -1
- package/dist/_internal/server/features/pre-orders/service.js +3 -2
- package/dist/_internal/server/features/prize-draws/og.js +5 -5
- package/dist/_internal/server/features/products/og.js +1 -1
- package/dist/_internal/server/features/promotions/service.js +3 -1
- package/dist/_internal/server/features/refunds/actions.d.ts +2 -2
- package/dist/_internal/server/features/refunds/actions.js +7 -6
- package/dist/_internal/server/functions/firestore.js +1 -1
- package/dist/_internal/server/functions/scheduled.d.ts +4 -1
- package/dist/_internal/server/functions/scheduled.js +26 -2
- package/dist/_internal/server/jobs/core/emiInstallmentReminder.js +1 -1
- package/dist/_internal/server/jobs/core/hardBanCascade.d.ts +4 -0
- package/dist/_internal/server/jobs/core/hardBanCascade.js +15 -4
- package/dist/_internal/server/jobs/core/hardBanReinstatement.d.ts +16 -0
- package/dist/_internal/server/jobs/core/hardBanReinstatement.js +63 -0
- package/dist/_internal/server/jobs/core/jobRunners.js +3 -1
- package/dist/_internal/server/jobs/core/onScamReportCreate.js +1 -1
- package/dist/_internal/server/jobs/core/paymentReviewAutoApprove.d.ts +10 -0
- package/dist/_internal/server/jobs/core/paymentReviewAutoApprove.js +60 -0
- package/dist/_internal/server/jobs/core/paymentWindowTimeout.d.ts +15 -0
- package/dist/_internal/server/jobs/core/paymentWindowTimeout.js +59 -0
- package/dist/_internal/server/jobs/core/pendingOrderTimeout.d.ts +7 -0
- package/dist/_internal/server/jobs/core/pendingOrderTimeout.js +32 -6
- package/dist/_internal/server/jobs/handlers/hardBanReinstatement.d.ts +2 -0
- package/dist/_internal/server/jobs/handlers/hardBanReinstatement.js +2 -0
- package/dist/_internal/server/jobs/handlers/index.d.ts +3 -0
- package/dist/_internal/server/jobs/handlers/index.js +3 -0
- package/dist/_internal/server/jobs/handlers/messages.d.ts +4 -0
- package/dist/_internal/server/jobs/handlers/messages.js +4 -0
- package/dist/_internal/server/jobs/handlers/onShipmentAllocationSync.d.ts +3 -3
- package/dist/_internal/server/jobs/handlers/onShipmentAllocationSync.js +12 -12
- package/dist/_internal/server/jobs/handlers/onShipmentItemWrite.d.ts +1 -1
- package/dist/_internal/server/jobs/handlers/onShipmentItemWrite.js +5 -5
- package/dist/_internal/server/jobs/handlers/paymentReviewAutoApprove.d.ts +2 -0
- package/dist/_internal/server/jobs/handlers/paymentReviewAutoApprove.js +2 -0
- package/dist/_internal/server/jobs/handlers/paymentWindowTimeout.d.ts +2 -0
- package/dist/_internal/server/jobs/handlers/paymentWindowTimeout.js +2 -0
- package/dist/_internal/shared/actions/action-registry.js +27 -0
- package/dist/_internal/shared/checkout/order-math.js +3 -2
- package/dist/_internal/shared/checkout/rules/_defaults.js +1 -0
- package/dist/_internal/shared/checkout/rules/preorder.rule.js +7 -0
- package/dist/_internal/shared/checkout/rules/prize-draw.rule.js +7 -0
- package/dist/_internal/shared/checkout/rules/types.d.ts +11 -0
- package/dist/_internal/shared/features/auctions/errors.js +1 -1
- package/dist/_internal/shared/features/categories/bundle-copy.d.ts +0 -1
- package/dist/_internal/shared/features/categories/bundle-copy.js +0 -1
- package/dist/_internal/shared/features/categories/bundle-schemas.d.ts +6 -6
- package/dist/_internal/shared/features/categories/bundle-schemas.js +2 -2
- package/dist/_internal/shared/features/checkout/config.d.ts +3 -3
- package/dist/_internal/shared/features/checkout/config.js +3 -3
- package/dist/_internal/shared/features/emi/schedule.d.ts +6 -6
- package/dist/_internal/shared/features/emi/schedule.js +10 -9
- package/dist/_internal/shared/features/promotions/errors.js +1 -1
- package/dist/_internal/shared/fees/calculator.d.ts +5 -5
- package/dist/_internal/shared/fees/calculator.js +19 -19
- package/dist/client.d.ts +1 -1
- package/dist/client.js +1 -1
- package/dist/constants/api-endpoints.d.ts +9 -0
- package/dist/constants/api-endpoints.js +3 -0
- package/dist/constants/field-names.d.ts +4 -0
- package/dist/constants/field-names.js +4 -0
- package/dist/features/admin/components/AdminArtView.js +2 -2
- package/dist/features/admin/components/AdminBidsView.js +2 -2
- package/dist/features/admin/components/AdminBundleEditorView.d.ts +1 -1
- package/dist/features/admin/components/AdminBundleEditorView.js +8 -8
- package/dist/features/admin/components/AdminBundlesView.js +6 -6
- package/dist/features/admin/components/AdminClassifiedView.js +2 -2
- package/dist/features/admin/components/AdminDigitalCodesView.js +2 -2
- package/dist/features/admin/components/AdminLiveView.js +2 -2
- package/dist/features/admin/components/AdminOrderEditorView.d.ts +6 -1
- package/dist/features/admin/components/AdminOrderEditorView.js +45 -5
- package/dist/features/admin/components/AdminOrdersView.js +8 -3
- package/dist/features/admin/components/AdminPayoutsView.js +2 -2
- package/dist/features/admin/components/AdminPrizeDrawsView.js +2 -2
- package/dist/features/admin/components/AdminReturnRequestsView.js +2 -2
- package/dist/features/admin/components/AdminSiteSettingsView.js +11 -11
- package/dist/features/admin/components/AdminStickersView.js +2 -2
- package/dist/features/admin/components/AdminSupportTicketDetailView.js +1 -1
- package/dist/features/admin/hooks/useAdminListingData.d.ts +1 -1
- package/dist/features/admin/hooks/useAdminListingData.js +3 -2
- package/dist/features/admin/schemas/firestore.d.ts +9 -7
- package/dist/features/admin/schemas/firestore.js +4 -3
- package/dist/features/auctions/components/AuctionBidsTable.js +3 -3
- package/dist/features/auth/checkout-value-otp.d.ts +46 -0
- package/dist/features/auth/checkout-value-otp.js +73 -0
- package/dist/features/auth/repository/user.repository.d.ts +6 -0
- package/dist/features/auth/repository/user.repository.js +19 -0
- package/dist/features/auth/schemas/firestore.d.ts +10 -0
- package/dist/features/auth/schemas/firestore.js +2 -0
- package/dist/features/cart/actions/cart-actions.d.ts +1 -1
- package/dist/features/cart/actions/cart-actions.js +4 -4
- package/dist/features/cart/components/CartView.d.ts +2 -2
- package/dist/features/cart/components/ShippingPicker.d.ts +4 -4
- package/dist/features/cart/components/ShippingPicker.js +11 -11
- package/dist/features/cart/repository/cart.repository.d.ts +1 -1
- package/dist/features/cart/repository/cart.repository.js +2 -2
- package/dist/features/cart/schemas/firestore.d.ts +2 -2
- package/dist/features/catalogue/components/CatalogueItemEditorView.js +3 -3
- package/dist/features/catalogue/components/PublicCatalogueView.js +2 -2
- package/dist/features/catalogue/schemas/validation.js +1 -1
- package/dist/features/categories/components/BundleCollage.js +2 -2
- package/dist/features/categories/components/BundleDetailView.js +2 -2
- package/dist/features/categories/components/BundleItemsPicker.d.ts +1 -1
- package/dist/features/categories/components/BundleItemsPicker.js +2 -2
- package/dist/features/categories/components/CategoryBundlesListing.js +2 -2
- package/dist/features/categories/schemas/firestore.d.ts +1 -1
- package/dist/features/categories/schemas/index.d.ts +3 -3
- package/dist/features/categories/schemas/index.js +2 -2
- package/dist/features/checkout/actions/checkout-value-otp-actions.d.ts +16 -0
- package/dist/features/checkout/actions/checkout-value-otp-actions.js +83 -0
- package/dist/features/checkout/actions/index.d.ts +1 -0
- package/dist/features/checkout/actions/index.js +1 -0
- package/dist/features/checkout/schemas/firestore.d.ts +1 -1
- package/dist/features/classified/components/index.d.ts +0 -4
- package/dist/features/classified/components/index.js +0 -2
- package/dist/features/digital-codes/components/index.d.ts +0 -4
- package/dist/features/digital-codes/components/index.js +0 -2
- package/dist/features/events/schemas/index.d.ts +1 -1
- package/dist/features/events/schemas/index.js +1 -1
- package/dist/features/homepage/components/FeaturedBundlesSection.js +2 -2
- package/dist/features/live/components/index.d.ts +0 -4
- package/dist/features/live/components/index.js +0 -2
- package/dist/features/lottery/types/index.d.ts +3 -3
- package/dist/features/lottery/types/index.js +5 -5
- package/dist/features/orders/components/OrderPaymentSummary.js +2 -2
- package/dist/features/orders/components/OrderSiblingPayments.js +1 -1
- package/dist/features/orders/components/RefundHistoryTable.js +1 -1
- package/dist/features/orders/components/RefundRequestView.js +1 -1
- package/dist/features/orders/constants/payment-window.d.ts +10 -0
- package/dist/features/orders/constants/payment-window.js +10 -0
- package/dist/features/orders/repository/orders.repository.d.ts +25 -0
- package/dist/features/orders/repository/orders.repository.js +50 -1
- package/dist/features/orders/schemas/firestore.d.ts +50 -2
- package/dist/features/orders/schemas/index.d.ts +24 -24
- package/dist/features/orders/schemas/index.js +20 -20
- package/dist/features/orders/types/index.d.ts +4 -0
- package/dist/features/orders/utils/bundle-grouping.d.ts +1 -1
- package/dist/features/orders/utils/bundle-grouping.js +1 -1
- package/dist/features/payments/schemas/index.d.ts +10 -10
- package/dist/features/payments/schemas/index.js +9 -9
- package/dist/features/pre-orders/components/PreOrderDetailPageView.js +2 -2
- package/dist/features/products/components/ArtStickersListView.d.ts +7 -0
- package/dist/features/products/components/ArtStickersListView.js +57 -0
- package/dist/features/products/components/GroupSettingsPanel.js +1 -1
- package/dist/features/products/components/MakeOfferButton.js +3 -3
- package/dist/features/products/components/MarketplaceBundleCard.d.ts +1 -1
- package/dist/features/products/components/MarketplaceBundleCard.js +2 -2
- package/dist/features/products/components/PrizeDrawCollage.js +2 -2
- package/dist/features/products/components/PrizeDrawItemsEditor.js +2 -2
- package/dist/features/products/components/PrizeRevealModal.js +1 -1
- package/dist/features/products/components/ProductDetailPageView.js +2 -9
- package/dist/features/products/components/ProductForm.js +2 -2
- package/dist/features/products/components/ProductGrid.js +2 -2
- package/dist/features/products/components/ProductsIndexListing.d.ts +13 -1
- package/dist/features/products/components/ProductsIndexListing.js +7 -5
- package/dist/features/products/components/ProductsIndexPageView.js +6 -1
- package/dist/features/products/constants/listing-tabs.d.ts +42 -17
- package/dist/features/products/constants/listing-tabs.js +25 -6
- package/dist/features/products/schemas/catalog-product.d.ts +5 -5
- package/dist/features/products/schemas/catalog-product.js +1 -1
- package/dist/features/products/schemas/firestore.d.ts +5 -5
- package/dist/features/products/schemas/firestore.js +2 -2
- package/dist/features/products/types/index.d.ts +5 -2
- package/dist/features/promotions/components/CouponCard.js +2 -2
- package/dist/features/promotions/schemas/firestore.d.ts +2 -0
- package/dist/features/promotions/schemas/firestore.js +1 -0
- package/dist/features/promotions/schemas/index.d.ts +14 -14
- package/dist/features/promotions/schemas/index.js +6 -6
- package/dist/features/scams/components/ScamProfileView.js +3 -7
- package/dist/features/scams/components/ScamRegistryView.js +2 -6
- package/dist/features/scams/schemas/firestore.d.ts +1 -1
- package/dist/features/search/components/Search.d.ts +1 -1
- package/dist/features/seller/actions/offer-actions.js +1 -1
- package/dist/features/seller/components/PrintCenterView.js +2 -2
- package/dist/features/seller/components/QuickProductForm.js +5 -5
- package/dist/features/seller/components/SellerArtView.js +2 -2
- package/dist/features/seller/components/SellerAuctionsView.js +2 -2
- package/dist/features/seller/components/SellerBidsView.js +2 -2
- package/dist/features/seller/components/SellerBundlesView.js +6 -6
- package/dist/features/seller/components/SellerClassifiedView.js +2 -2
- package/dist/features/seller/components/SellerDigitalCodesView.js +2 -2
- package/dist/features/seller/components/SellerLiveView.js +2 -2
- package/dist/features/seller/components/SellerOffersView.js +2 -2
- package/dist/features/seller/components/SellerOrdersView.js +3 -3
- package/dist/features/seller/components/SellerPayoutRequestView.js +2 -2
- package/dist/features/seller/components/SellerPayoutSettingsView.js +2 -2
- package/dist/features/seller/components/SellerPayoutsView.js +2 -2
- package/dist/features/seller/components/SellerPreOrdersView.js +2 -2
- package/dist/features/seller/components/SellerPrizeDrawsView.js +2 -2
- package/dist/features/seller/components/SellerProductShell.js +8 -8
- package/dist/features/seller/components/SellerProductsView.js +1 -1
- package/dist/features/seller/components/SellerShippingView.js +6 -6
- package/dist/features/seller/components/SellerStickersView.js +2 -2
- package/dist/features/seller/hooks/useSellerListingData.d.ts +1 -1
- package/dist/features/seller/hooks/useSellerListingData.js +3 -2
- package/dist/features/shipments/components/AdminShipmentEditorView.js +10 -10
- package/dist/features/shipments/components/AdminShipmentLotItemsView.js +4 -4
- package/dist/features/shipments/components/AdminShipmentProjectionsView.js +5 -5
- package/dist/features/shipments/components/AdminShipmentsView.js +4 -4
- package/dist/features/shipments/repository/shipment-lots.repository.d.ts +2 -2
- package/dist/features/shipments/repository/shipment-lots.repository.js +8 -8
- package/dist/features/shipments/schemas/firestore.d.ts +21 -21
- package/dist/features/shipments/schemas/firestore.js +9 -9
- package/dist/features/shipments/schemas/validation.d.ts +30 -30
- package/dist/features/shipments/schemas/validation.js +6 -6
- package/dist/features/shipments/utils/cost-allocation.d.ts +5 -5
- package/dist/features/shipments/utils/cost-allocation.js +39 -38
- package/dist/features/store-extensions/schemas/firestore.d.ts +5 -5
- package/dist/features/stores/components/StoreDetailLayoutView.js +9 -13
- package/dist/features/stores/schemas/firestore.d.ts +7 -7
- package/dist/features/stores/schemas/index.d.ts +84 -84
- package/dist/features/stores/schemas/index.js +5 -5
- package/dist/features/tester/seed-data/categories-tester-seed-data.js +1 -1
- package/dist/features/tester/seed-data/products-tester-seed-data.js +6 -6
- package/dist/features/tester/seed-data/tester-checklist-seed-data.js +9 -2
- package/dist/features/whatsapp-bot/helpers/whatsapp.d.ts +8 -1
- package/dist/features/whatsapp-bot/helpers/whatsapp.js +13 -2
- package/dist/features/whatsapp-bot/types/index.d.ts +9 -1
- package/dist/index.d.ts +4 -7
- package/dist/index.js +9 -5
- package/dist/next/routing/route-map.d.ts +2 -0
- package/dist/next/routing/route-map.js +6 -0
- package/dist/schemas/firestore-helpers.d.ts +2 -2
- package/dist/schemas/firestore-helpers.js +2 -2
- package/dist/schemas/registry.d.ts +73 -73
- package/dist/security/index.d.ts +2 -1
- package/dist/security/index.js +5 -1
- package/dist/security/pii-encrypt.d.ts +2 -53
- package/dist/security/pii-encrypt.js +19 -100
- package/dist/security/pii-mask.d.ts +67 -0
- package/dist/security/pii-mask.js +100 -0
- package/dist/seed/bids-seed-data.js +6 -6
- package/dist/seed/blog-posts-seed-data.js +1 -0
- package/dist/seed/cart-seed-data.js +13 -13
- package/dist/seed/catalogue-seed-data.js +6 -6
- package/dist/seed/categories-seed-data.js +5 -5
- package/dist/seed/claimed-coupons-seed-data.js +3 -3
- package/dist/seed/coupons-seed-data.js +20 -20
- package/dist/seed/events-seed-data.js +27 -27
- package/dist/seed/factories/bid.factory.js +1 -1
- package/dist/seed/faq-seed-data.js +20 -1
- package/dist/seed/grouped-listings-seed-data.d.ts +2 -2
- package/dist/seed/grouped-listings-seed-data.js +3 -3
- package/dist/seed/offers-seed-data.js +19 -19
- package/dist/seed/orders-seed-data.js +29 -29
- package/dist/seed/payouts-seed-data.js +7 -7
- package/dist/seed/products-auctions-seed-data.js +6 -6
- package/dist/seed/products-preorders-seed-data.d.ts +2 -2
- package/dist/seed/products-preorders-seed-data.js +1 -1
- package/dist/seed/products-standard-seed-data.js +8 -8
- package/dist/seed/scammers-seed-data.js +2 -2
- package/dist/seed/shipments-seed-data.js +29 -29
- package/dist/seed/site-settings-seed-data.js +3 -2
- package/dist/seed/store-extensions-seed-data.js +8 -8
- package/dist/seed/stores-seed-data.js +37 -8
- package/dist/seed/users-seed-data.js +38 -1
- package/dist/server-entry.d.ts +1 -3
- package/dist/server-entry.js +1 -3
- package/dist/server.d.ts +2 -1
- package/dist/server.js +3 -1
- package/dist/ui/components/PriceDisplay.js +3 -12
- package/dist/utils/number.formatter.d.ts +2 -7
- package/dist/utils/number.formatter.js +3 -8
- package/package.json +1 -1
- package/scripts/seed-cli.mjs +17 -3
- package/dist/_internal/client/scaffolds/DashboardScaffold.d.ts +0 -34
- package/dist/_internal/client/scaffolds/DashboardScaffold.js +0 -26
- package/dist/_internal/client/theme/__tests__/ThemeProvider.test.d.ts +0 -1
- package/dist/_internal/client/theme/__tests__/ThemeProvider.test.js +0 -109
- package/dist/_internal/server/features/auctions/__tests__/service.test.d.ts +0 -1
- package/dist/_internal/server/features/auctions/__tests__/service.test.js +0 -140
- package/dist/_internal/server/features/checkout/__tests__/actions.test.d.ts +0 -1
- package/dist/_internal/server/features/checkout/__tests__/actions.test.js +0 -600
- package/dist/_internal/server/features/refunds/__tests__/actions.test.d.ts +0 -1
- package/dist/_internal/server/features/refunds/__tests__/actions.test.js +0 -263
- package/dist/_internal/server/jobs/core/__tests__/auctionSettlement.test.d.ts +0 -1
- package/dist/_internal/server/jobs/core/__tests__/auctionSettlement.test.js +0 -249
- package/dist/_internal/server/jobs/core/__tests__/couponExpiry.test.d.ts +0 -1
- package/dist/_internal/server/jobs/core/__tests__/couponExpiry.test.js +0 -65
- package/dist/_internal/server/jobs/core/__tests__/listingProcessor.test.d.ts +0 -1
- package/dist/_internal/server/jobs/core/__tests__/listingProcessor.test.js +0 -163
- package/dist/_internal/server/jobs/core/__tests__/mediaTmpCleanup.test.d.ts +0 -1
- package/dist/_internal/server/jobs/core/__tests__/mediaTmpCleanup.test.js +0 -115
- package/dist/_internal/server/jobs/core/__tests__/onBidPlaced.test.d.ts +0 -1
- package/dist/_internal/server/jobs/core/__tests__/onBidPlaced.test.js +0 -201
- package/dist/_internal/server/jobs/core/__tests__/onOrderCreate.test.d.ts +0 -1
- package/dist/_internal/server/jobs/core/__tests__/onOrderCreate.test.js +0 -169
- package/dist/_internal/server/jobs/core/__tests__/onOrderStatusChange.test.d.ts +0 -1
- package/dist/_internal/server/jobs/core/__tests__/onOrderStatusChange.test.js +0 -148
- package/dist/_internal/server/jobs/core/__tests__/onProductStockChange.test.d.ts +0 -1
- package/dist/_internal/server/jobs/core/__tests__/onProductStockChange.test.js +0 -210
- package/dist/_internal/server/jobs/core/__tests__/onReviewWrite.test.d.ts +0 -1
- package/dist/_internal/server/jobs/core/__tests__/onReviewWrite.test.js +0 -190
- package/dist/_internal/server/jobs/core/__tests__/onUserBanChange.test.d.ts +0 -1
- package/dist/_internal/server/jobs/core/__tests__/onUserBanChange.test.js +0 -161
- package/dist/_internal/server/jobs/core/__tests__/payoutBatch.test.d.ts +0 -1
- package/dist/_internal/server/jobs/core/__tests__/payoutBatch.test.js +0 -302
- package/dist/_internal/server/jobs/core/__tests__/pendingOrderTimeout.test.d.ts +0 -1
- package/dist/_internal/server/jobs/core/__tests__/pendingOrderTimeout.test.js +0 -96
- package/dist/_internal/server/jobs/core/__tests__/triggerEventRaffle.test.d.ts +0 -1
- package/dist/_internal/server/jobs/core/__tests__/triggerEventRaffle.test.js +0 -252
- package/dist/_internal/server/jobs/core/__tests__/wrapJobHandler.test.d.ts +0 -1
- package/dist/_internal/server/jobs/core/__tests__/wrapJobHandler.test.js +0 -129
- package/dist/_internal/server/jobs/core/onCatalogueSubmittedForApproval.d.ts +0 -15
- package/dist/_internal/server/jobs/core/onCatalogueSubmittedForApproval.js +0 -38
- package/dist/_internal/server/providers/index.d.ts +0 -11
- package/dist/_internal/server/providers/index.js +0 -11
- package/dist/_internal/server/providers/payment/razorpay-mock.d.ts +0 -52
- package/dist/_internal/server/providers/payment/razorpay-mock.js +0 -118
- package/dist/_internal/server/providers/resolve.d.ts +0 -36
- package/dist/_internal/server/providers/resolve.js +0 -31
- package/dist/_internal/server/providers/shipping/shiprocket-mock.d.ts +0 -29
- package/dist/_internal/server/providers/shipping/shiprocket-mock.js +0 -152
- package/dist/_internal/shared/types/__tests__/action-result.test.d.ts +0 -1
- package/dist/_internal/shared/types/__tests__/action-result.test.js +0 -65
- package/dist/errors/__tests__/error-mapping.test.d.ts +0 -1
- package/dist/errors/__tests__/error-mapping.test.js +0 -122
- package/dist/errors/__tests__/safe-read.test.d.ts +0 -1
- package/dist/errors/__tests__/safe-read.test.js +0 -39
- package/dist/features/addresses/repository/__tests__/addresses.repository.test.d.ts +0 -1
- package/dist/features/addresses/repository/__tests__/addresses.repository.test.js +0 -386
- package/dist/features/admin/components/AdminListingScaffold.d.ts +0 -41
- package/dist/features/admin/components/AdminListingScaffold.js +0 -68
- package/dist/features/admin/components/QuickActionsPanel.d.ts +0 -15
- package/dist/features/admin/components/QuickActionsPanel.js +0 -5
- package/dist/features/admin/repository/__tests__/notification.repository.test.d.ts +0 -1
- package/dist/features/admin/repository/__tests__/notification.repository.test.js +0 -356
- package/dist/features/admin/repository/__tests__/site-settings.repository.test.d.ts +0 -1
- package/dist/features/admin/repository/__tests__/site-settings.repository.test.js +0 -298
- package/dist/features/auctions/repository/__tests__/bid.repository.test.d.ts +0 -1
- package/dist/features/auctions/repository/__tests__/bid.repository.test.js +0 -290
- package/dist/features/auctions/repository/auctions.repository.d.ts +0 -12
- package/dist/features/auctions/repository/auctions.repository.js +0 -42
- package/dist/features/auth/repository/__tests__/session.repository.test.d.ts +0 -1
- package/dist/features/auth/repository/__tests__/session.repository.test.js +0 -310
- package/dist/features/auth/repository/__tests__/session.test.d.ts +0 -1
- package/dist/features/auth/repository/__tests__/session.test.js +0 -146
- package/dist/features/auth/repository/__tests__/sms-counter.repository.test.d.ts +0 -1
- package/dist/features/auth/repository/__tests__/sms-counter.repository.test.js +0 -171
- package/dist/features/auth/repository/__tests__/sms-counter.test.d.ts +0 -1
- package/dist/features/auth/repository/__tests__/sms-counter.test.js +0 -88
- package/dist/features/auth/repository/__tests__/token.repository.test.d.ts +0 -1
- package/dist/features/auth/repository/__tests__/token.repository.test.js +0 -260
- package/dist/features/auth/repository/__tests__/token.test.d.ts +0 -1
- package/dist/features/auth/repository/__tests__/token.test.js +0 -140
- package/dist/features/auth/repository/__tests__/user.repository.test.d.ts +0 -1
- package/dist/features/auth/repository/__tests__/user.repository.test.js +0 -352
- package/dist/features/auth/repository/__tests__/user.test.d.ts +0 -1
- package/dist/features/auth/repository/__tests__/user.test.js +0 -226
- package/dist/features/before-after/repository/before-after.repository.d.ts +0 -13
- package/dist/features/before-after/repository/before-after.repository.js +0 -36
- package/dist/features/before-after/server.d.ts +0 -6
- package/dist/features/before-after/server.js +0 -6
- package/dist/features/cart/repository/__tests__/cart.repository.test.d.ts +0 -1
- package/dist/features/cart/repository/__tests__/cart.repository.test.js +0 -371
- package/dist/features/categories/repository/__tests__/categories.repository.test.d.ts +0 -1
- package/dist/features/categories/repository/__tests__/categories.repository.test.js +0 -813
- package/dist/features/collections/repository/collections.repository.d.ts +0 -8
- package/dist/features/collections/repository/collections.repository.js +0 -16
- package/dist/features/collections/server.d.ts +0 -6
- package/dist/features/collections/server.js +0 -6
- package/dist/features/events/repository/__tests__/event.repository.test.d.ts +0 -1
- package/dist/features/events/repository/__tests__/event.repository.test.js +0 -299
- package/dist/features/faq/repository/__tests__/faqs.repository.test.d.ts +0 -1
- package/dist/features/faq/repository/__tests__/faqs.repository.test.js +0 -311
- package/dist/features/forms/Form.d.ts +0 -25
- package/dist/features/forms/Form.js +0 -37
- package/dist/features/history/repository/__tests__/user-history.repository.test.d.ts +0 -1
- package/dist/features/history/repository/__tests__/user-history.repository.test.js +0 -180
- package/dist/features/homepage/repository/__tests__/carousel.repository.test.d.ts +0 -1
- package/dist/features/homepage/repository/__tests__/carousel.repository.test.js +0 -182
- package/dist/features/homepage/repository/__tests__/homepage-sections.repository.test.d.ts +0 -1
- package/dist/features/homepage/repository/__tests__/homepage-sections.repository.test.js +0 -185
- package/dist/features/layout/ListingLayout.d.ts +0 -34
- package/dist/features/layout/ListingLayout.js +0 -103
- package/dist/features/messages/repository/__tests__/conversations.repository.test.d.ts +0 -1
- package/dist/features/messages/repository/__tests__/conversations.repository.test.js +0 -257
- package/dist/features/orders/repository/__tests__/orders.repository.test.d.ts +0 -1
- package/dist/features/orders/repository/__tests__/orders.repository.test.js +0 -211
- package/dist/features/payments/repository/__tests__/payout.repository.test.d.ts +0 -1
- package/dist/features/payments/repository/__tests__/payout.repository.test.js +0 -292
- package/dist/features/pre-orders/repository/preorders.repository.d.ts +0 -8
- package/dist/features/pre-orders/repository/preorders.repository.js +0 -25
- package/dist/features/products/repository/__tests__/product-features.repository.test.d.ts +0 -1
- package/dist/features/products/repository/__tests__/product-features.repository.test.js +0 -329
- package/dist/features/products/repository/__tests__/products.repository.test.d.ts +0 -1
- package/dist/features/products/repository/__tests__/products.repository.test.js +0 -607
- package/dist/features/promotions/repository/__tests__/claimed-coupons.repository.test.d.ts +0 -1
- package/dist/features/promotions/repository/__tests__/claimed-coupons.repository.test.js +0 -219
- package/dist/features/promotions/repository/__tests__/coupons.repository.test.d.ts +0 -1
- package/dist/features/promotions/repository/__tests__/coupons.repository.test.js +0 -480
- package/dist/features/promotions/repository/promotions.repository.d.ts +0 -14
- package/dist/features/promotions/repository/promotions.repository.js +0 -43
- package/dist/features/reviews/repository/__tests__/reviews.repository.test.d.ts +0 -1
- package/dist/features/reviews/repository/__tests__/reviews.repository.test.js +0 -327
- package/dist/features/scams/repository/__tests__/scammer.repository.test.d.ts +0 -1
- package/dist/features/scams/repository/__tests__/scammer.repository.test.js +0 -385
- package/dist/features/search/repository/__tests__/search.repository.test.d.ts +0 -1
- package/dist/features/search/repository/__tests__/search.repository.test.js +0 -369
- package/dist/features/seller/components/SellerStatCard.d.ts +0 -14
- package/dist/features/seller/components/SellerStatCard.js +0 -6
- package/dist/features/seller/components/seller-products-styles.d.ts +0 -7
- package/dist/features/seller/components/seller-products-styles.js +0 -14
- package/dist/features/seller/repository/__tests__/offer.repository.test.d.ts +0 -1
- package/dist/features/seller/repository/__tests__/offer.repository.test.js +0 -458
- package/dist/features/seller/repository/seller.repository.d.ts +0 -22
- package/dist/features/seller/repository/seller.repository.js +0 -72
- package/dist/features/site-settings/components/__tests__/ThemeManagerView.test.d.ts +0 -1
- package/dist/features/site-settings/components/__tests__/ThemeManagerView.test.js +0 -37
- package/dist/features/stores/repository/__tests__/store.repository.test.d.ts +0 -1
- package/dist/features/stores/repository/__tests__/store.repository.test.js +0 -261
- package/dist/features/stores/repository/stores.repository.d.ts +0 -11
- package/dist/features/stores/repository/stores.repository.js +0 -37
- package/dist/features/support/repository/__tests__/support.repository.test.d.ts +0 -1
- package/dist/features/support/repository/__tests__/support.repository.test.js +0 -312
- package/dist/features/wishlist/repository/__tests__/user-wishlist.repository.test.d.ts +0 -1
- package/dist/features/wishlist/repository/__tests__/user-wishlist.repository.test.js +0 -139
- package/dist/features/wishlist/repository/wishlist.repository.d.ts +0 -13
- package/dist/features/wishlist/repository/wishlist.repository.js +0 -31
- package/dist/providers/db-firebase/__tests__/filter-aliases.test.d.ts +0 -1
- package/dist/providers/db-firebase/__tests__/filter-aliases.test.js +0 -93
- package/dist/providers/shipping-shiprocket/index.d.ts +0 -297
- package/dist/providers/shipping-shiprocket/index.js +0 -194
- package/dist/providers/shipping-shiprocket/shiprocket-provider.d.ts +0 -45
- package/dist/providers/shipping-shiprocket/shiprocket-provider.js +0 -168
- package/dist/react/contexts/ThemeContext.d.ts +0 -13
- package/dist/react/contexts/ThemeContext.js +0 -64
- package/dist/schemas/webhooks/shiprocket.d.ts +0 -30
- package/dist/schemas/webhooks/shiprocket.js +0 -22
- package/dist/seed/actions/demo-seed-actions.d.ts +0 -42
- package/dist/seed/actions/demo-seed-actions.js +0 -36
- package/dist/seed/actions/index.d.ts +0 -1
- package/dist/seed/actions/index.js +0 -1
- package/dist/seed/sub-listings-seed-data.d.ts +0 -123
- package/dist/seed/sub-listings-seed-data.js +0 -447
- package/dist/seed/tester-checklist-seed-data.d.ts +0 -2
- package/dist/seed/tester-checklist-seed-data.js +0 -248
- package/dist/ui/components/DashboardStatsCard.d.ts +0 -15
- package/dist/ui/components/DashboardStatsCard.js +0 -27
- package/dist/ui/components/DashboardStatsCard.style.css +0 -68
- package/dist/ui/components/DynamicSelect.d.ts +0 -23
- package/dist/ui/components/DynamicSelect.js +0 -77
- package/dist/ui/components/DynamicSelect.style.css +0 -101
- package/dist/ui/components/InlineCreateSelect.d.ts +0 -48
- package/dist/ui/components/InlineCreateSelect.js +0 -75
- package/dist/ui/components/ListingViewShell.d.ts +0 -37
- package/dist/ui/components/ListingViewShell.js +0 -9
- package/dist/ui/components/PaginatedMultiSelect.d.ts +0 -28
- package/dist/ui/components/PaginatedMultiSelect.js +0 -141
- package/dist/ui/components/PaginatedMultiSelect.style.css +0 -272
- package/dist/ui/components/SectionTabs.d.ts +0 -19
- package/dist/ui/components/SectionTabs.js +0 -66
- package/dist/ui/components/SectionTabs.style.css +0 -164
- package/dist/ui/components/__tests__/BulkActionBar.test.d.ts +0 -1
- package/dist/ui/components/__tests__/BulkActionBar.test.js +0 -96
- package/dist/ui/components/__tests__/ListingToolbar.test.d.ts +0 -1
- package/dist/ui/components/__tests__/ListingToolbar.test.js +0 -125
- package/dist/ui/components/__tests__/new-primitives.test.d.ts +0 -1
- package/dist/ui/components/__tests__/new-primitives.test.js +0 -187
|
@@ -20,6 +20,6 @@ export function LiveItemDetailView({ product, isLoading = false, renderActions,
|
|
|
20
20
|
const price = formatCurrency(product.price, product.currency ?? "INR");
|
|
21
21
|
const jurisdictions = meta?.jurisdictionAllowed ?? [];
|
|
22
22
|
const transport = meta?.transport;
|
|
23
|
-
return (_jsx(Container, { children: _jsx(Section, { padding: "y-xl", children: _jsxs(Stack, { gap: "lg", children: [product.images.length > 0 && (_jsx(Div, { className: `relative h-80 w-full ${__O.hidden} bg-muted`, rounded: "lg", children: _jsx(MediaImage, { src: product.mainImage || product.images[0], alt: product.title, size: "hero", objectFit: "contain" }) })), _jsxs(Stack, { gap: "sm", children: [_jsxs(Row, { gap: "sm", wrap: true, children: [_jsx(Badge, { variant: "secondary", children: "Live Item" }), meta?.vendorVerified && (_jsx(Badge, { variant: "active", children: "Verified Seller" })), meta?.cites && (_jsxs(Badge, { variant: "warning", children: ["CITES: ", meta.cites] }))] }), _jsx(Heading, { level: 1, weight: "bold", size: "2xl", children: product.title }), meta?.species && (_jsxs(Text, { className: "italic text-muted-foreground", size: "sm", children: [meta.species, meta.sex && meta.sex !== "n/a" && ` · ${meta.sex}`, meta.ageMonths !== undefined && ` · ${meta.ageMonths}mo`] })), _jsx(Text, { className: "text-primary", size: "2xl", weight: "semibold", children: price }), _jsx(Text, { className: "text-muted-foreground", children: product.description })] }), jurisdictions.length > 0 && (_jsxs(Div, { className: CLS_WARN_BOX, children: [_jsx(Text, { className: CLS_WARN_TITLE, children: "Delivery restrictions" }), _jsxs(Text, { className: CLS_WARN_BODY, children: ["This item can only be shipped to: ", jurisdictions.join(", ")] })] })), transport && (_jsxs(Div, { textSize: "sm", className: `border border-border bg-muted/40 ${__P.p4}`, rounded: "lg", children: [_jsx(Text, { weight: "medium", children: "Transport" }), _jsxs(Text, { className: "text-muted-foreground", children: ["Method: ", transport.method, transport.
|
|
24
|
-
` · Handling: ${formatCurrency(transport.
|
|
23
|
+
return (_jsx(Container, { children: _jsx(Section, { padding: "y-xl", children: _jsxs(Stack, { gap: "lg", children: [product.images.length > 0 && (_jsx(Div, { className: `relative h-80 w-full ${__O.hidden} bg-muted`, rounded: "lg", children: _jsx(MediaImage, { src: product.mainImage || product.images[0], alt: product.title, size: "hero", objectFit: "contain" }) })), _jsxs(Stack, { gap: "sm", children: [_jsxs(Row, { gap: "sm", wrap: true, children: [_jsx(Badge, { variant: "secondary", children: "Live Item" }), meta?.vendorVerified && (_jsx(Badge, { variant: "active", children: "Verified Seller" })), meta?.cites && (_jsxs(Badge, { variant: "warning", children: ["CITES: ", meta.cites] }))] }), _jsx(Heading, { level: 1, weight: "bold", size: "2xl", children: product.title }), meta?.species && (_jsxs(Text, { className: "italic text-muted-foreground", size: "sm", children: [meta.species, meta.sex && meta.sex !== "n/a" && ` · ${meta.sex}`, meta.ageMonths !== undefined && ` · ${meta.ageMonths}mo`] })), _jsx(Text, { className: "text-primary", size: "2xl", weight: "semibold", children: price }), _jsx(Text, { className: "text-muted-foreground", children: product.description })] }), jurisdictions.length > 0 && (_jsxs(Div, { className: CLS_WARN_BOX, children: [_jsx(Text, { className: CLS_WARN_TITLE, children: "Delivery restrictions" }), _jsxs(Text, { className: CLS_WARN_BODY, children: ["This item can only be shipped to: ", jurisdictions.join(", ")] })] })), transport && (_jsxs(Div, { textSize: "sm", className: `border border-border bg-muted/40 ${__P.p4}`, rounded: "lg", children: [_jsx(Text, { weight: "medium", children: "Transport" }), _jsxs(Text, { className: "text-muted-foreground", children: ["Method: ", transport.method, transport.handlingFee !== undefined &&
|
|
24
|
+
` · Handling: ${formatCurrency(transport.handlingFee, "INR")}`, transport.insuranceIncluded && " · Insurance included"] })] })), meta?.careInfo && (_jsxs(Div, { textSize: "sm", className: `border border-border bg-muted/40 ${__P.p4}`, rounded: "lg", children: [_jsx(Text, { weight: "medium", children: "Care information" }), _jsx(Text, { className: "mt-1 text-muted-foreground", children: meta.careInfo })] })), renderActions?.()] }) }) }));
|
|
25
25
|
}
|
|
@@ -2,7 +2,7 @@ import React from "react";
|
|
|
2
2
|
interface LotterySlotRow {
|
|
3
3
|
slotNumber: number;
|
|
4
4
|
name: string;
|
|
5
|
-
|
|
5
|
+
price: number;
|
|
6
6
|
}
|
|
7
7
|
interface LotteryEventFormData {
|
|
8
8
|
title: string;
|
|
@@ -12,13 +12,13 @@ interface LotteryEventFormData {
|
|
|
12
12
|
slots: Array<{
|
|
13
13
|
slotNumber: number;
|
|
14
14
|
name: string;
|
|
15
|
-
|
|
15
|
+
price: number;
|
|
16
16
|
weight: number;
|
|
17
17
|
isBooked: boolean;
|
|
18
18
|
}>;
|
|
19
19
|
totalSlots: number;
|
|
20
20
|
pricingMode: "uniform" | "variable";
|
|
21
|
-
|
|
21
|
+
uniformPrice?: number;
|
|
22
22
|
drawWindowDurationMinutes: number;
|
|
23
23
|
maxPullsPerTransaction: number;
|
|
24
24
|
maxPullsPerUser: number;
|
|
@@ -31,7 +31,7 @@ interface LotteryAdminEditViewProps {
|
|
|
31
31
|
description?: string;
|
|
32
32
|
totalSlots: number;
|
|
33
33
|
pricingMode: "uniform" | "variable";
|
|
34
|
-
|
|
34
|
+
uniformPrice?: number;
|
|
35
35
|
drawWindowDurationMinutes: number;
|
|
36
36
|
maxPullsPerTransaction: number;
|
|
37
37
|
maxPullsPerUser: number;
|
|
@@ -10,15 +10,15 @@ export function LotteryAdminEditView({ eventId, initialData, onSubmit, }) {
|
|
|
10
10
|
const [title, setTitle] = useState(initialData?.title ?? "");
|
|
11
11
|
const [description, setDescription] = useState(initialData?.description ?? "");
|
|
12
12
|
const [pricingMode, setPricingMode] = useState(initialData?.pricingMode ?? "uniform");
|
|
13
|
-
const [uniformPrice, setUniformPrice] = useState(String(
|
|
13
|
+
const [uniformPrice, setUniformPrice] = useState(String(initialData?.uniformPrice ?? 0));
|
|
14
14
|
const [drawWindowMinutes, setDrawWindowMinutes] = useState(String(initialData?.drawWindowDurationMinutes ?? 5));
|
|
15
15
|
const [maxPullsPerTx, setMaxPullsPerTx] = useState(String(initialData?.maxPullsPerTransaction ?? 1));
|
|
16
16
|
const [maxPullsPerUser, setMaxPullsPerUser] = useState(String(initialData?.maxPullsPerUser ?? 1));
|
|
17
|
-
const [slots, setSlots] = useState(initialData?.slots ?? [{ slotNumber: 1, name: "",
|
|
17
|
+
const [slots, setSlots] = useState(initialData?.slots ?? [{ slotNumber: 1, name: "", price: 0 }]);
|
|
18
18
|
const addSlot = () => {
|
|
19
19
|
setSlots((prev) => [
|
|
20
20
|
...prev,
|
|
21
|
-
{ slotNumber: prev.length + 1, name: "",
|
|
21
|
+
{ slotNumber: prev.length + 1, name: "", price: 0 },
|
|
22
22
|
]);
|
|
23
23
|
};
|
|
24
24
|
const removeSlot = (idx) => {
|
|
@@ -26,7 +26,7 @@ export function LotteryAdminEditView({ eventId, initialData, onSubmit, }) {
|
|
|
26
26
|
};
|
|
27
27
|
const updateSlot = (idx, field, value) => {
|
|
28
28
|
setSlots((prev) => prev.map((s, i) => i === idx
|
|
29
|
-
? { ...s, [field]: field === "
|
|
29
|
+
? { ...s, [field]: field === "price" ? Math.round(parseFloat(value) * 100) / 100 || 0 : value }
|
|
30
30
|
: s));
|
|
31
31
|
};
|
|
32
32
|
const handleSubmit = () => {
|
|
@@ -37,13 +37,13 @@ export function LotteryAdminEditView({ eventId, initialData, onSubmit, }) {
|
|
|
37
37
|
slots: slots.map((s) => ({
|
|
38
38
|
slotNumber: s.slotNumber,
|
|
39
39
|
name: s.name,
|
|
40
|
-
|
|
40
|
+
price: s.price,
|
|
41
41
|
weight: 0,
|
|
42
42
|
isBooked: false,
|
|
43
43
|
})),
|
|
44
44
|
totalSlots: slots.length,
|
|
45
45
|
pricingMode,
|
|
46
|
-
|
|
46
|
+
uniformPrice: pricingMode === "uniform" ? Math.round(parseFloat(uniformPrice) * 100) / 100 || 0 : undefined,
|
|
47
47
|
drawWindowDurationMinutes: parseInt(drawWindowMinutes, 10) || 5,
|
|
48
48
|
maxPullsPerTransaction: parseInt(maxPullsPerTx, 10) || 1,
|
|
49
49
|
maxPullsPerUser: parseInt(maxPullsPerUser, 10) || 1,
|
|
@@ -71,9 +71,9 @@ export function LotteryAdminEditView({ eventId, initialData, onSubmit, }) {
|
|
|
71
71
|
...(pricingMode === "variable"
|
|
72
72
|
? [
|
|
73
73
|
{
|
|
74
|
-
key: "
|
|
74
|
+
key: "price",
|
|
75
75
|
header: "Price (₹)",
|
|
76
|
-
render: (s) => (_jsx(Input, { type: "number", className: "w-24", placeholder: "0", value: s.
|
|
76
|
+
render: (s) => (_jsx(Input, { type: "number", className: "w-24", placeholder: "0", value: s.price, onChange: (e) => updateSlot(s._idx, "price", e.target.value), "aria-label": `Slot ${s.slotNumber} price` })),
|
|
77
77
|
},
|
|
78
78
|
]
|
|
79
79
|
: []),
|
|
@@ -19,9 +19,9 @@ export function LotteryAdminSlotView({ slots }) {
|
|
|
19
19
|
render: (s) => _jsx(Text, { size: "sm", children: s.name }),
|
|
20
20
|
},
|
|
21
21
|
{
|
|
22
|
-
key: "
|
|
22
|
+
key: "price",
|
|
23
23
|
header: "Price (₹)",
|
|
24
|
-
render: (s) => (_jsxs(Text, { size: "sm", family: "mono", children: ["\u20B9",
|
|
24
|
+
render: (s) => (_jsxs(Text, { size: "sm", family: "mono", children: ["\u20B9", s.price.toLocaleString("en-IN")] })),
|
|
25
25
|
},
|
|
26
26
|
{
|
|
27
27
|
key: "weight",
|
|
@@ -29,14 +29,14 @@ export async function addBundleToCartAction(userId, bundleSlug) {
|
|
|
29
29
|
if (bundle.bundleStockStatus === "out_of_stock") {
|
|
30
30
|
throw new ValidationError("Bundle is currently out of stock");
|
|
31
31
|
}
|
|
32
|
-
if (!bundle.
|
|
32
|
+
if (!bundle.bundlePrice || bundle.bundlePrice < 1) {
|
|
33
33
|
throw new ValidationError("Bundle price is not configured");
|
|
34
34
|
}
|
|
35
35
|
await cartRepository.addItem(userId, {
|
|
36
36
|
productId: bundle.id,
|
|
37
37
|
productTitle: bundle.name,
|
|
38
38
|
productImage: bundle.display?.coverImage ?? "",
|
|
39
|
-
price: bundle.
|
|
39
|
+
price: bundle.bundlePrice,
|
|
40
40
|
currency: getDefaultCurrency(),
|
|
41
41
|
quantity: 1,
|
|
42
42
|
storeId: bundle.createdByStoreId ?? "",
|
|
@@ -27,7 +27,7 @@ interface BundleDocLike {
|
|
|
27
27
|
display?: {
|
|
28
28
|
coverImage?: string | null;
|
|
29
29
|
} | null;
|
|
30
|
-
|
|
30
|
+
bundlePrice?: number | null;
|
|
31
31
|
bundleProductIds?: string[] | null;
|
|
32
32
|
bundleStockStatus?: "in_stock" | "partial" | "out_of_stock" | null;
|
|
33
33
|
}
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { resolveOgImageUrl } from "../seo/og";
|
|
3
|
-
function formatPriceInr(
|
|
4
|
-
|
|
5
|
-
return `₹${rupees.toLocaleString("en-IN")}`;
|
|
3
|
+
function formatPriceInr(amount) {
|
|
4
|
+
return `₹${amount.toLocaleString("en-IN")}`;
|
|
6
5
|
}
|
|
7
6
|
export function renderBundleOg(doc, opts) {
|
|
8
7
|
const name = doc?.name ?? "Bundle";
|
|
9
|
-
const priceLabel = typeof doc?.
|
|
10
|
-
? formatPriceInr(doc.
|
|
8
|
+
const priceLabel = typeof doc?.bundlePrice === "number" && doc.bundlePrice > 0
|
|
9
|
+
? formatPriceInr(doc.bundlePrice)
|
|
11
10
|
: null;
|
|
12
11
|
return renderBundleOgImage({
|
|
13
12
|
name,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { normalizeError } from "../../../../errors/normalize";
|
|
2
2
|
import { safeFireAndForget } from "../../../../utils/safe-fire-forget";
|
|
3
|
+
import { roundRupees } from "../../../../utils/number.formatter";
|
|
3
4
|
/**
|
|
4
5
|
* Checkout server actions (appkit).
|
|
5
6
|
*
|
|
@@ -36,6 +37,9 @@ import { getListingRule, runSyncPreflight, } from "../../../shared/checkout/rule
|
|
|
36
37
|
import { cartIsDigitalOnly } from "../../../shared/listing-types/cart-shipping";
|
|
37
38
|
import { processRefundAction } from "../refunds/actions";
|
|
38
39
|
import { sendNotification } from "../../../../features/admin/actions/notification-actions";
|
|
40
|
+
import { resolveDisplayedUpiId } from "./upi-resolution";
|
|
41
|
+
import { PAYMENT_WINDOW_MS } from "../../../../features/orders/constants/payment-window";
|
|
42
|
+
import { isCheckoutValueOtpVerified } from "../../../../features/checkout/actions/checkout-value-otp-actions";
|
|
39
43
|
const AUDIT_LOG_FAIL_MSG = "checkout: audit log failed (non-critical)";
|
|
40
44
|
/**
|
|
41
45
|
* SB-UNI-N — Atomically claim the next available digital code for a confirmed
|
|
@@ -247,7 +251,7 @@ function unitPriceFor(item, product) {
|
|
|
247
251
|
* so the caller can accumulate the checkout-wide `total`.
|
|
248
252
|
*/
|
|
249
253
|
async function createOrderForGroup(group, orderType, ctx) {
|
|
250
|
-
const { paymentMethod, emiTenureMonths, emiSettings, commissions, appliedCoupons, cartSubtotal, couponUsageAccumulator, uid, userName, userEmail, shippingAddress, notes, adminBypass, adminBypassBy, adminBatchId, orderIds, emailsToSend, outOfStockPolicy, droppedItems, buyerState, gstSettings, } = ctx;
|
|
254
|
+
const { paymentMethod, emiTenureMonths, emiSettings, commissions, appliedCoupons, cartSubtotal, couponUsageAccumulator, uid, userName, userEmail, shippingAddress, notes, adminBypass, adminBypassBy, adminBatchId, orderIds, emailsToSend, outOfStockPolicy, droppedItems, buyerState, gstSettings, siteContactUpiVpa, } = ctx;
|
|
251
255
|
const firstItem = group[0].item;
|
|
252
256
|
const firstProduct = group[0].product;
|
|
253
257
|
const groupTotal = group.reduce((sum, { item, product }) => sum + unitPriceFor(item, product) * item.quantity, 0);
|
|
@@ -308,15 +312,15 @@ async function createOrderForGroup(group, orderType, ctx) {
|
|
|
308
312
|
? undefined
|
|
309
313
|
: orderType === "preorder"
|
|
310
314
|
? computePreOrderDepositAmount(group, commissions.codDepositPercent)
|
|
311
|
-
:
|
|
315
|
+
: roundRupees(groupTotal * (commissions.codDepositPercent / 100));
|
|
312
316
|
const codRemainingAmount = isCodLike
|
|
313
|
-
?
|
|
317
|
+
? roundRupees(groupTotal - (depositAmount ?? 0))
|
|
314
318
|
: undefined;
|
|
315
319
|
let emiSchedule;
|
|
316
320
|
if (paymentMethod === "emi" && emiTenureMonths) {
|
|
317
321
|
const eligibility = checkEmiEligibility(groupTotal, storeEmiEnabled, emiSettings);
|
|
318
322
|
if (!eligibility.eligible) {
|
|
319
|
-
throw new ValidationError(`EMI is not available for this order (${eligibility.reason}). Minimum order value per seller is ₹${
|
|
323
|
+
throw new ValidationError(`EMI is not available for this order (${eligibility.reason}). Minimum order value per seller is ₹${emiSettings.minOrderValue}.`);
|
|
320
324
|
}
|
|
321
325
|
emiSchedule = computeEmiSchedule(groupTotal, emiTenureMonths, emiSettings);
|
|
322
326
|
}
|
|
@@ -338,7 +342,7 @@ async function createOrderForGroup(group, orderType, ctx) {
|
|
|
338
342
|
.reduce((s, { item }) => s + item.price * item.quantity, 0);
|
|
339
343
|
couponGroupDiscount =
|
|
340
344
|
eligibleTotal > 0
|
|
341
|
-
? Math.min(
|
|
345
|
+
? Math.min(roundRupees((eligibleTotal / groupTotal) * coupon.discountAmount), eligibleTotal)
|
|
342
346
|
: 0;
|
|
343
347
|
}
|
|
344
348
|
else {
|
|
@@ -347,7 +351,7 @@ async function createOrderForGroup(group, orderType, ctx) {
|
|
|
347
351
|
}
|
|
348
352
|
else {
|
|
349
353
|
if (cartSubtotal > 0) {
|
|
350
|
-
couponGroupDiscount = Math.min(
|
|
354
|
+
couponGroupDiscount = Math.min(roundRupees((groupTotal / cartSubtotal) * coupon.discountAmount), groupTotal);
|
|
351
355
|
}
|
|
352
356
|
}
|
|
353
357
|
if (couponGroupDiscount > 0) {
|
|
@@ -382,6 +386,20 @@ async function createOrderForGroup(group, orderType, ctx) {
|
|
|
382
386
|
? { prizeRevealDeadline: computePrizeRevealDeadline(group[0].product) }
|
|
383
387
|
: {}),
|
|
384
388
|
};
|
|
389
|
+
// ── 15-minute payment window + seller UPI resolution (Tier PP) ──────────
|
|
390
|
+
// Deadline + displayed UPI apply only to methods with a buyer-uploaded
|
|
391
|
+
// proof step — never cod (paid on delivery), razorpay (paid before order
|
|
392
|
+
// creation), or admin_bypass (already marked paid above).
|
|
393
|
+
const hasPaymentWindow = !adminBypass &&
|
|
394
|
+
(paymentMethod === PaymentMethodValues.UPI_MANUAL ||
|
|
395
|
+
paymentMethod === PaymentMethodValues.CASH ||
|
|
396
|
+
paymentMethod === PaymentMethodValues.EMI);
|
|
397
|
+
const paymentDeadline = hasPaymentWindow
|
|
398
|
+
? new Date(Date.now() + PAYMENT_WINDOW_MS)
|
|
399
|
+
: undefined;
|
|
400
|
+
const displayedUpiId = hasPaymentWindow
|
|
401
|
+
? await resolveDisplayedUpiId(firstItem.storeId, siteContactUpiVpa)
|
|
402
|
+
: undefined;
|
|
385
403
|
const order = await unitOfWork.orders.create({
|
|
386
404
|
productId: firstItem.productId,
|
|
387
405
|
productTitle: firstItem.productTitle,
|
|
@@ -401,6 +419,8 @@ async function createOrderForGroup(group, orderType, ctx) {
|
|
|
401
419
|
paymentStatus: adminBypass ? PaymentStatusValues.PAID : PaymentStatusValues.PENDING,
|
|
402
420
|
paymentMethod: adminBypass ? PaymentMethodValues.ADMIN_BYPASS : paymentMethod,
|
|
403
421
|
paymentId: adminBatchId,
|
|
422
|
+
paymentDeadline,
|
|
423
|
+
displayedUpiId,
|
|
404
424
|
adminBypassBy: adminBypassBy,
|
|
405
425
|
shippingAddress,
|
|
406
426
|
notes,
|
|
@@ -510,6 +530,21 @@ export async function createCheckoutOrderAction(input) {
|
|
|
510
530
|
if (cartItems.length === 0) {
|
|
511
531
|
throw new ValidationError(ERROR_MESSAGES.CHECKOUT.CART_EMPTY);
|
|
512
532
|
}
|
|
533
|
+
// Tier PP — OTP gate for high-value checkouts. Evaluated against the
|
|
534
|
+
// WHOLE checkout batch's total (not each resulting per-seller order),
|
|
535
|
+
// otherwise a buyer could dodge it by splitting a big cart across
|
|
536
|
+
// sellers. Skipped for COD (physical hand-off at the door is its own
|
|
537
|
+
// verification) and admin-bypass checkouts.
|
|
538
|
+
const otpThreshold = siteSettings?.payment?.otpCheckoutThreshold;
|
|
539
|
+
if (!adminBypass && paymentMethod !== "cod" && typeof otpThreshold === "number" && otpThreshold > 0) {
|
|
540
|
+
const cartTotalForOtpCheck = cartItems.reduce((sum, item) => sum + item.price * item.quantity, 0);
|
|
541
|
+
if (cartTotalForOtpCheck >= otpThreshold) {
|
|
542
|
+
const verified = await isCheckoutValueOtpVerified(uid);
|
|
543
|
+
if (!verified) {
|
|
544
|
+
throw new ApiError(403, "CHECKOUT_VALUE_OTP_REQUIRED");
|
|
545
|
+
}
|
|
546
|
+
}
|
|
547
|
+
}
|
|
513
548
|
const isDigitalCart = cartIsDigitalOnly(cartItems);
|
|
514
549
|
let shippingAddress;
|
|
515
550
|
let resolvedAddress = null;
|
|
@@ -711,6 +746,7 @@ export async function createCheckoutOrderAction(input) {
|
|
|
711
746
|
droppedItems: unavailable,
|
|
712
747
|
buyerState: resolvedAddress?.state,
|
|
713
748
|
gstSettings: siteSettings?.gst,
|
|
749
|
+
siteContactUpiVpa: siteSettings?.contact?.upiVpa,
|
|
714
750
|
};
|
|
715
751
|
for (const { items: group, orderType } of orderGroups) {
|
|
716
752
|
total += await createOrderForGroup(group, orderType, groupCtx);
|
|
@@ -770,8 +806,8 @@ async function refundDroppedItemsForRazorpayCheckout(input) {
|
|
|
770
806
|
const { unavailablePaid, orderIds, productByIdPaid, razorpayPaymentId } = input;
|
|
771
807
|
if (unavailablePaid.length === 0 || orderIds.length === 0)
|
|
772
808
|
return;
|
|
773
|
-
const
|
|
774
|
-
if (
|
|
809
|
+
const droppedValue = unavailablePaid.reduce((sum, u) => sum + (productByIdPaid.get(u.productId)?.price ?? 0) * u.requestedQty, 0);
|
|
810
|
+
if (droppedValue <= 0)
|
|
775
811
|
return;
|
|
776
812
|
const primaryOrderId = orderIds[0];
|
|
777
813
|
try {
|
|
@@ -783,12 +819,12 @@ async function refundDroppedItemsForRazorpayCheckout(input) {
|
|
|
783
819
|
// FIRST order created in this batch is used as the refund's book-
|
|
784
820
|
// keeping anchor).
|
|
785
821
|
const refundAmount = primaryOrder
|
|
786
|
-
? Math.min(
|
|
787
|
-
:
|
|
822
|
+
? Math.min(droppedValue, primaryOrder.totalPrice)
|
|
823
|
+
: droppedValue;
|
|
788
824
|
const refundResult = await processRefundAction({
|
|
789
825
|
orderId: primaryOrderId,
|
|
790
826
|
type: "partial",
|
|
791
|
-
|
|
827
|
+
amount: refundAmount,
|
|
792
828
|
reason: `Automatic refund — ${unavailablePaid.length} item(s) unavailable at checkout: ${unavailablePaid.map((u) => u.productTitle).join(", ")}`,
|
|
793
829
|
method: "razorpay",
|
|
794
830
|
razorpayPaymentId,
|
|
@@ -803,7 +839,7 @@ async function refundDroppedItemsForRazorpayCheckout(input) {
|
|
|
803
839
|
void normalizeError(refundErr);
|
|
804
840
|
serverLogger.warn("verifyAndPlaceRazorpayOrderAction: automatic partial refund for dropped items failed — flagging for manual follow-up", {
|
|
805
841
|
orderId: primaryOrderId,
|
|
806
|
-
|
|
842
|
+
droppedValue,
|
|
807
843
|
err: refundErr instanceof Error ? refundErr.message : String(refundErr),
|
|
808
844
|
});
|
|
809
845
|
await unitOfWork.orders
|
|
@@ -973,14 +1009,14 @@ export async function verifyAndPlaceRazorpayOrderAction(input) {
|
|
|
973
1009
|
}
|
|
974
1010
|
{
|
|
975
1011
|
// SB-UNI-5 2026-05-13 — bundle cart-lines use item.price (locked
|
|
976
|
-
//
|
|
1012
|
+
// bundlePrice) instead of the representative member's product.price.
|
|
977
1013
|
const cartSubtotalRs = productChecks.reduce((sum, { item, product }) => {
|
|
978
1014
|
const isBundle = Boolean(item.bundleCategorySlug && item.bundleProductIds?.length);
|
|
979
1015
|
const unit = isBundle ? item.price : product.price;
|
|
980
1016
|
return sum + unit * item.quantity;
|
|
981
1017
|
}, 0);
|
|
982
|
-
const expectedPlatformFee =
|
|
983
|
-
const expectedGstOnFee =
|
|
1018
|
+
const expectedPlatformFee = roundRupees(cartSubtotalRs * (platformFeePercent / 100));
|
|
1019
|
+
const expectedGstOnFee = roundRupees(expectedPlatformFee * (gstPercent / 100));
|
|
984
1020
|
const expectedPaymentAmountRs = cartSubtotalRs + expectedPlatformFee + expectedGstOnFee;
|
|
985
1021
|
const rzpOrderRecord = await fetchRazorpayOrder(razorpay_order_id);
|
|
986
1022
|
const paidAmountRs = paiseToRupees(rzpOrderRecord.amount);
|
|
@@ -1035,7 +1071,7 @@ export async function verifyAndPlaceRazorpayOrderAction(input) {
|
|
|
1035
1071
|
.reduce((s, { item, product }) => s + unitPriceFor(item, product) * item.quantity, 0);
|
|
1036
1072
|
couponGroupDiscount =
|
|
1037
1073
|
eligibleTotal > 0
|
|
1038
|
-
? Math.min(
|
|
1074
|
+
? Math.min(roundRupees((eligibleTotal / groupTotal) * coupon.discountAmount), eligibleTotal)
|
|
1039
1075
|
: 0;
|
|
1040
1076
|
}
|
|
1041
1077
|
else {
|
|
@@ -1043,7 +1079,7 @@ export async function verifyAndPlaceRazorpayOrderAction(input) {
|
|
|
1043
1079
|
}
|
|
1044
1080
|
}
|
|
1045
1081
|
else if (cartSubtotal > 0) {
|
|
1046
|
-
couponGroupDiscount = Math.min(
|
|
1082
|
+
couponGroupDiscount = Math.min(roundRupees((groupTotal / cartSubtotal) * coupon.discountAmount), groupTotal);
|
|
1047
1083
|
}
|
|
1048
1084
|
if (couponGroupDiscount > 0) {
|
|
1049
1085
|
couponDiscount += couponGroupDiscount;
|
|
@@ -1058,8 +1094,8 @@ export async function verifyAndPlaceRazorpayOrderAction(input) {
|
|
|
1058
1094
|
}
|
|
1059
1095
|
}
|
|
1060
1096
|
couponDiscount = Math.min(couponDiscount, groupTotal);
|
|
1061
|
-
const rawPlatformFee =
|
|
1062
|
-
const gstOnFee =
|
|
1097
|
+
const rawPlatformFee = roundRupees(groupTotal * (platformFeePercent / 100));
|
|
1098
|
+
const gstOnFee = roundRupees(rawPlatformFee * (gstPercent / 100));
|
|
1063
1099
|
const platformFee = rawPlatformFee + gstOnFee;
|
|
1064
1100
|
const orderTotal = Math.max(0, groupTotal - couponDiscount) + shippingFee;
|
|
1065
1101
|
total += orderTotal;
|
|
@@ -1077,7 +1113,7 @@ export async function verifyAndPlaceRazorpayOrderAction(input) {
|
|
|
1077
1113
|
const lt = (product?.listingType ?? "standard");
|
|
1078
1114
|
const itemRule = getListingRule(lt);
|
|
1079
1115
|
// SB-UNI-5 2026-05-13 — bundle cart-lines surface the locked
|
|
1080
|
-
//
|
|
1116
|
+
// bundlePrice (item.price), not the representative member's
|
|
1081
1117
|
// product.price. Stock decrement still runs per member elsewhere.
|
|
1082
1118
|
const isBundle = Boolean(item.bundleCategorySlug && item.bundleProductIds?.length);
|
|
1083
1119
|
const unitPrice = isBundle ? item.price : product.price;
|
|
@@ -1134,7 +1170,7 @@ export async function verifyAndPlaceRazorpayOrderAction(input) {
|
|
|
1134
1170
|
paymentRecord: {
|
|
1135
1171
|
method: "razorpay",
|
|
1136
1172
|
transactionId: razorpay_payment_id,
|
|
1137
|
-
|
|
1173
|
+
amount: orderTotal,
|
|
1138
1174
|
paidAt: new Date(),
|
|
1139
1175
|
verifiedBy: "razorpay-webhook",
|
|
1140
1176
|
verificationMethod: "webhook",
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { OrderDocument } from "../../../../features/orders/schemas/firestore";
|
|
2
|
+
/**
|
|
3
|
+
* Restores stock for a single order — increments `availableQuantity` (+ any
|
|
4
|
+
* rule-specific counters, via the symmetric `stockIncrementExtras` hook) for
|
|
5
|
+
* every product the order touched, then marks the order `stockRestored` so
|
|
6
|
+
* a second call is a no-op. Call sites: the 15-min `paymentWindowTimeout`
|
|
7
|
+
* sweep, the 24h `pendingOrderTimeout` sweep (COD), and
|
|
8
|
+
* `adminRejectPaymentAsFraudAction`.
|
|
9
|
+
*
|
|
10
|
+
* Runs its own Firestore transaction — Firestore requires all reads before
|
|
11
|
+
* any writes, so this cannot be folded into a caller's existing batch/
|
|
12
|
+
* transaction that has already started writing. `extraOrderUpdate` lets the
|
|
13
|
+
* caller's own order-cancellation fields (`status`, `cancellationReason`,
|
|
14
|
+
* `cancellationDate`, ...) land in the SAME transaction as the stock
|
|
15
|
+
* restore, so the two can never partially apply.
|
|
16
|
+
*/
|
|
17
|
+
export declare function restoreStockForOrder(db: FirebaseFirestore.Firestore, order: OrderDocument & {
|
|
18
|
+
id: string;
|
|
19
|
+
}, extraOrderUpdate: Partial<OrderDocument>): Promise<void>;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { ORDER_COLLECTION } from "../../../../features/orders/schemas/firestore";
|
|
2
|
+
import { PRODUCT_COLLECTION } from "../../../../features/products/schemas/firestore";
|
|
3
|
+
import { getListingRule } from "../../../shared/checkout/rules";
|
|
4
|
+
/**
|
|
5
|
+
* Per-product quantity to restore for one order — the inverse of
|
|
6
|
+
* `getExpandedDecrements` (bundle-expansion.ts), but reads from
|
|
7
|
+
* `OrderDocument.items` (post-checkout) rather than `CartItemDocument[]`
|
|
8
|
+
* (pre-checkout). Nets out any partial per-item cancellation that already
|
|
9
|
+
* happened (`cancelledQuantity`) so a previously-cancelled line isn't
|
|
10
|
+
* double-restored.
|
|
11
|
+
*/
|
|
12
|
+
function getOrderRestoreMap(order) {
|
|
13
|
+
const map = new Map();
|
|
14
|
+
for (const item of order.items ?? []) {
|
|
15
|
+
const remainingQty = item.quantity - (item.cancelledQuantity ?? 0);
|
|
16
|
+
if (remainingQty <= 0)
|
|
17
|
+
continue;
|
|
18
|
+
const memberIds = item.bundleProductIds && item.bundleProductIds.length > 0
|
|
19
|
+
? item.bundleProductIds
|
|
20
|
+
: [item.productId];
|
|
21
|
+
for (const pid of memberIds) {
|
|
22
|
+
map.set(pid, (map.get(pid) ?? 0) + remainingQty);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
return map;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Restores stock for a single order — increments `availableQuantity` (+ any
|
|
29
|
+
* rule-specific counters, via the symmetric `stockIncrementExtras` hook) for
|
|
30
|
+
* every product the order touched, then marks the order `stockRestored` so
|
|
31
|
+
* a second call is a no-op. Call sites: the 15-min `paymentWindowTimeout`
|
|
32
|
+
* sweep, the 24h `pendingOrderTimeout` sweep (COD), and
|
|
33
|
+
* `adminRejectPaymentAsFraudAction`.
|
|
34
|
+
*
|
|
35
|
+
* Runs its own Firestore transaction — Firestore requires all reads before
|
|
36
|
+
* any writes, so this cannot be folded into a caller's existing batch/
|
|
37
|
+
* transaction that has already started writing. `extraOrderUpdate` lets the
|
|
38
|
+
* caller's own order-cancellation fields (`status`, `cancellationReason`,
|
|
39
|
+
* `cancellationDate`, ...) land in the SAME transaction as the stock
|
|
40
|
+
* restore, so the two can never partially apply.
|
|
41
|
+
*/
|
|
42
|
+
export async function restoreStockForOrder(db, order, extraOrderUpdate) {
|
|
43
|
+
if (order.stockRestored)
|
|
44
|
+
return;
|
|
45
|
+
const restoreMap = getOrderRestoreMap(order);
|
|
46
|
+
const orderRef = db.collection(ORDER_COLLECTION).doc(order.id);
|
|
47
|
+
if (restoreMap.size === 0) {
|
|
48
|
+
await orderRef.update({
|
|
49
|
+
...extraOrderUpdate,
|
|
50
|
+
stockRestored: true,
|
|
51
|
+
stockRestoredAt: new Date(),
|
|
52
|
+
});
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
await db.runTransaction(async (tx) => {
|
|
56
|
+
const productIds = [...restoreMap.keys()];
|
|
57
|
+
const refs = productIds.map((pid) => db.collection(PRODUCT_COLLECTION).doc(pid));
|
|
58
|
+
const snaps = await Promise.all(refs.map((ref) => tx.get(ref)));
|
|
59
|
+
for (const snap of snaps) {
|
|
60
|
+
if (!snap.exists)
|
|
61
|
+
continue;
|
|
62
|
+
const product = snap.data();
|
|
63
|
+
const qty = restoreMap.get(snap.id) ?? 0;
|
|
64
|
+
if (qty <= 0)
|
|
65
|
+
continue;
|
|
66
|
+
const lt = (product.listingType ?? "standard");
|
|
67
|
+
const rule = getListingRule(lt);
|
|
68
|
+
tx.update(snap.ref, {
|
|
69
|
+
availableQuantity: product.availableQuantity + qty,
|
|
70
|
+
updatedAt: new Date(),
|
|
71
|
+
...rule.stockIncrementExtras(product, qty),
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
tx.update(orderRef, {
|
|
75
|
+
...extraOrderUpdate,
|
|
76
|
+
stockRestored: true,
|
|
77
|
+
stockRestoredAt: new Date(),
|
|
78
|
+
});
|
|
79
|
+
});
|
|
80
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Resolves the UPI VPA to show a buyer paying manually for an order — the
|
|
3
|
+
* seller's own `payoutDetails.upiId` for a seller-owned store (falling back
|
|
4
|
+
* to the site default if the seller hasn't configured one), or the site UPI
|
|
5
|
+
* directly for an admin-owned store. Called once at order-creation time and
|
|
6
|
+
* stored as `order.displayedUpiId` — resolving server-side here (rather than
|
|
7
|
+
* client-side at render time) makes the value immutable and un-spoofable,
|
|
8
|
+
* which is what the buyer-reported-UPI cross-check at proof-submission time
|
|
9
|
+
* depends on.
|
|
10
|
+
*/
|
|
11
|
+
export declare function resolveDisplayedUpiId(storeId: string | undefined, siteContactUpiVpa: string | undefined): Promise<string | undefined>;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { storeRepository, userRepository } from "../../../../repositories";
|
|
2
|
+
import { isSellerUser } from "../../../../features/auth/role-predicates";
|
|
3
|
+
/**
|
|
4
|
+
* Resolves the UPI VPA to show a buyer paying manually for an order — the
|
|
5
|
+
* seller's own `payoutDetails.upiId` for a seller-owned store (falling back
|
|
6
|
+
* to the site default if the seller hasn't configured one), or the site UPI
|
|
7
|
+
* directly for an admin-owned store. Called once at order-creation time and
|
|
8
|
+
* stored as `order.displayedUpiId` — resolving server-side here (rather than
|
|
9
|
+
* client-side at render time) makes the value immutable and un-spoofable,
|
|
10
|
+
* which is what the buyer-reported-UPI cross-check at proof-submission time
|
|
11
|
+
* depends on.
|
|
12
|
+
*/
|
|
13
|
+
export async function resolveDisplayedUpiId(storeId, siteContactUpiVpa) {
|
|
14
|
+
const siteDefault = siteContactUpiVpa || undefined;
|
|
15
|
+
if (!storeId)
|
|
16
|
+
return siteDefault;
|
|
17
|
+
const store = await storeRepository.findById(storeId);
|
|
18
|
+
if (!store?.ownerId)
|
|
19
|
+
return siteDefault;
|
|
20
|
+
const owner = await userRepository.findById(store.ownerId);
|
|
21
|
+
if (!owner || !isSellerUser(owner))
|
|
22
|
+
return siteDefault;
|
|
23
|
+
const payoutDetails = owner.payoutDetails;
|
|
24
|
+
if (payoutDetails?.method === "upi" && payoutDetails.upiId) {
|
|
25
|
+
return payoutDetails.upiId;
|
|
26
|
+
}
|
|
27
|
+
return siteDefault;
|
|
28
|
+
}
|
|
@@ -10,7 +10,7 @@ export function renderClassifiedOg(doc, opts) {
|
|
|
10
10
|
style: "currency",
|
|
11
11
|
currency: doc.currency ?? "INR",
|
|
12
12
|
maximumFractionDigits: 0,
|
|
13
|
-
}).format(doc.price
|
|
13
|
+
}).format(doc.price)
|
|
14
14
|
: null;
|
|
15
15
|
return renderClassifiedOgImage({
|
|
16
16
|
title: doc?.title ?? "Classified Listing",
|
|
@@ -6,7 +6,7 @@ export function renderDigitalCodeOg(doc, opts) {
|
|
|
6
6
|
style: "currency",
|
|
7
7
|
currency: doc.currency ?? "INR",
|
|
8
8
|
maximumFractionDigits: 0,
|
|
9
|
-
}).format(doc.price
|
|
9
|
+
}).format(doc.price)
|
|
10
10
|
: null;
|
|
11
11
|
const deliveryMethod = doc?.digitalCode?.codeDeliveryMethod === "auto-claim"
|
|
12
12
|
? "Instant delivery"
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* Item-request-specific accents:
|
|
11
11
|
* - Header pill says "Wanted" with cyan accent.
|
|
12
12
|
* - Status badge (Open / Closed).
|
|
13
|
-
* - Budget chip when
|
|
13
|
+
* - Budget chip when maxBudget is set.
|
|
14
14
|
* - Reply count chip.
|
|
15
15
|
*/
|
|
16
16
|
import type { ReactElement } from "react";
|
|
@@ -26,7 +26,7 @@ export interface ItemRequestOgData {
|
|
|
26
26
|
interface ItemRequestDocLike {
|
|
27
27
|
title?: string | null;
|
|
28
28
|
opDisplayName?: string | null;
|
|
29
|
-
|
|
29
|
+
maxBudget?: number | null;
|
|
30
30
|
imageUrls?: (string | null | undefined)[] | null;
|
|
31
31
|
status?: string | null;
|
|
32
32
|
replyCount?: number | null;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { resolveOgImageUrl } from "../seo/og";
|
|
3
|
-
function formatPriceInr(
|
|
4
|
-
|
|
5
|
-
return `≤ ₹${rupees.toLocaleString("en-IN")}`;
|
|
3
|
+
function formatPriceInr(amount) {
|
|
4
|
+
return `≤ ₹${amount.toLocaleString("en-IN")}`;
|
|
6
5
|
}
|
|
7
6
|
function normalizeStatus(s) {
|
|
8
7
|
if (s === "open" || s === "closed" || s === "removed" || s === "approved")
|
|
@@ -10,8 +9,8 @@ function normalizeStatus(s) {
|
|
|
10
9
|
return null;
|
|
11
10
|
}
|
|
12
11
|
export function renderItemRequestOg(doc, opts) {
|
|
13
|
-
const budgetLabel = typeof doc?.
|
|
14
|
-
? formatPriceInr(doc.
|
|
12
|
+
const budgetLabel = typeof doc?.maxBudget === "number" && doc.maxBudget > 0
|
|
13
|
+
? formatPriceInr(doc.maxBudget)
|
|
15
14
|
: null;
|
|
16
15
|
return renderItemRequestOgImage({
|
|
17
16
|
title: doc?.title ?? "Item Request",
|
|
@@ -6,7 +6,7 @@ export function renderLiveItemOg(doc, opts) {
|
|
|
6
6
|
style: "currency",
|
|
7
7
|
currency: doc.currency ?? "INR",
|
|
8
8
|
maximumFractionDigits: 0,
|
|
9
|
-
}).format(doc.price
|
|
9
|
+
}).format(doc.price)
|
|
10
10
|
: null;
|
|
11
11
|
return renderLiveItemOgImage({
|
|
12
12
|
title: doc?.title ?? "Live Listing",
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Lottery adapters — strips server-only fields (
|
|
2
|
+
* Lottery adapters — strips server-only fields (price, weight)
|
|
3
3
|
* before any slot/config data leaves the server.
|
|
4
4
|
*/
|
|
5
5
|
import type { LotteryConfig, LotterySlot, ClientLotteryConfig, ClientLotterySlot } from "../../../../features/lottery/types";
|
|
6
|
-
/** Strip
|
|
6
|
+
/** Strip price and weight from a single slot for client consumption. */
|
|
7
7
|
export declare function toClientLotterySlot(slot: LotterySlot): ClientLotterySlot;
|
|
8
8
|
/** Strip price/weight from the entire config for client consumption. */
|
|
9
9
|
export declare function toClientLotteryConfig(config: LotteryConfig): ClientLotteryConfig;
|