@mohasinac/appkit 4.62.0 → 4.63.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/.build-stamp.json +3 -3
- package/dist/_internal/client/features/layout/DashboardLayoutClient.js +8 -29
- package/dist/_internal/client/features/layout/filterNavItems.d.ts +28 -0
- package/dist/_internal/client/features/layout/filterNavItems.js +35 -0
- package/dist/_internal/server/features/ads/booking.d.ts +118 -0
- package/dist/_internal/server/features/ads/booking.js +326 -0
- package/dist/_internal/server/features/checkout/actions.d.ts +129 -9
- package/dist/_internal/server/features/checkout/actions.js +850 -79
- package/dist/_internal/server/features/checkout/expand-order-items.d.ts +1 -2
- package/dist/_internal/server/features/checkout/expand-order-items.js +32 -0
- package/dist/_internal/server/features/checkout/freeze-parts.d.ts +50 -0
- package/dist/_internal/server/features/checkout/freeze-parts.js +94 -0
- package/dist/_internal/server/features/checkout/value-otp-gate.d.ts +55 -0
- package/dist/_internal/server/features/checkout/value-otp-gate.js +60 -0
- package/dist/_internal/server/features/dashboard/attention.d.ts +128 -0
- package/dist/_internal/server/features/dashboard/attention.js +183 -0
- package/dist/_internal/server/features/dashboard/data.d.ts +47 -0
- package/dist/_internal/server/features/dashboard/data.js +82 -0
- package/dist/_internal/server/features/inventory/reservations.d.ts +99 -0
- package/dist/_internal/server/features/inventory/reservations.js +273 -0
- package/dist/_internal/server/features/invoicing/allocate.d.ts +63 -0
- package/dist/_internal/server/features/invoicing/allocate.js +162 -0
- package/dist/_internal/server/features/invoicing/credit-note.d.ts +57 -0
- package/dist/_internal/server/features/invoicing/credit-note.js +126 -0
- package/dist/_internal/server/features/invoicing/gstr1.d.ts +74 -0
- package/dist/_internal/server/features/invoicing/gstr1.js +251 -0
- package/dist/_internal/server/features/invoicing/issue.d.ts +96 -0
- package/dist/_internal/server/features/invoicing/issue.js +202 -0
- package/dist/_internal/server/features/offers/destinations.d.ts +40 -0
- package/dist/_internal/server/features/offers/destinations.js +65 -0
- package/dist/_internal/server/features/orders/actions.d.ts +8 -1
- package/dist/_internal/server/features/orders/actions.js +81 -8
- package/dist/_internal/server/features/orders/adapters.js +54 -0
- package/dist/_internal/server/features/orders/amend-delivery.d.ts +56 -0
- package/dist/_internal/server/features/orders/amend-delivery.js +124 -0
- package/dist/_internal/server/features/orders/balance.d.ts +89 -0
- package/dist/_internal/server/features/orders/balance.js +256 -0
- package/dist/_internal/server/features/orders/cancellation-refund.d.ts +15 -9
- package/dist/_internal/server/features/orders/cancellation-refund.js +15 -9
- package/dist/_internal/server/features/points/award.js +46 -4
- package/dist/_internal/server/features/pricing/actions.d.ts +58 -0
- package/dist/_internal/server/features/pricing/actions.js +144 -0
- package/dist/_internal/server/features/refunds/actions.js +26 -0
- package/dist/_internal/server/features/shipping/book-split.d.ts +86 -0
- package/dist/_internal/server/features/shipping/book-split.js +130 -0
- package/dist/_internal/server/features/shipping/book.d.ts +61 -0
- package/dist/_internal/server/features/shipping/book.js +176 -0
- package/dist/_internal/server/features/shipping/courier-block.d.ts +69 -0
- package/dist/_internal/server/features/shipping/courier-block.js +264 -0
- package/dist/_internal/server/features/site-settings/adapters.d.ts +2 -2
- package/dist/_internal/server/features/site-settings/adapters.js +29 -0
- package/dist/_internal/server/features/stores/adapters.d.ts +2 -2
- package/dist/_internal/server/features/stores/adapters.js +65 -0
- package/dist/_internal/server/functions/scheduled.d.ts +2 -1
- package/dist/_internal/server/functions/scheduled.js +95 -2
- package/dist/_internal/server/jobs/core/autoPayoutEligibility.js +11 -2
- package/dist/_internal/server/jobs/core/dailyStatusDigest.d.ts +4 -0
- package/dist/_internal/server/jobs/core/dailyStatusDigest.js +19 -2
- package/dist/_internal/server/jobs/core/index.d.ts +2 -1
- package/dist/_internal/server/jobs/core/index.js +2 -1
- package/dist/_internal/server/jobs/core/jobRunners.js +45 -0
- package/dist/_internal/server/jobs/core/onJobCreated.d.ts +30 -7
- package/dist/_internal/server/jobs/core/onJobCreated.js +78 -45
- package/dist/_internal/server/jobs/core/onOrderStatusChange.d.ts +7 -0
- package/dist/_internal/server/jobs/core/onOrderStatusChange.js +65 -0
- package/dist/_internal/server/jobs/core/paymentWindowTimeout.js +33 -0
- package/dist/_internal/server/jobs/core/reservationExpiry.d.ts +17 -0
- package/dist/_internal/server/jobs/core/reservationExpiry.js +40 -0
- package/dist/_internal/server/jobs/core/runJobOnce.d.ts +48 -0
- package/dist/_internal/server/jobs/core/runJobOnce.js +195 -0
- package/dist/_internal/server/jobs/core/weeklyPayoutEligibility.js +25 -2
- package/dist/_internal/server/jobs/handlers/index.d.ts +1 -0
- package/dist/_internal/server/jobs/handlers/index.js +1 -0
- package/dist/_internal/server/jobs/handlers/onOrderStatusChange.js +17 -0
- package/dist/_internal/server/jobs/handlers/reservationExpiry.d.ts +2 -0
- package/dist/_internal/server/jobs/handlers/reservationExpiry.js +2 -0
- package/dist/_internal/server/notifications/channel-health.d.ts +26 -3
- package/dist/_internal/shared/actions/action-registry.d.ts +1 -1
- package/dist/_internal/shared/actions/action-registry.js +296 -0
- package/dist/_internal/shared/checkout/coupon-discount.d.ts +43 -1
- package/dist/_internal/shared/checkout/coupon-discount.js +26 -1
- package/dist/_internal/shared/checkout/order-math.d.ts +174 -0
- package/dist/_internal/shared/checkout/order-math.js +159 -0
- package/dist/_internal/shared/checkout/refundable-base.d.ts +25 -0
- package/dist/_internal/shared/checkout/refundable-base.js +13 -1
- package/dist/_internal/shared/checkout/rules/index.d.ts +1 -1
- package/dist/_internal/shared/checkout/rules/index.js +1 -1
- package/dist/_internal/shared/checkout/rules/payment-gate.d.ts +18 -0
- package/dist/_internal/shared/checkout/rules/payment-gate.js +25 -0
- package/dist/_internal/shared/checkout/split.d.ts +75 -0
- package/dist/_internal/shared/checkout/split.js +120 -0
- package/dist/_internal/shared/content/disclaimers.d.ts +88 -0
- package/dist/_internal/shared/content/disclaimers.js +217 -0
- package/dist/_internal/shared/content/published-values.d.ts +93 -0
- package/dist/_internal/shared/content/published-values.js +206 -0
- package/dist/_internal/shared/features/admin/integrations.d.ts +139 -0
- package/dist/_internal/shared/features/admin/integrations.js +263 -0
- package/dist/_internal/shared/features/dashboard/hub-sections.d.ts +72 -0
- package/dist/_internal/shared/features/dashboard/hub-sections.js +75 -0
- package/dist/_internal/shared/features/emi/choice.d.ts +98 -0
- package/dist/_internal/shared/features/emi/choice.js +69 -0
- package/dist/_internal/shared/features/emi/group.d.ts +84 -0
- package/dist/_internal/shared/features/emi/group.js +126 -0
- package/dist/_internal/shared/features/ledger/posting.d.ts +107 -0
- package/dist/_internal/shared/features/ledger/posting.js +165 -0
- package/dist/_internal/shared/features/ledger/reports.d.ts +76 -0
- package/dist/_internal/shared/features/ledger/reports.js +127 -0
- package/dist/_internal/shared/features/ledger/rules.d.ts +170 -0
- package/dist/_internal/shared/features/ledger/rules.js +221 -0
- package/dist/_internal/shared/features/offers/coordination.d.ts +122 -0
- package/dist/_internal/shared/features/offers/coordination.js +80 -0
- package/dist/_internal/shared/features/orders/delivery-snapshot.d.ts +114 -0
- package/dist/_internal/shared/features/orders/delivery-snapshot.js +116 -0
- package/dist/_internal/shared/features/orders/dispute-reasons.d.ts +113 -0
- package/dist/_internal/shared/features/orders/dispute-reasons.js +181 -0
- package/dist/_internal/shared/features/orders/refund-copy.d.ts +1 -1
- package/dist/_internal/shared/features/orders/refund-copy.js +18 -1
- package/dist/_internal/shared/features/payouts/pay-period.d.ts +91 -0
- package/dist/_internal/shared/features/payouts/pay-period.js +104 -0
- package/dist/_internal/shared/features/points/accepts.d.ts +29 -0
- package/dist/_internal/shared/features/points/accepts.js +49 -0
- package/dist/_internal/shared/features/pricing/rate-registry.d.ts +150 -0
- package/dist/_internal/shared/features/pricing/rate-registry.js +246 -0
- package/dist/_internal/shared/features/shipping/parcel.d.ts +123 -0
- package/dist/_internal/shared/features/shipping/parcel.js +139 -0
- package/dist/_internal/shared/features/shipping/shared-purchase.d.ts +91 -0
- package/dist/_internal/shared/features/shipping/shared-purchase.js +108 -0
- package/dist/_internal/shared/features/site-settings/fees.d.ts +16 -8
- package/dist/_internal/shared/features/site-settings/fees.js +12 -8
- package/dist/_internal/shared/features/site-settings/types.d.ts +11 -0
- package/dist/_internal/shared/fees/calculator.d.ts +33 -1
- package/dist/_internal/shared/fees/calculator.js +32 -2
- package/dist/_internal/shared/fees/explain.d.ts +81 -0
- package/dist/_internal/shared/fees/explain.js +101 -0
- package/dist/_internal/shared/history/index.d.ts +1 -1
- package/dist/_internal/shared/history/index.js +1 -1
- package/dist/_internal/shared/history/types.d.ts +7 -1
- package/dist/_internal/shared/history/types.js +25 -0
- package/dist/client.d.ts +21 -0
- package/dist/client.js +43 -0
- package/dist/constants/api-endpoints.d.ts +114 -0
- package/dist/constants/api-endpoints.js +55 -0
- package/dist/constants/field-names.d.ts +42 -0
- package/dist/constants/field-names.js +52 -0
- package/dist/contracts/index.d.ts +1 -1
- package/dist/contracts/shipping.d.ts +45 -0
- package/dist/contracts/shipping.js +15 -0
- package/dist/features/about/components/AboutView.js +1 -1
- package/dist/features/account/components/BuyerAuctionsGuideView.js +4 -1
- package/dist/features/account/components/UserOrdersView.js +47 -35
- package/dist/features/admin/components/AdminCouponEditorView.js +17 -0
- package/dist/features/admin/components/AdminIntegrationsView.d.ts +55 -0
- package/dist/features/admin/components/AdminIntegrationsView.js +74 -0
- package/dist/features/admin/components/AdminInvoicingView.d.ts +2 -0
- package/dist/features/admin/components/AdminInvoicingView.js +65 -0
- package/dist/features/admin/components/AdminOrderEditorView.d.ts +33 -1
- package/dist/features/admin/components/AdminOrderEditorView.js +81 -3
- package/dist/features/admin/components/AdminOrdersGuideView.js +23 -2
- package/dist/features/admin/components/AdminOrdersView.js +86 -5
- package/dist/features/admin/components/OwnerQuickActions.js +24 -2
- package/dist/features/admin/constants/filter-tabs.d.ts +6 -0
- package/dist/features/admin/constants/filter-tabs.js +6 -0
- package/dist/features/admin/constants/site-settings-tabs.d.ts +1 -1
- package/dist/features/admin/hooks/useAdminListingData.js +16 -0
- package/dist/features/admin/schemas/admin-user-form.d.ts +2 -2
- package/dist/features/admin/schemas/firestore.d.ts +62 -0
- package/dist/features/admin/schemas/firestore.js +5 -0
- package/dist/features/ads/schemas/booking-write.d.ts +120 -0
- package/dist/features/ads/schemas/booking-write.js +75 -0
- package/dist/features/ads/schemas/creative-form.d.ts +18 -0
- package/dist/features/ads/schemas/creative-form.js +51 -0
- package/dist/features/ads/schemas/firestore.d.ts +140 -0
- package/dist/features/ads/schemas/firestore.js +109 -0
- package/dist/features/auctions/repository/bid.repository.js +3 -1
- package/dist/features/audit-log/schemas/firestore.d.ts +140 -0
- package/dist/features/audit-log/schemas/firestore.js +89 -0
- package/dist/features/auth/actions/profile-actions.d.ts +69 -1
- package/dist/features/auth/actions/profile-actions.js +62 -1
- package/dist/features/auth/permissions/constants.js +13 -0
- package/dist/features/auth/schemas/firestore.d.ts +16 -2
- package/dist/features/auth/schemas/firestore.js +2 -1
- package/dist/features/blog/actions/blog-actions.d.ts +6 -0
- package/dist/features/blog/actions/blog-actions.js +17 -2
- package/dist/features/blog/api/route.js +4 -1
- package/dist/features/blog/columns/index.js +5 -0
- package/dist/features/blog/components/BlogIndexPageView.js +2 -1
- package/dist/features/blog/repository/blog.repository.d.ts +4 -0
- package/dist/features/blog/repository/blog.repository.js +5 -0
- package/dist/features/blog/schemas/blog-form.d.ts +3 -0
- package/dist/features/blog/schemas/blog-form.js +1 -0
- package/dist/features/blog/schemas/firestore.d.ts +38 -1
- package/dist/features/blog/schemas/firestore.js +23 -0
- package/dist/features/blog/schemas/index.d.ts +6 -0
- package/dist/features/blog/schemas/index.js +2 -0
- package/dist/features/blog/types/index.d.ts +2 -0
- package/dist/features/cart/components/CartPriceBreakdown.d.ts +25 -1
- package/dist/features/cart/components/CartPriceBreakdown.js +29 -6
- package/dist/features/cart/components/PointsTenderPicker.d.ts +61 -0
- package/dist/features/cart/components/PointsTenderPicker.js +15 -0
- package/dist/features/cart/components/StoreAddonsPicker.js +2 -1
- package/dist/features/cart/components/index.d.ts +2 -0
- package/dist/features/cart/components/index.js +1 -0
- package/dist/features/cart/repository/cart.repository.d.ts +33 -0
- package/dist/features/cart/repository/cart.repository.js +47 -0
- package/dist/features/cart/schemas/firestore.d.ts +116 -0
- package/dist/features/contact/email.d.ts +27 -10
- package/dist/features/contact/email.js +20 -3
- package/dist/features/dashboard/components/DashboardHubView.d.ts +83 -0
- package/dist/features/dashboard/components/DashboardHubView.js +56 -0
- package/dist/features/dashboard/components/DashboardSectionsClient.d.ts +23 -0
- package/dist/features/dashboard/components/DashboardSectionsClient.js +66 -0
- package/dist/features/dispute-reasons/components/AdminDisputeReasonsView.d.ts +55 -0
- package/dist/features/dispute-reasons/components/AdminDisputeReasonsView.js +175 -0
- package/dist/features/dispute-reasons/repository/dispute-reasons.repository.d.ts +62 -0
- package/dist/features/dispute-reasons/repository/dispute-reasons.repository.js +108 -0
- package/dist/features/dispute-reasons/schemas/firestore.d.ts +62 -0
- package/dist/features/dispute-reasons/schemas/firestore.js +40 -0
- package/dist/features/events/components/EventSaleBanner.js +1 -1
- package/dist/features/faq/components/FAQAccordion.d.ts +13 -1
- package/dist/features/faq/components/FAQAccordion.js +29 -4
- package/dist/features/faq/components/FAQPageContent.js +2 -2
- package/dist/features/gateway-events/schemas/index.d.ts +2 -2
- package/dist/features/homepage/schemas/index.d.ts +8 -8
- package/dist/features/inventory/schemas/stock-reservation.d.ts +114 -0
- package/dist/features/inventory/schemas/stock-reservation.js +103 -0
- package/dist/features/invoicing/schemas/firestore.d.ts +112 -0
- package/dist/features/invoicing/schemas/firestore.js +45 -0
- package/dist/features/invoicing/utils/financial-year.d.ts +43 -0
- package/dist/features/invoicing/utils/financial-year.js +53 -0
- package/dist/features/jobs/actions/enqueue-job.js +18 -1
- package/dist/features/jobs/repository/jobs.repository.d.ts +62 -1
- package/dist/features/jobs/repository/jobs.repository.js +84 -1
- package/dist/features/jobs/schemas/firestore.d.ts +80 -0
- package/dist/features/jobs/schemas/firestore.js +37 -0
- package/dist/features/layout/AppLayoutShell.d.ts +9 -1
- package/dist/features/layout/AppLayoutShell.js +12 -4
- package/dist/features/layout/BottomActions.js +2 -1
- package/dist/features/layout/BottomNavbar.d.ts +10 -2
- package/dist/features/layout/SideActionDock.js +52 -2
- package/dist/features/layout/TitleBarLayout.js +13 -4
- package/dist/features/layout/TitleBarLayout.style.css +59 -0
- package/dist/features/layout/useCtaReveal.d.ts +16 -1
- package/dist/features/layout/useCtaReveal.js +17 -26
- package/dist/features/ledger/repository/journal.repository.d.ts +110 -0
- package/dist/features/ledger/repository/journal.repository.js +312 -0
- package/dist/features/ledger/schemas/expenses.d.ts +87 -0
- package/dist/features/ledger/schemas/expenses.js +27 -0
- package/dist/features/ledger/schemas/firestore.d.ts +183 -0
- package/dist/features/ledger/schemas/firestore.js +69 -0
- package/dist/features/lottery/schemas/zod.d.ts +6 -6
- package/dist/features/media/MediaImage.js +22 -1
- package/dist/features/media/upload/ImageUpload.js +1 -1
- package/dist/features/obligations/constants/policies.js +24 -1
- package/dist/features/orders/components/BalancePaymentPanel.d.ts +12 -0
- package/dist/features/orders/components/BalancePaymentPanel.js +94 -0
- package/dist/features/orders/components/OrderPaymentSummary.js +10 -1
- package/dist/features/orders/components/OrderProvenanceCard.d.ts +8 -0
- package/dist/features/orders/components/OrderProvenanceCard.js +185 -0
- package/dist/features/orders/components/RaiseDisputeForm.d.ts +14 -0
- package/dist/features/orders/components/RaiseDisputeForm.js +119 -0
- package/dist/features/orders/components/RefundRequestView.js +19 -1
- package/dist/features/orders/components/index.d.ts +4 -0
- package/dist/features/orders/components/index.js +2 -0
- package/dist/features/orders/constants/order-lane-tabs.d.ts +69 -0
- package/dist/features/orders/constants/order-lane-tabs.js +88 -0
- package/dist/features/orders/repository/orders.repository.d.ts +85 -1
- package/dist/features/orders/repository/orders.repository.js +205 -6
- package/dist/features/orders/schemas/balance.d.ts +40 -0
- package/dist/features/orders/schemas/balance.js +47 -0
- package/dist/features/orders/schemas/firestore.d.ts +398 -1
- package/dist/features/orders/schemas/firestore.js +43 -0
- package/dist/features/orders/schemas/index.d.ts +56 -8
- package/dist/features/orders/schemas/index.js +12 -0
- package/dist/features/orders/types/index.d.ts +47 -0
- package/dist/features/orders/utils/courier-block.d.ts +25 -0
- package/dist/features/orders/utils/courier-block.js +23 -0
- package/dist/features/payment-cases/schemas/firestore.d.ts +26 -1
- package/dist/features/payment-cases/schemas/firestore.js +1 -0
- package/dist/features/payments/repository/payout.repository.js +3 -2
- package/dist/features/payments/schemas/firestore.d.ts +92 -1
- package/dist/features/payments/schemas/firestore.js +23 -0
- package/dist/features/pricing/components/AdminPricingView.d.ts +13 -0
- package/dist/features/pricing/components/AdminPricingView.js +157 -0
- package/dist/features/products/components/PrizeDrawDetailPageView.js +2 -2
- package/dist/features/products/components/ProductDetailPageView.d.ts +17 -1
- package/dist/features/products/components/ProductDetailPageView.js +2 -2
- package/dist/features/products/schemas/firestore.d.ts +26 -1
- package/dist/features/products/schemas/firestore.js +2 -0
- package/dist/features/products/schemas/index.d.ts +2 -2
- package/dist/features/products/schemas/product-features.validators.d.ts +10 -10
- package/dist/features/promotions/actions/coupon-stacking.d.ts +30 -3
- package/dist/features/promotions/actions/coupon-stacking.js +21 -2
- package/dist/features/promotions/components/CouponCard.js +13 -0
- package/dist/features/promotions/constants/coupon-help.d.ts +2 -2
- package/dist/features/promotions/constants/coupon-help.js +9 -1
- package/dist/features/promotions/schemas/firestore.d.ts +24 -0
- package/dist/features/promotions/schemas/firestore.js +4 -0
- package/dist/features/promotions/types/index.d.ts +19 -1
- package/dist/features/reviews/repository/reviews.repository.d.ts +14 -0
- package/dist/features/reviews/repository/reviews.repository.js +16 -0
- package/dist/features/scams/components/ScamProfileView.js +2 -2
- package/dist/features/scams/components/ScamRegistryView.js +2 -2
- package/dist/features/scams/repository/scammer.repository.js +2 -1
- package/dist/features/scams/schemas/firestore.d.ts +2 -1
- package/dist/features/scams/schemas/firestore.js +2 -1
- package/dist/features/search/action-index/tab-entries.js +1 -1
- package/dist/features/seller/actions/offer-actions.js +56 -0
- package/dist/features/seller/actions/seller-actions.d.ts +1 -1
- package/dist/features/seller/actions/seller-actions.js +37 -3
- package/dist/features/seller/components/DispatchForm.d.ts +11 -0
- package/dist/features/seller/components/DispatchForm.js +190 -0
- package/dist/features/seller/components/SellerOrdersView.js +221 -27
- package/dist/features/seller/components/index.d.ts +1 -0
- package/dist/features/seller/components/index.js +1 -0
- package/dist/features/seller/hooks/useSellerListingData.js +25 -0
- package/dist/features/seller/repository/offer.repository.js +4 -3
- package/dist/features/seller/schemas/firestore.d.ts +23 -2
- package/dist/features/seller/schemas/firestore.js +3 -2
- package/dist/features/seller/schemas/index.d.ts +4 -4
- package/dist/features/seller/schemas/order-forms.d.ts +61 -4
- package/dist/features/seller/schemas/order-forms.js +41 -8
- package/dist/features/shipments/schemas/firestore.d.ts +25 -0
- package/dist/features/shipments/schemas/validation.d.ts +4 -4
- package/dist/features/shipping-boxes/repository/shipping-boxes.repository.d.ts +82 -0
- package/dist/features/shipping-boxes/repository/shipping-boxes.repository.js +145 -0
- package/dist/features/shipping-boxes/schemas/firestore.d.ts +80 -0
- package/dist/features/shipping-boxes/schemas/firestore.js +53 -0
- package/dist/features/store-extensions/schemas/report-create-form.d.ts +2 -2
- package/dist/features/store-extensions/schemas/shipping-config-form.d.ts +2 -2
- package/dist/features/stores/components/StoreOrdersGuideView.js +6 -1
- package/dist/features/stores/repository/store.repository.d.ts +18 -0
- package/dist/features/stores/repository/store.repository.js +27 -1
- package/dist/features/stores/schemas/firestore.d.ts +112 -0
- package/dist/features/stores/schemas/firestore.js +20 -0
- package/dist/features/stores/schemas/index.d.ts +6 -6
- package/dist/features/stores/types/index.d.ts +19 -0
- package/dist/features/support/repository/support.repository.js +72 -6
- package/dist/features/support/schemas/firestore.d.ts +17 -0
- package/dist/features/support/schemas/index.d.ts +8 -8
- package/dist/features/wishlist/hooks/useWishlistWithGuest.d.ts +1 -1
- package/dist/index.d.ts +11 -1
- package/dist/index.js +33 -1
- package/dist/next/routing/route-map.d.ts +112 -0
- package/dist/next/routing/route-map.js +63 -0
- package/dist/providers/shipping-shiprocket/index.d.ts +27 -1
- package/dist/providers/shipping-shiprocket/index.js +84 -1
- package/dist/react/contexts/SessionContext.d.ts +17 -1
- package/dist/schemas/registry.d.ts +69 -34
- package/dist/schemas/sieve.d.ts +2 -2
- package/dist/security/pii-schemas.d.ts +1 -1
- package/dist/security/pii-schemas.js +45 -0
- package/dist/server-entry.d.ts +2 -2
- package/dist/server-entry.js +8 -1
- package/dist/server.d.ts +36 -1
- package/dist/server.js +183 -1
- package/dist/styles.css +412 -80
- package/dist/tailwind-utilities.css +1 -1
- package/dist/tokens/themes/default-dark.js +1 -0
- package/dist/tokens/themes/default-light.js +1 -0
- package/dist/tokens/themes/required.d.ts +1 -1
- package/dist/tokens/themes/required.js +1 -0
- package/dist/tokens/tokens.css +15 -0
- package/dist/ui/components/Button.d.ts +10 -1
- package/dist/ui/components/Button.js +25 -3
- package/dist/ui/components/Chart.d.ts +63 -0
- package/dist/ui/components/Chart.js +169 -0
- package/dist/ui/components/Chart.style.css +214 -0
- package/dist/ui/components/Disclaimer.d.ts +19 -0
- package/dist/ui/components/Disclaimer.js +83 -0
- package/dist/ui/components/OverflowRow.js +54 -2
- package/dist/ui/components/OverflowRow.style.css +38 -0
- package/dist/ui/components/RichTextEditor.js +99 -8
- package/dist/ui/components/chart-spec.d.ts +68 -0
- package/dist/ui/components/chart-spec.js +140 -0
- package/dist/ui/components/index.style.css +1 -0
- package/dist/ui/components/surface-tokens.d.ts +1 -1
- package/dist/ui/components/surface-tokens.js +9 -0
- package/dist/ui/components/tabs-overflow.js +64 -11
- package/dist/ui/components/toolbar-collapse.d.ts +13 -0
- package/dist/ui/components/toolbar-collapse.js +10 -1
- package/dist/ui/index.d.ts +8 -0
- package/dist/ui/index.js +9 -0
- package/dist/ui/rich-text/RichText.d.ts +10 -1
- package/dist/ui/rich-text/RichText.js +33 -2
- package/dist/ui/rich-text/RichText.style.css +83 -79
- package/dist/ui/rich-text/RichTextRenderer.d.ts +30 -1
- package/dist/ui/rich-text/RichTextRenderer.js +34 -2
- package/dist/ui/rich-text/chart-blocks.d.ts +62 -0
- package/dist/ui/rich-text/chart-blocks.js +87 -0
- package/package.json +1 -1
- package/scripts/seed-cli.mjs +1834 -1822
|
@@ -145,6 +145,15 @@ export declare const orderRefundEventSchema: z.ZodObject<{
|
|
|
145
145
|
proofDocumentUrl: z.ZodOptional<z.ZodString>;
|
|
146
146
|
proofDocumentMimeType: z.ZodOptional<z.ZodString>;
|
|
147
147
|
overrideReason: z.ZodOptional<z.ZodString>;
|
|
148
|
+
creditNoteNumber: z.ZodOptional<z.ZodString>;
|
|
149
|
+
creditNoteIssuedAt: z.ZodOptional<z.ZodUnion<[z.ZodDate, z.ZodString, z.ZodObject<{
|
|
150
|
+
toDate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodDate>;
|
|
151
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
152
|
+
toDate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodDate>;
|
|
153
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
154
|
+
toDate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodDate>;
|
|
155
|
+
}, z.ZodTypeAny, "passthrough">>]>>;
|
|
156
|
+
creditNoteStoragePath: z.ZodOptional<z.ZodString>;
|
|
148
157
|
}, "strip", z.ZodTypeAny, {
|
|
149
158
|
type: "full" | "partial";
|
|
150
159
|
amount: number;
|
|
@@ -155,8 +164,8 @@ export declare const orderRefundEventSchema: z.ZodObject<{
|
|
|
155
164
|
}, z.ZodTypeAny, "passthrough">;
|
|
156
165
|
refundedBy: string;
|
|
157
166
|
status?: "failed" | "processed" | "reserved" | undefined;
|
|
158
|
-
failureReason?: string | undefined;
|
|
159
167
|
gateway?: string | undefined;
|
|
168
|
+
failureReason?: string | undefined;
|
|
160
169
|
itemIds?: string[] | undefined;
|
|
161
170
|
reasonCode?: string | undefined;
|
|
162
171
|
gatewayRefundId?: string | undefined;
|
|
@@ -166,6 +175,11 @@ export declare const orderRefundEventSchema: z.ZodObject<{
|
|
|
166
175
|
proofDocumentUrl?: string | undefined;
|
|
167
176
|
proofDocumentMimeType?: string | undefined;
|
|
168
177
|
overrideReason?: string | undefined;
|
|
178
|
+
creditNoteNumber?: string | undefined;
|
|
179
|
+
creditNoteIssuedAt?: string | Date | z.objectOutputType<{
|
|
180
|
+
toDate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodDate>;
|
|
181
|
+
}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
182
|
+
creditNoteStoragePath?: string | undefined;
|
|
169
183
|
}, {
|
|
170
184
|
type: "full" | "partial";
|
|
171
185
|
amount: number;
|
|
@@ -176,8 +190,8 @@ export declare const orderRefundEventSchema: z.ZodObject<{
|
|
|
176
190
|
}, z.ZodTypeAny, "passthrough">;
|
|
177
191
|
refundedBy: string;
|
|
178
192
|
status?: "failed" | "processed" | "reserved" | undefined;
|
|
179
|
-
failureReason?: string | undefined;
|
|
180
193
|
gateway?: string | undefined;
|
|
194
|
+
failureReason?: string | undefined;
|
|
181
195
|
itemIds?: string[] | undefined;
|
|
182
196
|
reasonCode?: string | undefined;
|
|
183
197
|
gatewayRefundId?: string | undefined;
|
|
@@ -187,6 +201,11 @@ export declare const orderRefundEventSchema: z.ZodObject<{
|
|
|
187
201
|
proofDocumentUrl?: string | undefined;
|
|
188
202
|
proofDocumentMimeType?: string | undefined;
|
|
189
203
|
overrideReason?: string | undefined;
|
|
204
|
+
creditNoteNumber?: string | undefined;
|
|
205
|
+
creditNoteIssuedAt?: string | Date | z.objectInputType<{
|
|
206
|
+
toDate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodDate>;
|
|
207
|
+
}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
208
|
+
creditNoteStoragePath?: string | undefined;
|
|
190
209
|
}>;
|
|
191
210
|
export declare const appliedOrderDiscountSchema: z.ZodObject<{
|
|
192
211
|
code: z.ZodString;
|
|
@@ -499,6 +518,15 @@ export declare const orderFirestoreSchema: z.ZodObject<{
|
|
|
499
518
|
proofDocumentUrl: z.ZodOptional<z.ZodString>;
|
|
500
519
|
proofDocumentMimeType: z.ZodOptional<z.ZodString>;
|
|
501
520
|
overrideReason: z.ZodOptional<z.ZodString>;
|
|
521
|
+
creditNoteNumber: z.ZodOptional<z.ZodString>;
|
|
522
|
+
creditNoteIssuedAt: z.ZodOptional<z.ZodUnion<[z.ZodDate, z.ZodString, z.ZodObject<{
|
|
523
|
+
toDate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodDate>;
|
|
524
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
525
|
+
toDate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodDate>;
|
|
526
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
527
|
+
toDate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodDate>;
|
|
528
|
+
}, z.ZodTypeAny, "passthrough">>]>>;
|
|
529
|
+
creditNoteStoragePath: z.ZodOptional<z.ZodString>;
|
|
502
530
|
}, "strip", z.ZodTypeAny, {
|
|
503
531
|
type: "full" | "partial";
|
|
504
532
|
amount: number;
|
|
@@ -509,8 +537,8 @@ export declare const orderFirestoreSchema: z.ZodObject<{
|
|
|
509
537
|
}, z.ZodTypeAny, "passthrough">;
|
|
510
538
|
refundedBy: string;
|
|
511
539
|
status?: "failed" | "processed" | "reserved" | undefined;
|
|
512
|
-
failureReason?: string | undefined;
|
|
513
540
|
gateway?: string | undefined;
|
|
541
|
+
failureReason?: string | undefined;
|
|
514
542
|
itemIds?: string[] | undefined;
|
|
515
543
|
reasonCode?: string | undefined;
|
|
516
544
|
gatewayRefundId?: string | undefined;
|
|
@@ -520,6 +548,11 @@ export declare const orderFirestoreSchema: z.ZodObject<{
|
|
|
520
548
|
proofDocumentUrl?: string | undefined;
|
|
521
549
|
proofDocumentMimeType?: string | undefined;
|
|
522
550
|
overrideReason?: string | undefined;
|
|
551
|
+
creditNoteNumber?: string | undefined;
|
|
552
|
+
creditNoteIssuedAt?: string | Date | z.objectOutputType<{
|
|
553
|
+
toDate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodDate>;
|
|
554
|
+
}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
555
|
+
creditNoteStoragePath?: string | undefined;
|
|
523
556
|
}, {
|
|
524
557
|
type: "full" | "partial";
|
|
525
558
|
amount: number;
|
|
@@ -530,8 +563,8 @@ export declare const orderFirestoreSchema: z.ZodObject<{
|
|
|
530
563
|
}, z.ZodTypeAny, "passthrough">;
|
|
531
564
|
refundedBy: string;
|
|
532
565
|
status?: "failed" | "processed" | "reserved" | undefined;
|
|
533
|
-
failureReason?: string | undefined;
|
|
534
566
|
gateway?: string | undefined;
|
|
567
|
+
failureReason?: string | undefined;
|
|
535
568
|
itemIds?: string[] | undefined;
|
|
536
569
|
reasonCode?: string | undefined;
|
|
537
570
|
gatewayRefundId?: string | undefined;
|
|
@@ -541,6 +574,11 @@ export declare const orderFirestoreSchema: z.ZodObject<{
|
|
|
541
574
|
proofDocumentUrl?: string | undefined;
|
|
542
575
|
proofDocumentMimeType?: string | undefined;
|
|
543
576
|
overrideReason?: string | undefined;
|
|
577
|
+
creditNoteNumber?: string | undefined;
|
|
578
|
+
creditNoteIssuedAt?: string | Date | z.objectInputType<{
|
|
579
|
+
toDate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodDate>;
|
|
580
|
+
}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
581
|
+
creditNoteStoragePath?: string | undefined;
|
|
544
582
|
}>, "many">>;
|
|
545
583
|
contestable: z.ZodOptional<z.ZodBoolean>;
|
|
546
584
|
adminBypassBy: z.ZodOptional<z.ZodString>;
|
|
@@ -646,6 +684,7 @@ export declare const orderFirestoreSchema: z.ZodObject<{
|
|
|
646
684
|
prizeRevealStatus?: "closed" | "open" | "pending" | "revealed" | undefined;
|
|
647
685
|
}[] | undefined;
|
|
648
686
|
bundleId?: string | undefined;
|
|
687
|
+
orderType?: string | undefined;
|
|
649
688
|
prizeWon?: {
|
|
650
689
|
title: string;
|
|
651
690
|
images: string[];
|
|
@@ -662,7 +701,6 @@ export declare const orderFirestoreSchema: z.ZodObject<{
|
|
|
662
701
|
bin: string;
|
|
663
702
|
} | undefined;
|
|
664
703
|
offerId?: string | undefined;
|
|
665
|
-
orderType?: string | undefined;
|
|
666
704
|
isNonRefundable?: boolean | undefined;
|
|
667
705
|
imageUrls?: string[] | undefined;
|
|
668
706
|
refundFeeDeducted?: number | undefined;
|
|
@@ -711,8 +749,8 @@ export declare const orderFirestoreSchema: z.ZodObject<{
|
|
|
711
749
|
}, z.ZodTypeAny, "passthrough">;
|
|
712
750
|
refundedBy: string;
|
|
713
751
|
status?: "failed" | "processed" | "reserved" | undefined;
|
|
714
|
-
failureReason?: string | undefined;
|
|
715
752
|
gateway?: string | undefined;
|
|
753
|
+
failureReason?: string | undefined;
|
|
716
754
|
itemIds?: string[] | undefined;
|
|
717
755
|
reasonCode?: string | undefined;
|
|
718
756
|
gatewayRefundId?: string | undefined;
|
|
@@ -722,6 +760,11 @@ export declare const orderFirestoreSchema: z.ZodObject<{
|
|
|
722
760
|
proofDocumentUrl?: string | undefined;
|
|
723
761
|
proofDocumentMimeType?: string | undefined;
|
|
724
762
|
overrideReason?: string | undefined;
|
|
763
|
+
creditNoteNumber?: string | undefined;
|
|
764
|
+
creditNoteIssuedAt?: string | Date | z.objectOutputType<{
|
|
765
|
+
toDate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodDate>;
|
|
766
|
+
}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
767
|
+
creditNoteStoragePath?: string | undefined;
|
|
725
768
|
}[] | undefined;
|
|
726
769
|
contestable?: boolean | undefined;
|
|
727
770
|
adminBypassBy?: string | undefined;
|
|
@@ -800,6 +843,7 @@ export declare const orderFirestoreSchema: z.ZodObject<{
|
|
|
800
843
|
prizeRevealStatus?: "closed" | "open" | "pending" | "revealed" | undefined;
|
|
801
844
|
}[] | undefined;
|
|
802
845
|
bundleId?: string | undefined;
|
|
846
|
+
orderType?: string | undefined;
|
|
803
847
|
prizeWon?: {
|
|
804
848
|
title: string;
|
|
805
849
|
images: string[];
|
|
@@ -816,7 +860,6 @@ export declare const orderFirestoreSchema: z.ZodObject<{
|
|
|
816
860
|
bin: string;
|
|
817
861
|
} | undefined;
|
|
818
862
|
offerId?: string | undefined;
|
|
819
|
-
orderType?: string | undefined;
|
|
820
863
|
isNonRefundable?: boolean | undefined;
|
|
821
864
|
imageUrls?: string[] | undefined;
|
|
822
865
|
refundFeeDeducted?: number | undefined;
|
|
@@ -865,8 +908,8 @@ export declare const orderFirestoreSchema: z.ZodObject<{
|
|
|
865
908
|
}, z.ZodTypeAny, "passthrough">;
|
|
866
909
|
refundedBy: string;
|
|
867
910
|
status?: "failed" | "processed" | "reserved" | undefined;
|
|
868
|
-
failureReason?: string | undefined;
|
|
869
911
|
gateway?: string | undefined;
|
|
912
|
+
failureReason?: string | undefined;
|
|
870
913
|
itemIds?: string[] | undefined;
|
|
871
914
|
reasonCode?: string | undefined;
|
|
872
915
|
gatewayRefundId?: string | undefined;
|
|
@@ -876,6 +919,11 @@ export declare const orderFirestoreSchema: z.ZodObject<{
|
|
|
876
919
|
proofDocumentUrl?: string | undefined;
|
|
877
920
|
proofDocumentMimeType?: string | undefined;
|
|
878
921
|
overrideReason?: string | undefined;
|
|
922
|
+
creditNoteNumber?: string | undefined;
|
|
923
|
+
creditNoteIssuedAt?: string | Date | z.objectInputType<{
|
|
924
|
+
toDate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodDate>;
|
|
925
|
+
}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
926
|
+
creditNoteStoragePath?: string | undefined;
|
|
879
927
|
}[] | undefined;
|
|
880
928
|
contestable?: boolean | undefined;
|
|
881
929
|
adminBypassBy?: string | undefined;
|
|
@@ -87,6 +87,18 @@ export const orderRefundEventSchema = z.object({
|
|
|
87
87
|
proofDocumentUrl: z.string().optional(),
|
|
88
88
|
proofDocumentMimeType: z.string().optional(),
|
|
89
89
|
overrideReason: z.string().optional(),
|
|
90
|
+
/*
|
|
91
|
+
* Phase 7 credit note. Added HERE in the same change as the interface, per
|
|
92
|
+
* the 🛑 above: `z.object()` STRIPS unknown keys, so a field present on the
|
|
93
|
+
* interface and absent here is REMOVED on parse — it does not error, it
|
|
94
|
+
* vanishes. That is exactly how this schema silently discarded
|
|
95
|
+
* `razorpayRefundId`, and a credit-note number discarded on parse is a
|
|
96
|
+
* numbered document with nothing pointing at it: the number is consumed, the
|
|
97
|
+
* series has no gap, and no refund claims it.
|
|
98
|
+
*/
|
|
99
|
+
creditNoteNumber: z.string().optional(),
|
|
100
|
+
creditNoteIssuedAt: firestoreDateSchema.optional(),
|
|
101
|
+
creditNoteStoragePath: z.string().optional(),
|
|
90
102
|
});
|
|
91
103
|
export const appliedOrderDiscountSchema = z.object({
|
|
92
104
|
code: z.string(),
|
|
@@ -250,6 +250,32 @@ export interface Order {
|
|
|
250
250
|
platformFee?: number;
|
|
251
251
|
/** COD handling fee, charged only on cash-on-delivery orders. */
|
|
252
252
|
codHandlingFee?: number;
|
|
253
|
+
/**
|
|
254
|
+
* D46/D47 — points spent on this order, in points (1 point = ₹1).
|
|
255
|
+
*
|
|
256
|
+
* Absent on every order placed before the tender existed, and absent on any
|
|
257
|
+
* order that used none.
|
|
258
|
+
*/
|
|
259
|
+
pointsApplied?: number;
|
|
260
|
+
/**
|
|
261
|
+
* What was actually COLLECTED: `total − pointsApplied`.
|
|
262
|
+
*
|
|
263
|
+
* 🛑 Read it as **`amountDue ?? total`**, never `amountDue ?? 0`. Absent means
|
|
264
|
+
* "no points were used, so the whole total was collected"; zero would mean
|
|
265
|
+
* the order was free. The two are a long way apart on a receipt, and the
|
|
266
|
+
* wrong default turns every historical order into a ₹0 one.
|
|
267
|
+
*/
|
|
268
|
+
amountDue?: number;
|
|
269
|
+
/**
|
|
270
|
+
* The invoice number from the gapless FY series, e.g. `LIR/26-27/0001`
|
|
271
|
+
* (Phase 7).
|
|
272
|
+
*
|
|
273
|
+
* Absent until the order is paid, and absent on every order placed before
|
|
274
|
+
* the series existed — so the invoice page must render its own fallback
|
|
275
|
+
* rather than printing "undefined" where a statutory field belongs.
|
|
276
|
+
*/
|
|
277
|
+
invoiceNumber?: string;
|
|
278
|
+
invoiceIssuedAt?: string;
|
|
253
279
|
trackingNumber?: string;
|
|
254
280
|
shippingCarrier?: string;
|
|
255
281
|
/** Carrier tracking page URL — rendered as an external link that opens in a new tab. No live-tracking API integration; this is just the passthrough URL a seller/admin entered. */
|
|
@@ -261,6 +287,27 @@ export interface Order {
|
|
|
261
287
|
timelineTruncated?: number;
|
|
262
288
|
/** How the buyer acquired the right to buy. Written once, at creation. */
|
|
263
289
|
sourceContext?: OrderSourceContext;
|
|
290
|
+
/**
|
|
291
|
+
* D55 — the pre-order balance, once the seller has OPENED it for collection.
|
|
292
|
+
*
|
|
293
|
+
* 🛑 Absent until then, and that is the difference between "a balance
|
|
294
|
+
* exists" (`sourceContext.balanceDue > 0`, true from the moment the order
|
|
295
|
+
* was placed) and "a balance is payable". The buyer's panel gates on this
|
|
296
|
+
* field, so forgetting it in `orderDocumentToOrder` would render the
|
|
297
|
+
* "nothing to pay" branch on every order forever — Root Cause #57, which
|
|
298
|
+
* is what made the whole manual-payment flow dead for weeks.
|
|
299
|
+
*/
|
|
300
|
+
balance?: {
|
|
301
|
+
amount: number;
|
|
302
|
+
method: "manual";
|
|
303
|
+
status: "awaiting" | "submitted" | "paid" | "rejected";
|
|
304
|
+
dueBy?: string;
|
|
305
|
+
proofUrl?: string;
|
|
306
|
+
transactionId?: string;
|
|
307
|
+
submittedAt?: string;
|
|
308
|
+
reviewedAt?: string;
|
|
309
|
+
reviewNote?: string;
|
|
310
|
+
};
|
|
264
311
|
physicalLocation?: {
|
|
265
312
|
zone: string;
|
|
266
313
|
shelf: string;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* "Is this order waiting on OUR courier problem?" — one predicate, so the
|
|
3
|
+
* obligation engine, the seller's UI and the admin digest cannot disagree.
|
|
4
|
+
*
|
|
5
|
+
* Deliberately a function over the document rather than a stored boolean: a
|
|
6
|
+
* denormalised `isCourierBlocked` mirror drifts the first time a write path
|
|
7
|
+
* forgets it (Root Cause #42), and the field it derives from is right there.
|
|
8
|
+
*/
|
|
9
|
+
import type { OrderDocument } from "../schemas/firestore";
|
|
10
|
+
/** The subset actually read, so callers need not hold a whole order. */
|
|
11
|
+
export interface CourierBlockBearing {
|
|
12
|
+
courierBlock?: OrderDocument["courierBlock"];
|
|
13
|
+
shippingDate?: Date | null;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* True while a courier booking we attempted is still unresolved.
|
|
17
|
+
*
|
|
18
|
+
* 🛑 A block is CLEARED by the parcel actually going out, not by anything
|
|
19
|
+
* clearing the field. So a `shippingDate` wins over a stale `courierBlock`:
|
|
20
|
+
* if the seller gave up waiting and posted it themselves, the order is
|
|
21
|
+
* dispatched and the block is history, even if nobody deleted it. Reading the
|
|
22
|
+
* field alone would pause the dispatch clock forever on an order that had in
|
|
23
|
+
* fact shipped.
|
|
24
|
+
*/
|
|
25
|
+
export declare function hasOpenCourierBlock(order: CourierBlockBearing): boolean;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* "Is this order waiting on OUR courier problem?" — one predicate, so the
|
|
3
|
+
* obligation engine, the seller's UI and the admin digest cannot disagree.
|
|
4
|
+
*
|
|
5
|
+
* Deliberately a function over the document rather than a stored boolean: a
|
|
6
|
+
* denormalised `isCourierBlocked` mirror drifts the first time a write path
|
|
7
|
+
* forgets it (Root Cause #42), and the field it derives from is right there.
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* True while a courier booking we attempted is still unresolved.
|
|
11
|
+
*
|
|
12
|
+
* 🛑 A block is CLEARED by the parcel actually going out, not by anything
|
|
13
|
+
* clearing the field. So a `shippingDate` wins over a stale `courierBlock`:
|
|
14
|
+
* if the seller gave up waiting and posted it themselves, the order is
|
|
15
|
+
* dispatched and the block is history, even if nobody deleted it. Reading the
|
|
16
|
+
* field alone would pause the dispatch clock forever on an order that had in
|
|
17
|
+
* fact shipped.
|
|
18
|
+
*/
|
|
19
|
+
export function hasOpenCourierBlock(order) {
|
|
20
|
+
if (!order.courierBlock)
|
|
21
|
+
return false;
|
|
22
|
+
return !order.shippingDate;
|
|
23
|
+
}
|
|
@@ -107,7 +107,32 @@ export type PaymentCaseKind = "missing_order" | "unprocessed_event" | "status_co
|
|
|
107
107
|
* Keyed on the USER, so a persistently broken mirror is one case with a
|
|
108
108
|
* rising `observedCount` rather than a new row every night.
|
|
109
109
|
*/
|
|
110
|
-
| "ledger_drift"
|
|
110
|
+
| "ledger_drift"
|
|
111
|
+
/**
|
|
112
|
+
* We could not book a courier, so one or more PAID orders cannot be
|
|
113
|
+
* dispatched by us.
|
|
114
|
+
*
|
|
115
|
+
* The commonest cause is our own prepaid courier wallet running dry —
|
|
116
|
+
* Shiprocket has no recharge API, so the top-up is irreducibly a human
|
|
117
|
+
* action, which is exactly what a case is for.
|
|
118
|
+
*
|
|
119
|
+
* 🛑 KEYED ON THE WALLET (the provider), NOT ON THE ORDER. Fifty blocked
|
|
120
|
+
* orders are ONE problem with one fix, and the daily email ceiling applies
|
|
121
|
+
* to staff mail too (`send-guard.ts:92`) — so a per-order case would open
|
|
122
|
+
* fifty rows and spend the whole 80/day budget telling an operator the same
|
|
123
|
+
* thing fifty times, leaving them blind to everything else. `openOrObserve`
|
|
124
|
+
* raises `observedCount` instead, which also makes "how many orders are
|
|
125
|
+
* stuck behind this" readable at a glance.
|
|
126
|
+
*
|
|
127
|
+
* 🛑 Its own kind rather than `shipping_unpriced`, which means we could not
|
|
128
|
+
* work out what shipping COSTS. Here the price is known and the money to pay
|
|
129
|
+
* it is not there. The kind chips are what an operator triages by, and this
|
|
130
|
+
* is the fourth time this file has had to say so — the shortcut is always
|
|
131
|
+
* attractive because a plausible kind already exists.
|
|
132
|
+
*
|
|
133
|
+
* `severity: "error"`: a buyer has paid and their parcel is not moving.
|
|
134
|
+
*/
|
|
135
|
+
| "courier_unavailable";
|
|
111
136
|
/**
|
|
112
137
|
* Identical to `ReportStatus`, deliberately — see the header. `actioned` means
|
|
113
138
|
* a human did something; `dismissed` means a human decided nothing was wrong.
|
|
@@ -220,8 +220,9 @@ export class PayoutRepository extends BaseRepository {
|
|
|
220
220
|
trigger: ctx?.trigger ?? defaultTrigger,
|
|
221
221
|
reason: ctx?.reason,
|
|
222
222
|
note: ctx?.note,
|
|
223
|
-
// `sellerEmail` / `upiId` — `encryptPiiFields`
|
|
224
|
-
//
|
|
223
|
+
// `sellerEmail` / `upiId` — `encryptPiiFields` covers only NAMED paths,
|
|
224
|
+
// and nothing declares them under `statusHistory[].changes`, so either
|
|
225
|
+
// one reaching `changes` would persist in PLAINTEXT.
|
|
225
226
|
piiFields: PAYOUT_PII_FIELDS,
|
|
226
227
|
});
|
|
227
228
|
return withEntry ?? patch;
|
|
@@ -5,6 +5,7 @@ import { type GeneratePayoutIdInput } from "../../../utils/id-generators";
|
|
|
5
5
|
import type { BaseDocument } from "../../../_internal/shared/types/base-document";
|
|
6
6
|
import type { StatusChangeEntry } from "../../../_internal/shared/history/types";
|
|
7
7
|
import type { Encrypted, Plaintext } from "../../../security/encrypted";
|
|
8
|
+
import type { PayCadence } from "../../../_internal/shared/features/payouts/pay-period";
|
|
8
9
|
export interface PayoutBankAccount {
|
|
9
10
|
accountHolderName: string;
|
|
10
11
|
accountNumberMasked: string;
|
|
@@ -45,7 +46,29 @@ export type PayoutPaymentMethod = "bank_transfer" | "upi";
|
|
|
45
46
|
* asterisks". The distinction is which named method you called.
|
|
46
47
|
*/
|
|
47
48
|
export type PayoutPlain = Plaintext<PayoutDocument>;
|
|
48
|
-
|
|
49
|
+
/**
|
|
50
|
+
* 🛑 **A seller payout settles a LIABILITY. An employee payout is an EXPENSE.**
|
|
51
|
+
*
|
|
52
|
+
* One undiscriminated shape misstates both statements at once — wages vanish
|
|
53
|
+
* from the P&L and reappear as settled seller liabilities — so `payeeType` is
|
|
54
|
+
* a discriminated union rather than an optional field.
|
|
55
|
+
*
|
|
56
|
+
* ## Why `PayoutDocument` still names the STORE variant
|
|
57
|
+
*
|
|
58
|
+
* Every one of the ~30 existing readers means a seller payout, and every one
|
|
59
|
+
* of them is correct. Renaming the type they import would turn a safety change
|
|
60
|
+
* into a mechanical sweep, and the sweep is where the real mistakes go in.
|
|
61
|
+
* `PayoutDocument = StorePayoutDocument` keeps them compiling and correct;
|
|
62
|
+
* anything that must handle BOTH takes `AnyPayoutDocument` and is forced by
|
|
63
|
+
* `tsc` to narrow.
|
|
64
|
+
*
|
|
65
|
+
* 🛑 `payeeType` is REQUIRED here, not optional-with-a-default. That breaks
|
|
66
|
+
* the five sites that CONSTRUCT a payout, which is the entire point — a row
|
|
67
|
+
* written without it is a row the books cannot classify, and an optional
|
|
68
|
+
* discriminant defers that discovery to a reader rather than a writer.
|
|
69
|
+
*/
|
|
70
|
+
export interface StorePayoutDocument extends BaseDocument {
|
|
71
|
+
payeeType: "store";
|
|
49
72
|
storeId: string;
|
|
50
73
|
sellerName: string;
|
|
51
74
|
sellerEmail: Encrypted<string>;
|
|
@@ -92,6 +115,74 @@ export interface PayoutDocument extends BaseDocument {
|
|
|
92
115
|
statusHistory?: StatusChangeEntry[];
|
|
93
116
|
statusHistoryTruncated?: number;
|
|
94
117
|
}
|
|
118
|
+
/**
|
|
119
|
+
* Wages for a period, earned by resolving support tickets.
|
|
120
|
+
*
|
|
121
|
+
* ## 🛑 `platformFee` is ABSENT, not zero
|
|
122
|
+
*
|
|
123
|
+
* A `0` would read as "we took no commission on these wages", which is a
|
|
124
|
+
* statement about a transaction that did not happen. Commission is not a
|
|
125
|
+
* concept between a platform and its own staff, and the books must be able to
|
|
126
|
+
* tell "not applicable" from "nil" — a nil commission is a seller payout where
|
|
127
|
+
* the rate happened to resolve to zero, and those post differently.
|
|
128
|
+
*
|
|
129
|
+
* The same argument removes `storeId`, `sellerName`, `sellerEmail`,
|
|
130
|
+
* `grossAmount`, `platformFeeRate`, `gatewayFee*`, `orderIds` and
|
|
131
|
+
* `refundDeductions`. A field that cannot apply is omitted so `tsc` refuses
|
|
132
|
+
* the read, rather than present-and-empty so a reader quietly gets a falsy
|
|
133
|
+
* value.
|
|
134
|
+
*/
|
|
135
|
+
export interface EmployeePayoutDocument extends BaseDocument {
|
|
136
|
+
payeeType: "employee";
|
|
137
|
+
employeeUid: string;
|
|
138
|
+
employeeName: string;
|
|
139
|
+
/** PII, same treatment as a seller's. */
|
|
140
|
+
employeeEmail: Encrypted<string>;
|
|
141
|
+
amount: number;
|
|
142
|
+
currency: string;
|
|
143
|
+
status: PayoutStatus;
|
|
144
|
+
paymentMethod: PayoutPaymentMethod;
|
|
145
|
+
bankAccount?: PayoutBankAccount;
|
|
146
|
+
upiId?: Encrypted<string>;
|
|
147
|
+
/**
|
|
148
|
+
* The tickets this payslip is for.
|
|
149
|
+
*
|
|
150
|
+
* 🛑 Tickets **still resolved at period end**, not tickets closed during it.
|
|
151
|
+
* Paying per ticket closed rewards closing rather than resolving, so a
|
|
152
|
+
* reopened ticket does not count — see `resolvedTicketsForPeriod`.
|
|
153
|
+
*/
|
|
154
|
+
ticketIds: string[];
|
|
155
|
+
/** Resolved by `payPeriodFor`, never computed at a call site. */
|
|
156
|
+
periodStart: Date;
|
|
157
|
+
periodEnd: Date;
|
|
158
|
+
payCadence: PayCadence;
|
|
159
|
+
notes?: string;
|
|
160
|
+
adminNote?: string;
|
|
161
|
+
requestedAt: Date;
|
|
162
|
+
processedAt?: Date;
|
|
163
|
+
transactionId?: string;
|
|
164
|
+
statusHistory?: StatusChangeEntry[];
|
|
165
|
+
statusHistoryTruncated?: number;
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* What ~30 existing readers mean, and what they should keep meaning.
|
|
169
|
+
*
|
|
170
|
+
* Deliberately an alias rather than a rename: see the header on
|
|
171
|
+
* `StorePayoutDocument`.
|
|
172
|
+
*/
|
|
173
|
+
export type PayoutDocument = StorePayoutDocument;
|
|
174
|
+
/** Use this ONLY where both kinds genuinely arrive together. */
|
|
175
|
+
export type AnyPayoutDocument = StorePayoutDocument | EmployeePayoutDocument;
|
|
176
|
+
/**
|
|
177
|
+
* 🛑 Narrow on the DISCRIMINANT, never on the presence of `storeId`.
|
|
178
|
+
*
|
|
179
|
+
* A `"storeId" in payout` test reads as equivalent and is not: it answers a
|
|
180
|
+
* question about the object in hand rather than about what the row IS, so a
|
|
181
|
+
* partially-populated or hand-built object answers it wrongly, silently, and
|
|
182
|
+
* in the direction that posts wages as a settled seller liability.
|
|
183
|
+
*/
|
|
184
|
+
export declare function isStorePayout(p: AnyPayoutDocument): p is StorePayoutDocument;
|
|
185
|
+
export declare function isEmployeePayout(p: AnyPayoutDocument): p is EmployeePayoutDocument;
|
|
95
186
|
/**
|
|
96
187
|
* The fields whose changes earn a timeline entry.
|
|
97
188
|
*
|
|
@@ -8,6 +8,20 @@ export const PayoutStatusValues = {
|
|
|
8
8
|
PAID: "paid",
|
|
9
9
|
FAILED: "failed",
|
|
10
10
|
};
|
|
11
|
+
/**
|
|
12
|
+
* 🛑 Narrow on the DISCRIMINANT, never on the presence of `storeId`.
|
|
13
|
+
*
|
|
14
|
+
* A `"storeId" in payout` test reads as equivalent and is not: it answers a
|
|
15
|
+
* question about the object in hand rather than about what the row IS, so a
|
|
16
|
+
* partially-populated or hand-built object answers it wrongly, silently, and
|
|
17
|
+
* in the direction that posts wages as a settled seller liability.
|
|
18
|
+
*/
|
|
19
|
+
export function isStorePayout(p) {
|
|
20
|
+
return p.payeeType === "store";
|
|
21
|
+
}
|
|
22
|
+
export function isEmployeePayout(p) {
|
|
23
|
+
return p.payeeType === "employee";
|
|
24
|
+
}
|
|
11
25
|
/**
|
|
12
26
|
* The fields whose changes earn a timeline entry.
|
|
13
27
|
*
|
|
@@ -36,6 +50,15 @@ export const PAYOUT_INDEXED_FIELDS = [
|
|
|
36
50
|
];
|
|
37
51
|
export const DEFAULT_PLATFORM_FEE_RATE = 0.05;
|
|
38
52
|
export const DEFAULT_PAYOUT_DATA = {
|
|
53
|
+
/*
|
|
54
|
+
* 🛑 Here as a BACKSTOP, not as the reason the field is set. Every caller
|
|
55
|
+
* passes `payeeType` explicitly and must keep doing so — a default that is
|
|
56
|
+
* the only writer makes the discriminant optional in practice, which is the
|
|
57
|
+
* exact failure the required field exists to prevent. This catches a row
|
|
58
|
+
* built by some path nobody enumerated and lands it on the correct side of
|
|
59
|
+
* the books rather than on neither.
|
|
60
|
+
*/
|
|
61
|
+
payeeType: "store",
|
|
39
62
|
status: "pending",
|
|
40
63
|
platformFeeRate: DEFAULT_PLATFORM_FEE_RATE,
|
|
41
64
|
orderIds: [],
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export interface AdminPricingViewProps {
|
|
3
|
+
/**
|
|
4
|
+
* The rate endpoint, supplied by the consumer.
|
|
5
|
+
*
|
|
6
|
+
* 🛑 REQUIRED, with no default. appkit cannot import `API_ROUTES` (that is
|
|
7
|
+
* consumer-side), so a default would be a path literal living in the
|
|
8
|
+
* library — a second place the route is written, and the one nobody updates
|
|
9
|
+
* when it moves. `audit-hardcoded-api-routes` blocks it, correctly.
|
|
10
|
+
*/
|
|
11
|
+
endpoint: string;
|
|
12
|
+
}
|
|
13
|
+
export declare function AdminPricingView({ endpoint }: AdminPricingViewProps): React.JSX.Element;
|