@mohasinac/appkit 3.8.2 → 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 +3 -7
- package/dist/index.js +7 -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/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 +8 -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
|
@@ -33,7 +33,7 @@ export declare const emiInstallmentSchema: z.ZodObject<{
|
|
|
33
33
|
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
34
34
|
toDate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodDate>;
|
|
35
35
|
}, z.ZodTypeAny, "passthrough">>]>;
|
|
36
|
-
amount: z.ZodNumber
|
|
36
|
+
amount: z.ZodEffects<z.ZodNumber, number, number>;
|
|
37
37
|
status: z.ZodEnum<["pending", "paid", "overdue"]>;
|
|
38
38
|
paidAt: z.ZodOptional<z.ZodUnion<[z.ZodDate, z.ZodString, z.ZodObject<{
|
|
39
39
|
toDate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodDate>;
|
|
@@ -86,8 +86,8 @@ export declare const orderDocumentItemSchema: z.ZodObject<{
|
|
|
86
86
|
productId: z.ZodString;
|
|
87
87
|
productTitle: z.ZodString;
|
|
88
88
|
quantity: z.ZodNumber;
|
|
89
|
-
unitPrice: z.ZodNumber
|
|
90
|
-
totalPrice: z.ZodNumber
|
|
89
|
+
unitPrice: z.ZodEffects<z.ZodNumber, number, number>;
|
|
90
|
+
totalPrice: z.ZodEffects<z.ZodNumber, number, number>;
|
|
91
91
|
listingType: z.ZodOptional<z.ZodEnum<["standard", "auction", "pre-order", "prize-draw", "classified", "digital-code", "live"]>>;
|
|
92
92
|
prizeRevealStatus: z.ZodOptional<z.ZodEnum<["pending", "open", "closed", "revealed"]>>;
|
|
93
93
|
prizeRevealDeadline: z.ZodOptional<z.ZodString>;
|
|
@@ -116,7 +116,7 @@ export declare const orderDocumentItemSchema: z.ZodObject<{
|
|
|
116
116
|
export declare const orderRefundEventSchema: z.ZodObject<{
|
|
117
117
|
refundId: z.ZodString;
|
|
118
118
|
type: z.ZodEnum<["full", "partial"]>;
|
|
119
|
-
amount: z.ZodNumber
|
|
119
|
+
amount: z.ZodEffects<z.ZodNumber, number, number>;
|
|
120
120
|
itemIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
121
121
|
reason: z.ZodString;
|
|
122
122
|
refundedAt: z.ZodUnion<[z.ZodDate, z.ZodString, z.ZodObject<{
|
|
@@ -167,7 +167,7 @@ export declare const appliedOrderDiscountSchema: z.ZodObject<{
|
|
|
167
167
|
code: z.ZodString;
|
|
168
168
|
couponId: z.ZodOptional<z.ZodString>;
|
|
169
169
|
type: z.ZodEnum<["coupon", "deal", "auto"]>;
|
|
170
|
-
discountAmount: z.ZodNumber
|
|
170
|
+
discountAmount: z.ZodEffects<z.ZodNumber, number, number>;
|
|
171
171
|
scope: z.ZodOptional<z.ZodEnum<["admin", "seller"]>>;
|
|
172
172
|
storeId: z.ZodOptional<z.ZodString>;
|
|
173
173
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -251,8 +251,8 @@ export declare const orderFirestoreSchema: z.ZodObject<{
|
|
|
251
251
|
productId: z.ZodString;
|
|
252
252
|
productTitle: z.ZodString;
|
|
253
253
|
quantity: z.ZodNumber;
|
|
254
|
-
unitPrice: z.ZodNumber
|
|
255
|
-
totalPrice: z.ZodNumber
|
|
254
|
+
unitPrice: z.ZodEffects<z.ZodNumber, number, number>;
|
|
255
|
+
totalPrice: z.ZodEffects<z.ZodNumber, number, number>;
|
|
256
256
|
listingType: z.ZodOptional<z.ZodEnum<["standard", "auction", "pre-order", "prize-draw", "classified", "digital-code", "live"]>>;
|
|
257
257
|
prizeRevealStatus: z.ZodOptional<z.ZodEnum<["pending", "open", "closed", "revealed"]>>;
|
|
258
258
|
prizeRevealDeadline: z.ZodOptional<z.ZodString>;
|
|
@@ -281,8 +281,8 @@ export declare const orderFirestoreSchema: z.ZodObject<{
|
|
|
281
281
|
orderType: z.ZodOptional<z.ZodString>;
|
|
282
282
|
imageUrls: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
283
283
|
quantity: z.ZodNumber;
|
|
284
|
-
unitPrice: z.ZodNumber
|
|
285
|
-
totalPrice: z.ZodNumber
|
|
284
|
+
unitPrice: z.ZodEffects<z.ZodNumber, number, number>;
|
|
285
|
+
totalPrice: z.ZodEffects<z.ZodNumber, number, number>;
|
|
286
286
|
currency: z.ZodString;
|
|
287
287
|
status: z.ZodEnum<["pending", "confirmed", "processing", "shipped", "delivered", "cancelled", "refunded", "return_requested", "returned"]>;
|
|
288
288
|
paymentStatus: z.ZodEnum<["pending", "processing", "paid", "failed", "refunded", "partial_refund"]>;
|
|
@@ -320,18 +320,18 @@ export declare const orderFirestoreSchema: z.ZodObject<{
|
|
|
320
320
|
toDate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodDate>;
|
|
321
321
|
}, z.ZodTypeAny, "passthrough">>]>>;
|
|
322
322
|
cancellationReason: z.ZodOptional<z.ZodString>;
|
|
323
|
-
refundAmount: z.ZodOptional<z.ZodNumber
|
|
323
|
+
refundAmount: z.ZodOptional<z.ZodEffects<z.ZodNumber, number, number>>;
|
|
324
324
|
refundStatus: z.ZodOptional<z.ZodEnum<["pending", "processing", "completed", "rejected"]>>;
|
|
325
|
-
refundFeeDeducted: z.ZodOptional<z.ZodNumber
|
|
326
|
-
refundNetAmount: z.ZodOptional<z.ZodNumber
|
|
325
|
+
refundFeeDeducted: z.ZodOptional<z.ZodEffects<z.ZodNumber, number, number>>;
|
|
326
|
+
refundNetAmount: z.ZodOptional<z.ZodEffects<z.ZodNumber, number, number>>;
|
|
327
327
|
refundNote: z.ZodOptional<z.ZodString>;
|
|
328
328
|
couponCode: z.ZodOptional<z.ZodString>;
|
|
329
|
-
couponDiscount: z.ZodOptional<z.ZodNumber
|
|
329
|
+
couponDiscount: z.ZodOptional<z.ZodEffects<z.ZodNumber, number, number>>;
|
|
330
330
|
appliedDiscounts: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
331
331
|
code: z.ZodString;
|
|
332
332
|
couponId: z.ZodOptional<z.ZodString>;
|
|
333
333
|
type: z.ZodEnum<["coupon", "deal", "auto"]>;
|
|
334
|
-
discountAmount: z.ZodNumber
|
|
334
|
+
discountAmount: z.ZodEffects<z.ZodNumber, number, number>;
|
|
335
335
|
scope: z.ZodOptional<z.ZodEnum<["admin", "seller"]>>;
|
|
336
336
|
storeId: z.ZodOptional<z.ZodString>;
|
|
337
337
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -349,14 +349,14 @@ export declare const orderFirestoreSchema: z.ZodObject<{
|
|
|
349
349
|
storeId?: string | undefined;
|
|
350
350
|
couponId?: string | undefined;
|
|
351
351
|
}>, "many">>;
|
|
352
|
-
platformFee: z.ZodOptional<z.ZodNumber
|
|
353
|
-
depositAmount: z.ZodOptional<z.ZodNumber
|
|
354
|
-
codRemainingAmount: z.ZodOptional<z.ZodNumber
|
|
355
|
-
codHandlingFee: z.ZodOptional<z.ZodNumber
|
|
352
|
+
platformFee: z.ZodOptional<z.ZodEffects<z.ZodNumber, number, number>>;
|
|
353
|
+
depositAmount: z.ZodOptional<z.ZodEffects<z.ZodNumber, number, number>>;
|
|
354
|
+
codRemainingAmount: z.ZodOptional<z.ZodEffects<z.ZodNumber, number, number>>;
|
|
355
|
+
codHandlingFee: z.ZodOptional<z.ZodEffects<z.ZodNumber, number, number>>;
|
|
356
356
|
emiEnabled: z.ZodOptional<z.ZodBoolean>;
|
|
357
357
|
emiTenureMonths: z.ZodOptional<z.ZodNumber>;
|
|
358
|
-
emiTokenAmount: z.ZodOptional<z.ZodNumber
|
|
359
|
-
emiSurchargeAmount: z.ZodOptional<z.ZodNumber
|
|
358
|
+
emiTokenAmount: z.ZodOptional<z.ZodEffects<z.ZodNumber, number, number>>;
|
|
359
|
+
emiSurchargeAmount: z.ZodOptional<z.ZodEffects<z.ZodNumber, number, number>>;
|
|
360
360
|
emiInstallments: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
361
361
|
index: z.ZodNumber;
|
|
362
362
|
dueDate: z.ZodUnion<[z.ZodDate, z.ZodString, z.ZodObject<{
|
|
@@ -366,7 +366,7 @@ export declare const orderFirestoreSchema: z.ZodObject<{
|
|
|
366
366
|
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
367
367
|
toDate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodDate>;
|
|
368
368
|
}, z.ZodTypeAny, "passthrough">>]>;
|
|
369
|
-
amount: z.ZodNumber
|
|
369
|
+
amount: z.ZodEffects<z.ZodNumber, number, number>;
|
|
370
370
|
status: z.ZodEnum<["pending", "paid", "overdue"]>;
|
|
371
371
|
paidAt: z.ZodOptional<z.ZodUnion<[z.ZodDate, z.ZodString, z.ZodObject<{
|
|
372
372
|
toDate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodDate>;
|
|
@@ -415,9 +415,9 @@ export declare const orderFirestoreSchema: z.ZodObject<{
|
|
|
415
415
|
toDate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodDate>;
|
|
416
416
|
}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
417
417
|
}>, "many">>;
|
|
418
|
-
emiRemainingBalance: z.ZodOptional<z.ZodNumber
|
|
418
|
+
emiRemainingBalance: z.ZodOptional<z.ZodEffects<z.ZodNumber, number, number>>;
|
|
419
419
|
emiComplete: z.ZodOptional<z.ZodBoolean>;
|
|
420
|
-
shippingFee: z.ZodOptional<z.ZodNumber
|
|
420
|
+
shippingFee: z.ZodOptional<z.ZodEffects<z.ZodNumber, number, number>>;
|
|
421
421
|
shippingMethod: z.ZodOptional<z.ZodEnum<["custom"]>>;
|
|
422
422
|
shippingCarrier: z.ZodOptional<z.ZodString>;
|
|
423
423
|
trackingUrl: z.ZodOptional<z.ZodString>;
|
|
@@ -465,7 +465,7 @@ export declare const orderFirestoreSchema: z.ZodObject<{
|
|
|
465
465
|
refunds: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
466
466
|
refundId: z.ZodString;
|
|
467
467
|
type: z.ZodEnum<["full", "partial"]>;
|
|
468
|
-
amount: z.ZodNumber
|
|
468
|
+
amount: z.ZodEffects<z.ZodNumber, number, number>;
|
|
469
469
|
itemIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
470
470
|
reason: z.ZodString;
|
|
471
471
|
refundedAt: z.ZodUnion<[z.ZodDate, z.ZodString, z.ZodObject<{
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export * from "./firestore";
|
|
2
2
|
import { z } from "zod";
|
|
3
|
-
import { auditTimestampsShape, firestoreDateSchema,
|
|
3
|
+
import { auditTimestampsShape, firestoreDateSchema, rupeesSchema } from "../../../schemas/firestore-helpers";
|
|
4
4
|
// ─── Firestore document schema (W2) ───────────────────────────────────────────
|
|
5
5
|
// Mirrors OrderDocument + OrderDocumentItem + OrderRefundEvent +
|
|
6
6
|
// AppliedOrderDiscount in ./firestore.ts. Registered into SCHEMAS.firestore.orders.
|
|
@@ -36,7 +36,7 @@ export const emiInstallmentStatusSchema = z.enum(["pending", "paid", "overdue"])
|
|
|
36
36
|
export const emiInstallmentSchema = z.object({
|
|
37
37
|
index: z.number().int().positive(),
|
|
38
38
|
dueDate: firestoreDateSchema,
|
|
39
|
-
amount:
|
|
39
|
+
amount: rupeesSchema,
|
|
40
40
|
status: emiInstallmentStatusSchema,
|
|
41
41
|
paidAt: firestoreDateSchema.optional(),
|
|
42
42
|
transactionId: z.string().optional(),
|
|
@@ -47,8 +47,8 @@ export const orderDocumentItemSchema = z.object({
|
|
|
47
47
|
productId: z.string(),
|
|
48
48
|
productTitle: z.string(),
|
|
49
49
|
quantity: z.number().int().positive(),
|
|
50
|
-
unitPrice:
|
|
51
|
-
totalPrice:
|
|
50
|
+
unitPrice: rupeesSchema,
|
|
51
|
+
totalPrice: rupeesSchema,
|
|
52
52
|
listingType: orderListingTypeSchema.optional(),
|
|
53
53
|
prizeRevealStatus: z.enum(["pending", "open", "closed", "revealed"]).optional(),
|
|
54
54
|
prizeRevealDeadline: z.string().optional(),
|
|
@@ -57,7 +57,7 @@ export const orderDocumentItemSchema = z.object({
|
|
|
57
57
|
export const orderRefundEventSchema = z.object({
|
|
58
58
|
refundId: z.string(),
|
|
59
59
|
type: orderRefundTypeSchema,
|
|
60
|
-
amount:
|
|
60
|
+
amount: rupeesSchema,
|
|
61
61
|
itemIds: z.array(z.string()).optional(),
|
|
62
62
|
reason: z.string(),
|
|
63
63
|
refundedAt: firestoreDateSchema,
|
|
@@ -72,7 +72,7 @@ export const appliedOrderDiscountSchema = z.object({
|
|
|
72
72
|
code: z.string(),
|
|
73
73
|
couponId: z.string().optional(),
|
|
74
74
|
type: z.enum(["coupon", "deal", "auto"]),
|
|
75
|
-
discountAmount:
|
|
75
|
+
discountAmount: rupeesSchema,
|
|
76
76
|
scope: z.enum(["admin", "seller"]).optional(),
|
|
77
77
|
storeId: z.string().optional(),
|
|
78
78
|
});
|
|
@@ -100,8 +100,8 @@ export const orderFirestoreSchema = z.object({
|
|
|
100
100
|
orderType: z.string().optional(),
|
|
101
101
|
imageUrls: z.array(z.string()).optional(),
|
|
102
102
|
quantity: z.number().int().positive(),
|
|
103
|
-
unitPrice:
|
|
104
|
-
totalPrice:
|
|
103
|
+
unitPrice: rupeesSchema,
|
|
104
|
+
totalPrice: rupeesSchema,
|
|
105
105
|
currency: z.string(),
|
|
106
106
|
status: z.enum([
|
|
107
107
|
"pending",
|
|
@@ -125,26 +125,26 @@ export const orderFirestoreSchema = z.object({
|
|
|
125
125
|
deliveryDate: firestoreDateSchema.optional(),
|
|
126
126
|
cancellationDate: firestoreDateSchema.optional(),
|
|
127
127
|
cancellationReason: z.string().optional(),
|
|
128
|
-
refundAmount:
|
|
128
|
+
refundAmount: rupeesSchema.optional(),
|
|
129
129
|
refundStatus: orderRefundStatusSchema.optional(),
|
|
130
|
-
refundFeeDeducted:
|
|
131
|
-
refundNetAmount:
|
|
130
|
+
refundFeeDeducted: rupeesSchema.optional(),
|
|
131
|
+
refundNetAmount: rupeesSchema.optional(),
|
|
132
132
|
refundNote: z.string().optional(),
|
|
133
133
|
couponCode: z.string().optional(),
|
|
134
|
-
couponDiscount:
|
|
134
|
+
couponDiscount: rupeesSchema.optional(),
|
|
135
135
|
appliedDiscounts: z.array(appliedOrderDiscountSchema).optional(),
|
|
136
|
-
platformFee:
|
|
137
|
-
depositAmount:
|
|
138
|
-
codRemainingAmount:
|
|
139
|
-
codHandlingFee:
|
|
136
|
+
platformFee: rupeesSchema.optional(),
|
|
137
|
+
depositAmount: rupeesSchema.optional(),
|
|
138
|
+
codRemainingAmount: rupeesSchema.optional(),
|
|
139
|
+
codHandlingFee: rupeesSchema.optional(),
|
|
140
140
|
emiEnabled: z.boolean().optional(),
|
|
141
141
|
emiTenureMonths: z.number().int().min(2).max(6).optional(),
|
|
142
|
-
emiTokenAmount:
|
|
143
|
-
emiSurchargeAmount:
|
|
142
|
+
emiTokenAmount: rupeesSchema.optional(),
|
|
143
|
+
emiSurchargeAmount: rupeesSchema.optional(),
|
|
144
144
|
emiInstallments: z.array(emiInstallmentSchema).optional(),
|
|
145
|
-
emiRemainingBalance:
|
|
145
|
+
emiRemainingBalance: rupeesSchema.optional(),
|
|
146
146
|
emiComplete: z.boolean().optional(),
|
|
147
|
-
shippingFee:
|
|
147
|
+
shippingFee: rupeesSchema.optional(),
|
|
148
148
|
shippingMethod: orderShippingMethodSchema.optional(),
|
|
149
149
|
shippingCarrier: z.string().optional(),
|
|
150
150
|
trackingUrl: z.string().optional(),
|
|
@@ -80,6 +80,10 @@ export interface Order {
|
|
|
80
80
|
};
|
|
81
81
|
createdAt?: string;
|
|
82
82
|
updatedAt?: string;
|
|
83
|
+
/** Tier PP — true when the 2-hour auto-approve sweep confirmed this order's payment instead of a manual admin review. Drives the "Raise a dispute" CTA. */
|
|
84
|
+
autoApproved?: boolean;
|
|
85
|
+
disputeRaised?: boolean;
|
|
86
|
+
disputeStatus?: "open" | "resolved";
|
|
83
87
|
/**
|
|
84
88
|
* Reveal-mode prize-draw fields (SB4-H/SB8-C). Set once the reveal
|
|
85
89
|
* endpoint has assigned a prize to this order; used to drive the
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
* 1. ONE order row whose `bundleCategorySlug` + `bundleProductIds[]` set
|
|
12
12
|
* describe the bundle (this is what S-SBUNI-4's checkout writes — the
|
|
13
13
|
* bundle stays a single row in the order with the locked
|
|
14
|
-
*
|
|
14
|
+
* bundlePrice as its line total).
|
|
15
15
|
* 2. (Future) Expanded N rows, each tagged with the same
|
|
16
16
|
* `bundleCategorySlug`. The grouping handles this too in case a future
|
|
17
17
|
* session pivots to row expansion.
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
* 1. ONE order row whose `bundleCategorySlug` + `bundleProductIds[]` set
|
|
12
12
|
* describe the bundle (this is what S-SBUNI-4's checkout writes — the
|
|
13
13
|
* bundle stays a single row in the order with the locked
|
|
14
|
-
*
|
|
14
|
+
* bundlePrice as its line total).
|
|
15
15
|
* 2. (Future) Expanded N rows, each tagged with the same
|
|
16
16
|
* `bundleCategorySlug`. The grouping handles this too in case a future
|
|
17
17
|
* session pivots to row expansion.
|
|
@@ -22,8 +22,8 @@ export declare const payoutBankAccountSchema: z.ZodObject<{
|
|
|
22
22
|
export declare const payoutRefundDeductionSchema: z.ZodObject<{
|
|
23
23
|
orderId: z.ZodString;
|
|
24
24
|
refundId: z.ZodString;
|
|
25
|
-
refundedAmount: z.ZodNumber
|
|
26
|
-
deductedAmount: z.ZodNumber
|
|
25
|
+
refundedAmount: z.ZodEffects<z.ZodNumber, number, number>;
|
|
26
|
+
deductedAmount: z.ZodEffects<z.ZodNumber, number, number>;
|
|
27
27
|
reason: z.ZodString;
|
|
28
28
|
appliedAt: z.ZodUnion<[z.ZodDate, z.ZodString, z.ZodObject<{
|
|
29
29
|
toDate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodDate>;
|
|
@@ -70,9 +70,9 @@ export declare const payoutFirestoreSchema: z.ZodObject<{
|
|
|
70
70
|
storeId: z.ZodString;
|
|
71
71
|
sellerName: z.ZodString;
|
|
72
72
|
sellerEmail: z.ZodString;
|
|
73
|
-
amount: z.ZodNumber
|
|
74
|
-
grossAmount: z.ZodNumber
|
|
75
|
-
platformFee: z.ZodNumber
|
|
73
|
+
amount: z.ZodEffects<z.ZodNumber, number, number>;
|
|
74
|
+
grossAmount: z.ZodEffects<z.ZodNumber, number, number>;
|
|
75
|
+
platformFee: z.ZodEffects<z.ZodNumber, number, number>;
|
|
76
76
|
platformFeeRate: z.ZodNumber;
|
|
77
77
|
currency: z.ZodString;
|
|
78
78
|
status: z.ZodEnum<["pending", "processing", "paid", "failed"]>;
|
|
@@ -97,16 +97,16 @@ export declare const payoutFirestoreSchema: z.ZodObject<{
|
|
|
97
97
|
notes: z.ZodOptional<z.ZodString>;
|
|
98
98
|
adminNote: z.ZodOptional<z.ZodString>;
|
|
99
99
|
orderIds: z.ZodArray<z.ZodString, "many">;
|
|
100
|
-
gatewayFee: z.ZodOptional<z.ZodNumber
|
|
100
|
+
gatewayFee: z.ZodOptional<z.ZodEffects<z.ZodNumber, number, number>>;
|
|
101
101
|
gatewayFeeRate: z.ZodOptional<z.ZodNumber>;
|
|
102
|
-
gstAmount: z.ZodOptional<z.ZodNumber
|
|
102
|
+
gstAmount: z.ZodOptional<z.ZodEffects<z.ZodNumber, number, number>>;
|
|
103
103
|
gstRate: z.ZodOptional<z.ZodNumber>;
|
|
104
104
|
isAutomatic: z.ZodOptional<z.ZodBoolean>;
|
|
105
105
|
refundDeductions: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
106
106
|
orderId: z.ZodString;
|
|
107
107
|
refundId: z.ZodString;
|
|
108
|
-
refundedAmount: z.ZodNumber
|
|
109
|
-
deductedAmount: z.ZodNumber
|
|
108
|
+
refundedAmount: z.ZodEffects<z.ZodNumber, number, number>;
|
|
109
|
+
deductedAmount: z.ZodEffects<z.ZodNumber, number, number>;
|
|
110
110
|
reason: z.ZodString;
|
|
111
111
|
appliedAt: z.ZodUnion<[z.ZodDate, z.ZodString, z.ZodObject<{
|
|
112
112
|
toDate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodDate>;
|
|
@@ -134,7 +134,7 @@ export declare const payoutFirestoreSchema: z.ZodObject<{
|
|
|
134
134
|
toDate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodDate>;
|
|
135
135
|
}, z.ZodTypeAny, "passthrough">;
|
|
136
136
|
}>, "many">>;
|
|
137
|
-
netAmount: z.ZodOptional<z.ZodNumber
|
|
137
|
+
netAmount: z.ZodOptional<z.ZodEffects<z.ZodNumber, number, number>>;
|
|
138
138
|
requestedAt: z.ZodUnion<[z.ZodDate, z.ZodString, z.ZodObject<{
|
|
139
139
|
toDate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodDate>;
|
|
140
140
|
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
@@ -2,7 +2,7 @@ export * from "./firestore";
|
|
|
2
2
|
export * from "./saved-methods-firestore";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
import { getDefaultCurrency } from "../../../core/baseline-resolver";
|
|
5
|
-
import { auditTimestampsShape, firestoreDateSchema,
|
|
5
|
+
import { auditTimestampsShape, firestoreDateSchema, rupeesSchema } from "../../../schemas/firestore-helpers";
|
|
6
6
|
// ─── Firestore document schema (W2) ───────────────────────────────────────────
|
|
7
7
|
// Mirrors PayoutDocument + PayoutRefundDeduction + PayoutBankAccount in
|
|
8
8
|
// ./firestore.ts. Registered into SCHEMAS.firestore.payouts.
|
|
@@ -17,8 +17,8 @@ export const payoutBankAccountSchema = z.object({
|
|
|
17
17
|
export const payoutRefundDeductionSchema = z.object({
|
|
18
18
|
orderId: z.string(),
|
|
19
19
|
refundId: z.string(),
|
|
20
|
-
refundedAmount:
|
|
21
|
-
deductedAmount:
|
|
20
|
+
refundedAmount: rupeesSchema,
|
|
21
|
+
deductedAmount: rupeesSchema,
|
|
22
22
|
reason: z.string(),
|
|
23
23
|
appliedAt: firestoreDateSchema,
|
|
24
24
|
});
|
|
@@ -27,9 +27,9 @@ export const payoutFirestoreSchema = z.object({
|
|
|
27
27
|
storeId: z.string(),
|
|
28
28
|
sellerName: z.string(),
|
|
29
29
|
sellerEmail: z.string(),
|
|
30
|
-
amount:
|
|
31
|
-
grossAmount:
|
|
32
|
-
platformFee:
|
|
30
|
+
amount: rupeesSchema,
|
|
31
|
+
grossAmount: rupeesSchema,
|
|
32
|
+
platformFee: rupeesSchema,
|
|
33
33
|
platformFeeRate: z.number().min(0).max(1),
|
|
34
34
|
currency: z.string(),
|
|
35
35
|
status: payoutStatusEnumSchema,
|
|
@@ -39,13 +39,13 @@ export const payoutFirestoreSchema = z.object({
|
|
|
39
39
|
notes: z.string().optional(),
|
|
40
40
|
adminNote: z.string().optional(),
|
|
41
41
|
orderIds: z.array(z.string()),
|
|
42
|
-
gatewayFee:
|
|
42
|
+
gatewayFee: rupeesSchema.optional(),
|
|
43
43
|
gatewayFeeRate: z.number().optional(),
|
|
44
|
-
gstAmount:
|
|
44
|
+
gstAmount: rupeesSchema.optional(),
|
|
45
45
|
gstRate: z.number().optional(),
|
|
46
46
|
isAutomatic: z.boolean().optional(),
|
|
47
47
|
refundDeductions: z.array(payoutRefundDeductionSchema).optional(),
|
|
48
|
-
netAmount:
|
|
48
|
+
netAmount: rupeesSchema.optional(),
|
|
49
49
|
requestedAt: firestoreDateSchema,
|
|
50
50
|
processedAt: firestoreDateSchema.optional(),
|
|
51
51
|
...auditTimestampsShape,
|
|
@@ -13,7 +13,7 @@ const CLS_PREORDER_BADGE = "inline-block rounded-full bg-indigo-100 dark:bg-indi
|
|
|
13
13
|
const CLS_STATUS_BADGE = "inline-block rounded-full bg-warning-surface dark:bg-warning-surface px-[var(--appkit-space-2-5)] py-[var(--appkit-space-0-5)] text-warning dark:text-warning";
|
|
14
14
|
import { ROUTES } from "../../../next";
|
|
15
15
|
import { getDefaultCurrency } from "../../../core/baseline-resolver";
|
|
16
|
-
import { formatCurrency } from "../../../utils/number.formatter";
|
|
16
|
+
import { formatCurrency, roundRupees } from "../../../utils/number.formatter";
|
|
17
17
|
import { normalizeRichTextHtml } from "../../../utils/string.formatter";
|
|
18
18
|
import { safeDisplayName } from "../../../security";
|
|
19
19
|
import { ProgressBarFill } from "../../../ui/components/ProgressBarFill";
|
|
@@ -101,7 +101,7 @@ export async function PreOrderDetailPageView({ id, initialPreOrder, onReserveNow
|
|
|
101
101
|
const depositAmount = typeof p.preOrderDepositAmount === "number"
|
|
102
102
|
? p.preOrderDepositAmount
|
|
103
103
|
: price !== null && depositPercent !== null
|
|
104
|
-
?
|
|
104
|
+
? roundRupees((price * depositPercent) / 100)
|
|
105
105
|
: null;
|
|
106
106
|
const deliveryDate = p.preOrderDeliveryDate
|
|
107
107
|
? new Date(p.preOrderDeliveryDate)
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
type SearchParams = Record<string, string | string[]>;
|
|
3
|
+
export interface ArtStickersListViewProps {
|
|
4
|
+
searchParams?: SearchParams;
|
|
5
|
+
}
|
|
6
|
+
export declare function ArtStickersListView({ searchParams }: ArtStickersListViewProps): Promise<React.JSX.Element>;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { productRepository } from "../../../repositories";
|
|
3
|
+
import { Container, Heading, Main, Section, Text } from "../../../ui";
|
|
4
|
+
import { AdSlot } from "../../homepage/components/AdSlot";
|
|
5
|
+
import { parseListingSearchParams } from "../../../utils/listing-params";
|
|
6
|
+
import { ProductsIndexListing } from "./ProductsIndexListing";
|
|
7
|
+
import { PRODUCT_FIELDS } from "../../../constants/field-names";
|
|
8
|
+
import { sieveFilter, sieveMultiEq, sieveAnd, SIEVE_OP } from "../../../utils/sieve-builder";
|
|
9
|
+
import { sortBy } from "../../../constants/sort";
|
|
10
|
+
import { ART_STICKERS_TYPE_FILTER_TABS } from "../constants/listing-tabs";
|
|
11
|
+
const ART_STICKERS_LISTING_TYPES = ["art", "stickers"];
|
|
12
|
+
const DEFAULT_PAGE = 1;
|
|
13
|
+
const DEFAULT_PAGE_SIZE = 24;
|
|
14
|
+
const DEFAULT_SORT = sortBy(PRODUCT_FIELDS.CREATED_AT);
|
|
15
|
+
function sp(params, key) {
|
|
16
|
+
const v = params[key];
|
|
17
|
+
return Array.isArray(v) ? v[0] ?? "" : v ?? "";
|
|
18
|
+
}
|
|
19
|
+
function buildArtStickersFilters(params) {
|
|
20
|
+
const listingTypeParam = sp(params, "listingType");
|
|
21
|
+
const listingType = listingTypeParam && ART_STICKERS_LISTING_TYPES.includes(listingTypeParam)
|
|
22
|
+
? listingTypeParam
|
|
23
|
+
: ART_STICKERS_LISTING_TYPES.join("|");
|
|
24
|
+
const parts = [
|
|
25
|
+
sieveFilter(PRODUCT_FIELDS.STATUS, SIEVE_OP.EQ, PRODUCT_FIELDS.STATUS_VALUES.PUBLISHED),
|
|
26
|
+
sieveFilter(PRODUCT_FIELDS.LISTING_TYPE, SIEVE_OP.EQ, listingType),
|
|
27
|
+
];
|
|
28
|
+
const condition = sp(params, "condition");
|
|
29
|
+
if (condition) {
|
|
30
|
+
const values = condition.split("|").filter(Boolean);
|
|
31
|
+
if (values.length === 1)
|
|
32
|
+
parts.push(sieveFilter(PRODUCT_FIELDS.CONDITION, SIEVE_OP.EQ, values[0]));
|
|
33
|
+
else if (values.length > 1)
|
|
34
|
+
parts.push(sieveMultiEq(PRODUCT_FIELDS.CONDITION, values));
|
|
35
|
+
}
|
|
36
|
+
const minPrice = sp(params, "minPrice");
|
|
37
|
+
const maxPrice = sp(params, "maxPrice");
|
|
38
|
+
if (minPrice)
|
|
39
|
+
parts.push(sieveFilter(PRODUCT_FIELDS.PRICE, SIEVE_OP.GTE, minPrice));
|
|
40
|
+
if (maxPrice)
|
|
41
|
+
parts.push(sieveFilter(PRODUCT_FIELDS.PRICE, SIEVE_OP.LTE, maxPrice));
|
|
42
|
+
const storeId = sp(params, "seller");
|
|
43
|
+
if (storeId)
|
|
44
|
+
parts.push(sieveFilter(PRODUCT_FIELDS.STORE_ID, SIEVE_OP.EQ, storeId));
|
|
45
|
+
return sieveAnd(...parts);
|
|
46
|
+
}
|
|
47
|
+
export async function ArtStickersListView({ searchParams = {} }) {
|
|
48
|
+
const std = parseListingSearchParams(searchParams);
|
|
49
|
+
const sort = std.sorts ?? DEFAULT_SORT;
|
|
50
|
+
const page = std.page ?? DEFAULT_PAGE;
|
|
51
|
+
const pageSize = std.pageSize ?? DEFAULT_PAGE_SIZE;
|
|
52
|
+
const filters = buildArtStickersFilters(searchParams);
|
|
53
|
+
const result = await productRepository
|
|
54
|
+
.list({ filters, sorts: sort, page, pageSize })
|
|
55
|
+
.catch(() => null);
|
|
56
|
+
return (_jsxs(Main, { children: [_jsx(Section, { border: "bottom-subtle", paddingY: "b-md", padding: "t-xl", children: _jsxs(Container, { size: "xl", children: [_jsx(Heading, { level: 1, size: "3xl", weight: "bold", color: "primary", children: "Art & Stickers" }), _jsx(Text, { className: "mt-1", color: "muted", size: "sm", children: "Original art prints and sticker packs from independent sellers" })] }) }), _jsxs(Container, { size: "xl", padding: "x-md", children: [_jsx(AdSlot, { id: "listing-sidebar-top", className: "mb-4 mt-4" }), _jsx(ProductsIndexListing, { initialData: result ?? null, listingTypes: ART_STICKERS_LISTING_TYPES, typeTabs: ART_STICKERS_TYPE_FILTER_TABS, searchPlaceholder: "Search art & stickers..." }), _jsx(AdSlot, { id: "listing-sidebar-bottom", className: "mt-8" })] })] }));
|
|
57
|
+
}
|
|
@@ -138,7 +138,7 @@ export function GroupSettingsPanel({ productId, productSlug, groupId, isGroupPar
|
|
|
138
138
|
await apiClient.post(childrenEndpoint, {
|
|
139
139
|
mode: "create",
|
|
140
140
|
title: createForm.title,
|
|
141
|
-
price: Math.round(parseFloat(createForm.price) * 100),
|
|
141
|
+
price: Math.round(parseFloat(createForm.price) * 100) / 100,
|
|
142
142
|
condition: createForm.condition,
|
|
143
143
|
parentId: productId,
|
|
144
144
|
});
|
|
@@ -3,7 +3,7 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
3
3
|
import { useState, useTransition } from "react";
|
|
4
4
|
import { Button, Div, Input, LoginRequiredModal, Modal, Span, Stack, Text } from "../../../ui";
|
|
5
5
|
import { isAuthError } from "../../../utils/auth-error";
|
|
6
|
-
import { formatCurrency } from "../../../utils/number.formatter";
|
|
6
|
+
import { formatCurrency, roundRupees } from "../../../utils/number.formatter";
|
|
7
7
|
import { normalizeError } from "../../../errors/normalize";
|
|
8
8
|
const CLS_SUCCESS_BOX = "rounded-xl border border-success dark:border-success bg-success-surface p-[var(--appkit-space-4)] text-left space-y-1";
|
|
9
9
|
const CLS_PENDING_BOX = "rounded-xl border border-warning dark:border-warning bg-warning-surface dark:bg-warning-surface p-[var(--appkit-space-4)] text-left space-y-1";
|
|
@@ -17,8 +17,8 @@ export function MakeOfferButton({ productId, listedPrice, currency, minOfferPerc
|
|
|
17
17
|
const [errorMsg, setErrorMsg] = useState("");
|
|
18
18
|
const [showLoginModal, setShowLoginModal] = useState(false);
|
|
19
19
|
const [isPending, startTransition] = useTransition();
|
|
20
|
-
const minOffer =
|
|
21
|
-
const defaultOffer =
|
|
20
|
+
const minOffer = roundRupees(listedPrice * (minOfferPercent / 100));
|
|
21
|
+
const defaultOffer = roundRupees(listedPrice * 0.9);
|
|
22
22
|
const [offerAmount, setOfferAmount] = useState(Math.max(defaultOffer, minOffer));
|
|
23
23
|
const [buyerNote, setBuyerNote] = useState("");
|
|
24
24
|
const fmt = (n) => currency ? formatCurrency(n, currency) : `₹${n.toLocaleString()}`;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { CategoryDocument } from "../../categories/schemas/firestore";
|
|
2
|
-
export type MarketplaceBundleCardData = Pick<CategoryDocument, "id" | "name" | "slug" | "bundleItemDetails" | "bundleProductIds" | "
|
|
2
|
+
export type MarketplaceBundleCardData = Pick<CategoryDocument, "id" | "name" | "slug" | "bundleItemDetails" | "bundleProductIds" | "bundlePrice" | "bundleStockStatus" | "display">;
|
|
3
3
|
export interface MarketplaceBundleCardLabels {
|
|
4
4
|
bundleBadge?: string;
|
|
5
5
|
inStockBadge?: string;
|
|
@@ -33,7 +33,7 @@ export function MarketplaceBundleCard({ bundle, className = "", variant = "grid"
|
|
|
33
33
|
const memberCount = bundle.bundleProductIds?.length ?? 0;
|
|
34
34
|
const stock = bundle.bundleStockStatus ?? "in_stock";
|
|
35
35
|
const cover = bundle.display?.coverImage;
|
|
36
|
-
const price = bundle.
|
|
36
|
+
const price = bundle.bundlePrice;
|
|
37
37
|
const collageTiles = (bundle.bundleItemDetails ?? [])
|
|
38
38
|
.filter((d) => Boolean(d.imageURL))
|
|
39
39
|
.slice(0, 4);
|
|
@@ -52,7 +52,7 @@ export function MarketplaceBundleCard({ bundle, className = "", variant = "grid"
|
|
|
52
52
|
}, className: selectable || isSelected
|
|
53
53
|
? "opacity-100"
|
|
54
54
|
: "opacity-0 group-hover:opacity-100 transition-opacity" }))] }), _jsxs(BaseListingCard.Info, { variant: variant, children: [_jsx(TextLink, { href: String(detailHref), children: _jsx(Text, { size: "sm", weight: "medium", color: "primary", truncate: 2, children: bundle.name }) }), _jsxs(Row, { justify: "between", className: "mt-1", gap: "sm", children: [_jsx(Text, { size: "sm", weight: "semibold", color: "primary", children: price
|
|
55
|
-
? formatCurrency(price
|
|
55
|
+
? formatCurrency(price, getDefaultCurrency())
|
|
56
56
|
: "—" }), _jsx(Text, { className: "text-[var(--appkit-color-text-muted)]", size: "xs", children: mergedLabels.itemsLabel(memberCount) })] }), _jsx(Div, { className: CLS_VIEW_BTN, role: "button", tabIndex: 0, onClick: handleNavigate, onKeyDown: (e) => { if (e.key === "Enter" || e.key === " ")
|
|
57
57
|
handleNavigate(); }, children: "View Bundle" })] })] }));
|
|
58
58
|
}
|
|
@@ -41,7 +41,7 @@ function toGalleryImages(items) {
|
|
|
41
41
|
badge: `#${it.itemNumber}`,
|
|
42
42
|
caption: it.title || `Prize #${it.itemNumber}`,
|
|
43
43
|
sub: it.estimatedValue != null
|
|
44
|
-
? `est. ₹${
|
|
44
|
+
? `est. ₹${it.estimatedValue.toLocaleString("en-IN")}`
|
|
45
45
|
: undefined,
|
|
46
46
|
}));
|
|
47
47
|
}
|
|
@@ -60,7 +60,7 @@ export function PrizeDrawCollage({ items, highlightItemNumber, onItemClick, wonL
|
|
|
60
60
|
isHighlight
|
|
61
61
|
? "ring-2 ring-offset-2 ring-[var(--appkit-color-primary)] scale-[1.02]"
|
|
62
62
|
: "hover:scale-[1.01]",
|
|
63
|
-
].join(" "), "aria-label": `View ${it.title || `prize #${it.itemNumber}`} in lightbox`, children: [_jsxs(Div, { className: "relative aspect-square w-full", children: [cover ? (_jsx(MediaImage, { src: cover, alt: it.title || `Prize #${it.itemNumber}`, size: "thumbnail" })) : (_jsx(Row, { className: "absolute inset-0 bg-[var(--appkit-color-surface-muted)]", align: "center", justify: "center", children: _jsx(Text, { className: "text-[var(--appkit-color-text-muted)]", size: "xs", children: "No image" }) })), _jsxs(Div, { textWeight: "semibold", textSize: "xs", surface: "overlay-xl", padding: "chip-2xs", className: "absolute left-2 top-2 text-white", rounded: "default", children: ["#", it.itemNumber] }), it.isWon && !hideWonState ? (_jsxs(_Fragment, { children: [_jsx(Scrim, { direction: "diagonal", intensity: "medium", multiply: true, className: "absolute inset-0" }), _jsx(Row, { className: "absolute inset-0", align: "center", justify: "center", children: _jsx(Text, { className: CLS_WON_STAMP, children: wonLabel }) })] })) : null] }), _jsxs(Div, { padding: "xs", children: [_jsx(Text, { className: "line-clamp-2", size: "sm", weight: "medium", children: it.title || `Prize #${it.itemNumber}` }), it.estimatedValue != null ? (_jsxs(Text, { className: "text-[var(--appkit-color-text-muted)]", size: "xs", children: ["est. \u20B9",
|
|
63
|
+
].join(" "), "aria-label": `View ${it.title || `prize #${it.itemNumber}`} in lightbox`, children: [_jsxs(Div, { className: "relative aspect-square w-full", children: [cover ? (_jsx(MediaImage, { src: cover, alt: it.title || `Prize #${it.itemNumber}`, size: "thumbnail" })) : (_jsx(Row, { className: "absolute inset-0 bg-[var(--appkit-color-surface-muted)]", align: "center", justify: "center", children: _jsx(Text, { className: "text-[var(--appkit-color-text-muted)]", size: "xs", children: "No image" }) })), _jsxs(Div, { textWeight: "semibold", textSize: "xs", surface: "overlay-xl", padding: "chip-2xs", className: "absolute left-2 top-2 text-white", rounded: "default", children: ["#", it.itemNumber] }), it.isWon && !hideWonState ? (_jsxs(_Fragment, { children: [_jsx(Scrim, { direction: "diagonal", intensity: "medium", multiply: true, className: "absolute inset-0" }), _jsx(Row, { className: "absolute inset-0", align: "center", justify: "center", children: _jsx(Text, { className: CLS_WON_STAMP, children: wonLabel }) })] })) : null] }), _jsxs(Div, { padding: "xs", children: [_jsx(Text, { className: "line-clamp-2", size: "sm", weight: "medium", children: it.title || `Prize #${it.itemNumber}` }), it.estimatedValue != null ? (_jsxs(Text, { className: "text-[var(--appkit-color-text-muted)]", size: "xs", children: ["est. \u20B9", it.estimatedValue.toLocaleString("en-IN")] })) : null] })] }, `collage-${it.itemNumber}`));
|
|
64
64
|
}) }), _jsx(ImageLightbox, { images: galleryImages, activeIndex: lightboxIndex, onClose: () => setLightboxIndex(null), onNavigate: (i) => setLightboxIndex(i), showThumbnails: true })] }));
|
|
65
65
|
}
|
|
66
66
|
export default PrizeDrawCollage;
|
|
@@ -89,9 +89,9 @@ export function PrizeDrawItemsEditor({ items, onChange, onUploadImage, onUploadV
|
|
|
89
89
|
return (_jsxs(Stack, { gap: "md", children: [_jsxs(Row, { justify: "between", align: "center", children: [_jsxs(Heading, { level: 3, children: ["Prize Items (", items.length, ")"] }), _jsxs(Button, { type: "button", variant: "secondary", onClick: addItem, disabled: anyWon || items.length >= MAX_ITEMS, children: ["+ Add prize (", items.length, "/", MAX_ITEMS, ")"] })] }), _jsxs(Text, { className: "text-[var(--appkit-color-text-muted)]", size: "sm", children: ["Add between ", MIN_ITEMS, " and ", MAX_ITEMS, " prizes. Each entry will reveal exactly one of these. Items marked won during a prior reveal cannot be edited or removed."] }), anyWon ? (_jsxs(Div, { textSize: "sm", className: "border border-error/40", color: "error", surface: "danger-surface", padding: "inlineSm", rounded: "default", children: [_jsx(Span, { weight: "bold", children: "Draw locked." }), " At least one prize has been revealed \u2014 this listing can no longer be edited. To run a similar draw, clone it into a new prize-draw listing."] })) : warning ? (_jsx(Div, { className: CLS_WARN_BOX, children: warning })) : null, _jsx(Stack, { gap: "md", children: items.map((it, index) => {
|
|
90
90
|
const locked = it.isWon || anyWon;
|
|
91
91
|
return (_jsxs(Div, { className: `relative border border-[var(--appkit-color-border)] ${locked ? "opacity-60" : ""}`, rounded: "lg", padding: "md", children: [locked ? (_jsx(Row, { surface: "overlay-xs", className: "absolute inset-0 z-10 bg-[rgba(0,0,0,0.1)] dark: pointer-events-none", align: "center", justify: "center", rounded: "lg", children: _jsx(Text, { className: CLS_WON_BADGE, children: "Won \u2014 locked" }) })) : null, _jsxs(Row, { justify: "between", align: "center", className: "mb-3", children: [_jsxs(Heading, { level: 4, children: ["Prize #", it.itemNumber] }), _jsxs(Row, { gap: "xs", children: [_jsx(Button, { type: "button", variant: "ghost", size: "sm", onClick: () => move(index, -1), disabled: locked || index === 0, "aria-label": "Move up", children: "\u2191" }), _jsx(Button, { type: "button", variant: "ghost", size: "sm", onClick: () => move(index, 1), disabled: locked || index === items.length - 1, "aria-label": "Move down", children: "\u2193" }), _jsx(Button, { type: "button", variant: "danger", size: "sm", onClick: () => removeItem(index), disabled: locked || items.length <= MIN_ITEMS, children: "Remove" })] })] }), _jsxs(Stack, { gap: "sm", children: [_jsx(FormField, { name: `item-${index}-title`, label: "Title", type: "text", value: it.title, onChange: (v) => update(index, { title: v }), disabled: locked, placeholder: "e.g. PSA 9 Charizard Base Set Holo" }), _jsx(FormField, { name: `item-${index}-description`, label: "Description (optional)", type: "textarea", value: it.description ?? "", onChange: (v) => update(index, { description: v }), disabled: locked, placeholder: "What makes this prize special?" }), _jsxs(Row, { gap: "md", children: [_jsx(Div, { className: "flex-1", children: _jsx(FormField, { name: `item-${index}-condition`, label: "Condition", type: "select", value: it.condition, onChange: (v) => update(index, { condition: v }), disabled: locked, options: CONDITION_OPTIONS }) }), _jsx(Div, { className: "flex-1", children: _jsx(FormField, { name: `item-${index}-value`, label: "Estimated value (\u20B9)", type: "number", value: it.estimatedValue != null
|
|
92
|
-
? String(
|
|
92
|
+
? String(it.estimatedValue)
|
|
93
93
|
: "", onChange: (v) => update(index, {
|
|
94
|
-
estimatedValue: Math.round((parseFloat(v) || 0) * 100),
|
|
94
|
+
estimatedValue: Math.round((parseFloat(v) || 0) * 100) / 100,
|
|
95
95
|
}), disabled: locked, placeholder: "2999" }) })] }), _jsxs(Stack, { gap: "xs", children: [_jsxs(Text, { size: "sm", weight: "medium", children: ["Images (", (it.images ?? []).length, "/", MAX_IMAGES_PER_ITEM, ")"] }), _jsx(Row, { gap: "sm", wrap: true, children: Array.from({ length: MAX_IMAGES_PER_ITEM }).map((_, slot) => {
|
|
96
96
|
const existing = (it.images ?? [])[slot];
|
|
97
97
|
return (_jsxs(Div, { className: "w-40", children: [_jsx(ImageUpload, { currentImage: existing, label: existing ? "Replace" : `Image ${slot + 1}`, onUpload: (file) => onUploadImage(file, it.itemNumber), onChange: (url) => setImage(index, slot, url) }), existing && !locked ? (_jsx(Button, { type: "button", variant: "ghost", size: "sm", onClick: () => removeImage(index, slot), children: "Remove" })) : null] }, slot));
|
|
@@ -155,6 +155,6 @@ export function PrizeRevealModal({ open, onClose, items, orderId, productId, onR
|
|
|
155
155
|
// audit-content-alignment-ok: theatrical reveal-modal centerpiece, not marketing content
|
|
156
156
|
_jsxs(Div, { className: `bg-[var(--appkit-color-surface-muted)] ${__P.p4} text-center`, rounded: "default", children: [_jsx(Text, { size: "lg", weight: "semibold", children: "Rolling\u2026" }), _jsx(Text, { className: "text-[var(--appkit-color-text-muted)]", size: "sm", children: "The winner was locked by the server before this animation started. Hang tight \u2014 we're just making it look pretty." })] })) : null, phase === "won" && winner ? (
|
|
157
157
|
// audit-content-alignment-ok: theatrical reveal-modal centerpiece, not marketing content
|
|
158
|
-
_jsxs(Div, { className: `border-2 border-[var(--appkit-color-primary)] bg-[var(--appkit-color-surface)] ${__P.p4} text-center`, rounded: "lg", children: [_jsx(Text, { className: "tracking-wider text-[var(--appkit-color-text-muted)]", size: "xs", transform: "uppercase", children: "You won" }), _jsxs(Heading, { level: 2, className: "my-2", children: ["#", winner.itemNumber, " \u2014 ", winner.title] }), winnerImg ? (_jsx(Div, { className: "relative mx-auto h-64 w-64 max-w-full", rounded: "md", overflow: "hidden", children: _jsx(MediaImage, { src: winnerImg, alt: winner.title, size: "hero", objectFit: "contain" }) })) : null, winner.estimatedValue != null ? (_jsxs(Text, { className: "mt-2 text-[var(--appkit-color-text-muted)]", size: "sm", children: ["Estimated value: \u20B9",
|
|
158
|
+
_jsxs(Div, { className: `border-2 border-[var(--appkit-color-primary)] bg-[var(--appkit-color-surface)] ${__P.p4} text-center`, rounded: "lg", children: [_jsx(Text, { className: "tracking-wider text-[var(--appkit-color-text-muted)]", size: "xs", transform: "uppercase", children: "You won" }), _jsxs(Heading, { level: 2, className: "my-2", children: ["#", winner.itemNumber, " \u2014 ", winner.title] }), winnerImg ? (_jsx(Div, { className: "relative mx-auto h-64 w-64 max-w-full", rounded: "md", overflow: "hidden", children: _jsx(MediaImage, { src: winnerImg, alt: winner.title, size: "hero", objectFit: "contain" }) })) : null, winner.estimatedValue != null ? (_jsxs(Text, { className: "mt-2 text-[var(--appkit-color-text-muted)]", size: "sm", children: ["Estimated value: \u20B9", winner.estimatedValue.toLocaleString("en-IN")] })) : null] })) : null, _jsxs(Div, { textSize: "xs", className: "border border-[var(--appkit-color-border)] bg-[var(--appkit-color-surface-muted)] text-[var(--appkit-color-text-muted)]", padding: "inlineSm", rounded: "default", children: [_jsx(Span, { weight: "bold", children: "Fairness guarantee:" }), " ", "Winners are picked by ", _jsx("code", { children: "crypto.randomInt" }), " running on LetItRip's server before the animation starts. The animation is theatrical \u2014 neither the store nor LetItRip staff can influence the outcome.", " ", effectiveRngUrl ? (_jsx(Anchor, { href: effectiveRngUrl, tone: "none", underline: "always", children: "View RNG source code \u2192" })) : null] })] })] }));
|
|
159
159
|
}
|
|
160
160
|
export default PrizeRevealModal;
|