@mohasinac/appkit 4.71.0 → 4.71.2
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 +4 -4
- package/dist/_internal/client/edit-mode/EditModeProvider.d.ts +32 -0
- package/dist/_internal/client/edit-mode/EditModeProvider.js +33 -0
- package/dist/_internal/client/edit-mode/index.d.ts +2 -0
- package/dist/_internal/client/edit-mode/index.js +1 -0
- package/dist/_internal/client/features/giveaway/ClearanceGiveawayDetailView.d.ts +32 -0
- package/dist/_internal/client/features/giveaway/ClearanceGiveawayDetailView.js +29 -0
- package/dist/_internal/client/features/giveaway/GiveawayAdminEditView.d.ts +66 -0
- package/dist/_internal/client/features/giveaway/GiveawayAdminEditView.js +187 -0
- package/dist/_internal/client/features/giveaway/GiveawayAdminSlotView.d.ts +18 -0
- package/dist/_internal/client/features/giveaway/GiveawayAdminSlotView.js +52 -0
- package/dist/_internal/client/features/giveaway/GiveawayDetailView.d.ts +40 -0
- package/dist/_internal/client/features/giveaway/GiveawayDetailView.js +49 -0
- package/dist/_internal/client/features/giveaway/GiveawayEntriesView.d.ts +34 -0
- package/dist/_internal/client/features/giveaway/GiveawayEntriesView.js +64 -0
- package/dist/_internal/client/features/giveaway/GiveawayListView.d.ts +39 -0
- package/dist/_internal/client/features/giveaway/GiveawayListView.js +45 -0
- package/dist/_internal/client/features/giveaway/GiveawayPullForm.d.ts +31 -0
- package/dist/_internal/client/features/giveaway/GiveawayPullForm.js +94 -0
- package/dist/_internal/client/features/giveaway/GiveawaySlotGrid.d.ts +14 -0
- package/dist/_internal/client/features/giveaway/GiveawaySlotGrid.js +23 -0
- package/dist/_internal/client/features/giveaway/slot-collage-items.d.ts +15 -0
- package/dist/_internal/client/features/giveaway/slot-collage-items.js +13 -0
- package/dist/_internal/client/features/layout/DashboardLayoutClient.d.ts +34 -1
- package/dist/_internal/client/features/layout/DashboardLayoutClient.js +79 -9
- package/dist/_internal/client/features/layout/PortalBackLink.d.ts +15 -0
- package/dist/_internal/client/features/layout/PortalBackLink.js +58 -0
- package/dist/_internal/client/features/layout/SidebarCollapseToggle.js +37 -1
- package/dist/_internal/client/features/layout/filterNavItems.d.ts +11 -6
- package/dist/_internal/client/features/layout/filterNavItems.js +36 -4
- package/dist/_internal/client/features/layout/sidebarPositionClasses.js +10 -2
- package/dist/_internal/client/features/maintenance/views/AnalysisRunnerView.d.ts +6 -1
- package/dist/_internal/client/features/maintenance/views/AnalysisRunnerView.js +4 -3
- package/dist/_internal/client/features/maintenance/views/CacheInvalidationPanel.js +1 -1
- package/dist/_internal/client/features/maintenance/views/CloudLogsListView.d.ts +4 -1
- package/dist/_internal/client/features/maintenance/views/CloudLogsListView.js +4 -3
- package/dist/_internal/client/features/maintenance/views/MaintenanceDashboardView.d.ts +4 -1
- package/dist/_internal/client/features/maintenance/views/MaintenanceDashboardView.js +4 -2
- package/dist/_internal/client/features/maintenance/views/RepositoryCacheStatusPanel.d.ts +15 -0
- package/dist/_internal/client/features/maintenance/views/RepositoryCacheStatusPanel.js +161 -0
- package/dist/_internal/client/features/maintenance/views/ServerErrorDetailView.d.ts +4 -1
- package/dist/_internal/client/features/maintenance/views/ServerErrorDetailView.js +3 -2
- package/dist/_internal/client/features/maintenance/views/ServerErrorsListView.d.ts +11 -1
- package/dist/_internal/client/features/maintenance/views/ServerErrorsListView.js +3 -2
- package/dist/_internal/server/features/ads/booking.d.ts +1 -1
- package/dist/_internal/server/features/ads/booking.js +1 -1
- package/dist/_internal/server/features/assistant/actions.d.ts +29 -0
- package/dist/_internal/server/features/assistant/actions.js +170 -0
- package/dist/_internal/server/features/assistant/budget.d.ts +28 -0
- package/dist/_internal/server/features/assistant/budget.js +132 -0
- package/dist/_internal/server/features/assistant/escalate.d.ts +25 -0
- package/dist/_internal/server/features/assistant/escalate.js +108 -0
- package/dist/_internal/server/features/assistant/guard.d.ts +10 -0
- package/dist/_internal/server/features/assistant/guard.js +110 -0
- package/dist/_internal/server/features/assistant/handles.d.ts +42 -0
- package/dist/_internal/server/features/assistant/handles.js +172 -0
- package/dist/_internal/server/features/assistant/history-store.d.ts +16 -0
- package/dist/_internal/server/features/assistant/history-store.js +63 -0
- package/dist/_internal/server/features/assistant/model-routing.d.ts +70 -0
- package/dist/_internal/server/features/assistant/model-routing.js +80 -0
- package/dist/_internal/server/features/assistant/quorum.d.ts +32 -0
- package/dist/_internal/server/features/assistant/quorum.js +128 -0
- package/dist/_internal/server/features/assistant/redaction.d.ts +68 -0
- package/dist/_internal/server/features/assistant/redaction.js +69 -0
- package/dist/_internal/server/features/assistant/severity.d.ts +41 -0
- package/dist/_internal/server/features/assistant/severity.js +93 -0
- package/dist/_internal/server/features/assistant/tools/admin/search-nav.d.ts +39 -0
- package/dist/_internal/server/features/assistant/tools/admin/search-nav.js +27 -0
- package/dist/_internal/server/features/assistant/tools/builtin/get-my-orders.d.ts +15 -0
- package/dist/_internal/server/features/assistant/tools/builtin/get-my-orders.js +116 -0
- package/dist/_internal/server/features/assistant/tools/builtin/get-toggle-state.d.ts +8 -0
- package/dist/_internal/server/features/assistant/tools/builtin/get-toggle-state.js +64 -0
- package/dist/_internal/server/features/assistant/tools/builtin/index.d.ts +38 -0
- package/dist/_internal/server/features/assistant/tools/builtin/index.js +29 -0
- package/dist/_internal/server/features/assistant/tools/builtin/search-faqs.d.ts +8 -0
- package/dist/_internal/server/features/assistant/tools/builtin/search-faqs.js +62 -0
- package/dist/_internal/server/features/assistant/tools/builtin/search-products.d.ts +16 -0
- package/dist/_internal/server/features/assistant/tools/builtin/search-products.js +79 -0
- package/dist/_internal/server/features/assistant/tools/define.d.ts +85 -0
- package/dist/_internal/server/features/assistant/tools/define.js +8 -0
- package/dist/_internal/server/features/assistant/tools/json-schema.d.ts +34 -0
- package/dist/_internal/server/features/assistant/tools/json-schema.js +79 -0
- package/dist/_internal/server/features/assistant/tools/manifest.d.ts +22 -0
- package/dist/_internal/server/features/assistant/tools/manifest.js +27 -0
- package/dist/_internal/server/features/assistant/tools/registry.d.ts +22 -0
- package/dist/_internal/server/features/assistant/tools/registry.js +43 -0
- package/dist/_internal/server/features/assistant/turn.d.ts +43 -0
- package/dist/_internal/server/features/assistant/turn.js +281 -0
- package/dist/_internal/server/features/auth/permissions.d.ts +65 -10
- package/dist/_internal/server/features/auth/permissions.js +74 -15
- package/dist/_internal/server/features/brands/actions.js +3 -3
- package/dist/_internal/server/features/bundles/actions.js +3 -3
- package/dist/_internal/server/features/categories/adapters.d.ts +2 -2
- package/dist/_internal/server/features/categories/adapters.js +17 -8
- package/dist/_internal/server/features/checkout/actions.d.ts +142 -15
- package/dist/_internal/server/features/checkout/actions.js +988 -142
- package/dist/_internal/server/features/checkout/gateway-selection.d.ts +68 -0
- package/dist/_internal/server/features/checkout/gateway-selection.js +124 -0
- package/dist/_internal/server/features/checkout/index.d.ts +5 -0
- package/dist/_internal/server/features/checkout/index.js +18 -0
- package/dist/_internal/server/features/checkout/locked-lines.d.ts +10 -10
- package/dist/_internal/server/features/checkout/locked-lines.js +37 -37
- package/dist/_internal/server/features/checkout/prize-bundle-gates.d.ts +1 -1
- package/dist/_internal/server/features/checkout/prize-bundle-gates.js +1 -1
- package/dist/_internal/server/features/checkout/source-context.js +17 -17
- package/dist/_internal/server/features/checkout/split-settlement.d.ts +100 -0
- package/dist/_internal/server/features/checkout/split-settlement.js +205 -0
- package/dist/_internal/server/features/checkout/upi-resolution.js +8 -1
- package/dist/_internal/server/features/clearance/actions.d.ts +2 -0
- package/dist/_internal/server/features/clearance/actions.js +33 -0
- package/dist/_internal/server/features/clearance/data.d.ts +1 -0
- package/dist/_internal/server/features/clearance/data.js +2 -0
- package/dist/_internal/server/features/clearance/index.d.ts +4 -0
- package/dist/_internal/server/features/clearance/index.js +4 -0
- package/dist/_internal/server/features/clearance/og.d.ts +32 -0
- package/dist/_internal/server/features/clearance/og.js +47 -0
- package/dist/_internal/server/features/clearance/service.d.ts +3 -0
- package/dist/_internal/server/features/clearance/service.js +19 -0
- package/dist/_internal/server/features/collector-drops/actions.js +76 -0
- package/dist/_internal/server/features/collector-drops/data.d.ts +2 -0
- package/dist/_internal/server/features/collector-drops/data.js +3 -0
- package/dist/_internal/server/features/collector-drops/index.d.ts +5 -0
- package/dist/_internal/server/features/collector-drops/index.js +5 -0
- package/dist/_internal/server/features/collector-drops/og.d.ts +22 -0
- package/dist/_internal/server/features/collector-drops/og.js +30 -0
- package/dist/_internal/server/features/collector-drops/service.d.ts +20 -0
- package/dist/_internal/server/features/collector-drops/service.js +65 -0
- package/dist/_internal/server/features/dashboard/page-regions.d.ts +33 -0
- package/dist/_internal/server/features/dashboard/page-regions.js +53 -0
- package/dist/_internal/server/features/digital-code/pool.d.ts +14 -1
- package/dist/_internal/server/features/digital-code/pool.js +21 -2
- package/dist/_internal/server/features/digital-code/release.d.ts +79 -0
- package/dist/_internal/server/features/digital-code/release.js +176 -0
- package/dist/_internal/server/features/events/adapters.d.ts +7 -7
- package/dist/_internal/server/features/events/adapters.js +6 -6
- package/dist/_internal/server/features/events/data.d.ts +17 -1
- package/dist/_internal/server/features/events/data.js +51 -0
- package/dist/_internal/server/features/events/service.d.ts +2 -2
- package/dist/_internal/server/features/forms/field-visibility.d.ts +35 -0
- package/dist/_internal/server/features/forms/field-visibility.js +89 -0
- package/dist/_internal/server/features/giveaway/actions.d.ts +43 -0
- package/dist/_internal/server/features/giveaway/actions.js +369 -0
- package/dist/_internal/server/features/giveaway/adapters.d.ts +15 -0
- package/dist/_internal/server/features/giveaway/adapters.js +31 -0
- package/dist/_internal/server/features/giveaway/data.d.ts +19 -0
- package/dist/_internal/server/features/giveaway/data.js +56 -0
- package/dist/_internal/server/features/giveaway/metadata.d.ts +6 -0
- package/dist/_internal/server/features/giveaway/metadata.js +31 -0
- package/dist/_internal/server/features/giveaway/og.d.ts +40 -0
- package/dist/_internal/server/features/giveaway/og.js +79 -0
- package/dist/_internal/server/features/homepage/index.js +1 -1
- package/dist/_internal/server/features/inventory/reservations.d.ts +1 -1
- package/dist/_internal/server/features/inventory/reservations.js +1 -1
- package/dist/_internal/server/features/maintenance/cache-admin.d.ts +44 -0
- package/dist/_internal/server/features/maintenance/cache-admin.js +85 -0
- package/dist/_internal/server/features/media/contextGuards.d.ts +2 -2
- package/dist/_internal/server/features/media/contextGuards.js +4 -4
- package/dist/_internal/server/features/messages/actions.js +11 -0
- package/dist/_internal/server/features/order-completion/actions.js +1 -1
- package/dist/_internal/server/features/orders/actions.d.ts +3 -2
- package/dist/_internal/server/features/orders/actions.js +67 -16
- package/dist/_internal/server/features/orders/adapters.js +20 -3
- package/dist/_internal/server/features/orders/balance.d.ts +5 -2
- package/dist/_internal/server/features/orders/balance.js +12 -2
- package/dist/_internal/server/features/products/actions.d.ts +1 -1
- package/dist/_internal/server/features/products/actions.js +8 -8
- package/dist/_internal/server/features/products/data.js +5 -4
- package/dist/_internal/server/features/products/index.d.ts +1 -1
- package/dist/_internal/server/features/products/index.js +1 -1
- package/dist/_internal/server/features/products/list-public.js +18 -12
- package/dist/_internal/server/features/products/listing-tab-counts.d.ts +1 -1
- package/dist/_internal/server/features/products/listing-tab-counts.js +8 -8
- package/dist/_internal/server/features/products/og.js +1 -1
- package/dist/_internal/server/features/products/service.d.ts +51 -14
- package/dist/_internal/server/features/products/service.js +95 -29
- package/dist/_internal/server/features/scams/og.d.ts +1 -1
- package/dist/_internal/server/features/search/entity-index.d.ts +14 -0
- package/dist/_internal/server/features/search/entity-index.js +87 -0
- package/dist/_internal/server/features/search/index-build/build.js +13 -4
- package/dist/_internal/server/features/search/index-build/sources.d.ts +2 -0
- package/dist/_internal/server/features/search/index-build/sources.js +4 -2
- package/dist/_internal/server/features/search/search-everything.d.ts +2 -0
- package/dist/_internal/server/features/search/search-sources.js +5 -3
- package/dist/_internal/server/features/seo/index.d.ts +1 -1
- package/dist/_internal/server/features/seo/index.js +1 -1
- package/dist/_internal/server/features/seo/manifest.js +3 -3
- package/dist/_internal/server/features/seo/product-detail-types.js +2 -1
- package/dist/_internal/server/features/seo/robots.js +19 -4
- package/dist/_internal/server/features/seo/sitemap.js +62 -94
- package/dist/_internal/server/features/seo/static-params.d.ts +0 -18
- package/dist/_internal/server/features/seo/static-params.js +0 -55
- package/dist/_internal/server/features/shared/listing-data-factory.js +3 -3
- package/dist/_internal/server/features/site-settings/actions.d.ts +36 -0
- package/dist/_internal/server/features/site-settings/actions.js +57 -1
- package/dist/_internal/server/features/site-settings/adapters.d.ts +3 -3
- package/dist/_internal/server/features/site-settings/adapters.js +39 -4
- package/dist/_internal/server/features/sticker-trace/promote-to-listings.js +2 -2
- package/dist/_internal/server/features/sticker-trace/sweep.d.ts +13 -0
- package/dist/_internal/server/features/sticker-trace/sweep.js +49 -0
- package/dist/_internal/server/features/stores/activation.d.ts +22 -0
- package/dist/_internal/server/features/stores/activation.js +73 -0
- package/dist/_internal/server/features/stores/adapters.d.ts +1 -1
- package/dist/_internal/server/features/stores/adapters.js +22 -0
- package/dist/_internal/server/features/stores/data.d.ts +1 -1
- package/dist/_internal/server/features/stores/data.js +1 -1
- package/dist/_internal/server/features/stores/index.d.ts +2 -1
- package/dist/_internal/server/features/stores/index.js +7 -1
- package/dist/_internal/server/features/stores/tabs.js +6 -11
- package/dist/_internal/server/features/widgets/widget-instances.d.ts +34 -0
- package/dist/_internal/server/features/widgets/widget-instances.js +169 -0
- package/dist/_internal/server/functions/define.d.ts +4 -4
- package/dist/_internal/server/functions/define.js +4 -4
- package/dist/_internal/server/functions/firestore.d.ts +3 -3
- package/dist/_internal/server/functions/firestore.js +18 -9
- package/dist/_internal/server/functions/https.js +1 -1
- package/dist/_internal/server/functions/scheduled.d.ts +26 -3
- package/dist/_internal/server/functions/scheduled.js +49 -12
- package/dist/_internal/server/jobs/core/assignSpinPrize.js +5 -1
- package/dist/_internal/server/jobs/core/autoPayoutEligibility.js +13 -11
- package/dist/_internal/server/jobs/core/bundleStockSync.js +1 -1
- package/dist/_internal/server/jobs/core/cleanupRtdbEvents.js +2 -2
- package/dist/_internal/server/jobs/core/clearanceAssignWinner.d.ts +60 -0
- package/dist/_internal/server/jobs/core/clearanceAssignWinner.js +227 -0
- package/dist/_internal/server/jobs/core/clearanceExpiryReveal.d.ts +14 -0
- package/dist/_internal/server/jobs/core/clearanceExpiryReveal.js +71 -0
- package/dist/_internal/server/jobs/core/clearanceSoldOutReveal.d.ts +22 -0
- package/dist/_internal/server/jobs/core/clearanceSoldOutReveal.js +67 -0
- package/dist/_internal/server/jobs/core/collectorDropSettlement.d.ts +2 -0
- package/dist/_internal/server/jobs/core/collectorDropSettlement.js +240 -0
- package/dist/_internal/server/jobs/core/countersReconcile.js +21 -21
- package/dist/_internal/server/jobs/core/event-draw-reasons.d.ts +4 -2
- package/dist/_internal/server/jobs/core/event-draw-reasons.js +6 -4
- package/dist/_internal/server/jobs/core/index.d.ts +5 -5
- package/dist/_internal/server/jobs/core/index.js +5 -5
- package/dist/_internal/server/jobs/core/jobRunners.d.ts +1 -1
- package/dist/_internal/server/jobs/core/jobRunners.js +25 -0
- package/dist/_internal/server/jobs/core/offerExpiry.js +23 -23
- package/dist/_internal/server/jobs/core/onCategoryWrite.d.ts +1 -1
- package/dist/_internal/server/jobs/core/onClearancePaymentConfirmed.d.ts +19 -0
- package/dist/_internal/server/jobs/core/onClearancePaymentConfirmed.js +32 -0
- package/dist/_internal/server/jobs/core/onProductWrite.d.ts +1 -1
- package/dist/_internal/server/jobs/core/onProductWrite.js +23 -23
- package/dist/_internal/server/jobs/core/onReviewWrite.d.ts +1 -1
- package/dist/_internal/server/jobs/core/onStoreWrite.d.ts +1 -1
- package/dist/_internal/server/jobs/core/paymentReviewAutoApprove.js +1 -1
- package/dist/_internal/server/jobs/core/paymentWindowTimeout.d.ts +1 -1
- package/dist/_internal/server/jobs/core/paymentWindowTimeout.js +1 -1
- package/dist/_internal/server/jobs/core/priceIndexRollup.d.ts +1 -1
- package/dist/_internal/server/jobs/core/priceIndexRollup.js +5 -5
- package/dist/_internal/server/jobs/core/promotions.js +1 -1
- package/dist/_internal/server/jobs/core/revalidateNotify.d.ts +1 -1
- package/dist/_internal/server/jobs/core/revalidateNotify.js +2 -2
- package/dist/_internal/server/jobs/core/settlementVendorRegister.d.ts +47 -0
- package/dist/_internal/server/jobs/core/settlementVendorRegister.js +414 -0
- package/dist/_internal/server/jobs/core/stickerTraceSweep.d.ts +9 -0
- package/dist/_internal/server/jobs/core/stickerTraceSweep.js +25 -0
- package/dist/_internal/server/jobs/core/surfaceCountsRollup.js +47 -7
- package/dist/_internal/server/jobs/core/testDataCleanup.js +1 -1
- package/dist/_internal/server/jobs/core/triggerEventRaffle.d.ts +2 -2
- package/dist/_internal/server/jobs/core/triggerEventRaffle.js +17 -12
- package/dist/_internal/server/jobs/core/weeklyPayoutEligibility.js +10 -8
- package/dist/_internal/server/jobs/handlers/clearanceExpiryReveal.d.ts +2 -0
- package/dist/_internal/server/jobs/handlers/clearanceExpiryReveal.js +2 -0
- package/dist/_internal/server/jobs/handlers/clearanceSoldOutReveal.d.ts +3 -0
- package/dist/_internal/server/jobs/handlers/clearanceSoldOutReveal.js +4 -0
- package/dist/_internal/server/jobs/handlers/collectorDropSettlement.d.ts +2 -0
- package/dist/_internal/server/jobs/handlers/collectorDropSettlement.js +2 -0
- package/dist/_internal/server/jobs/handlers/index.d.ts +6 -5
- package/dist/_internal/server/jobs/handlers/index.js +11 -9
- package/dist/_internal/server/jobs/handlers/messages.d.ts +4 -4
- package/dist/_internal/server/jobs/handlers/messages.js +13 -13
- package/dist/_internal/server/jobs/handlers/onCatalogueSubmittedForApproval.d.ts +1 -1
- package/dist/_internal/server/jobs/handlers/onClearancePaymentConfirmed.d.ts +3 -0
- package/dist/_internal/server/jobs/handlers/onClearancePaymentConfirmed.js +11 -0
- package/dist/_internal/server/jobs/handlers/onProductStockChange.d.ts +1 -1
- package/dist/_internal/server/jobs/handlers/onReviewWrite.d.ts +1 -1
- package/dist/_internal/server/jobs/handlers/onScamReportCreate.d.ts +1 -1
- package/dist/_internal/server/jobs/handlers/onScamReportUpdate.d.ts +1 -1
- package/dist/_internal/server/jobs/handlers/onShipmentAllocationSync.d.ts +1 -1
- package/dist/_internal/server/jobs/handlers/onShipmentDeleted.d.ts +1 -1
- package/dist/_internal/server/jobs/handlers/onShipmentItemWrite.d.ts +1 -1
- package/dist/_internal/server/jobs/handlers/onSiteSettingsWrite.d.ts +2 -2
- package/dist/_internal/server/jobs/handlers/onSiteSettingsWrite.js +1 -1
- package/dist/_internal/server/jobs/handlers/onSupportTicketCreate.d.ts +1 -1
- package/dist/_internal/server/jobs/handlers/onSupportTicketUpdate.d.ts +1 -1
- package/dist/_internal/server/jobs/handlers/onUserBanChange.d.ts +1 -1
- package/dist/_internal/server/jobs/handlers/stickerTraceSweep.d.ts +2 -0
- package/dist/_internal/server/jobs/handlers/stickerTraceSweep.js +2 -0
- package/dist/_internal/server/jobs/handlers/triggerEventRaffle.d.ts +1 -1
- package/dist/_internal/server/jobs/handlers/triggerEventRaffle.js +1 -1
- package/dist/_internal/server/jobs/runtime/adapters/firebase.d.ts +1 -1
- package/dist/_internal/server/jobs/runtime/adapters/firebase.js +1 -1
- package/dist/_internal/server/jobs/runtime/types.d.ts +1 -1
- package/dist/_internal/server/payments/policy-consent.d.ts +170 -0
- package/dist/_internal/server/payments/policy-consent.js +287 -0
- package/dist/_internal/server/payments/webhook-registry.d.ts +162 -0
- package/dist/_internal/server/payments/webhook-registry.js +228 -0
- package/dist/_internal/shared/actions/action-registry.d.ts +40 -6
- package/dist/_internal/shared/actions/action-registry.js +318 -312
- package/dist/_internal/shared/cache/revalidate-targets.d.ts +2 -2
- package/dist/_internal/shared/cache/revalidate-targets.js +8 -8
- package/dist/_internal/shared/checkout/lanes.d.ts +25 -25
- package/dist/_internal/shared/checkout/lanes.js +35 -35
- package/dist/_internal/shared/checkout/order-math.d.ts +50 -50
- package/dist/_internal/shared/checkout/order-math.js +108 -50
- package/dist/_internal/shared/checkout/payout-base.d.ts +51 -0
- package/dist/_internal/shared/checkout/payout-base.js +84 -0
- package/dist/_internal/shared/checkout/policy-consent.d.ts +182 -0
- package/dist/_internal/shared/checkout/policy-consent.js +214 -0
- package/dist/_internal/shared/checkout/rules/_limits.d.ts +35 -4
- package/dist/_internal/shared/checkout/rules/_limits.js +35 -4
- package/dist/_internal/shared/checkout/rules/_registry.js +6 -8
- package/dist/_internal/shared/checkout/rules/art-and-stickers.rule.d.ts +13 -0
- package/dist/_internal/shared/checkout/rules/art-and-stickers.rule.js +5 -0
- package/dist/_internal/shared/checkout/rules/bundle.rule.d.ts +24 -6
- package/dist/_internal/shared/checkout/rules/bundle.rule.js +4 -1
- package/dist/_internal/shared/checkout/rules/clearance.rule.d.ts +2 -0
- package/dist/_internal/shared/checkout/rules/clearance.rule.js +148 -0
- package/dist/_internal/shared/checkout/rules/collector-drop.rule.d.ts +2 -0
- package/dist/_internal/shared/checkout/rules/collector-drop.rule.js +50 -0
- package/dist/_internal/shared/checkout/rules/index.d.ts +4 -5
- package/dist/_internal/shared/checkout/rules/index.js +4 -5
- package/dist/_internal/shared/checkout/rules/payment-gate.d.ts +24 -3
- package/dist/_internal/shared/checkout/rules/payment-gate.js +24 -6
- package/dist/_internal/shared/checkout/rules/preorder.rule.js +39 -0
- package/dist/_internal/shared/checkout/rules/types.d.ts +26 -5
- package/dist/_internal/shared/checkout/settlement-split.d.ts +136 -0
- package/dist/_internal/shared/checkout/settlement-split.js +198 -0
- package/dist/_internal/shared/checkout/settlement.d.ts +186 -0
- package/dist/_internal/shared/checkout/settlement.js +0 -0
- package/dist/_internal/shared/config/index.d.ts +1 -1
- package/dist/_internal/shared/config/schema.d.ts +35 -1
- package/dist/_internal/shared/content/composite-sentences/en.d.ts +31 -0
- package/dist/_internal/shared/content/composite-sentences/en.js +173 -0
- package/dist/_internal/shared/content/composite-sentences/index.d.ts +21 -0
- package/dist/_internal/shared/content/composite-sentences/index.js +26 -0
- package/dist/_internal/shared/content/composite-sentences/registry.d.ts +41 -0
- package/dist/_internal/shared/content/composite-sentences/registry.js +50 -0
- package/dist/_internal/shared/content/disclaimers.d.ts +4 -4
- package/dist/_internal/shared/content/disclaimers.js +32 -10
- package/dist/_internal/shared/content/fragmented-paragraphs/en.d.ts +20 -0
- package/dist/_internal/shared/content/fragmented-paragraphs/en.js +16 -0
- package/dist/_internal/shared/content/fragmented-paragraphs/index.d.ts +16 -0
- package/dist/_internal/shared/content/fragmented-paragraphs/index.js +22 -0
- package/dist/_internal/shared/content/fragments.d.ts +114 -0
- package/dist/_internal/shared/content/fragments.js +88 -0
- package/dist/_internal/shared/content/published-values.d.ts +1 -1
- package/dist/_internal/shared/content/published-values.js +2 -0
- package/dist/_internal/shared/features/admin/integrations.d.ts +2 -1
- package/dist/_internal/shared/features/admin/integrations.js +34 -16
- package/dist/_internal/shared/features/admin/row-widget-resources.d.ts +4 -0
- package/dist/_internal/shared/features/admin/row-widget-resources.js +29 -0
- package/dist/_internal/shared/features/blog/schema.d.ts +7 -7
- package/dist/_internal/shared/features/cart/schema.d.ts +8 -8
- package/dist/_internal/shared/features/cart/schema.js +3 -4
- package/dist/_internal/shared/features/categories/bundle-config.d.ts +3 -3
- package/dist/_internal/shared/features/categories/bundle-config.js +3 -3
- package/dist/_internal/shared/features/categories/bundle-copy.d.ts +1 -1
- package/dist/_internal/shared/features/categories/bundle-copy.js +1 -1
- package/dist/_internal/shared/features/categories/bundle-schemas.d.ts +49 -49
- package/dist/_internal/shared/features/categories/bundle-schemas.js +1 -1
- package/dist/_internal/shared/features/checkout/config.d.ts +2 -0
- package/dist/_internal/shared/features/checkout/config.js +23 -0
- package/dist/_internal/shared/features/collector-drops/config.d.ts +100 -0
- package/dist/_internal/shared/features/collector-drops/config.js +136 -0
- package/dist/_internal/shared/features/collector-drops/errors.d.ts +16 -0
- package/dist/_internal/shared/features/collector-drops/errors.js +32 -0
- package/dist/_internal/shared/features/collector-drops/schema.d.ts +42 -0
- package/dist/_internal/shared/features/collector-drops/schema.js +24 -0
- package/dist/_internal/shared/features/content-tags/registry.d.ts +55 -0
- package/dist/_internal/shared/features/content-tags/registry.js +54 -0
- package/dist/_internal/shared/features/dashboard/recent-entry.d.ts +466 -0
- package/dist/_internal/shared/features/dashboard/recent-entry.js +132 -0
- package/dist/_internal/shared/features/events/config.d.ts +1 -1
- package/dist/_internal/shared/features/events/config.js +1 -1
- package/dist/_internal/shared/features/events/schema.d.ts +4 -4
- package/dist/_internal/shared/features/layout/config.d.ts +9 -1
- package/dist/_internal/shared/features/layout/config.js +23 -3
- package/dist/_internal/shared/features/notifications/action-url.js +1 -1
- package/dist/_internal/shared/features/notifications/email-eligibility.d.ts +4 -4
- package/dist/_internal/shared/features/notifications/email-eligibility.js +9 -9
- package/dist/_internal/shared/features/offers/config.js +1 -1
- package/dist/_internal/shared/features/orders/schema.d.ts +2 -2
- package/dist/_internal/shared/features/orders/workflow-registry.d.ts +145 -0
- package/dist/_internal/shared/features/orders/workflow-registry.js +197 -0
- package/dist/_internal/shared/features/payouts/destination.d.ts +101 -0
- package/dist/_internal/shared/features/payouts/destination.js +221 -0
- package/dist/_internal/shared/features/print/label-profiles.d.ts +1 -1
- package/dist/_internal/shared/features/print/label-profiles.js +1 -1
- package/dist/_internal/shared/features/products/composite.d.ts +104 -0
- package/dist/_internal/shared/features/products/composite.js +188 -0
- package/dist/_internal/shared/features/products/group-rules.d.ts +28 -2
- package/dist/_internal/shared/features/products/group-rules.js +29 -0
- package/dist/_internal/shared/features/products/pdp-section-ids.d.ts +13 -0
- package/dist/_internal/shared/features/products/pdp-section-ids.js +14 -0
- package/dist/_internal/shared/features/products/schema.d.ts +31 -13
- package/dist/_internal/shared/features/products/schema.js +75 -10
- package/dist/_internal/shared/features/products/to-product-item.js +1 -1
- package/dist/_internal/shared/features/products/types.d.ts +1 -1
- package/dist/_internal/shared/features/promotions/schema.d.ts +4 -4
- package/dist/_internal/shared/features/shipping/offer.d.ts +408 -0
- package/dist/_internal/shared/features/shipping/offer.js +440 -0
- package/dist/_internal/shared/features/site-settings/fees.d.ts +32 -3
- package/dist/_internal/shared/features/site-settings/fees.js +1 -1
- package/dist/_internal/shared/features/site-settings/settings-preview-registry.d.ts +17 -0
- package/dist/_internal/shared/features/site-settings/settings-preview-registry.js +56 -0
- package/dist/_internal/shared/features/site-settings/toggle-catalog.d.ts +68 -0
- package/dist/_internal/shared/features/site-settings/toggle-catalog.js +204 -0
- package/dist/_internal/shared/features/site-settings/types.d.ts +27 -1
- package/dist/_internal/shared/fees/calculator.d.ts +256 -21
- package/dist/_internal/shared/fees/calculator.js +269 -26
- package/dist/_internal/shared/fees/explain.d.ts +20 -5
- package/dist/_internal/shared/fees/explain.js +38 -18
- package/dist/_internal/shared/listing-types/_registry.d.ts +30 -15
- package/dist/_internal/shared/listing-types/_registry.js +39 -16
- package/dist/_internal/shared/listing-types/action-tracker.d.ts +1 -1
- package/dist/_internal/shared/listing-types/art-and-stickers/config.d.ts +94 -0
- package/dist/_internal/shared/listing-types/art-and-stickers/config.js +57 -0
- package/dist/_internal/shared/listing-types/art-and-stickers/ctas.js +3 -0
- package/dist/_internal/shared/listing-types/art-and-stickers/schema.d.ts +2 -0
- package/dist/_internal/shared/listing-types/art-and-stickers/schema.js +3 -0
- package/dist/_internal/shared/listing-types/availability.js +2 -2
- package/dist/_internal/shared/listing-types/capabilities.d.ts +77 -1
- package/dist/_internal/shared/listing-types/capabilities.js +72 -13
- package/dist/_internal/shared/listing-types/classified/config.d.ts +1 -0
- package/dist/_internal/shared/listing-types/classified/config.js +1 -0
- package/dist/_internal/shared/listing-types/clearance/config.d.ts +74 -0
- package/dist/_internal/shared/listing-types/clearance/config.js +46 -0
- package/dist/_internal/shared/listing-types/clearance/schema.d.ts +3 -0
- package/dist/_internal/shared/listing-types/clearance/schema.js +13 -0
- package/dist/_internal/shared/listing-types/collector-drop/config.d.ts +85 -0
- package/dist/_internal/shared/listing-types/collector-drop/config.js +59 -0
- package/dist/_internal/shared/listing-types/collector-drop/schema.d.ts +3 -0
- package/dist/_internal/shared/listing-types/collector-drop/schema.js +11 -0
- package/dist/_internal/shared/listing-types/digital-code/config.d.ts +1 -0
- package/dist/_internal/shared/listing-types/digital-code/config.js +1 -0
- package/dist/_internal/shared/listing-types/feature-flags.d.ts +125 -8
- package/dist/_internal/shared/listing-types/feature-flags.js +149 -12
- package/dist/_internal/shared/listing-types/hidden-surfaces.d.ts +19 -10
- package/dist/_internal/shared/listing-types/hidden-surfaces.js +6 -5
- package/dist/_internal/shared/listing-types/live/config.d.ts +1 -0
- package/dist/_internal/shared/listing-types/live/config.js +1 -0
- package/dist/_internal/shared/listing-types/pre-order/config.d.ts +1 -0
- package/dist/_internal/shared/listing-types/pre-order/config.js +20 -5
- package/dist/_internal/shared/listing-types/pre-order/schema.d.ts +45 -0
- package/dist/_internal/shared/listing-types/pre-order/schema.js +60 -2
- package/dist/_internal/shared/listing-types/route-gating.d.ts +11 -11
- package/dist/_internal/shared/listing-types/route-gating.js +15 -14
- package/dist/_internal/shared/listing-types/spares/config.d.ts +1 -0
- package/dist/_internal/shared/listing-types/spares/config.js +1 -0
- package/dist/_internal/shared/listing-types/standard/config.d.ts +1 -0
- package/dist/_internal/shared/listing-types/standard/config.js +1 -0
- package/dist/_internal/shared/listing-types/tiers.d.ts +2 -2
- package/dist/_internal/shared/listing-types/tiers.js +6 -7
- package/dist/_internal/shared/search/index-record.d.ts +10 -4
- package/dist/_internal/shared/search/index-record.js +18 -1
- package/dist/_internal/shared/search/match.d.ts +3 -1
- package/dist/_internal/shared/search/match.js +2 -1
- package/dist/_internal/shared/search/to-groups.js +1 -0
- package/dist/_internal/shared/templating/placeholders.d.ts +18 -0
- package/dist/_internal/shared/templating/placeholders.js +24 -0
- package/dist/_internal/shared/tester/window.d.ts +1 -1
- package/dist/_internal/shared/tester/window.js +5 -5
- package/dist/_internal/shared/tokens/index.d.ts +1 -1
- package/dist/_internal/shared/tokens/index.js +1 -1
- package/dist/cli/index.d.ts +1 -1
- package/dist/cli/index.js +2 -2
- package/dist/client-entry.d.ts +1 -1
- package/dist/client.d.ts +49 -40
- package/dist/client.js +97 -32
- package/dist/configs/next.d.ts +1 -1
- package/dist/configs/tailwind.d.ts +12 -0
- package/dist/configs/tailwind.js +14 -0
- package/dist/constants/api-endpoints.d.ts +93 -51
- package/dist/constants/api-endpoints.js +53 -28
- package/dist/constants/field-names.d.ts +40 -20
- package/dist/constants/field-names.js +41 -21
- package/dist/constants/index.d.ts +2 -2
- package/dist/constants/index.js +2 -2
- package/dist/constants/notification-types.d.ts +1 -1
- package/dist/constants/pagination-presets.d.ts +2 -2
- package/dist/constants/pagination-presets.js +2 -2
- package/dist/constants/seed-meta.d.ts +1 -1
- package/dist/constants/storage-keys.d.ts +6 -0
- package/dist/constants/storage-keys.js +12 -0
- package/dist/constants/table-keys.d.ts +3 -2
- package/dist/constants/table-keys.js +3 -2
- package/dist/contracts/ai.d.ts +183 -0
- package/dist/contracts/ai.js +2 -0
- package/dist/contracts/auth.d.ts +16 -1
- package/dist/contracts/client-live-edit.d.ts +29 -0
- package/dist/contracts/client-live-edit.js +23 -0
- package/dist/contracts/feature.d.ts +1 -1
- package/dist/contracts/index.d.ts +1 -1
- package/dist/contracts/payment.d.ts +238 -0
- package/dist/contracts/payment.js +125 -0
- package/dist/contracts/registry.d.ts +29 -1
- package/dist/core/CacheManager.d.ts +21 -0
- package/dist/core/CacheManager.js +38 -0
- package/dist/core/integration-keys.d.ts +6 -0
- package/dist/core/integration-keys.js +14 -0
- package/dist/core/mutation-events.d.ts +3 -3
- package/dist/core/mutation-events.js +7 -5
- package/dist/core/site-config.js +1 -1
- package/dist/core/unit-of-work.d.ts +1 -2
- package/dist/core/unit-of-work.js +1 -5
- package/dist/edit-mode/index.d.ts +11 -0
- package/dist/edit-mode/index.js +10 -0
- package/dist/errors/error-codes.d.ts +7 -7
- package/dist/errors/error-codes.js +7 -7
- package/dist/errors/error-display-map.js +8 -8
- package/dist/errors/messages.d.ts +8 -8
- package/dist/errors/messages.js +8 -8
- package/dist/features/_guide-cls.d.ts +1 -0
- package/dist/features/_guide-cls.js +10 -1
- package/dist/features/about/components/DeveloperView.d.ts +4 -1
- package/dist/features/about/components/DeveloperView.js +3 -2
- package/dist/features/about/components/FeesView.d.ts +4 -1
- package/dist/features/about/components/FeesView.js +3 -2
- package/dist/features/about/components/GstExplainerView.d.ts +4 -1
- package/dist/features/about/components/GstExplainerView.js +3 -2
- package/dist/features/about/components/GuidesHubView.d.ts +5 -2
- package/dist/features/about/components/GuidesHubView.js +7 -6
- package/dist/features/about/components/HelpPageView.d.ts +10 -1
- package/dist/features/about/components/HelpPageView.js +6 -5
- package/dist/features/about/components/HowCheckoutWorksView.d.ts +4 -1
- package/dist/features/about/components/HowCheckoutWorksView.js +4 -14
- package/dist/features/about/components/HowCollectorDropsWorkView.d.ts +6 -0
- package/dist/features/about/components/HowCollectorDropsWorkView.js +105 -0
- package/dist/features/about/components/HowEmiWorksView.d.ts +4 -1
- package/dist/features/about/components/HowEmiWorksView.js +4 -14
- package/dist/features/about/components/HowOffersWorkView.d.ts +4 -1
- package/dist/features/about/components/HowOffersWorkView.js +3 -16
- package/dist/features/about/components/HowOrdersWorkView.d.ts +4 -1
- package/dist/features/about/components/HowOrdersWorkView.js +3 -10
- package/dist/features/about/components/HowPayoutsWorkView.d.ts +4 -1
- package/dist/features/about/components/HowPayoutsWorkView.js +5 -15
- package/dist/features/about/components/HowPreOrdersWorkView.d.ts +4 -1
- package/dist/features/about/components/HowPreOrdersWorkView.js +5 -15
- package/dist/features/about/components/HowReviewsWorkView.d.ts +4 -1
- package/dist/features/about/components/HowReviewsWorkView.js +5 -15
- package/dist/features/about/components/PolicyPageView.d.ts +79 -3
- package/dist/features/about/components/PolicyPageView.js +63 -4
- package/dist/features/about/components/PublicProfileView.d.ts +11 -1
- package/dist/features/about/components/PublicProfileView.js +9 -8
- package/dist/features/about/components/SecurityPrivacyView.d.ts +4 -1
- package/dist/features/about/components/SecurityPrivacyView.js +3 -2
- package/dist/features/about/components/ShippingPolicyView.d.ts +4 -1
- package/dist/features/about/components/ShippingPolicyView.js +4 -3
- package/dist/features/about/components/SpotAFakeView.d.ts +4 -1
- package/dist/features/about/components/SpotAFakeView.js +3 -2
- package/dist/features/about/components/TrackOrderView.d.ts +4 -1
- package/dist/features/about/components/TrackOrderView.js +3 -2
- package/dist/features/about/index.d.ts +2 -2
- package/dist/features/about/index.js +1 -1
- package/dist/features/about/schemas/index.d.ts +18 -18
- package/dist/features/account/components/AddressBook.d.ts +1 -1
- package/dist/features/account/components/AddressForm.js +25 -1
- package/dist/features/account/components/BecomeSellerView.d.ts +4 -1
- package/dist/features/account/components/BecomeSellerView.js +3 -2
- package/dist/features/account/components/BuyerAccountGuideView.d.ts +6 -1
- package/dist/features/account/components/BuyerAccountGuideView.js +4 -4
- package/dist/features/account/components/BuyerCollectorDropsGuideView.d.ts +7 -0
- package/dist/features/account/components/BuyerCollectorDropsGuideView.js +46 -0
- package/dist/features/account/components/BuyerOrdersGuideView.d.ts +6 -1
- package/dist/features/account/components/BuyerOrdersGuideView.js +3 -3
- package/dist/features/account/components/BuyerShoppingGuideView.d.ts +6 -1
- package/dist/features/account/components/BuyerShoppingGuideView.js +5 -5
- package/dist/features/account/components/NotificationBell.js +1 -1
- package/dist/features/account/components/NotificationPreferencesPanel.js +1 -1
- package/dist/features/account/components/OrderDetailView.d.ts +4 -1
- package/dist/features/account/components/OrderDetailView.js +3 -1
- package/dist/features/account/components/UserAccountHubView.d.ts +4 -1
- package/dist/features/account/components/UserAccountHubView.js +8 -2
- package/dist/features/account/components/UserBidsView.d.ts +6 -1
- package/dist/features/account/components/UserBidsView.js +17 -8
- package/dist/features/account/components/UserOrderTrackView.d.ts +4 -1
- package/dist/features/account/components/UserOrderTrackView.js +3 -1
- package/dist/features/account/components/UserOrdersView.d.ts +4 -1
- package/dist/features/account/components/UserOrdersView.js +6 -5
- package/dist/features/account/components/UserReturnsView.d.ts +4 -1
- package/dist/features/account/components/UserReturnsView.js +4 -3
- package/dist/features/account/components/UserSidebar.js +14 -4
- package/dist/features/account/hooks/useNotifications.d.ts +1 -1
- package/dist/features/account/hooks/useProfile.d.ts +13 -0
- package/dist/features/account/hooks/usePublicProfile.d.ts +11 -1
- package/dist/features/account/hooks/usePublicProfile.js +6 -1
- package/dist/features/account/schemas/index.d.ts +4 -4
- package/dist/features/addresses/schemas/address-form.d.ts +12 -12
- package/dist/features/addresses/schemas/index.d.ts +2 -2
- package/dist/features/admin/actions/admin-actions.js +4 -4
- package/dist/features/admin/actions/admin-read-actions.d.ts +1 -1
- package/dist/features/admin/actions/admin-read-actions.js +1 -1
- package/dist/features/admin/actions/notification-actions.js +4 -4
- package/dist/features/admin/actions/site-settings-actions.d.ts +1 -1
- package/dist/features/admin/api/bids/route.js +7 -1
- package/dist/features/admin/api/coupons/route.js +7 -1
- package/dist/features/admin/api/products/route.js +7 -1
- package/dist/features/admin/api/reviews/route.js +7 -1
- package/dist/features/admin/components/AdminActionIndexView.d.ts +4 -1
- package/dist/features/admin/components/AdminActionIndexView.js +3 -2
- package/dist/features/admin/components/AdminAdEditorView.d.ts +6 -1
- package/dist/features/admin/components/AdminAdEditorView.js +3 -1
- package/dist/features/admin/components/AdminAddressBookView.d.ts +4 -1
- package/dist/features/admin/components/AdminAddressBookView.js +3 -2
- package/dist/features/admin/components/AdminAddressClustersView.d.ts +4 -1
- package/dist/features/admin/components/AdminAddressClustersView.js +3 -2
- package/dist/features/admin/components/AdminAddressEditorView.d.ts +6 -1
- package/dist/features/admin/components/AdminAddressEditorView.js +13 -2
- package/dist/features/admin/components/AdminAddressesView.d.ts +4 -1
- package/dist/features/admin/components/AdminAddressesView.js +3 -2
- package/dist/features/admin/components/AdminAdsView.d.ts +4 -1
- package/dist/features/admin/components/AdminAdsView.js +3 -2
- package/dist/features/admin/components/AdminAllEventEntriesView.d.ts +6 -2
- package/dist/features/admin/components/AdminAllEventEntriesView.js +3 -2
- package/dist/features/admin/components/AdminAnalyticsGuideView.d.ts +6 -1
- package/dist/features/admin/components/AdminAnalyticsGuideView.js +3 -2
- package/dist/features/admin/components/AdminArtAndStickersView.d.ts +20 -0
- package/dist/features/admin/components/AdminArtAndStickersView.js +39 -0
- package/dist/features/admin/components/AdminAuditLogView.d.ts +6 -2
- package/dist/features/admin/components/AdminAuditLogView.js +5 -1
- package/dist/features/admin/components/AdminBidsView.d.ts +6 -2
- package/dist/features/admin/components/AdminBidsView.js +5 -3
- package/dist/features/admin/components/AdminBlogEditorView.d.ts +6 -1
- package/dist/features/admin/components/AdminBlogEditorView.js +5 -2
- package/dist/features/admin/components/AdminBlogView.d.ts +6 -2
- package/dist/features/admin/components/AdminBlogView.js +4 -2
- package/dist/features/admin/components/AdminBrandEditorView.d.ts +6 -1
- package/dist/features/admin/components/AdminBrandEditorView.js +6 -2
- package/dist/features/admin/components/AdminBrandsView.d.ts +6 -2
- package/dist/features/admin/components/AdminBrandsView.js +7 -3
- package/dist/features/admin/components/AdminBundleEditorView.d.ts +10 -1
- package/dist/features/admin/components/AdminBundleEditorView.js +6 -2
- package/dist/features/admin/components/AdminBundlesView.d.ts +4 -1
- package/dist/features/admin/components/AdminBundlesView.js +10 -3
- package/dist/features/admin/components/AdminCartsView.d.ts +6 -2
- package/dist/features/admin/components/AdminCartsView.js +7 -2
- package/dist/features/admin/components/AdminCatalogGuideView.d.ts +6 -1
- package/dist/features/admin/components/AdminCatalogGuideView.js +4 -3
- package/dist/features/admin/components/AdminCategoriesView.d.ts +6 -2
- package/dist/features/admin/components/AdminCategoriesView.js +7 -3
- package/dist/features/admin/components/AdminCategoryEditorView.d.ts +6 -1
- package/dist/features/admin/components/AdminCategoryEditorView.js +13 -9
- package/dist/features/admin/components/AdminClassifiedView.d.ts +6 -2
- package/dist/features/admin/components/AdminClassifiedView.js +8 -3
- package/dist/features/admin/components/AdminClearanceView.d.ts +8 -0
- package/dist/features/admin/components/AdminClearanceView.js +156 -0
- package/dist/features/admin/components/AdminContactView.d.ts +4 -1
- package/dist/features/admin/components/AdminContactView.js +3 -1
- package/dist/features/admin/components/AdminContentGuideView.d.ts +6 -1
- package/dist/features/admin/components/AdminContentGuideView.js +4 -3
- package/dist/features/admin/components/AdminCouponEditorView.d.ts +6 -1
- package/dist/features/admin/components/AdminCouponEditorView.js +9 -5
- package/dist/features/admin/components/AdminCouponsView.d.ts +4 -1
- package/dist/features/admin/components/AdminCouponsView.js +4 -2
- package/dist/features/admin/components/AdminDashboardView.d.ts +4 -1
- package/dist/features/admin/components/AdminDashboardView.js +3 -1
- package/dist/features/admin/components/AdminDigitalCodesView.d.ts +6 -2
- package/dist/features/admin/components/AdminDigitalCodesView.js +4 -3
- package/dist/features/admin/components/AdminEmployeeEditorView.d.ts +36 -1
- package/dist/features/admin/components/AdminEmployeeEditorView.js +15 -7
- package/dist/features/admin/components/AdminFaqEditorView.d.ts +6 -1
- package/dist/features/admin/components/AdminFaqEditorView.js +82 -4
- package/dist/features/admin/components/AdminFaqsView.d.ts +4 -1
- package/dist/features/admin/components/AdminFaqsView.js +5 -4
- package/dist/features/admin/components/AdminFeatureEditorView.d.ts +6 -1
- package/dist/features/admin/components/AdminFeatureEditorView.js +6 -2
- package/dist/features/admin/components/AdminFeaturesView.d.ts +6 -2
- package/dist/features/admin/components/AdminFeaturesView.js +10 -4
- package/dist/features/admin/components/AdminFulfillmentView.d.ts +4 -1
- package/dist/features/admin/components/AdminFulfillmentView.js +3 -2
- package/dist/features/admin/components/AdminGatewayEventsView.d.ts +6 -2
- package/dist/features/admin/components/AdminGatewayEventsView.js +3 -2
- package/dist/features/admin/components/AdminGroupedListingsView.d.ts +6 -2
- package/dist/features/admin/components/AdminGroupedListingsView.js +3 -2
- package/dist/features/admin/components/AdminGuideHubView.d.ts +7 -1
- package/dist/features/admin/components/AdminGuideHubView.js +5 -3
- package/dist/features/admin/components/AdminHistoryView.d.ts +6 -2
- package/dist/features/admin/components/AdminHistoryView.js +7 -6
- package/dist/features/admin/components/AdminInvoicingView.d.ts +6 -1
- package/dist/features/admin/components/AdminInvoicingView.js +3 -2
- package/dist/features/admin/components/AdminLiveView.d.ts +6 -2
- package/dist/features/admin/components/AdminLiveView.js +4 -3
- package/dist/features/admin/components/AdminMediaView.d.ts +4 -1
- package/dist/features/admin/components/AdminMediaView.js +15 -3
- package/dist/features/admin/components/AdminMoneyCasesView.d.ts +6 -2
- package/dist/features/admin/components/AdminMoneyCasesView.js +3 -2
- package/dist/features/admin/components/AdminNavEditorView.d.ts +12 -1
- package/dist/features/admin/components/AdminNavEditorView.js +4 -3
- package/dist/features/admin/components/AdminNavigationView.d.ts +4 -1
- package/dist/features/admin/components/AdminNavigationView.js +3 -1
- package/dist/features/admin/components/AdminNewsletterView.d.ts +4 -1
- package/dist/features/admin/components/AdminNewsletterView.js +3 -2
- package/dist/features/admin/components/AdminNotificationsView.d.ts +6 -2
- package/dist/features/admin/components/AdminNotificationsView.js +19 -7
- package/dist/features/admin/components/AdminOffersView.d.ts +6 -2
- package/dist/features/admin/components/AdminOffersView.js +4 -3
- package/dist/features/admin/components/AdminOrderEditorView.d.ts +1 -1
- package/dist/features/admin/components/AdminOrderEditorView.js +1 -1
- package/dist/features/admin/components/AdminOrdersGuideView.d.ts +6 -1
- package/dist/features/admin/components/AdminOrdersGuideView.js +5 -4
- package/dist/features/admin/components/AdminOrdersView.d.ts +6 -2
- package/dist/features/admin/components/AdminOrdersView.js +46 -5
- package/dist/features/admin/components/AdminPaymentClustersView.d.ts +4 -1
- package/dist/features/admin/components/AdminPaymentClustersView.js +3 -2
- package/dist/features/admin/components/AdminPaymentMethodsView.d.ts +4 -1
- package/dist/features/admin/components/AdminPaymentMethodsView.js +3 -2
- package/dist/features/admin/components/AdminPaymentsGuideView.d.ts +6 -1
- package/dist/features/admin/components/AdminPaymentsGuideView.js +3 -2
- package/dist/features/admin/components/AdminPayoutsView.d.ts +6 -2
- package/dist/features/admin/components/AdminPayoutsView.js +3 -2
- package/dist/features/admin/components/AdminProductEditorView.d.ts +6 -1
- package/dist/features/admin/components/AdminProductEditorView.js +7 -3
- package/dist/features/admin/components/AdminProductsView.d.ts +4 -1
- package/dist/features/admin/components/AdminProductsView.js +78 -47
- package/dist/features/admin/components/AdminReturnRequestsView.d.ts +4 -1
- package/dist/features/admin/components/AdminReturnRequestsView.js +3 -2
- package/dist/features/admin/components/AdminReviewsView.d.ts +6 -2
- package/dist/features/admin/components/AdminReviewsView.js +3 -2
- package/dist/features/admin/components/AdminScammersView.d.ts +6 -2
- package/dist/features/admin/components/AdminScammersView.js +3 -2
- package/dist/features/admin/components/AdminSectionsView.d.ts +4 -1
- package/dist/features/admin/components/AdminSectionsView.js +39 -38
- package/dist/features/admin/components/AdminSessionsView.d.ts +6 -2
- package/dist/features/admin/components/AdminSessionsView.js +3 -2
- package/dist/features/admin/components/AdminSidebar.js +19 -5
- package/dist/features/admin/components/AdminSiteConfigGuideView.d.ts +6 -1
- package/dist/features/admin/components/AdminSiteConfigGuideView.js +4 -3
- package/dist/features/admin/components/AdminSiteSettingsView.d.ts +4 -1
- package/dist/features/admin/components/AdminSiteSettingsView.js +1161 -647
- package/dist/features/admin/components/AdminSparesView.d.ts +7 -3
- package/dist/features/admin/components/AdminSparesView.js +5 -4
- package/dist/features/admin/components/AdminStoreAddressesView.d.ts +4 -1
- package/dist/features/admin/components/AdminStoreAddressesView.js +3 -2
- package/dist/features/admin/components/AdminStoreEditorView.js +4 -3
- package/dist/features/admin/components/AdminStoresGuideView.d.ts +6 -1
- package/dist/features/admin/components/AdminStoresGuideView.js +3 -2
- package/dist/features/admin/components/AdminStoresView.d.ts +6 -2
- package/dist/features/admin/components/AdminStoresView.js +3 -2
- package/dist/features/admin/components/AdminSublistingCategoriesView.d.ts +4 -1
- package/dist/features/admin/components/AdminSublistingCategoriesView.js +4 -3
- package/dist/features/admin/components/AdminSublistingCategoryEditorView.d.ts +6 -1
- package/dist/features/admin/components/AdminSublistingCategoryEditorView.js +3 -1
- package/dist/features/admin/components/AdminSupportTicketsView.d.ts +6 -2
- package/dist/features/admin/components/AdminSupportTicketsView.js +3 -2
- package/dist/features/admin/components/AdminTaxCodesView.d.ts +6 -2
- package/dist/features/admin/components/AdminTaxCodesView.js +4 -3
- package/dist/features/admin/components/AdminTeamGuideView.d.ts +6 -1
- package/dist/features/admin/components/AdminTeamGuideView.js +4 -2
- package/dist/features/admin/components/AdminTeamView.d.ts +4 -1
- package/dist/features/admin/components/AdminTeamView.js +22 -28
- package/dist/features/admin/components/AdminTesterChecklistItemEditorView.d.ts +6 -1
- package/dist/features/admin/components/AdminTesterChecklistItemEditorView.js +6 -2
- package/dist/features/admin/components/AdminTesterChecklistView.d.ts +4 -1
- package/dist/features/admin/components/AdminTesterChecklistView.js +5 -4
- package/dist/features/admin/components/AdminTrustGuideView.d.ts +6 -1
- package/dist/features/admin/components/AdminTrustGuideView.js +3 -2
- package/dist/features/admin/components/AdminUserEditorView.js +2 -1
- package/dist/features/admin/components/AdminUsersGuideView.d.ts +6 -1
- package/dist/features/admin/components/AdminUsersGuideView.js +3 -2
- package/dist/features/admin/components/AdminUsersView.d.ts +6 -2
- package/dist/features/admin/components/AdminUsersView.js +38 -6
- package/dist/features/admin/components/AdminViewCards.js +1 -1
- package/dist/features/admin/components/AdminWishlistsView.d.ts +6 -2
- package/dist/features/admin/components/AdminWishlistsView.js +7 -6
- package/dist/features/admin/components/DashboardStats.js +20 -23
- package/dist/features/admin/components/DataListingView.js +16 -2
- package/dist/features/admin/components/OwnerQuickActions.d.ts +1 -1
- package/dist/features/admin/components/OwnerQuickActions.js +18 -2
- package/dist/features/admin/components/QuickEditMenu.js +1 -1
- package/dist/features/admin/components/ViewNotificationModal.js +1 -1
- package/dist/features/admin/components/analytics/AdminStatCard.d.ts +1 -5
- package/dist/features/admin/components/analytics/AdminStatCard.js +2 -14
- package/dist/features/admin/components/index.d.ts +4 -12
- package/dist/features/admin/components/index.js +4 -8
- package/dist/features/admin/components/sections/adminSectionsBuildParse.d.ts +5 -5
- package/dist/features/admin/components/sections/adminSectionsBuildParse.js +22 -22
- package/dist/features/admin/components/sections/adminSectionsTypes.d.ts +8 -7
- package/dist/features/admin/components/sections/adminSectionsTypes.js +13 -13
- package/dist/features/admin/constants/filter-tabs.d.ts +27 -17
- package/dist/features/admin/constants/filter-tabs.js +40 -12
- package/dist/features/admin/constants/site-settings-tabs.d.ts +4 -4
- package/dist/features/admin/constants/site-settings-tabs.js +3 -3
- package/dist/features/admin/hooks/build-filter-panel.d.ts +50 -0
- package/dist/features/admin/hooks/build-filter-panel.js +55 -0
- package/dist/features/admin/hooks/useAdminListing.d.ts +1 -1
- package/dist/features/admin/hooks/useAdminListingData.js +14 -1
- package/dist/features/admin/hooks/useAdminSiteSettingsPreview.d.ts +6 -0
- package/dist/features/admin/hooks/useAdminSiteSettingsPreview.js +46 -0
- package/dist/features/admin/repository/site-settings.repository.d.ts +26 -25
- package/dist/features/admin/repository/site-settings.repository.js +73 -21
- package/dist/features/admin/schemas/admin-editor-forms.d.ts +2 -2
- package/dist/features/admin/schemas/admin-user-form.d.ts +7 -7
- package/dist/features/admin/schemas/admin-user-form.js +6 -6
- package/dist/features/admin/schemas/firestore.d.ts +265 -41
- package/dist/features/admin/schemas/firestore.js +10 -10
- package/dist/features/admin/schemas/nav-item-form.d.ts +2 -2
- package/dist/features/admin/schemas/site-settings-about-form.d.ts +162 -0
- package/dist/features/admin/schemas/site-settings-about-form.js +142 -0
- package/dist/features/admin/schemas/site-settings-announcement-form.d.ts +18 -0
- package/dist/features/admin/schemas/site-settings-announcement-form.js +53 -0
- package/dist/features/admin/schemas/site-settings-appearance-form.d.ts +93 -0
- package/dist/features/admin/schemas/site-settings-appearance-form.js +75 -0
- package/dist/features/admin/schemas/site-settings-branding-form.d.ts +30 -0
- package/dist/features/admin/schemas/site-settings-branding-form.js +77 -0
- package/dist/features/admin/schemas/site-settings-collector-drop-form.d.ts +30 -0
- package/dist/features/admin/schemas/site-settings-collector-drop-form.js +63 -0
- package/dist/features/admin/schemas/site-settings-contact-form.d.ts +42 -0
- package/dist/features/admin/schemas/site-settings-contact-form.js +85 -0
- package/dist/features/admin/schemas/site-settings-emi-form.d.ts +27 -0
- package/dist/features/admin/schemas/site-settings-emi-form.js +68 -0
- package/dist/features/admin/schemas/site-settings-fees-form.d.ts +78 -0
- package/dist/features/admin/schemas/site-settings-fees-form.js +161 -0
- package/dist/features/admin/schemas/site-settings-form.d.ts +3 -3
- package/dist/features/admin/schemas/site-settings-form.js +1 -1
- package/dist/features/admin/schemas/site-settings-gst-form.d.ts +18 -0
- package/dist/features/admin/schemas/site-settings-gst-form.js +57 -0
- package/dist/features/admin/schemas/site-settings-integrations-form.d.ts +99 -0
- package/dist/features/admin/schemas/site-settings-integrations-form.js +172 -0
- package/dist/features/admin/schemas/site-settings-legal-form.d.ts +38 -0
- package/dist/features/admin/schemas/site-settings-legal-form.js +76 -0
- package/dist/features/admin/schemas/site-settings-limits-form.d.ts +15 -0
- package/dist/features/admin/schemas/site-settings-limits-form.js +48 -0
- package/dist/features/admin/schemas/site-settings-listings-form.d.ts +15 -0
- package/dist/features/admin/schemas/site-settings-listings-form.js +78 -0
- package/dist/features/admin/schemas/site-settings-notifications-form.d.ts +60 -0
- package/dist/features/admin/schemas/site-settings-notifications-form.js +160 -0
- package/dist/features/admin/schemas/site-settings-procurement-form.d.ts +12 -0
- package/dist/features/admin/schemas/site-settings-procurement-form.js +48 -0
- package/dist/features/admin/schemas/site-settings-seo-form.d.ts +21 -0
- package/dist/features/admin/schemas/site-settings-seo-form.js +42 -0
- package/dist/features/admin/schemas/site-settings-shipping-form.d.ts +48 -0
- package/dist/features/admin/schemas/site-settings-shipping-form.js +132 -0
- package/dist/features/admin/schemas/site-settings-watermark-form.d.ts +34 -0
- package/dist/features/admin/schemas/site-settings-watermark-form.js +68 -0
- package/dist/features/admin/schemas/site-settings-whatsapp-form.d.ts +36 -0
- package/dist/features/admin/schemas/site-settings-whatsapp-form.js +62 -0
- package/dist/features/admin/types/product.types.d.ts +6 -6
- package/dist/features/admin/types/product.types.js +1 -1
- package/dist/features/analytics/types.d.ts +1 -1
- package/dist/features/analytics/types.js +3 -3
- package/dist/features/assistant/components/AdminAssistantWidget.d.ts +1 -0
- package/dist/features/assistant/components/AdminAssistantWidget.js +84 -0
- package/dist/features/assistant/components/AssistantPageView.d.ts +6 -0
- package/dist/features/assistant/components/AssistantPageView.js +54 -0
- package/dist/features/assistant/components/AssistantWidget.d.ts +5 -0
- package/dist/features/assistant/components/AssistantWidget.js +127 -0
- package/dist/features/assistant/schemas/ask.d.ts +15 -0
- package/dist/features/assistant/schemas/ask.js +10 -0
- package/dist/features/audit-log/schemas/firestore.d.ts +94 -0
- package/dist/features/audit-log/schemas/firestore.js +51 -0
- package/dist/features/auth/actions/profile-actions.d.ts +8 -6
- package/dist/features/auth/actions/profile-actions.js +17 -8
- package/dist/features/auth/auth-helpers.d.ts +186 -2
- package/dist/features/auth/auth-helpers.js +320 -4
- package/dist/features/auth/components/Guards.d.ts +10 -0
- package/dist/features/auth/components/Guards.js +30 -6
- package/dist/features/auth/components/OAuthLoadingView.d.ts +6 -1
- package/dist/features/auth/components/OAuthLoadingView.js +3 -2
- package/dist/features/auth/hooks/useRBAC.d.ts +29 -1
- package/dist/features/auth/hooks/useRBAC.js +46 -12
- package/dist/features/auth/permissions/constants.d.ts +130 -5
- package/dist/features/auth/permissions/constants.js +176 -2
- package/dist/features/auth/repository/user.repository.d.ts +89 -29
- package/dist/features/auth/repository/user.repository.js +218 -79
- package/dist/features/auth/role-predicates.d.ts +64 -8
- package/dist/features/auth/role-predicates.js +104 -12
- package/dist/features/auth/schemas/firestore.d.ts +107 -8
- package/dist/features/auth/schemas/firestore.js +19 -2
- package/dist/features/auth/schemas/index.d.ts +26 -6
- package/dist/features/auth/schemas/index.js +17 -0
- package/dist/features/auth/types/index.d.ts +23 -1
- package/dist/features/before-after/schemas/index.d.ts +2 -2
- package/dist/features/blog/actions/blog-actions.d.ts +31 -31
- package/dist/features/blog/actions/blog-actions.js +1 -1
- package/dist/features/blog/components/BlogFeaturedCard.js +1 -1
- package/dist/features/blog/components/BlogIndexListing.js +2 -1
- package/dist/features/blog/components/BlogIndexPageView.d.ts +4 -1
- package/dist/features/blog/components/BlogIndexPageView.js +3 -2
- package/dist/features/blog/components/BlogListView.js +1 -1
- package/dist/features/blog/components/BlogPostView.js +33 -2
- package/dist/features/blog/schemas/blog-category.schema.d.ts +2 -0
- package/dist/features/blog/schemas/blog-category.schema.js +8 -0
- package/dist/features/blog/schemas/blog-form.d.ts +4 -4
- package/dist/features/blog/schemas/blog-form.js +1 -1
- package/dist/features/blog/schemas/index.d.ts +67 -67
- package/dist/features/blog/schemas/index.js +3 -7
- package/dist/features/cart/actions/cart-actions.d.ts +5 -5
- package/dist/features/cart/actions/cart-actions.js +7 -7
- package/dist/features/cart/components/CartDrawer.js +1 -1
- package/dist/features/cart/components/CartGroupLineRow.js +1 -1
- package/dist/features/cart/components/CartView.d.ts +1 -1
- package/dist/features/cart/hooks/useCartQuery.d.ts +1 -1
- package/dist/features/cart/hooks/useCheckoutReadQueries.d.ts +1 -1
- package/dist/features/cart/repository/cart.repository.d.ts +3 -3
- package/dist/features/cart/repository/cart.repository.js +6 -6
- package/dist/features/cart/schemas/firestore.d.ts +21 -21
- package/dist/features/cart/schemas/firestore.js +2 -2
- package/dist/features/cart/schemas/index.d.ts +15 -15
- package/dist/features/cart/utils/pending-ops.d.ts +1 -1
- package/dist/features/catalogue/components/AdminCatalogueApprovalsView.d.ts +6 -1
- package/dist/features/catalogue/components/AdminCatalogueApprovalsView.js +3 -1
- package/dist/features/catalogue/components/CatalogueItemEditorView.d.ts +6 -1
- package/dist/features/catalogue/components/CatalogueItemEditorView.js +3 -2
- package/dist/features/catalogue/components/PublicCatalogueItemDetailView.d.ts +4 -1
- package/dist/features/catalogue/components/PublicCatalogueItemDetailView.js +4 -3
- package/dist/features/catalogue/components/PublicCatalogueView.js +1 -1
- package/dist/features/catalogue/components/UserCatalogueView.d.ts +4 -1
- package/dist/features/catalogue/components/UserCatalogueView.js +4 -3
- package/dist/features/categories/api/[id]/description-template/route.js +1 -24
- package/dist/features/categories/api/[id]/price-guidance/route.js +6 -1
- package/dist/features/categories/api/[id]/route.js +20 -3
- package/dist/features/categories/api/route.js +1 -1
- package/dist/features/categories/components/BrandDetailPageView.d.ts +4 -1
- package/dist/features/categories/components/BrandDetailPageView.js +50 -10
- package/dist/features/categories/components/BrandDetailTabs.d.ts +12 -3
- package/dist/features/categories/components/BrandDetailTabs.js +10 -9
- package/dist/features/categories/components/BundleCollage.d.ts +1 -1
- package/dist/features/categories/components/BundleCollage.js +2 -2
- package/dist/features/categories/components/BundleDetailView.d.ts +4 -1
- package/dist/features/categories/components/BundleDetailView.js +4 -3
- package/dist/features/categories/components/BundleDynamicRuleEditor.d.ts +1 -1
- package/dist/features/categories/components/BundleDynamicRuleEditor.js +1 -1
- package/dist/features/categories/components/BundlesListView.d.ts +4 -1
- package/dist/features/categories/components/BundlesListView.js +3 -2
- package/dist/features/categories/components/CategoriesIndexListing.js +10 -3
- package/dist/features/categories/components/CategoriesIndexPageView.d.ts +4 -1
- package/dist/features/categories/components/CategoriesIndexPageView.js +3 -2
- package/dist/features/categories/components/CategoryBundlesListing.js +7 -3
- package/dist/features/categories/components/CategoryDetailPageView.d.ts +4 -1
- package/dist/features/categories/components/CategoryDetailPageView.js +134 -101
- package/dist/features/categories/components/CategoryDetailTabs.d.ts +12 -3
- package/dist/features/categories/components/CategoryDetailTabs.js +10 -10
- package/dist/features/categories/components/CategoryForm.js +2 -1
- package/dist/features/categories/components/CategoryGrid.js +1 -1
- package/dist/features/categories/components/CategoryProductsListing.d.ts +1 -1
- package/dist/features/categories/components/CategoryProductsListing.js +6 -5
- package/dist/features/categories/components/CategoryTableColumns.js +1 -1
- package/dist/features/categories/components/ConcernCard.js +1 -1
- package/dist/features/categories/components/FranchiseDetailPageView.d.ts +4 -1
- package/dist/features/categories/components/FranchiseDetailPageView.js +24 -5
- package/dist/features/categories/components/FranchisesIndexView.d.ts +6 -1
- package/dist/features/categories/components/FranchisesIndexView.js +4 -3
- package/dist/features/categories/components/SubcategoryCardRow.js +1 -1
- package/dist/features/categories/hooks/useCategorySelector.d.ts +1 -1
- package/dist/features/categories/hooks/useCategoryTree.js +1 -1
- package/dist/features/categories/repository/categories.repository.d.ts +43 -6
- package/dist/features/categories/repository/categories.repository.js +75 -22
- package/dist/features/categories/repository/price-index.repository.d.ts +2 -2
- package/dist/features/categories/schemas/bundle-form.d.ts +21 -21
- package/dist/features/categories/schemas/bundle-form.js +1 -1
- package/dist/features/categories/schemas/category-content.d.ts +3 -3
- package/dist/features/categories/schemas/category-counts.d.ts +5 -5
- package/dist/features/categories/schemas/category-counts.js +4 -4
- package/dist/features/categories/schemas/firestore.d.ts +36 -18
- package/dist/features/categories/schemas/firestore.js +9 -9
- package/dist/features/categories/schemas/index.d.ts +122 -116
- package/dist/features/categories/schemas/index.js +10 -6
- package/dist/features/categories/types/index.d.ts +13 -10
- package/dist/features/checkout/manifest.js +15 -6
- package/dist/features/checkout/repository/buyer-policy-consent.repository.d.ts +44 -0
- package/dist/features/checkout/repository/buyer-policy-consent.repository.js +66 -0
- package/dist/features/checkout/schemas/firestore.d.ts +37 -0
- package/dist/features/checkout/schemas/firestore.js +1 -0
- package/dist/features/classified/components/ClassifiedDetailPageView.d.ts +4 -1
- package/dist/features/classified/components/ClassifiedDetailPageView.js +35 -21
- package/dist/features/collections/components/CollectionCard.js +1 -1
- package/dist/features/collections/schemas/index.d.ts +4 -4
- package/dist/features/collector-drops/actions/bid-actions.d.ts +50 -0
- package/dist/features/collector-drops/actions/bid-actions.js +454 -0
- package/dist/features/collector-drops/api/route.d.ts +14 -0
- package/dist/features/collector-drops/api/route.js +62 -0
- package/dist/features/collector-drops/columns/index.d.ts +14 -0
- package/dist/features/collector-drops/columns/index.js +63 -0
- package/dist/features/collector-drops/components/CollapsibleBidHistory.js +41 -0
- package/dist/features/collector-drops/components/CollectorDropBidsTable.d.ts +27 -0
- package/dist/features/collector-drops/components/CollectorDropBidsTable.js +96 -0
- package/dist/features/collector-drops/components/CollectorDropBottomActions.d.ts +23 -0
- package/dist/features/collector-drops/components/CollectorDropBottomActions.js +89 -0
- package/dist/features/collector-drops/components/CollectorDropDetailPageView.d.ts +25 -0
- package/dist/features/collector-drops/components/CollectorDropDetailPageView.js +314 -0
- package/dist/features/collector-drops/components/CollectorDropFilters.d.ts +16 -0
- package/dist/features/collector-drops/components/CollectorDropFilters.js +18 -0
- package/dist/features/collector-drops/components/CollectorDropLiveStatusBadge.d.ts +20 -0
- package/dist/features/collector-drops/components/CollectorDropLiveStatusBadge.js +21 -0
- package/dist/features/collector-drops/components/CollectorDropsListView.d.ts +9 -0
- package/dist/features/collector-drops/components/CollectorDropsListView.js +23 -0
- package/dist/features/collector-drops/components/LiveBidPrice.d.ts +19 -0
- package/dist/features/collector-drops/components/LiveBidPrice.js +19 -0
- package/dist/features/collector-drops/components/LiveMinIncrement.d.ts +18 -0
- package/dist/features/collector-drops/components/LiveMinIncrement.js +25 -0
- package/dist/features/collector-drops/components/MarketplaceCollectorDropCard.d.ts +99 -0
- package/dist/features/collector-drops/components/MarketplaceCollectorDropCard.js +212 -0
- package/dist/features/collector-drops/components/MarketplaceCollectorDropGrid.d.ts +21 -0
- package/dist/features/collector-drops/components/MarketplaceCollectorDropGrid.js +47 -0
- package/dist/features/collector-drops/components/PlaceBidFormClient.d.ts +65 -0
- package/dist/features/collector-drops/components/PlaceBidFormClient.js +306 -0
- package/dist/features/collector-drops/components/bid-detail-fields.js +103 -0
- package/dist/features/collector-drops/components/index.d.ts +7 -0
- package/dist/features/collector-drops/components/index.js +5 -0
- package/dist/features/collector-drops/hooks/useBids.d.ts +33 -0
- package/dist/features/collector-drops/hooks/useBids.js +32 -0
- package/dist/features/collector-drops/hooks/useCollectorDrops.d.ts +51 -0
- package/dist/features/collector-drops/hooks/useCollectorDrops.js +105 -0
- package/dist/features/collector-drops/hooks/useIsCollectorDropEnded.d.ts +41 -0
- package/dist/features/collector-drops/hooks/useIsCollectorDropEnded.js +76 -0
- package/dist/features/collector-drops/hooks/useLiveCollectorDropBid.d.ts +20 -0
- package/dist/features/collector-drops/hooks/useLiveCollectorDropBid.js +23 -0
- package/dist/features/collector-drops/hooks/usePlaceBid.d.ts +25 -0
- package/dist/features/collector-drops/hooks/usePlaceBid.js +28 -0
- package/dist/features/collector-drops/hooks/useRealtimeBids.d.ts +41 -0
- package/dist/features/collector-drops/hooks/useRealtimeBids.js +170 -0
- package/dist/features/collector-drops/index.d.ts +8 -0
- package/dist/features/collector-drops/index.js +8 -0
- package/dist/features/collector-drops/manifest.js +17 -0
- package/dist/features/collector-drops/messages/en.json +18 -0
- package/dist/features/collector-drops/repository/bid.repository.d.ts +256 -0
- package/dist/features/collector-drops/repository/bid.repository.js +575 -0
- package/dist/features/collector-drops/schemas/bid-input.d.ts +30 -0
- package/dist/features/collector-drops/schemas/bid-input.js +28 -0
- package/dist/features/collector-drops/schemas/firestore.d.ts +120 -0
- package/dist/features/collector-drops/schemas/firestore.js +73 -0
- package/dist/features/collector-drops/schemas/index.d.ts +170 -0
- package/dist/features/collector-drops/schemas/index.js +64 -0
- package/dist/features/collector-drops/server.d.ts +8 -0
- package/dist/features/collector-drops/server.js +8 -0
- package/dist/features/collector-drops/types/index.d.ts +74 -0
- package/dist/features/consultation/schemas/index.d.ts +6 -6
- package/dist/features/contact/components/ContactInfoSidebar.d.ts +3 -1
- package/dist/features/contact/components/ContactInfoSidebar.js +3 -2
- package/dist/features/contact/components/ContactPageView.d.ts +4 -1
- package/dist/features/contact/components/ContactPageView.js +7 -6
- package/dist/features/contact/email.d.ts +1 -1
- package/dist/features/contact/schemas/inquiry-forms.js +2 -2
- package/dist/features/corporate/schemas/index.d.ts +5 -5
- package/dist/features/cron/firebase-adapters.d.ts +3 -3
- package/dist/features/cron/firebase-adapters.js +3 -3
- package/dist/features/cron/index.d.ts +0 -1
- package/dist/features/cron/index.js +9 -1
- package/dist/features/cron/jobs/preorder-reminder.job.d.ts +1 -1
- package/dist/features/cron/jobs/preorder-reminder.job.js +1 -1
- package/dist/features/cron/registry.d.ts +4 -4
- package/dist/features/cron/registry.js +4 -4
- package/dist/features/dashboard/components/AdminComposableRegion.d.ts +49 -0
- package/dist/features/dashboard/components/AdminComposableRegion.js +42 -0
- package/dist/features/dashboard/components/DashboardCardRenderer.d.ts +73 -0
- package/dist/features/dashboard/components/DashboardCardRenderer.js +434 -0
- package/dist/features/dashboard/components/DashboardHubView.d.ts +19 -1
- package/dist/features/dashboard/components/DashboardHubView.js +11 -6
- package/dist/features/dashboard/components/DashboardQuickJump.d.ts +90 -0
- package/dist/features/dashboard/components/DashboardQuickJump.js +255 -0
- package/dist/features/dashboard/components/DashboardSectionsClient.js +7 -0
- package/dist/features/dashboard/components/EditableWidget.d.ts +51 -0
- package/dist/features/dashboard/components/EditableWidget.js +44 -0
- package/dist/features/dashboard/components/HiddenHubCardGate.d.ts +25 -0
- package/dist/features/dashboard/components/HiddenHubCardGate.js +44 -0
- package/dist/features/dashboard/components/RecentVisitTracker.d.ts +35 -0
- package/dist/features/dashboard/components/RecentVisitTracker.js +33 -0
- package/dist/features/dashboard/components/WidgetInstanceEditor.d.ts +91 -0
- package/dist/features/dashboard/components/WidgetInstanceEditor.js +91 -0
- package/dist/features/dashboard/hooks/useHiddenHubCards.d.ts +9 -0
- package/dist/features/dashboard/hooks/useHiddenHubCards.js +101 -0
- package/dist/features/dashboard/hooks/usePageRegion.d.ts +27 -0
- package/dist/features/dashboard/hooks/usePageRegion.js +106 -0
- package/dist/features/dashboard/hooks/useRecentlyVisited.d.ts +9 -0
- package/dist/features/dashboard/hooks/useRecentlyVisited.js +127 -0
- package/dist/features/dashboard/hooks/useSavedCards.d.ts +23 -0
- package/dist/features/dashboard/hooks/useSavedCards.js +147 -0
- package/dist/features/digital-codes/components/DigitalCodeDetailPageView.d.ts +4 -1
- package/dist/features/digital-codes/components/DigitalCodeDetailPageView.js +29 -13
- package/dist/features/email/notification-templates.js +3 -3
- package/dist/features/events/actions/event-actions.d.ts +11 -3
- package/dist/features/events/actions/event-actions.js +21 -11
- package/dist/features/events/api/[id]/route.js +1 -1
- package/dist/features/events/components/AdminEventEditorView.d.ts +6 -1
- package/dist/features/events/components/AdminEventEditorView.js +81 -21
- package/dist/features/events/components/AdminEventEntriesView.d.ts +4 -1
- package/dist/features/events/components/AdminEventEntriesView.js +3 -2
- package/dist/features/events/components/AdminEventsView.d.ts +6 -2
- package/dist/features/events/components/AdminEventsView.js +5 -4
- package/dist/features/events/components/BonusSpinView.d.ts +27 -0
- package/dist/features/events/components/BonusSpinView.js +151 -0
- package/dist/features/events/components/EventCard.js +1 -1
- package/dist/features/events/components/EventFilters.js +13 -5
- package/dist/features/events/components/EventGiveawayEntryForm.d.ts +24 -0
- package/dist/features/events/components/EventGiveawayEntryForm.js +46 -0
- package/dist/features/events/components/EventGiveawayWinnerView.d.ts +38 -0
- package/dist/features/events/components/EventGiveawayWinnerView.js +40 -0
- package/dist/features/events/components/EventGiveawaysSection.d.ts +48 -0
- package/dist/features/events/components/EventGiveawaysSection.js +102 -0
- package/dist/features/events/components/EventsIndexListing.js +7 -3
- package/dist/features/events/components/EventsListPageView.d.ts +4 -1
- package/dist/features/events/components/EventsListPageView.js +4 -2
- package/dist/features/events/components/RelatedEventsCarousel.js +1 -1
- package/dist/features/events/components/event-entry-detail-fields.d.ts +1 -1
- package/dist/features/events/components/event-entry-detail-fields.js +1 -1
- package/dist/features/events/components/index.d.ts +8 -8
- package/dist/features/events/components/index.js +4 -4
- package/dist/features/events/constants/event-type-meta.d.ts +14 -6
- package/dist/features/events/constants/event-type-meta.js +40 -14
- package/dist/features/events/manifest.js +31 -0
- package/dist/features/events/repository/events.repository.js +1 -1
- package/dist/features/events/schemas/event-form.d.ts +40 -10
- package/dist/features/events/schemas/event-form.js +32 -1
- package/dist/features/events/schemas/firestore.d.ts +55 -13
- package/dist/features/events/schemas/firestore.js +15 -10
- package/dist/features/events/schemas/index.d.ts +144 -133
- package/dist/features/events/schemas/index.js +24 -11
- package/dist/features/events/types/index.d.ts +32 -7
- package/dist/features/events/types/index.js +45 -8
- package/dist/features/events/utils/carousel-slide.d.ts +12 -14
- package/dist/features/events/utils/carousel-slide.js +23 -26
- package/dist/features/faq/actions/faq-actions.d.ts +197 -6
- package/dist/features/faq/actions/faq-actions.js +79 -2
- package/dist/features/faq/components/FAQAccordion.js +2 -1
- package/dist/features/faq/manifest.js +9 -1
- package/dist/features/faq/schemas/firestore.d.ts +26 -1
- package/dist/features/faq/schemas/firestore.js +1 -0
- package/dist/features/faq/schemas/index.d.ts +2 -2
- package/dist/features/faq/utils/getHomepageFaqsCached.d.ts +9 -0
- package/dist/features/faq/utils/getHomepageFaqsCached.js +21 -1
- package/dist/features/faq/utils/resolveFaqAnswer.d.ts +9 -0
- package/dist/features/faq/utils/resolveFaqAnswer.js +18 -0
- package/dist/features/gateway-events/schemas/index.d.ts +2 -2
- package/dist/features/giveaway/repository/giveaway-entry.repository.d.ts +48 -0
- package/dist/features/giveaway/repository/giveaway-entry.repository.js +172 -0
- package/dist/features/giveaway/schemas/config-write.d.ts +145 -0
- package/dist/features/giveaway/schemas/config-write.js +199 -0
- package/dist/features/giveaway/schemas/firestore.d.ts +77 -0
- package/dist/features/giveaway/schemas/firestore.js +42 -0
- package/dist/features/giveaway/schemas/zod.d.ts +113 -0
- package/dist/features/giveaway/schemas/zod.js +39 -0
- package/dist/features/giveaway/types/index.d.ts +72 -0
- package/dist/features/giveaway/types/index.js +68 -0
- package/dist/features/grouped/components/GroupedListingDetailView.d.ts +4 -1
- package/dist/features/grouped/components/GroupedListingDetailView.js +4 -3
- package/dist/features/grouped/components/GroupedListingEditorView.d.ts +10 -1
- package/dist/features/grouped/components/GroupedListingEditorView.js +3 -2
- package/dist/features/grouped/schemas/index.d.ts +2 -2
- package/dist/features/history/repository/user-history.repository.d.ts +1 -1
- package/dist/features/history/utils/guest-history.d.ts +1 -1
- package/dist/features/homepage/actions/index.d.ts +0 -1
- package/dist/features/homepage/actions/index.js +0 -1
- package/dist/features/homepage/api/carousel/route.d.ts +12 -6
- package/dist/features/homepage/api/carousel/route.js +15 -137
- package/dist/features/homepage/components/AdSlot.js +1 -1
- package/dist/features/homepage/components/CTABannerSection.js +2 -2
- package/dist/features/homepage/components/CollectionCardsSection.d.ts +2 -2
- package/dist/features/homepage/components/CollectionCardsSection.js +4 -4
- package/dist/features/homepage/components/CustomCardsSection.js +1 -1
- package/dist/features/homepage/components/FeaturedCollectorDropsSection.d.ts +18 -0
- package/dist/features/homepage/components/FeaturedCollectorDropsSection.js +12 -0
- package/dist/features/homepage/components/GoogleReviewsSection.js +1 -1
- package/dist/features/homepage/components/HeroCarousel.js +7 -6
- package/dist/features/homepage/components/HomepageSectionBoundary.d.ts +1 -1
- package/dist/features/homepage/components/HomepageSectionBoundary.js +1 -1
- package/dist/features/homepage/components/MarketplaceHomepageView.d.ts +4 -1
- package/dist/features/homepage/components/MarketplaceHomepageView.js +23 -32
- package/dist/features/homepage/components/SectionCarousel.js +1 -1
- package/dist/features/homepage/components/ShopByCategorySection.js +12 -2
- package/dist/features/homepage/components/SocialPostCard.js +1 -1
- package/dist/features/homepage/components/TrustFeaturesSection.js +11 -1
- package/dist/features/homepage/components/index.d.ts +2 -2
- package/dist/features/homepage/components/index.js +1 -1
- package/dist/features/homepage/constants/carousel.d.ts +8 -0
- package/dist/features/homepage/constants/carousel.js +8 -0
- package/dist/features/homepage/constants/section-copy.d.ts +2 -2
- package/dist/features/homepage/constants/section-copy.js +5 -5
- package/dist/features/homepage/hooks/homepage-query.js +2 -2
- package/dist/features/homepage/hooks/useActiveAd.d.ts +1 -1
- package/dist/features/homepage/hooks/useActiveAd.js +1 -1
- package/dist/features/homepage/hooks/useFeaturedCollectorDrops.d.ts +15 -0
- package/dist/features/homepage/hooks/useFeaturedCollectorDrops.js +49 -0
- package/dist/features/homepage/index.d.ts +1 -1
- package/dist/features/homepage/index.js +1 -1
- package/dist/features/homepage/lib/section-gating.d.ts +1 -1
- package/dist/features/homepage/lib/section-gating.js +1 -1
- package/dist/features/homepage/lib/section-renderer.d.ts +3 -2
- package/dist/features/homepage/lib/section-renderer.js +24 -13
- package/dist/features/homepage/lib/slide-gating.d.ts +5 -5
- package/dist/features/homepage/lib/slide-gating.js +6 -6
- package/dist/features/homepage/repository/homepage-sections.repository.d.ts +1 -1
- package/dist/features/homepage/schemas/firestore.d.ts +48 -169
- package/dist/features/homepage/schemas/firestore.js +12 -57
- package/dist/features/homepage/schemas/index.d.ts +2 -885
- package/dist/features/homepage/schemas/index.js +7 -112
- package/dist/features/homepage/server.d.ts +1 -3
- package/dist/features/homepage/server.js +1 -3
- package/dist/features/inventory/components/AdminMoveLedgerView.d.ts +6 -1
- package/dist/features/inventory/components/AdminMoveLedgerView.js +3 -2
- package/dist/features/inventory/components/AdminStorageBoxesView.d.ts +6 -1
- package/dist/features/inventory/components/AdminStorageBoxesView.js +4 -3
- package/dist/features/inventory/components/ReceiveStationView.d.ts +4 -1
- package/dist/features/inventory/components/ReceiveStationView.js +3 -2
- package/dist/features/jobs/actions/enqueue-job.d.ts +1 -1
- package/dist/features/jobs/schemas/firestore.d.ts +1 -1
- package/dist/features/layout/AppLayoutShell.d.ts +30 -1
- package/dist/features/layout/AppLayoutShell.js +44 -14
- package/dist/features/layout/AutoBreadcrumbs.js +6 -7
- package/dist/features/layout/BottomActions.js +1 -1
- package/dist/features/layout/BottomNavbar.d.ts +1 -1
- package/dist/features/layout/BottomNavbar.js +1 -1
- package/dist/features/layout/EditModeToggle.d.ts +8 -0
- package/dist/features/layout/EditModeToggle.js +17 -0
- package/dist/features/layout/LanguageSwitcher.d.ts +27 -0
- package/dist/features/layout/LanguageSwitcher.js +28 -0
- package/dist/features/layout/NavbarLayout.js +2 -2
- package/dist/features/layout/SideActionDock.js +2 -2
- package/dist/features/layout/SidebarLayout.js +11 -1
- package/dist/features/layout/TitleBarLayout.d.ts +14 -1
- package/dist/features/layout/TitleBarLayout.js +2 -2
- package/dist/features/layout/index.d.ts +6 -6
- package/dist/features/layout/index.js +3 -3
- package/dist/features/live/components/LiveItemDetailPageView.d.ts +4 -1
- package/dist/features/live/components/LiveItemDetailPageView.js +21 -3
- package/dist/features/media/MediaPickerModal.js +1 -1
- package/dist/features/media/hooks/useMedia.d.ts +1 -1
- package/dist/features/media/index.d.ts +0 -8
- package/dist/features/media/index.js +2 -5
- package/dist/features/media/modals/ImageCropModal.d.ts +2 -8
- package/dist/features/media/types/index.d.ts +4 -4
- package/dist/features/media/upload/ImageUpload.js +1 -1
- package/dist/features/media/upload/MediaUploadField.js +2 -2
- package/dist/features/media/upload/MediaUploadList.js +2 -2
- package/dist/features/media/upload/register-form-field-renderers.d.ts +1 -0
- package/dist/features/media/upload/register-form-field-renderers.js +34 -0
- package/dist/features/messages/components/ConversationThreadView.d.ts +4 -1
- package/dist/features/messages/components/ConversationThreadView.js +4 -3
- package/dist/features/messages/components/ConversationsInboxView.d.ts +6 -1
- package/dist/features/messages/components/ConversationsInboxView.js +26 -3
- package/dist/features/messages/schemas/firestore.d.ts +26 -3
- package/dist/features/messages/schemas/firestore.js +10 -0
- package/dist/features/obligations/constants/policies.js +71 -2
- package/dist/features/obligations/schemas/firestore.d.ts +17 -1
- package/dist/features/obligations/schemas/firestore.js +1 -0
- package/dist/features/orders/actions/order-actions.js +39 -0
- package/dist/features/orders/components/OrderPaymentSummary.js +1 -0
- package/dist/features/orders/components/OrderProvenanceCard.js +11 -11
- package/dist/features/orders/components/OrdersList.js +6 -4
- package/dist/features/orders/components/RefundRequestView.d.ts +4 -1
- package/dist/features/orders/components/RefundRequestView.js +3 -2
- package/dist/features/orders/constants/order-lane-tabs.d.ts +3 -3
- package/dist/features/orders/constants/order-lane-tabs.js +8 -8
- package/dist/features/orders/hooks/useOrders.d.ts +2 -0
- package/dist/features/orders/hooks/useOrders.js +7 -1
- package/dist/features/orders/repository/orders.repository.js +2 -2
- package/dist/features/orders/schemas/firestore.d.ts +197 -26
- package/dist/features/orders/schemas/firestore.js +1 -1
- package/dist/features/orders/schemas/index.d.ts +69 -29
- package/dist/features/orders/schemas/index.js +19 -1
- package/dist/features/orders/types/index.d.ts +31 -4
- package/dist/features/orders/utils/order-splitter.d.ts +3 -3
- package/dist/features/orders/utils/order-splitter.js +8 -8
- package/dist/features/payments/repository/payout.repository.d.ts +80 -0
- package/dist/features/payments/repository/payout.repository.js +116 -0
- package/dist/features/payments/schemas/firestore.d.ts +29 -0
- package/dist/features/payments/schemas/firestore.js +15 -0
- package/dist/features/payments/schemas/index.d.ts +2 -2
- package/dist/features/payments/types/index.d.ts +1 -1
- package/dist/features/pre-orders/components/MarketplacePreorderCard.js +1 -1
- package/dist/features/pre-orders/components/PreOrderActionsClient.d.ts +5 -0
- package/dist/features/pre-orders/components/PreOrderActionsClient.js +8 -5
- package/dist/features/pre-orders/components/PreOrderDetailPageView.d.ts +4 -1
- package/dist/features/pre-orders/components/PreOrderDetailPageView.js +30 -10
- package/dist/features/pre-orders/components/PreOrdersIndexListing.js +1 -1
- package/dist/features/pre-orders/components/PreOrdersListView.d.ts +4 -1
- package/dist/features/pre-orders/components/PreOrdersListView.js +3 -2
- package/dist/features/pre-orders/schemas/index.d.ts +8 -8
- package/dist/features/price-index/components/PriceIndexToolView.d.ts +4 -1
- package/dist/features/price-index/components/PriceIndexToolView.js +7 -7
- package/dist/features/price-index/lookup-target.js +1 -1
- package/dist/features/print/components/BoxLabelPrintView.d.ts +4 -1
- package/dist/features/print/components/BoxLabelPrintView.js +3 -2
- package/dist/features/products/actions/product-actions.d.ts +9 -9
- package/dist/features/products/actions/product-actions.js +19 -19
- package/dist/features/products/api/[id]/route.js +31 -10
- package/dist/features/products/api/route.d.ts +2 -2
- package/dist/features/products/api/route.js +11 -4
- package/dist/features/products/columns/productTableColumns.js +1 -1
- package/dist/features/products/components/ArtStickersListView.d.ts +4 -1
- package/dist/features/products/components/ArtStickersListView.js +7 -6
- package/dist/features/products/components/AvailabilityTabs.js +2 -2
- package/dist/features/products/components/BidHistory.d.ts +3 -0
- package/dist/features/products/components/BidHistory.js +3 -1
- package/dist/features/products/components/CardStoreLine.d.ts +2 -2
- package/dist/features/products/components/CardStoreLine.js +1 -1
- package/dist/features/products/components/CityCollectiblesView.d.ts +4 -1
- package/dist/features/products/components/CityCollectiblesView.js +3 -2
- package/dist/features/products/components/ClearanceBottomActions.d.ts +6 -0
- package/dist/features/products/components/ClearanceBottomActions.js +6 -0
- package/dist/features/products/components/ClearanceCollage.d.ts +35 -0
- package/dist/features/products/components/ClearanceCollage.js +91 -0
- package/dist/features/products/components/ClearanceDetailPageView.d.ts +37 -0
- package/dist/features/products/components/ClearanceDetailPageView.js +156 -0
- package/dist/features/products/components/ClearanceEntryActions.d.ts +32 -0
- package/dist/features/products/components/ClearanceEntryActions.js +104 -0
- package/dist/features/products/components/ClearanceIndexListing.d.ts +8 -0
- package/dist/features/products/components/ClearanceIndexListing.js +108 -0
- package/dist/features/products/components/ClearanceItemsEditor.d.ts +13 -0
- package/dist/features/products/components/ClearanceItemsEditor.js +101 -0
- package/dist/features/products/components/ClearanceListingView.d.ts +18 -0
- package/dist/features/products/components/ClearanceListingView.js +38 -0
- package/dist/features/products/components/ClearanceSection.d.ts +15 -0
- package/dist/features/products/components/ClearanceSection.js +49 -0
- package/dist/features/products/components/ClearanceWinnerMappingView.d.ts +14 -0
- package/dist/features/products/components/ClearanceWinnerMappingView.js +43 -0
- package/dist/features/products/components/CollectorDropDetailView.d.ts +16 -0
- package/dist/features/products/components/CollectorDropDetailView.js +13 -0
- package/dist/features/products/components/CollectorDropsIndexListing.d.ts +8 -0
- package/dist/features/products/components/CollectorDropsIndexListing.js +170 -0
- package/dist/features/products/components/CompareOverlay.d.ts +2 -2
- package/dist/features/products/components/CompareOverlay.js +5 -5
- package/dist/features/products/components/CustomSectionTabContent.d.ts +1 -1
- package/dist/features/products/components/CustomSectionTabContent.js +1 -1
- package/dist/features/products/components/GroupMemberPicker.js +1 -1
- package/dist/features/products/components/GroupSettingsPanel.d.ts +2 -2
- package/dist/features/products/components/GroupSettingsPanel.js +4 -4
- package/dist/features/products/components/ListingBottomActions.d.ts +4 -4
- package/dist/features/products/components/ListingBottomActions.js +1 -1
- package/dist/features/products/components/MarketplaceBundleCard.js +1 -1
- package/dist/features/products/components/MarketplaceClearanceCard.d.ts +34 -0
- package/dist/features/products/components/MarketplaceClearanceCard.js +129 -0
- package/dist/features/products/components/NonRefundableConsentModal.d.ts +1 -1
- package/dist/features/products/components/NonRefundableConsentModal.js +2 -2
- package/dist/features/products/components/PdpSectionJumpNav.d.ts +4 -0
- package/dist/features/products/components/PdpSectionJumpNav.js +41 -0
- package/dist/features/products/components/PlaceBidForm.d.ts +1 -1
- package/dist/features/products/components/PrizeRevealModal.js +31 -8
- package/dist/features/products/components/ProductDetailActions.js +1 -1
- package/dist/features/products/components/ProductDetailPageView.d.ts +4 -1
- package/dist/features/products/components/ProductDetailPageView.js +128 -98
- package/dist/features/products/components/ProductFeatureBadges.js +10 -7
- package/dist/features/products/components/ProductFilters.js +1 -1
- package/dist/features/products/components/ProductForm.d.ts +1 -1
- package/dist/features/products/components/ProductForm.js +20 -21
- package/dist/features/products/components/ProductGalleryClient.js +1 -1
- package/dist/features/products/components/ProductGradingTab.js +1 -1
- package/dist/features/products/components/ProductGrid.d.ts +18 -1
- package/dist/features/products/components/ProductGrid.js +91 -22
- package/dist/features/products/components/ProductsIndexListing.d.ts +1 -1
- package/dist/features/products/components/ProductsIndexListing.js +85 -18
- package/dist/features/products/components/ProductsIndexPageView.d.ts +4 -1
- package/dist/features/products/components/ProductsIndexPageView.js +12 -11
- package/dist/features/products/components/RelatedItemsSection.d.ts +82 -2
- package/dist/features/products/components/RelatedItemsSection.js +152 -9
- package/dist/features/products/components/ShowGroupSection.js +30 -2
- package/dist/features/products/components/SparesListView.d.ts +4 -1
- package/dist/features/products/components/SparesListView.js +3 -2
- package/dist/features/products/components/SublistingCarouselSection.js +1 -1
- package/dist/features/products/components/TrustBadgeRow.d.ts +15 -0
- package/dist/features/products/components/TrustBadgeRow.js +13 -0
- package/dist/features/products/components/index.d.ts +16 -16
- package/dist/features/products/components/index.js +9 -9
- package/dist/features/products/config/listing-type-listing-config.js +1 -1
- package/dist/features/products/constants/action-defs.d.ts +24 -25
- package/dist/features/products/constants/action-defs.js +35 -36
- package/dist/features/products/constants/card-badges.d.ts +3 -3
- package/dist/features/products/constants/card-badges.js +3 -3
- package/dist/features/products/constants/listing-tabs.d.ts +11 -5
- package/dist/features/products/constants/listing-tabs.js +21 -22
- package/dist/features/products/constants/preorder-window.d.ts +101 -0
- package/dist/features/products/constants/preorder-window.js +172 -0
- package/dist/features/products/constants/product-features.constants.js +3 -3
- package/dist/features/products/constants/sieve.d.ts +4 -4
- package/dist/features/products/constants/sieve.js +14 -14
- package/dist/features/products/hooks/useProducts.js +1 -1
- package/dist/features/products/hooks/useRelatedProducts.d.ts +2 -2
- package/dist/features/products/hooks/useRelatedProducts.js +5 -5
- package/dist/features/products/index.d.ts +1 -1
- package/dist/features/products/index.js +3 -3
- package/dist/features/products/messages/en.json +1 -1
- package/dist/features/products/repository/category-assignment.js +2 -2
- package/dist/features/products/repository/products.repository.d.ts +9 -6
- package/dist/features/products/repository/products.repository.js +54 -29
- package/dist/features/products/schemas/firestore.d.ts +81 -29
- package/dist/features/products/schemas/firestore.js +84 -14
- package/dist/features/products/schemas/index.d.ts +61 -40
- package/dist/features/products/schemas/index.js +26 -10
- package/dist/features/products/schemas/part-slots.d.ts +84 -0
- package/dist/features/products/schemas/part-slots.js +231 -0
- package/dist/features/products/schemas/product-features.d.ts +3 -3
- package/dist/features/products/schemas/product-features.validators.d.ts +40 -40
- package/dist/features/products/schemas/product-features.validators.js +3 -3
- package/dist/features/products/schemas/surface-counts.d.ts +1 -1
- package/dist/features/products/schemas/surface-counts.js +1 -1
- package/dist/features/products/types/index.d.ts +7 -7
- package/dist/features/products/utils/listing-badge-variant.d.ts +1 -1
- package/dist/features/products/utils/listing-badge-variant.js +5 -6
- package/dist/features/products/utils/listing-type.d.ts +6 -9
- package/dist/features/products/utils/listing-type.js +30 -9
- package/dist/features/promotions/actions/seller-coupon-actions.d.ts +2 -2
- package/dist/features/promotions/actions/seller-coupon-actions.js +2 -2
- package/dist/features/promotions/components/CouponCard.d.ts +1 -1
- package/dist/features/promotions/components/CouponsIndexListing.js +3 -1
- package/dist/features/promotions/hooks/useCouponValidate.d.ts +1 -1
- package/dist/features/promotions/repository/coupons.repository.d.ts +2 -5
- package/dist/features/promotions/repository/coupons.repository.js +22 -11
- package/dist/features/promotions/schemas/firestore.d.ts +11 -3
- package/dist/features/promotions/schemas/index.d.ts +23 -23
- package/dist/features/promotions/schemas/index.js +3 -3
- package/dist/features/reviews/actions/review-actions.js +1 -1
- package/dist/features/reviews/api/[id]/route.js +34 -10
- package/dist/features/reviews/components/ReviewDetailPageView.d.ts +4 -1
- package/dist/features/reviews/components/ReviewDetailPageView.js +29 -2
- package/dist/features/reviews/components/ReviewDetailShell.js +2 -2
- package/dist/features/reviews/components/ReviewModal.js +1 -1
- package/dist/features/reviews/components/ReviewsIndexPageView.d.ts +4 -1
- package/dist/features/reviews/components/ReviewsIndexPageView.js +4 -3
- package/dist/features/reviews/components/ReviewsList.js +1 -1
- package/dist/features/reviews/components/ReviewsListingPanel.d.ts +1 -1
- package/dist/features/reviews/schemas/firestore.d.ts +1 -1
- package/dist/features/reviews/schemas/index.d.ts +20 -20
- package/dist/features/scams/actions/scam-actions.js +1 -1
- package/dist/features/scams/components/ScamProfileView.d.ts +4 -1
- package/dist/features/scams/components/ScamProfileView.js +4 -3
- package/dist/features/scams/components/ScamRegistryView.d.ts +4 -1
- package/dist/features/scams/components/ScamRegistryView.js +5 -3
- package/dist/features/scams/schemas/index.d.ts +8 -8
- package/dist/features/scams/schemas/report-form.d.ts +4 -4
- package/dist/features/search/action-index/repository.d.ts +1 -1
- package/dist/features/search/action-index/repository.js +1 -1
- package/dist/features/search/action-index/settings-entries.js +6 -6
- package/dist/features/search/components/Search.d.ts +1 -1
- package/dist/features/search/components/SearchFacetRail.js +2 -2
- package/dist/features/search/components/SearchResultsPageView.js +2 -1
- package/dist/features/search/hooks/useNavSuggestions.d.ts +1 -1
- package/dist/features/search/hooks/useNavSuggestions.js +1 -1
- package/dist/features/search/hooks/useSiteSearch.js +1 -1
- package/dist/features/seller/actions/offer-actions.js +3 -3
- package/dist/features/seller/actions/seller-actions.d.ts +19 -0
- package/dist/features/seller/actions/seller-actions.js +163 -44
- package/dist/features/seller/api/coupons/route.js +6 -1
- package/dist/features/seller/api/products/route.js +6 -1
- package/dist/features/seller/api/store/route.js +6 -1
- package/dist/features/seller/components/FulfillmentView.d.ts +4 -1
- package/dist/features/seller/components/FulfillmentView.js +3 -2
- package/dist/features/seller/components/PrintCenterView.d.ts +4 -1
- package/dist/features/seller/components/PrintCenterView.js +3 -2
- package/dist/features/seller/components/SellerAddressesView.d.ts +4 -1
- package/dist/features/seller/components/SellerAddressesView.js +3 -2
- package/dist/features/seller/components/SellerAnalyticsAlertsView.d.ts +4 -1
- package/dist/features/seller/components/SellerAnalyticsAlertsView.js +3 -2
- package/dist/features/seller/components/SellerAnalyticsView.d.ts +4 -1
- package/dist/features/seller/components/SellerAnalyticsView.js +3 -1
- package/dist/features/seller/components/SellerArtAndStickersView.d.ts +18 -0
- package/dist/features/seller/components/SellerArtAndStickersView.js +7 -0
- package/dist/features/seller/components/SellerBidsView.d.ts +4 -1
- package/dist/features/seller/components/SellerBidsView.js +9 -8
- package/dist/features/seller/components/SellerBundlesView.d.ts +4 -1
- package/dist/features/seller/components/SellerBundlesView.js +3 -2
- package/dist/features/seller/components/SellerClassifiedView.d.ts +6 -2
- package/dist/features/seller/components/SellerClassifiedView.js +4 -3
- package/dist/features/seller/components/SellerCouponEditorView.d.ts +4 -1
- package/dist/features/seller/components/SellerCouponEditorView.js +3 -2
- package/dist/features/seller/components/SellerDigitalCodesView.d.ts +6 -2
- package/dist/features/seller/components/SellerDigitalCodesView.js +4 -3
- package/dist/features/seller/components/SellerFeaturesView.d.ts +6 -1
- package/dist/features/seller/components/SellerFeaturesView.js +8 -3
- package/dist/features/seller/components/SellerGoogleReviewsView.d.ts +4 -1
- package/dist/features/seller/components/SellerGoogleReviewsView.js +3 -2
- package/dist/features/seller/components/SellerGuideView.d.ts +11 -1
- package/dist/features/seller/components/SellerGuideView.js +7 -2
- package/dist/features/seller/components/SellerListingTypeView.d.ts +2 -2
- package/dist/features/seller/components/SellerListingTypeView.js +14 -20
- package/dist/features/seller/components/SellerLiveView.d.ts +6 -2
- package/dist/features/seller/components/SellerLiveView.js +4 -3
- package/dist/features/seller/components/SellerOffersView.d.ts +4 -1
- package/dist/features/seller/components/SellerOffersView.js +4 -3
- package/dist/features/seller/components/SellerOrdersView.d.ts +4 -1
- package/dist/features/seller/components/SellerOrdersView.js +44 -47
- package/dist/features/seller/components/SellerPayoutRequestView.d.ts +4 -1
- package/dist/features/seller/components/SellerPayoutRequestView.js +3 -2
- package/dist/features/seller/components/SellerPayoutSettingsView.js +125 -13
- package/dist/features/seller/components/SellerProductShell.d.ts +3 -3
- package/dist/features/seller/components/SellerProductShell.js +74 -26
- package/dist/features/seller/components/SellerProductsCards.js +3 -3
- package/dist/features/seller/components/SellerProductsView.js +21 -121
- package/dist/features/seller/components/SellerReviewsView.d.ts +10 -1
- package/dist/features/seller/components/SellerReviewsView.js +3 -2
- package/dist/features/seller/components/SellerShippingOfferView.d.ts +5 -0
- package/dist/features/seller/components/SellerShippingOfferView.js +164 -0
- package/dist/features/seller/components/SellerShippingView.d.ts +4 -1
- package/dist/features/seller/components/SellerShippingView.js +6 -5
- package/dist/features/seller/components/SellerSidebar.js +29 -5
- package/dist/features/seller/components/SellerSparesView.d.ts +6 -2
- package/dist/features/seller/components/SellerSparesView.js +4 -3
- package/dist/features/seller/components/SellerStoreCategoriesView.d.ts +4 -1
- package/dist/features/seller/components/SellerStoreCategoriesView.js +3 -2
- package/dist/features/seller/components/SellerStorefrontView.d.ts +4 -1
- package/dist/features/seller/components/SellerStorefrontView.js +6 -5
- package/dist/features/seller/components/SellerSupportView.d.ts +4 -1
- package/dist/features/seller/components/SellerSupportView.js +3 -2
- package/dist/features/seller/components/analytics/SellerAnalyticsStats.d.ts +8 -1
- package/dist/features/seller/components/analytics/SellerAnalyticsStats.js +1 -1
- package/dist/features/seller/components/index.d.ts +2 -4
- package/dist/features/seller/components/index.js +1 -2
- package/dist/features/seller/constants/store-tabs.d.ts +4 -0
- package/dist/features/seller/constants/store-tabs.js +12 -0
- package/dist/features/seller/hooks/useSellerStorefront.js +18 -1
- package/dist/features/seller/repository/seller-profile.repository.d.ts +32 -0
- package/dist/features/seller/repository/seller-profile.repository.js +98 -0
- package/dist/features/seller/schemas/coupon-form.d.ts +15 -15
- package/dist/features/seller/schemas/coupon-form.js +2 -2
- package/dist/features/seller/schemas/index.d.ts +6 -6
- package/dist/features/seller/schemas/product-form.d.ts +9 -9
- package/dist/features/seller/schemas/product-form.js +4 -4
- package/dist/features/seller/schemas/seller-profile-firestore.d.ts +48 -0
- package/dist/features/seller/schemas/seller-profile-firestore.js +38 -0
- package/dist/features/server-errors/schemas/index.d.ts +4 -4
- package/dist/features/shell/CommandPalette.d.ts +53 -4
- package/dist/features/shell/CommandPalette.js +144 -11
- package/dist/features/shell/QuickFormDrawer.d.ts +2 -14
- package/dist/features/shell/SectionForm.js +1 -1
- package/dist/features/shell/SectionVisibilityGate.d.ts +36 -0
- package/dist/features/shell/SectionVisibilityGate.js +46 -0
- package/dist/features/shell/WizardFormSteps.d.ts +7 -0
- package/dist/features/shell/WizardFormSteps.js +53 -0
- package/dist/features/shell/build-sections.d.ts +95 -2
- package/dist/features/shell/build-sections.js +177 -6
- package/dist/features/shell/field-ui-meta.d.ts +69 -0
- package/dist/features/shell/field-ui-meta.js +56 -0
- package/dist/features/shell/index.d.ts +2 -0
- package/dist/features/shell/index.js +1 -0
- package/dist/features/shell/searchNavItems.d.ts +22 -0
- package/dist/features/shell/searchNavItems.js +61 -0
- package/dist/features/shell/useFieldVisibility.d.ts +43 -0
- package/dist/features/shell/useFieldVisibility.js +126 -0
- package/dist/features/shipments/components/AdminShipmentEditorView.d.ts +6 -1
- package/dist/features/shipments/components/AdminShipmentEditorView.js +3 -2
- package/dist/features/shipments/components/AdminShipmentLotItemsView.d.ts +4 -1
- package/dist/features/shipments/components/AdminShipmentLotItemsView.js +3 -2
- package/dist/features/shipments/components/AdminShipmentProjectionsView.d.ts +6 -1
- package/dist/features/shipments/components/AdminShipmentProjectionsView.js +3 -9
- package/dist/features/shipments/components/AdminShipmentsView.d.ts +6 -2
- package/dist/features/shipments/components/AdminShipmentsView.js +5 -4
- package/dist/features/shipments/schemas/validation.d.ts +19 -19
- package/dist/features/shipments/schemas/validation.js +3 -4
- package/dist/features/site-settings/components/ActionPermissionsManager.js +21 -9
- package/dist/features/site-settings/components/NavPermissionsManager.d.ts +20 -1
- package/dist/features/site-settings/components/NavPermissionsManager.js +82 -6
- package/dist/features/site-settings/components/ThemeManagerView.js +22 -2
- package/dist/features/sticker-trace/components/StickerRunHistoryPanel.d.ts +8 -1
- package/dist/features/sticker-trace/components/StickerRunHistoryPanel.js +43 -11
- package/dist/features/sticker-trace/components/StickerTraceStudio.js +34 -13
- package/dist/features/sticker-trace/repository/sticker-sheets.repository.d.ts +1 -1
- package/dist/features/sticker-trace/repository/sticker-sheets.repository.js +1 -1
- package/dist/features/sticker-trace/repository/sticker-trace-runs.repository.d.ts +8 -0
- package/dist/features/sticker-trace/repository/sticker-trace-runs.repository.js +15 -0
- package/dist/features/store-extensions/repository/store-extensions.repositories.d.ts +2 -1
- package/dist/features/store-extensions/repository/store-extensions.repositories.js +16 -0
- package/dist/features/store-extensions/schemas/admin-notification-form.d.ts +2 -2
- package/dist/features/store-extensions/schemas/analytics-forms.d.ts +2 -2
- package/dist/features/store-extensions/schemas/firestore.d.ts +12 -2
- package/dist/features/store-extensions/schemas/firestore.js +3 -4
- package/dist/features/store-extensions/schemas/listing-template-form.d.ts +10 -10
- package/dist/features/store-extensions/schemas/listing-template-form.js +3 -4
- package/dist/features/store-extensions/schemas/payout-method-form.d.ts +10 -10
- package/dist/features/store-extensions/schemas/report-create-form.d.ts +2 -2
- package/dist/features/store-extensions/schemas/shipping-config-form.d.ts +33 -20
- package/dist/features/store-extensions/schemas/shipping-config-form.js +11 -0
- package/dist/features/store-extensions/schemas/store-category-form.d.ts +6 -6
- package/dist/features/stores/actions/store-query-actions.d.ts +2 -2
- package/dist/features/stores/actions/store-query-actions.js +5 -5
- package/dist/features/stores/api/[storeSlug]/collector-drops/route.d.ts +23 -0
- package/dist/features/stores/api/[storeSlug]/collector-drops/route.js +83 -0
- package/dist/features/stores/api/[storeSlug]/products/route.d.ts +1 -1
- package/dist/features/stores/api/[storeSlug]/products/route.js +1 -1
- package/dist/features/stores/components/InteractiveStoreCard.js +1 -1
- package/dist/features/stores/components/StoreArtStickersPageView.d.ts +4 -1
- package/dist/features/stores/components/StoreArtStickersPageView.js +6 -5
- package/dist/features/stores/components/StoreBundlesPageView.d.ts +5 -2
- package/dist/features/stores/components/StoreBundlesPageView.js +5 -4
- package/dist/features/stores/components/StoreCapabilitiesGuideView.d.ts +6 -2
- package/dist/features/stores/components/StoreCapabilitiesGuideView.js +6 -5
- package/dist/features/stores/components/StoreClassifiedsPageView.d.ts +4 -1
- package/dist/features/stores/components/StoreClassifiedsPageView.js +4 -3
- package/dist/features/stores/components/StoreClearancePageView.d.ts +11 -0
- package/dist/features/stores/components/StoreClearancePageView.js +25 -0
- package/dist/features/stores/components/StoreCollectorDropsListing.d.ts +7 -0
- package/dist/features/stores/components/StoreCollectorDropsListing.js +138 -0
- package/dist/features/stores/components/StoreCollectorDropsPageView.d.ts +11 -0
- package/dist/features/stores/components/StoreCollectorDropsPageView.js +25 -0
- package/dist/features/stores/components/StoreCollectorDropsView.d.ts +17 -0
- package/dist/features/stores/components/StoreCollectorDropsView.js +5 -0
- package/dist/features/stores/components/StoreCreateForm.js +16 -2
- package/dist/features/stores/components/StoreDetailLayoutView.d.ts +1 -1
- package/dist/features/stores/components/StoreDetailLayoutView.js +7 -1
- package/dist/features/stores/components/StoreDigitalCodesPageView.d.ts +4 -1
- package/dist/features/stores/components/StoreDigitalCodesPageView.js +4 -3
- package/dist/features/stores/components/StoreFinanceGuideView.d.ts +6 -2
- package/dist/features/stores/components/StoreFinanceGuideView.js +3 -2
- package/dist/features/stores/components/StoreGuideHubView.d.ts +4 -1
- package/dist/features/stores/components/StoreGuideHubView.js +6 -4
- package/dist/features/stores/components/StoreHeader.js +1 -1
- package/dist/features/stores/components/StoreListingsGuideView.d.ts +6 -2
- package/dist/features/stores/components/StoreListingsGuideView.js +12 -11
- package/dist/features/stores/components/StoreLiveItemsPageView.d.ts +4 -1
- package/dist/features/stores/components/StoreLiveItemsPageView.js +4 -3
- package/dist/features/stores/components/StoreNavTabs.d.ts +1 -1
- package/dist/features/stores/components/StoreOrdersGuideView.d.ts +6 -2
- package/dist/features/stores/components/StoreOrdersGuideView.js +6 -5
- package/dist/features/stores/components/StorePreOrdersPageView.d.ts +4 -1
- package/dist/features/stores/components/StorePreOrdersPageView.js +4 -3
- package/dist/features/stores/components/StoreProductsPageView.d.ts +12 -1
- package/dist/features/stores/components/StoreProductsPageView.js +4 -3
- package/dist/features/stores/components/StoreReviewsPageView.d.ts +4 -1
- package/dist/features/stores/components/StoreReviewsPageView.js +4 -3
- package/dist/features/stores/components/StoreSettingsGuideView.d.ts +6 -2
- package/dist/features/stores/components/StoreSettingsGuideView.js +3 -2
- package/dist/features/stores/components/StoreSparesPageView.d.ts +4 -1
- package/dist/features/stores/components/StoreSparesPageView.js +10 -9
- package/dist/features/stores/components/StoresIndexListing.js +16 -11
- package/dist/features/stores/components/StoresIndexPageView.d.ts +10 -1
- package/dist/features/stores/components/StoresIndexPageView.js +3 -2
- package/dist/features/stores/components/index.d.ts +5 -5
- package/dist/features/stores/components/index.js +2 -2
- package/dist/features/stores/hooks/useStores.d.ts +4 -4
- package/dist/features/stores/hooks/useStores.js +4 -4
- package/dist/features/stores/manifest.js +3 -3
- package/dist/features/stores/messages/en.json +1 -1
- package/dist/features/stores/repository/store.repository.d.ts +80 -0
- package/dist/features/stores/repository/store.repository.js +98 -0
- package/dist/features/stores/schemas/firestore.d.ts +193 -1
- package/dist/features/stores/schemas/firestore.js +66 -0
- package/dist/features/stores/schemas/index.d.ts +16 -16
- package/dist/features/stores/server.d.ts +1 -1
- package/dist/features/stores/server.js +1 -1
- package/dist/features/stores/types/index.d.ts +5 -5
- package/dist/features/support/schemas/firestore.d.ts +1 -1
- package/dist/features/support/schemas/firestore.js +1 -1
- package/dist/features/support/schemas/index.d.ts +12 -12
- package/dist/features/support/schemas/index.js +1 -1
- package/dist/features/tax-codes/schemas/tax-code-form.d.ts +4 -4
- package/dist/features/tax-codes/schemas/tax-codes.validators.d.ts +4 -4
- package/dist/features/tax-codes/schemas/tax-codes.validators.js +1 -1
- package/dist/features/tester/actions/checklist-item-actions.d.ts +3 -3
- package/dist/features/tester/components/AdminTesterFeedbackIssuesView.js +1 -1
- package/dist/features/tester/components/AdminTesterFeedbackView.d.ts +6 -1
- package/dist/features/tester/components/AdminTesterFeedbackView.js +3 -2
- package/dist/features/tester/schemas/checklist-item-form.d.ts +2 -2
- package/dist/features/whatsapp-bot/components/SellerWhatsAppSettingsView.d.ts +4 -1
- package/dist/features/whatsapp-bot/components/SellerWhatsAppSettingsView.js +3 -2
- package/dist/features/wishlist/components/WishlistHeartButton.d.ts +2 -2
- package/dist/features/wishlist/components/WishlistHeartButton.js +2 -2
- package/dist/features/wishlist/components/WishlistPage.js +1 -1
- package/dist/features/wishlist/components/WishlistView.d.ts +1 -1
- package/dist/features/wishlist/hooks/useGuestWishlist.d.ts +6 -6
- package/dist/features/wishlist/hooks/useUserWishlist.d.ts +1 -1
- package/dist/features/wishlist/hooks/useWishlistCount.js +1 -1
- package/dist/features/wishlist/hooks/useWishlistWithGuest.d.ts +6 -6
- package/dist/features/wishlist/repository/user-wishlist.repository.d.ts +1 -1
- package/dist/features/wishlist/utils/guest-wishlist.d.ts +14 -5
- package/dist/index.d.ts +182 -201
- package/dist/index.js +284 -230
- package/dist/jobs.d.ts +1 -1
- package/dist/jobs.js +3 -3
- package/dist/next/api/api-response.d.ts +1 -1
- package/dist/next/api/parseJsonBody.d.ts +1 -1
- package/dist/next/api/routeHandler.d.ts +5 -0
- package/dist/next/api/routeHandler.js +24 -2
- package/dist/next/components/UnauthorizedView.d.ts +4 -1
- package/dist/next/components/UnauthorizedView.js +3 -2
- package/dist/next/index.d.ts +3 -1
- package/dist/next/index.js +5 -1
- package/dist/next/routing/portals.d.ts +266 -0
- package/dist/next/routing/portals.js +379 -0
- package/dist/next/routing/route-map.d.ts +114 -71
- package/dist/next/routing/route-map.js +137 -45
- package/dist/providers/ai-groq/index.d.ts +18 -0
- package/dist/providers/ai-groq/index.js +241 -0
- package/dist/providers/auth-firebase/claims.d.ts +85 -0
- package/dist/providers/auth-firebase/claims.js +116 -0
- package/dist/providers/auth-firebase/helpers.d.ts +6 -1
- package/dist/providers/auth-firebase/helpers.js +26 -2
- package/dist/providers/auth-firebase/provider.js +9 -4
- package/dist/providers/auth-firebase/session.js +32 -1
- package/dist/providers/db-firebase/admin.d.ts +24 -1
- package/dist/providers/db-firebase/admin.js +29 -5
- package/dist/providers/db-firebase/base.repository.d.ts +1 -1
- package/dist/providers/db-firebase/filter-aliases.d.ts +2 -2
- package/dist/providers/db-firebase/rtdb-url.js +1 -1
- package/dist/providers/db-firebase/sieve.js +2 -2
- package/dist/providers/payment-cashfree/easy-split.d.ts +119 -0
- package/dist/providers/payment-cashfree/easy-split.js +206 -0
- package/dist/providers/payment-cashfree/index.d.ts +341 -0
- package/dist/providers/payment-cashfree/index.js +714 -0
- package/dist/providers/payment-phonepe/index.d.ts +1 -1
- package/dist/providers/payment-phonepe/index.js +14 -1
- package/dist/providers/payment-razorpay/index.d.ts +1 -1
- package/dist/providers/shipping-shiprocket/index.d.ts +40 -5
- package/dist/providers/shipping-shiprocket/index.js +49 -5
- package/dist/providers.d.ts +3 -0
- package/dist/providers.js +5 -0
- package/dist/react/contexts/SessionContext.d.ts +18 -2
- package/dist/react/contexts/SessionContext.js +23 -1
- package/dist/react/hooks/useBrowsePageFlags.d.ts +2 -2
- package/dist/react/hooks/useBrowsePageFlags.js +11 -5
- package/dist/react/hooks/useCanSeePrices.js +1 -1
- package/dist/react/hooks/useCountdown.d.ts +1 -1
- package/dist/react/hooks/useCountdown.js +1 -1
- package/dist/react/hooks/useListingSurfaceVisibility.js +12 -2
- package/dist/react/hooks/useListingTypeFlags.d.ts +62 -8
- package/dist/react/hooks/useListingTypeFlags.js +14 -7
- package/dist/repositories/index.d.ts +3 -4
- package/dist/repositories/index.js +4 -5
- package/dist/schemas/registry.d.ts +320 -899
- package/dist/schemas/registry.js +7 -7
- package/dist/schemas/sieve.d.ts +2 -2
- package/dist/schemas/webhooks/google-oauth.d.ts +4 -4
- package/dist/security/authorization.d.ts +27 -5
- package/dist/security/authorization.js +53 -13
- package/dist/security/index.d.ts +1 -1
- package/dist/security/index.js +1 -1
- package/dist/security/pii-mask.d.ts +1 -1
- package/dist/security/pii-mask.js +1 -1
- package/dist/security/pii-schemas.d.ts +26 -2
- package/dist/security/pii-schemas.js +26 -2
- package/dist/seo/json-ld.d.ts +6 -6
- package/dist/seo/json-ld.js +7 -7
- package/dist/seo/metadata.d.ts +3 -3
- package/dist/seo/metadata.js +7 -7
- package/dist/server-entry.d.ts +13 -13
- package/dist/server-entry.js +54 -15
- package/dist/server.d.ts +79 -46
- package/dist/server.js +158 -74
- package/dist/stores/panel-store.d.ts +1 -1
- package/dist/styles.css +380 -183
- package/dist/tailwind-utilities.css +1 -1
- package/dist/tokens/contrast.d.ts +61 -0
- package/dist/tokens/contrast.js +128 -0
- package/dist/tokens/themes/cobalt-night.js +10 -3
- package/dist/tokens/themes/default-dark.d.ts +5 -4
- package/dist/tokens/themes/default-dark.js +48 -40
- package/dist/tokens/themes/default-light.d.ts +5 -5
- package/dist/tokens/themes/default-light.js +64 -36
- package/dist/tokens/themes/required.d.ts +1 -1
- package/dist/tokens/themes/required.js +40 -0
- package/dist/tokens/themes/sunset.js +14 -2
- package/dist/tokens/tokens.css +117 -85
- package/dist/ui/chrome/BottomActionsContext.d.ts +190 -0
- package/dist/ui/chrome/BottomActionsContext.js +198 -0
- package/dist/ui/chrome/useBottomActions.d.ts +37 -0
- package/dist/ui/chrome/useBottomActions.js +86 -0
- package/dist/ui/columns/cell-renderers.d.ts +10 -5
- package/dist/ui/columns/cell-renderers.js +9 -7
- package/dist/ui/columns/column-renderers.js +13 -4
- package/dist/ui/components/AdminFilterFacets.d.ts +37 -0
- package/dist/ui/components/AdminFilterFacets.js +126 -0
- package/dist/ui/components/Avatar.js +1 -1
- package/dist/ui/components/AvatarDisplay.d.ts +1 -1
- package/dist/ui/components/BaseListingCard.js +1 -1
- package/dist/ui/components/Button.js +2 -13
- package/dist/ui/components/Button.style.css +91 -0
- package/dist/ui/components/Card.d.ts +1 -1
- package/dist/ui/components/Card.js +0 -9
- package/dist/ui/components/Card.style.css +0 -70
- package/dist/ui/components/ClaimCouponButton.d.ts +1 -1
- package/dist/ui/components/ConfirmDeleteModal.d.ts +1 -1
- package/dist/ui/components/ConfirmDeleteModal.js +2 -18
- package/dist/ui/components/ConfirmDeleteModal.style.css +53 -1
- package/dist/ui/components/DetailPageGallery.d.ts +1 -1
- package/dist/ui/components/DetailPageGallery.js +2 -2
- package/dist/ui/components/DetailPageHero.d.ts +1 -1
- package/dist/ui/components/DetailPageHero.js +1 -1
- package/dist/ui/components/DetailPageTabs.d.ts +1 -1
- package/dist/ui/components/DetailPageTabs.js +1 -1
- package/dist/ui/components/DetailViewShell.d.ts +27 -2
- package/dist/ui/components/DetailViewShell.js +5 -1
- package/dist/ui/components/Disclaimer.js +11 -2
- package/dist/ui/components/Drawer.js +19 -2
- package/dist/ui/components/FilterChipGroup.d.ts +2 -2
- package/dist/ui/components/Form.js +1 -1
- package/dist/ui/components/FormField.d.ts +19 -2
- package/dist/ui/components/FormField.js +88 -21
- package/dist/ui/components/GatedPrice.d.ts +1 -1
- package/dist/ui/components/GatedPrice.js +1 -1
- package/dist/ui/components/ImageGallery.js +1 -1
- package/dist/ui/components/ImageLightbox.js +5 -2
- package/dist/ui/components/ImageMosaic.js +1 -1
- package/dist/ui/components/ListingToolbar.d.ts +56 -1
- package/dist/ui/components/ListingToolbar.js +54 -4
- package/dist/ui/components/LiveEditableRegion.d.ts +29 -0
- package/dist/ui/components/LiveEditableRegion.js +54 -0
- package/dist/ui/components/MediaAvatar.js +13 -0
- package/dist/ui/components/MediaImage.d.ts +116 -0
- package/dist/ui/components/MediaImage.js +194 -0
- package/dist/ui/components/MediaLightbox.js +246 -0
- package/dist/ui/components/MediaVideo.js +141 -0
- package/dist/ui/components/Modal.d.ts +1 -1
- package/dist/ui/components/Modal.js +18 -47
- package/dist/ui/components/Modal.style.css +43 -0
- package/dist/ui/components/PaginatedSelect.d.ts +1 -1
- package/dist/ui/components/QuickCreateModal.js +4 -1
- package/dist/ui/components/RecordDetailModal.js +1 -1
- package/dist/ui/components/RowActionMenu.js +11 -51
- package/dist/ui/components/RowActionMenu.style.css +64 -10
- package/dist/ui/components/SideDrawer.style.css +11 -16
- package/dist/ui/components/SiteLogo.js +1 -1
- package/dist/ui/components/SiteMark.js +1 -1
- package/dist/ui/components/SpecTable.d.ts +1 -1
- package/dist/ui/components/SplitTile.js +1 -1
- package/dist/ui/components/dialog-shell.d.ts +32 -0
- package/dist/ui/components/dialog-shell.js +23 -0
- package/dist/ui/components/form-field-registry.d.ts +43 -0
- package/dist/ui/components/form-field-registry.js +7 -0
- package/dist/ui/components/surface-tokens.d.ts +6 -2
- package/dist/ui/components/surface-tokens.js +3 -1
- package/dist/ui/design-pack.d.ts +21 -0
- package/dist/ui/design-pack.js +47 -0
- package/dist/ui/forms/FormShell.js +14 -1
- package/dist/ui/forms/useFormBottomActions.d.ts +78 -0
- package/dist/ui/forms/useFormBottomActions.js +128 -0
- package/dist/ui/icons/icon-registry.d.ts +6 -1
- package/dist/ui/icons/icon-registry.js +12 -3
- package/dist/ui/rich-text/RichText.js +35 -8
- package/dist/ui/types/image-crop.d.ts +8 -0
- package/dist/ui/types/quick-field.d.ts +33 -0
- package/dist/ui/widgets/index.d.ts +7 -0
- package/dist/ui/widgets/index.js +3 -0
- package/dist/ui/widgets/merge.d.ts +85 -0
- package/dist/ui/widgets/merge.js +162 -0
- package/dist/ui/widgets/pilot-registry.d.ts +104 -0
- package/dist/ui/widgets/pilot-registry.js +305 -0
- package/dist/ui/widgets/resolve.d.ts +109 -0
- package/dist/ui/widgets/resolve.js +442 -0
- package/dist/ui/widgets/types.d.ts +252 -0
- package/dist/ui/widgets/types.js +45 -0
- package/dist/utils/id-generators.d.ts +5 -5
- package/dist/utils/id-generators.js +14 -10
- package/dist/utils/listing-params.d.ts +1 -1
- package/dist/utils/listing-params.js +1 -1
- package/dist/utils/pack-by-span.d.ts +21 -0
- package/dist/utils/pack-by-span.js +84 -0
- package/dist/utils/search-txt-builders.d.ts +2 -2
- package/dist/utils/search-txt-builders.js +1 -1
- package/dist/validation/schemas.d.ts +17 -17
- package/package.json +85 -23
- package/scripts/dedupe-peer-deps.mjs +17 -0
- package/scripts/seed-cli.mjs +33 -16
- package/scripts/sieve-audit.mjs +14 -14
- package/dist/_internal/client/features/lottery/LotteryAdminEditView.d.ts +0 -66
- package/dist/_internal/client/features/lottery/LotteryAdminEditView.js +0 -187
- package/dist/_internal/client/features/lottery/LotteryAdminSlotView.d.ts +0 -15
- package/dist/_internal/client/features/lottery/LotteryAdminSlotView.js +0 -51
- package/dist/_internal/client/features/lottery/LotteryDetailView.d.ts +0 -37
- package/dist/_internal/client/features/lottery/LotteryDetailView.js +0 -48
- package/dist/_internal/client/features/lottery/LotteryEntriesView.d.ts +0 -24
- package/dist/_internal/client/features/lottery/LotteryEntriesView.js +0 -63
- package/dist/_internal/client/features/lottery/LotteryListView.d.ts +0 -29
- package/dist/_internal/client/features/lottery/LotteryListView.js +0 -44
- package/dist/_internal/client/features/lottery/LotteryPullForm.d.ts +0 -31
- package/dist/_internal/client/features/lottery/LotteryPullForm.js +0 -94
- package/dist/_internal/client/features/lottery/LotterySlotGrid.d.ts +0 -14
- package/dist/_internal/client/features/lottery/LotterySlotGrid.js +0 -23
- package/dist/_internal/client/features/lottery/PrizeDrawLotteryDetailView.d.ts +0 -29
- package/dist/_internal/client/features/lottery/PrizeDrawLotteryDetailView.js +0 -28
- package/dist/_internal/client/features/lottery/slot-collage-items.d.ts +0 -15
- package/dist/_internal/client/features/lottery/slot-collage-items.js +0 -13
- package/dist/_internal/server/features/auctions/actions.js +0 -76
- package/dist/_internal/server/features/auctions/data.d.ts +0 -2
- package/dist/_internal/server/features/auctions/data.js +0 -3
- package/dist/_internal/server/features/auctions/index.d.ts +0 -5
- package/dist/_internal/server/features/auctions/index.js +0 -5
- package/dist/_internal/server/features/auctions/og.d.ts +0 -22
- package/dist/_internal/server/features/auctions/og.js +0 -30
- package/dist/_internal/server/features/auctions/service.d.ts +0 -20
- package/dist/_internal/server/features/auctions/service.js +0 -65
- package/dist/_internal/server/features/beys/data.d.ts +0 -44
- package/dist/_internal/server/features/beys/data.js +0 -107
- package/dist/_internal/server/features/beys/og.d.ts +0 -42
- package/dist/_internal/server/features/beys/og.js +0 -89
- package/dist/_internal/server/features/checkout/freeze-parts.d.ts +0 -50
- package/dist/_internal/server/features/checkout/freeze-parts.js +0 -94
- package/dist/_internal/server/features/lottery/actions.d.ts +0 -43
- package/dist/_internal/server/features/lottery/actions.js +0 -365
- package/dist/_internal/server/features/lottery/adapters.d.ts +0 -15
- package/dist/_internal/server/features/lottery/adapters.js +0 -31
- package/dist/_internal/server/features/lottery/data.d.ts +0 -19
- package/dist/_internal/server/features/lottery/data.js +0 -41
- package/dist/_internal/server/features/lottery/metadata.d.ts +0 -6
- package/dist/_internal/server/features/lottery/metadata.js +0 -31
- package/dist/_internal/server/features/lottery/og.d.ts +0 -40
- package/dist/_internal/server/features/lottery/og.js +0 -79
- package/dist/_internal/server/features/parts/assembly.d.ts +0 -126
- package/dist/_internal/server/features/parts/assembly.js +0 -246
- package/dist/_internal/server/features/parts/buildable.d.ts +0 -47
- package/dist/_internal/server/features/parts/buildable.js +0 -159
- package/dist/_internal/server/features/parts/data.d.ts +0 -65
- package/dist/_internal/server/features/parts/data.js +0 -171
- package/dist/_internal/server/features/parts/og.d.ts +0 -34
- package/dist/_internal/server/features/parts/og.js +0 -66
- package/dist/_internal/server/features/prize-draws/actions.d.ts +0 -2
- package/dist/_internal/server/features/prize-draws/actions.js +0 -33
- package/dist/_internal/server/features/prize-draws/data.d.ts +0 -1
- package/dist/_internal/server/features/prize-draws/data.js +0 -2
- package/dist/_internal/server/features/prize-draws/index.d.ts +0 -4
- package/dist/_internal/server/features/prize-draws/index.js +0 -4
- package/dist/_internal/server/features/prize-draws/og.d.ts +0 -32
- package/dist/_internal/server/features/prize-draws/og.js +0 -47
- package/dist/_internal/server/features/prize-draws/service.d.ts +0 -3
- package/dist/_internal/server/features/prize-draws/service.js +0 -19
- package/dist/_internal/server/jobs/core/auctionSettlement.d.ts +0 -2
- package/dist/_internal/server/jobs/core/auctionSettlement.js +0 -240
- package/dist/_internal/server/jobs/core/onPrizeDrawPaymentConfirmed.d.ts +0 -19
- package/dist/_internal/server/jobs/core/onPrizeDrawPaymentConfirmed.js +0 -30
- package/dist/_internal/server/jobs/core/prizeDrawAssignWinner.d.ts +0 -20
- package/dist/_internal/server/jobs/core/prizeDrawAssignWinner.js +0 -114
- package/dist/_internal/server/jobs/core/prizeDrawExpiryReveal.d.ts +0 -14
- package/dist/_internal/server/jobs/core/prizeDrawExpiryReveal.js +0 -71
- package/dist/_internal/server/jobs/core/prizeDrawSoldOutReveal.d.ts +0 -22
- package/dist/_internal/server/jobs/core/prizeDrawSoldOutReveal.js +0 -67
- package/dist/_internal/server/jobs/handlers/auctionSettlement.d.ts +0 -2
- package/dist/_internal/server/jobs/handlers/auctionSettlement.js +0 -2
- package/dist/_internal/server/jobs/handlers/onPrizeDrawPaymentConfirmed.d.ts +0 -3
- package/dist/_internal/server/jobs/handlers/onPrizeDrawPaymentConfirmed.js +0 -11
- package/dist/_internal/server/jobs/handlers/prizeDrawExpiryReveal.d.ts +0 -2
- package/dist/_internal/server/jobs/handlers/prizeDrawExpiryReveal.js +0 -2
- package/dist/_internal/server/jobs/handlers/prizeDrawSoldOutReveal.d.ts +0 -3
- package/dist/_internal/server/jobs/handlers/prizeDrawSoldOutReveal.js +0 -4
- package/dist/_internal/shared/checkout/rules/art.rule.d.ts +0 -9
- package/dist/_internal/shared/checkout/rules/art.rule.js +0 -5
- package/dist/_internal/shared/checkout/rules/auction.rule.d.ts +0 -2
- package/dist/_internal/shared/checkout/rules/auction.rule.js +0 -37
- package/dist/_internal/shared/checkout/rules/prize-draw.rule.d.ts +0 -2
- package/dist/_internal/shared/checkout/rules/prize-draw.rule.js +0 -130
- package/dist/_internal/shared/checkout/rules/stickers.rule.d.ts +0 -9
- package/dist/_internal/shared/checkout/rules/stickers.rule.js +0 -5
- package/dist/_internal/shared/features/auctions/config.d.ts +0 -100
- package/dist/_internal/shared/features/auctions/config.js +0 -136
- package/dist/_internal/shared/features/auctions/errors.d.ts +0 -16
- package/dist/_internal/shared/features/auctions/errors.js +0 -32
- package/dist/_internal/shared/features/auctions/schema.d.ts +0 -42
- package/dist/_internal/shared/features/auctions/schema.js +0 -24
- package/dist/_internal/shared/listing-types/art/config.d.ts +0 -74
- package/dist/_internal/shared/listing-types/art/config.js +0 -36
- package/dist/_internal/shared/listing-types/art/ctas.js +0 -3
- package/dist/_internal/shared/listing-types/art/schema.d.ts +0 -2
- package/dist/_internal/shared/listing-types/art/schema.js +0 -3
- package/dist/_internal/shared/listing-types/auction/config.d.ts +0 -84
- package/dist/_internal/shared/listing-types/auction/config.js +0 -58
- package/dist/_internal/shared/listing-types/auction/schema.d.ts +0 -3
- package/dist/_internal/shared/listing-types/auction/schema.js +0 -7
- package/dist/_internal/shared/listing-types/prize-draw/config.d.ts +0 -73
- package/dist/_internal/shared/listing-types/prize-draw/config.js +0 -45
- package/dist/_internal/shared/listing-types/prize-draw/schema.d.ts +0 -3
- package/dist/_internal/shared/listing-types/prize-draw/schema.js +0 -13
- package/dist/_internal/shared/listing-types/stickers/config.d.ts +0 -74
- package/dist/_internal/shared/listing-types/stickers/config.js +0 -36
- package/dist/_internal/shared/listing-types/stickers/ctas.d.ts +0 -1
- package/dist/_internal/shared/listing-types/stickers/ctas.js +0 -3
- package/dist/_internal/shared/listing-types/stickers/schema.d.ts +0 -2
- package/dist/_internal/shared/listing-types/stickers/schema.js +0 -3
- package/dist/_internal/shared/listing-types/stickers/seed-factory.d.ts +0 -1
- package/dist/_internal/shared/listing-types/stickers/seed-factory.js +0 -1
- package/dist/features/about/components/HowAuctionsWorkView.d.ts +0 -3
- package/dist/features/about/components/HowAuctionsWorkView.js +0 -104
- package/dist/features/account/components/BuyerAuctionsGuideView.d.ts +0 -2
- package/dist/features/account/components/BuyerAuctionsGuideView.js +0 -46
- package/dist/features/admin/components/AdminArtView.d.ts +0 -13
- package/dist/features/admin/components/AdminArtView.js +0 -31
- package/dist/features/admin/components/AdminBeysView.d.ts +0 -27
- package/dist/features/admin/components/AdminBeysView.js +0 -180
- package/dist/features/admin/components/AdminCarouselEditorView.d.ts +0 -9
- package/dist/features/admin/components/AdminCarouselEditorView.js +0 -299
- package/dist/features/admin/components/AdminCarouselGroupEditorView.d.ts +0 -14
- package/dist/features/admin/components/AdminCarouselGroupEditorView.js +0 -96
- package/dist/features/admin/components/AdminCarouselView.d.ts +0 -6
- package/dist/features/admin/components/AdminCarouselView.js +0 -273
- package/dist/features/admin/components/AdminPartsView.d.ts +0 -27
- package/dist/features/admin/components/AdminPartsView.js +0 -162
- package/dist/features/admin/components/AdminPrizeDrawsView.d.ts +0 -4
- package/dist/features/admin/components/AdminPrizeDrawsView.js +0 -155
- package/dist/features/admin/components/AdminStickersView.d.ts +0 -13
- package/dist/features/admin/components/AdminStickersView.js +0 -31
- package/dist/features/auctions/actions/bid-actions.d.ts +0 -50
- package/dist/features/auctions/actions/bid-actions.js +0 -454
- package/dist/features/auctions/api/route.d.ts +0 -14
- package/dist/features/auctions/api/route.js +0 -62
- package/dist/features/auctions/columns/index.d.ts +0 -14
- package/dist/features/auctions/columns/index.js +0 -63
- package/dist/features/auctions/components/AuctionBidsTable.d.ts +0 -27
- package/dist/features/auctions/components/AuctionBidsTable.js +0 -96
- package/dist/features/auctions/components/AuctionBottomActions.d.ts +0 -23
- package/dist/features/auctions/components/AuctionBottomActions.js +0 -89
- package/dist/features/auctions/components/AuctionDetailPageView.d.ts +0 -22
- package/dist/features/auctions/components/AuctionDetailPageView.js +0 -246
- package/dist/features/auctions/components/AuctionFilters.d.ts +0 -16
- package/dist/features/auctions/components/AuctionFilters.js +0 -18
- package/dist/features/auctions/components/AuctionLiveStatusBadge.d.ts +0 -20
- package/dist/features/auctions/components/AuctionLiveStatusBadge.js +0 -21
- package/dist/features/auctions/components/AuctionsListView.d.ts +0 -6
- package/dist/features/auctions/components/AuctionsListView.js +0 -22
- package/dist/features/auctions/components/CollapsibleBidHistory.js +0 -34
- package/dist/features/auctions/components/LiveBidPrice.d.ts +0 -19
- package/dist/features/auctions/components/LiveBidPrice.js +0 -19
- package/dist/features/auctions/components/LiveMinIncrement.d.ts +0 -18
- package/dist/features/auctions/components/LiveMinIncrement.js +0 -25
- package/dist/features/auctions/components/MarketplaceAuctionCard.d.ts +0 -99
- package/dist/features/auctions/components/MarketplaceAuctionCard.js +0 -212
- package/dist/features/auctions/components/MarketplaceAuctionGrid.d.ts +0 -21
- package/dist/features/auctions/components/MarketplaceAuctionGrid.js +0 -47
- package/dist/features/auctions/components/PlaceBidFormClient.d.ts +0 -65
- package/dist/features/auctions/components/PlaceBidFormClient.js +0 -306
- package/dist/features/auctions/components/bid-detail-fields.js +0 -103
- package/dist/features/auctions/components/index.d.ts +0 -7
- package/dist/features/auctions/components/index.js +0 -5
- package/dist/features/auctions/hooks/useAuctions.d.ts +0 -51
- package/dist/features/auctions/hooks/useAuctions.js +0 -105
- package/dist/features/auctions/hooks/useBids.d.ts +0 -33
- package/dist/features/auctions/hooks/useBids.js +0 -32
- package/dist/features/auctions/hooks/useIsAuctionEnded.d.ts +0 -41
- package/dist/features/auctions/hooks/useIsAuctionEnded.js +0 -76
- package/dist/features/auctions/hooks/useLiveAuctionBid.d.ts +0 -20
- package/dist/features/auctions/hooks/useLiveAuctionBid.js +0 -23
- package/dist/features/auctions/hooks/usePlaceBid.d.ts +0 -25
- package/dist/features/auctions/hooks/usePlaceBid.js +0 -28
- package/dist/features/auctions/hooks/useRealtimeBids.d.ts +0 -41
- package/dist/features/auctions/hooks/useRealtimeBids.js +0 -170
- package/dist/features/auctions/index.d.ts +0 -8
- package/dist/features/auctions/index.js +0 -8
- package/dist/features/auctions/manifest.js +0 -17
- package/dist/features/auctions/messages/en.json +0 -18
- package/dist/features/auctions/repository/bid.repository.d.ts +0 -256
- package/dist/features/auctions/repository/bid.repository.js +0 -575
- package/dist/features/auctions/schemas/bid-input.d.ts +0 -30
- package/dist/features/auctions/schemas/bid-input.js +0 -28
- package/dist/features/auctions/schemas/firestore.d.ts +0 -120
- package/dist/features/auctions/schemas/firestore.js +0 -73
- package/dist/features/auctions/schemas/index.d.ts +0 -170
- package/dist/features/auctions/schemas/index.js +0 -64
- package/dist/features/auctions/server.d.ts +0 -8
- package/dist/features/auctions/server.js +0 -8
- package/dist/features/auctions/types/index.d.ts +0 -74
- package/dist/features/beys/components/BeyDetailPageView.d.ts +0 -50
- package/dist/features/beys/components/BeyDetailPageView.js +0 -104
- package/dist/features/beys/schemas/firestore.d.ts +0 -417
- package/dist/features/beys/schemas/firestore.js +0 -65
- package/dist/features/cron/jobs/auction-expiry.job.d.ts +0 -27
- package/dist/features/cron/jobs/auction-expiry.job.js +0 -43
- package/dist/features/events/components/EventRaffleEntryForm.d.ts +0 -24
- package/dist/features/events/components/EventRaffleEntryForm.js +0 -46
- package/dist/features/events/components/EventRaffleWinnerView.d.ts +0 -35
- package/dist/features/events/components/EventRaffleWinnerView.js +0 -39
- package/dist/features/events/components/EventRafflesSection.d.ts +0 -42
- package/dist/features/events/components/EventRafflesSection.js +0 -96
- package/dist/features/events/components/SpinWheelView.d.ts +0 -27
- package/dist/features/events/components/SpinWheelView.js +0 -151
- package/dist/features/homepage/actions/carousel-actions.d.ts +0 -38
- package/dist/features/homepage/actions/carousel-actions.js +0 -54
- package/dist/features/homepage/api/carousel/[id]/route.d.ts +0 -23
- package/dist/features/homepage/api/carousel/[id]/route.js +0 -125
- package/dist/features/homepage/components/FeaturedAuctionsSection.d.ts +0 -18
- package/dist/features/homepage/components/FeaturedAuctionsSection.js +0 -12
- package/dist/features/homepage/hooks/useFeaturedAuctions.d.ts +0 -15
- package/dist/features/homepage/hooks/useFeaturedAuctions.js +0 -49
- package/dist/features/homepage/repository/carousel.repository.d.ts +0 -100
- package/dist/features/homepage/repository/carousel.repository.js +0 -258
- package/dist/features/homepage/repository/carousels.repository.d.ts +0 -38
- package/dist/features/homepage/repository/carousels.repository.js +0 -149
- package/dist/features/layout/BottomActionsContext.d.ts +0 -173
- package/dist/features/layout/BottomActionsContext.js +0 -175
- package/dist/features/layout/hooks/useBottomActions.d.ts +0 -37
- package/dist/features/layout/hooks/useBottomActions.js +0 -86
- package/dist/features/layout/hooks/useFormBottomActions.d.ts +0 -78
- package/dist/features/layout/hooks/useFormBottomActions.js +0 -128
- package/dist/features/lottery/repository/lottery-entry.repository.d.ts +0 -48
- package/dist/features/lottery/repository/lottery-entry.repository.js +0 -172
- package/dist/features/lottery/schemas/config-write.d.ts +0 -145
- package/dist/features/lottery/schemas/config-write.js +0 -199
- package/dist/features/lottery/schemas/firestore.d.ts +0 -77
- package/dist/features/lottery/schemas/firestore.js +0 -25
- package/dist/features/lottery/schemas/zod.d.ts +0 -113
- package/dist/features/lottery/schemas/zod.js +0 -39
- package/dist/features/lottery/types/index.d.ts +0 -72
- package/dist/features/lottery/types/index.js +0 -68
- package/dist/features/media/MediaAvatar.js +0 -13
- package/dist/features/media/MediaImage.d.ts +0 -116
- package/dist/features/media/MediaImage.js +0 -194
- package/dist/features/media/MediaLightbox.js +0 -246
- package/dist/features/media/MediaVideo.js +0 -141
- package/dist/features/parts/components/AssemblyDrawer.d.ts +0 -107
- package/dist/features/parts/components/AssemblyDrawer.js +0 -257
- package/dist/features/parts/components/ModelCompositionPanel.d.ts +0 -37
- package/dist/features/parts/components/ModelCompositionPanel.js +0 -38
- package/dist/features/parts/components/PartDetailPageView.d.ts +0 -61
- package/dist/features/parts/components/PartDetailPageView.js +0 -123
- package/dist/features/parts/components/PartsIndexPageView.d.ts +0 -42
- package/dist/features/parts/components/PartsIndexPageView.js +0 -29
- package/dist/features/parts/components/PartsSearchBox.d.ts +0 -9
- package/dist/features/parts/components/PartsSearchBox.js +0 -136
- package/dist/features/parts/schemas/admin-edit.d.ts +0 -81
- package/dist/features/parts/schemas/admin-edit.js +0 -89
- package/dist/features/parts/schemas/firestore.d.ts +0 -925
- package/dist/features/parts/schemas/firestore.js +0 -384
- package/dist/features/parts/utils/colourway-match.d.ts +0 -62
- package/dist/features/parts/utils/colourway-match.js +0 -98
- package/dist/features/parts/utils/part-breakdown.d.ts +0 -53
- package/dist/features/parts/utils/part-breakdown.js +0 -77
- package/dist/features/products/components/AuctionDetailView.d.ts +0 -16
- package/dist/features/products/components/AuctionDetailView.js +0 -13
- package/dist/features/products/components/AuctionsIndexListing.d.ts +0 -8
- package/dist/features/products/components/AuctionsIndexListing.js +0 -170
- package/dist/features/products/components/MarketplacePrizeDrawCard.d.ts +0 -34
- package/dist/features/products/components/MarketplacePrizeDrawCard.js +0 -129
- package/dist/features/products/components/PrizeDrawBottomActions.d.ts +0 -6
- package/dist/features/products/components/PrizeDrawBottomActions.js +0 -6
- package/dist/features/products/components/PrizeDrawCollage.d.ts +0 -35
- package/dist/features/products/components/PrizeDrawCollage.js +0 -91
- package/dist/features/products/components/PrizeDrawDetailPageView.d.ts +0 -27
- package/dist/features/products/components/PrizeDrawDetailPageView.js +0 -136
- package/dist/features/products/components/PrizeDrawEntryActions.d.ts +0 -32
- package/dist/features/products/components/PrizeDrawEntryActions.js +0 -104
- package/dist/features/products/components/PrizeDrawItemsEditor.d.ts +0 -13
- package/dist/features/products/components/PrizeDrawItemsEditor.js +0 -101
- package/dist/features/products/components/PrizeDrawWinnerMappingView.d.ts +0 -14
- package/dist/features/products/components/PrizeDrawWinnerMappingView.js +0 -43
- package/dist/features/products/components/PrizeDrawsIndexListing.d.ts +0 -8
- package/dist/features/products/components/PrizeDrawsIndexListing.js +0 -108
- package/dist/features/products/components/PrizeDrawsListingView.d.ts +0 -15
- package/dist/features/products/components/PrizeDrawsListingView.js +0 -37
- package/dist/features/products/components/PrizeDrawsSection.d.ts +0 -15
- package/dist/features/products/components/PrizeDrawsSection.js +0 -49
- package/dist/features/seller/components/SellerArtView.d.ts +0 -15
- package/dist/features/seller/components/SellerArtView.js +0 -6
- package/dist/features/seller/components/SellerStickersView.d.ts +0 -15
- package/dist/features/seller/components/SellerStickersView.js +0 -6
- package/dist/features/stores/api/[storeSlug]/auctions/route.d.ts +0 -23
- package/dist/features/stores/api/[storeSlug]/auctions/route.js +0 -83
- package/dist/features/stores/components/StoreAuctionsListing.d.ts +0 -7
- package/dist/features/stores/components/StoreAuctionsListing.js +0 -138
- package/dist/features/stores/components/StoreAuctionsPageView.d.ts +0 -8
- package/dist/features/stores/components/StoreAuctionsPageView.js +0 -24
- package/dist/features/stores/components/StoreAuctionsView.d.ts +0 -17
- package/dist/features/stores/components/StoreAuctionsView.js +0 -5
- package/dist/features/stores/components/StorePrizeDrawsPageView.d.ts +0 -8
- package/dist/features/stores/components/StorePrizeDrawsPageView.js +0 -24
- /package/dist/_internal/server/features/{auctions → collector-drops}/actions.d.ts +0 -0
- /package/dist/_internal/shared/listing-types/{art → art-and-stickers}/ctas.d.ts +0 -0
- /package/dist/_internal/shared/listing-types/{art → art-and-stickers}/og.d.ts +0 -0
- /package/dist/_internal/shared/listing-types/{art → art-and-stickers}/og.js +0 -0
- /package/dist/_internal/shared/listing-types/{art → art-and-stickers}/seed-factory.d.ts +0 -0
- /package/dist/_internal/shared/listing-types/{art → art-and-stickers}/seed-factory.js +0 -0
- /package/dist/_internal/shared/listing-types/{auction → clearance}/ctas.d.ts +0 -0
- /package/dist/_internal/shared/listing-types/{auction → clearance}/ctas.js +0 -0
- /package/dist/_internal/shared/listing-types/{auction → clearance}/og.d.ts +0 -0
- /package/dist/_internal/shared/listing-types/{auction → clearance}/og.js +0 -0
- /package/dist/_internal/shared/listing-types/{auction → clearance}/seed-factory.d.ts +0 -0
- /package/dist/_internal/shared/listing-types/{auction → clearance}/seed-factory.js +0 -0
- /package/dist/_internal/shared/listing-types/{prize-draw → collector-drop}/ctas.d.ts +0 -0
- /package/dist/_internal/shared/listing-types/{prize-draw → collector-drop}/ctas.js +0 -0
- /package/dist/_internal/shared/listing-types/{prize-draw → collector-drop}/og.d.ts +0 -0
- /package/dist/_internal/shared/listing-types/{prize-draw → collector-drop}/og.js +0 -0
- /package/dist/_internal/shared/listing-types/{prize-draw → collector-drop}/seed-factory.d.ts +0 -0
- /package/dist/_internal/shared/listing-types/{prize-draw → collector-drop}/seed-factory.js +0 -0
- /package/dist/features/{auctions → collector-drops}/actions/index.d.ts +0 -0
- /package/dist/features/{auctions → collector-drops}/actions/index.js +0 -0
- /package/dist/features/{auctions → collector-drops}/components/CollapsibleBidHistory.d.ts +0 -0
- /package/dist/features/{auctions → collector-drops}/components/bid-detail-fields.d.ts +0 -0
- /package/dist/features/{auctions → collector-drops}/manifest.d.ts +0 -0
- /package/dist/features/{auctions → collector-drops}/types/index.js +0 -0
- /package/dist/{features/media → ui/components}/MediaAvatar.d.ts +0 -0
- /package/dist/{features/media → ui/components}/MediaLightbox.d.ts +0 -0
- /package/dist/{features/media → ui/components}/MediaVideo.d.ts +0 -0
- /package/dist/{_internal/shared/listing-types/stickers/og.d.ts → ui/types/image-crop.js} +0 -0
- /package/dist/{_internal/shared/listing-types/stickers/og.js → ui/types/quick-field.js} +0 -0
|
@@ -12,8 +12,21 @@ import { roundRupees } from "../../../../utils/number.formatter.js";
|
|
|
12
12
|
import { ApiError, ValidationError, NotFoundError, ERROR_MESSAGES } from "../../../../errors/index.js";
|
|
13
13
|
import { ORDER_FIELDS } from "../../../../constants/field-names.js";
|
|
14
14
|
import { serverLogger } from "../../../../monitoring/index.js";
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
/*
|
|
16
|
+
* 🛑 `roundShippingUp` is NO LONGER IMPORTED HERE, and its absence is the fix.
|
|
17
|
+
* It was applied to a client-supplied `chargedRate` and the result was charged
|
|
18
|
+
* — see `CreateCheckoutOrderInput.selectedShippingQuote`. The ₹50 step now
|
|
19
|
+
* applies only where a carrier rate ENTERS the system (`toQuoteOptions`) and
|
|
20
|
+
* inside `buildShippingOptions`, never to anything a browser sent.
|
|
21
|
+
*/
|
|
22
|
+
import { toQuoteOptions, } from "../../../shared/shipping/quote.js";
|
|
23
|
+
import { unitOfWork, adminNotificationsRepository, siteSettingsRepository, userRepository, storeRepository, sellerProfileRepository, couponsRepository, claimedCouponsRepository, addressesRepository, productRepository,
|
|
24
|
+
/*
|
|
25
|
+
* Phase 3 — the split-settlement records written by the capture request, read
|
|
26
|
+
* back here so each order can record whether ITS seller's share went straight
|
|
27
|
+
* to them out of escrow. That record is the double-payment guard.
|
|
28
|
+
*/
|
|
29
|
+
payoutRepository, } from "../../../../repositories/index.js";
|
|
17
30
|
import { isIntraStateSupply } from "../../../shared/fees/calculator.js";
|
|
18
31
|
import { resolveStateKey, INDIA_STATES } from "../../../shared/fees/india-states.js";
|
|
19
32
|
import { allocatePointsAcrossGroups, pointsBaseForGroup, computePreOrderDepositAmount, lineTotalFor, resolvePointsTender, sumGroupGst, unitPriceFor, } from "../../../shared/checkout/order-math.js";
|
|
@@ -34,6 +47,15 @@ import { failedCheckoutRepository } from "../../../../features/checkout/reposito
|
|
|
34
47
|
import { sendOrderConfirmationEmail } from "../../../../features/contact/server.js";
|
|
35
48
|
import { splitCartIntoOrderGroups } from "../../../../features/orders/utils/order-splitter.js";
|
|
36
49
|
import { DEFAULT_STORE_SHIPPING_POLICY, quoteShipping, toStoreShippingPolicy, } from "../../../shared/features/shipping/mode.js";
|
|
50
|
+
/*
|
|
51
|
+
* The seller's offer, the buyer's pick, and the SERVER's price for it — the
|
|
52
|
+
* money-authority fix of 2026-11-08. `offer.ts`'s header carries the measured
|
|
53
|
+
* defect (a forged `chargedRate` of 1 moved a ₹149 order's total from ₹172.69
|
|
54
|
+
* to ₹222.69) and the reason the fix is re-resolution rather than prohibition:
|
|
55
|
+
* the buyer legitimately CHOOSES between the seller's own rate and a carrier
|
|
56
|
+
* quote, so what must be rejected is the client's AMOUNT, never its CHOICE.
|
|
57
|
+
*/
|
|
58
|
+
import { CUSTOM_SHIPPING_OPTION_ID, DEFAULT_SELLER_SHIPPING_OFFER, buildShippingOptions, impliedObligation, offerFromPolicy, platformShippingOptionId, resolveShippingSelection, toSellerShippingOffer, } from "../../../shared/features/shipping/offer.js";
|
|
37
59
|
/*
|
|
38
60
|
* D44's first consumer of `shippingUnavailable`. A store whose shipping cannot
|
|
39
61
|
* be priced is a configuration fault with a money consequence — we ship free —
|
|
@@ -57,7 +79,6 @@ import { CART_COLLECTION } from "../../../../features/cart/schemas/index.js";
|
|
|
57
79
|
// S-SBUNI-RULES 2026-05-13 — bundle cart-line stock fan-out helpers.
|
|
58
80
|
import { getCartItemMemberIds, getExpandedDecrements, bucketCartItemsByStock, isMultiMemberLine, } from "./bundle-expansion.js";
|
|
59
81
|
import { expandCartLineToOrderRows } from "./expand-order-items.js";
|
|
60
|
-
import { freezePartsOnItems } from "./freeze-parts.js";
|
|
61
82
|
import { OrderStatusValues, PaymentStatusValues, PaymentMethodValues, OutOfStockPolicyValues, } from "../../../../features/orders/schemas/index.js";
|
|
62
83
|
import { getDefaultCurrency } from "../../../../core/baseline-resolver.js";
|
|
63
84
|
import { getProviders } from "../../../../contracts/index.js";
|
|
@@ -74,18 +95,55 @@ import { amountDueNow, emiOrderFields, groupEmiGate, groupEmiQuote, groupEmiSche
|
|
|
74
95
|
import { formatShippingAddress } from "./data.js";
|
|
75
96
|
import { enforceMaxPerUserForCart } from "./prize-bundle-gates.js";
|
|
76
97
|
import { getListingRule, runSyncPreflight, assertPaymentMethodAllowed, assertEmiOptInAllowed, } from "../../../shared/checkout/rules/index.js";
|
|
98
|
+
/*
|
|
99
|
+
* Phase 1c — the PER-CART gateway choice. `assertCollectingGateway` refuses
|
|
100
|
+
* before capture (the `"online"` tender in `createCheckoutOrderAction`);
|
|
101
|
+
* `resolveCollectingGatewayForCart` is the non-throwing form, used at SETTLE
|
|
102
|
+
* where the money has already moved and a refusal would only deny the buyer
|
|
103
|
+
* the order they paid for. See `gateway-selection.ts`.
|
|
104
|
+
*/
|
|
105
|
+
import { assertCollectingGateway, resolveCollectingGatewayForCart, } from "./gateway-selection.js";
|
|
77
106
|
// The `GroupCouponDiscountResult` type is deliberately NOT imported: every
|
|
78
107
|
// call site here destructures the result inline, so naming the type would be
|
|
79
108
|
// an unused import.
|
|
80
109
|
import { computeCartCouponDiscount, computeGroupCouponDiscount, } from "../../../shared/checkout/coupon-discount.js";
|
|
81
110
|
import { revalidateGroupLines } from "./group-rule-revalidation.js";
|
|
82
|
-
import { cartIsDigitalOnly } from "../../../shared/listing-types/cart-shipping.js";
|
|
111
|
+
import { cartIsDigitalOnly, cartRequiresShipping } from "../../../shared/listing-types/cart-shipping.js";
|
|
83
112
|
import { processRefundAction } from "../refunds/actions.js";
|
|
84
113
|
import { sendNotification } from "../../../../features/admin/actions/notification-actions.js";
|
|
85
114
|
import { resolveDisplayedUpiId } from "./upi-resolution.js";
|
|
86
115
|
import { resolveSupplierIdentity } from "./supplier-identity.js";
|
|
87
116
|
import { PAYMENT_WINDOW_MS } from "../../../../features/orders/constants/payment-window.js";
|
|
88
117
|
import { assertCheckoutValueOtp } from "./value-otp-gate.js";
|
|
118
|
+
/*
|
|
119
|
+
* Item 1.39 — the blocking buyer policy agreement. Lives under
|
|
120
|
+
* `_internal/server/payments/` rather than beside the other checkout gates
|
|
121
|
+
* because BOTH order paths need it and one of them (the gateway path) takes
|
|
122
|
+
* consent in a different request from the one that places the order.
|
|
123
|
+
*/
|
|
124
|
+
import { assertBuyerPolicyConsent, attachOrdersToPolicyConsent, loadBuyerPolicyConsent, } from "../../payments/policy-consent.js";
|
|
125
|
+
/*
|
|
126
|
+
* The fulfilment question, asked of the ORDER WORKFLOW REGISTRY rather than of
|
|
127
|
+
* a listing-type literal. See the call site in `finalizeOrderPlacement`: both
|
|
128
|
+
* predicates fold the capability row together with the listing's own
|
|
129
|
+
* `digitalCode.codeDeliveryMethod` opt-in, which is the half the old
|
|
130
|
+
* `listingType === "digital-code"` comparison could not see.
|
|
131
|
+
*/
|
|
132
|
+
import { awaitsManualRelease, fulfilsOnPayment, } from "../../../shared/features/orders/workflow-registry.js";
|
|
133
|
+
/*
|
|
134
|
+
* The `pending_release` write. Server-side and transactional, so it lives
|
|
135
|
+
* beside the release action it hands the line over to rather than in the shared
|
|
136
|
+
* registry — the registry decides, this performs.
|
|
137
|
+
*/
|
|
138
|
+
import { markAwaitingRelease } from "../digital-code/release.js";
|
|
139
|
+
/*
|
|
140
|
+
* 🛑 The ONLY legal way to read `finalSale`. The field is optional and the
|
|
141
|
+
* platform default is TRUE, so `!p.finalSale` and `p.finalSale === true` both
|
|
142
|
+
* misread absence — see the helper's own header. Imported from the defining
|
|
143
|
+
* module rather than a barrel: it is a pure predicate with no firebase-admin
|
|
144
|
+
* in its chain.
|
|
145
|
+
*/
|
|
146
|
+
import { isFinalSale } from "../../../../features/products/constants/final-sale.js";
|
|
89
147
|
const AUDIT_LOG_FAIL_MSG = "checkout: audit log failed (non-critical)";
|
|
90
148
|
/**
|
|
91
149
|
* How long a `gatewayOrderClaims` holder owns the right to place an order
|
|
@@ -278,6 +336,9 @@ opts) {
|
|
|
278
336
|
storeEmiEnabled: false,
|
|
279
337
|
storeState: undefined,
|
|
280
338
|
shippingPolicy: DEFAULT_STORE_SHIPPING_POLICY,
|
|
339
|
+
// No store, so no offer. The default is custom at ₹0 — the same thing
|
|
340
|
+
// `DEFAULT_STORE_SHIPPING_POLICY` says, and for the same reason.
|
|
341
|
+
shippingOffer: { ...DEFAULT_SELLER_SHIPPING_OFFER },
|
|
281
342
|
shippingUnavailable: false,
|
|
282
343
|
storeProtections: { shipping: false, sale: false },
|
|
283
344
|
// No store, so no seller to absorb a redemption.
|
|
@@ -287,6 +348,9 @@ opts) {
|
|
|
287
348
|
// No store, so no seller registration — the caller falls back to the
|
|
288
349
|
// platform's via resolveSupplierIdentity.
|
|
289
350
|
storeTaxIdentity: undefined,
|
|
351
|
+
// No store, so no vendor. The split builder treats that as NOT settleable
|
|
352
|
+
// and refuses the capture rather than collecting into our own account.
|
|
353
|
+
settlementVendors: undefined,
|
|
290
354
|
};
|
|
291
355
|
}
|
|
292
356
|
const store = await storeRepository.findById(storeId);
|
|
@@ -398,6 +462,21 @@ opts) {
|
|
|
398
462
|
storeEmiEnabled,
|
|
399
463
|
storeState,
|
|
400
464
|
shippingPolicy: policy,
|
|
465
|
+
/*
|
|
466
|
+
* 🛑 Resolved from the STORED `shippingPricing` document, falling back to
|
|
467
|
+
* the offer the legacy single mode implies — never from anything the
|
|
468
|
+
* client sent. `toSellerShippingOffer` reads the explicit `offer` when the
|
|
469
|
+
* seller has saved one and derives it from `mode` otherwise, so there is
|
|
470
|
+
* one stored field and one reader rather than a second config system
|
|
471
|
+
* (`mode.ts`'s header records what happened last time there were two).
|
|
472
|
+
*
|
|
473
|
+
* `store?.shippingPricing` is passed rather than `policy`, because the
|
|
474
|
+
* explicit offer is a sibling of `mode` on that document and `policy` has
|
|
475
|
+
* already discarded it.
|
|
476
|
+
*/
|
|
477
|
+
shippingOffer: store?.shippingPricing
|
|
478
|
+
? toSellerShippingOffer(store.shippingPricing)
|
|
479
|
+
: offerFromPolicy(policy),
|
|
401
480
|
shippingUnavailable: quote.kind === "unavailable",
|
|
402
481
|
storeProtections: {
|
|
403
482
|
shipping: store?.supportsShippingProtection === true,
|
|
@@ -429,8 +508,106 @@ opts) {
|
|
|
429
508
|
registeredAddress: store.registeredAddress,
|
|
430
509
|
}
|
|
431
510
|
: undefined,
|
|
511
|
+
/*
|
|
512
|
+
* Raw and per gateway — see the field's own 🛑. The store document is
|
|
513
|
+
* already in hand, so this costs nothing; deciding settleability here would
|
|
514
|
+
* mean guessing which gateway collects.
|
|
515
|
+
*/
|
|
516
|
+
settlementVendors: store?.settlementVendors,
|
|
432
517
|
};
|
|
433
518
|
}
|
|
519
|
+
/**
|
|
520
|
+
* The carrier options for a destination, obtained SERVER-SIDE at order time.
|
|
521
|
+
*
|
|
522
|
+
* ## 🛑 This outbound call is the whole point
|
|
523
|
+
*
|
|
524
|
+
* `CreateCheckoutOrderInput.selectedShippingQuote` used to carry the rates, and
|
|
525
|
+
* its own docstring conceded the gap: *"the gap worth closing is re-quoting the
|
|
526
|
+
* carrier at order time, which costs an outbound call on the payment path and
|
|
527
|
+
* is tracked separately."* It is closed here. One call, only for a seller who
|
|
528
|
+
* actually accepts carrier quotes, and only when the buyer picked one — a cart
|
|
529
|
+
* whose seller ships their own way performs no call at all.
|
|
530
|
+
*
|
|
531
|
+
* ## 🛑 Returns `[]` on EVERY failure, and `[]` means "no platform option"
|
|
532
|
+
*
|
|
533
|
+
* Not "free", and not "trust whatever the client said". An empty list makes
|
|
534
|
+
* `resolveShippingSelection` refuse a platform pick with
|
|
535
|
+
* `no-method-available`, which is the owner's own rule for this case: *"the
|
|
536
|
+
* platform option is ABSENT at checkout rather than guessed."* The alternatives
|
|
537
|
+
* are both money defects — guessing a rate charges the buyer a number no
|
|
538
|
+
* carrier quoted, and falling back to the client's figure is the defect this
|
|
539
|
+
* whole change exists to remove.
|
|
540
|
+
*
|
|
541
|
+
* Today the registered provider is `ManualShippingProvider`, whose
|
|
542
|
+
* `checkServiceability` returns `{ isServiceable: true, couriers: [] }` — so
|
|
543
|
+
* this legitimately yields zero options on every call until a real carrier
|
|
544
|
+
* account is wired, and a forged platform pick is therefore REFUSED rather than
|
|
545
|
+
* mispriced. Measured, not assumed: `providers.config.ts` defaults
|
|
546
|
+
* `siteSettings.shipping.provider` to `"manual"`.
|
|
547
|
+
*/
|
|
548
|
+
async function carrierOptionsForDestination(pincode, weightKg) {
|
|
549
|
+
if (!pincode)
|
|
550
|
+
return [];
|
|
551
|
+
const shipping = getProviders().shipping;
|
|
552
|
+
if (!shipping) {
|
|
553
|
+
serverLogger.error("checkout carrier re-quote: no shipping provider registered", {
|
|
554
|
+
pincode,
|
|
555
|
+
});
|
|
556
|
+
return [];
|
|
557
|
+
}
|
|
558
|
+
try {
|
|
559
|
+
const result = await shipping.checkServiceability(pincode, weightKg);
|
|
560
|
+
if (!result.isServiceable)
|
|
561
|
+
return [];
|
|
562
|
+
return toQuoteOptions(result.couriers);
|
|
563
|
+
}
|
|
564
|
+
catch (err) {
|
|
565
|
+
/*
|
|
566
|
+
* A carrier outage must not 500 a checkout. It removes the platform option
|
|
567
|
+
* — which is a refusal the buyer can act on ("choose the seller's own
|
|
568
|
+
* shipping, or retry") — rather than taking the order at a price nobody
|
|
569
|
+
* quoted.
|
|
570
|
+
*/
|
|
571
|
+
serverLogger.error("checkout carrier re-quote failed", {
|
|
572
|
+
pincode,
|
|
573
|
+
err: err instanceof Error ? err.message : String(err),
|
|
574
|
+
});
|
|
575
|
+
return [];
|
|
576
|
+
}
|
|
577
|
+
}
|
|
578
|
+
/**
|
|
579
|
+
* The carrier's own minimum weight slab, used when the cart cannot say what the
|
|
580
|
+
* parcel weighs.
|
|
581
|
+
*
|
|
582
|
+
* Same figure and same reasoning as `POST /api/shipping/quote`: the cart does
|
|
583
|
+
* not reliably carry per-item weights, 0.5 kg is the carrier's own floor, and a
|
|
584
|
+
* heavier parcel quotes low — which the reconciliation rule already handles by
|
|
585
|
+
* making the seller absorb the difference. Shared as a constant so the quote
|
|
586
|
+
* the buyer was shown and the quote the order is priced from cannot differ by
|
|
587
|
+
* their default weight.
|
|
588
|
+
*/
|
|
589
|
+
export const CHECKOUT_DEFAULT_PARCEL_WEIGHT_KG = 0.5;
|
|
590
|
+
/**
|
|
591
|
+
* Which option id the buyer's posted pick corresponds to.
|
|
592
|
+
*
|
|
593
|
+
* 🛑 Reads the IDENTITY out of `selectedShippingQuote` and discards every
|
|
594
|
+
* amount on it. That object is a legacy wire shape carrying
|
|
595
|
+
* `rawRate`/`chargedRate`, and those two numbers are precisely what must not
|
|
596
|
+
* reach the total — so this function exists to make the narrowing mechanical
|
|
597
|
+
* rather than a thing each call site has to remember.
|
|
598
|
+
*
|
|
599
|
+
* A pick whose `courierId` is the literal custom id maps to the custom option;
|
|
600
|
+
* `platformShippingOptionId` namespaces carrier ids for exactly that reason, so
|
|
601
|
+
* a carrier returning `"custom"` cannot land a buyer on the wrong side of the
|
|
602
|
+
* fulfilment obligation.
|
|
603
|
+
*/
|
|
604
|
+
function requestedShippingOptionId(quote) {
|
|
605
|
+
if (!quote?.courierId)
|
|
606
|
+
return undefined;
|
|
607
|
+
if (quote.courierId === CUSTOM_SHIPPING_OPTION_ID)
|
|
608
|
+
return CUSTOM_SHIPPING_OPTION_ID;
|
|
609
|
+
return platformShippingOptionId(quote.courierId);
|
|
610
|
+
}
|
|
434
611
|
/**
|
|
435
612
|
* The pre-C5b flat number, read as a `flat` mode.
|
|
436
613
|
*
|
|
@@ -440,8 +617,9 @@ opts) {
|
|
|
440
617
|
async function legacyFlatPolicy(storeOwnerId) {
|
|
441
618
|
if (!storeOwnerId)
|
|
442
619
|
return DEFAULT_STORE_SHIPPING_POLICY;
|
|
443
|
-
|
|
444
|
-
const
|
|
620
|
+
// shippingConfig is seller-only data — sellerProfiles, not users.
|
|
621
|
+
const sellerProfile = await sellerProfileRepository.findById(storeOwnerId);
|
|
622
|
+
const legacy = sellerProfile ? sellerProfileRepository.revealProfile(sellerProfile).shippingConfig : undefined;
|
|
445
623
|
if (!legacy?.isConfigured)
|
|
446
624
|
return DEFAULT_STORE_SHIPPING_POLICY;
|
|
447
625
|
const amount = legacy.customShippingPrice ?? 0;
|
|
@@ -729,15 +907,127 @@ async function settlePointsTender(input) {
|
|
|
729
907
|
});
|
|
730
908
|
}
|
|
731
909
|
}
|
|
910
|
+
/**
|
|
911
|
+
* §Payment cross-gateway duplication pass (overhaul brief, 2026-11-05) —
|
|
912
|
+
* the ~45-line post-write side-effect tail `createOrderForGroup` and
|
|
913
|
+
* `createPhonePeGroupOrder` both ran in the exact same order, independently
|
|
914
|
+
* copy-pasted: settlePointsTender → finalizeLockedLines → digital-code
|
|
915
|
+
* claim → coupon-usage accumulation → email queueing →
|
|
916
|
+
* emitOrderPlacedNotifications. Pure sequencing, no business-logic
|
|
917
|
+
* branching between the two copies — the plan's own read-first pass found
|
|
918
|
+
* this the one real, clean consolidation candidate (the order-literal
|
|
919
|
+
* assembly itself is NOT: real per-gateway field differences there trip
|
|
920
|
+
* the Duplication Decision Framework's keep-separate rule).
|
|
921
|
+
*
|
|
922
|
+
* `paymentMethod`/`paid` are the only two values that differ between the
|
|
923
|
+
* two original call sites (dynamic on the manual/COD path, a fixed
|
|
924
|
+
* `PaymentMethodValues.ONLINE`/`true` on the online-gateway path) — both
|
|
925
|
+
* are caller-supplied params here rather than re-derived, so this function
|
|
926
|
+
* makes no payment-method assumption of its own.
|
|
927
|
+
*
|
|
928
|
+
* `emailsToSend` is the SAME shared, whole-checkout accumulator array both
|
|
929
|
+
* original call sites pushed into directly (mutated by reference, same
|
|
930
|
+
* pattern `couponUsageAccumulator` already uses) — not a return value,
|
|
931
|
+
* since the caller flushes it once per whole checkout, not per group.
|
|
932
|
+
*/
|
|
933
|
+
async function finalizeOrderPlacement(input) {
|
|
934
|
+
const { orderId, uid, group, pointsApplied, pointsBudget, firstItem, userEmail, userName, groupCouponCodes, couponUsageAccumulator, emailsToSend, orderItems, totalQuantity, orderTotal, shippingAddress, paymentMethod, storeOwnerId, paid, storeId, } = input;
|
|
935
|
+
// The second half of the points tender — see `settlePointsTender`. Runs
|
|
936
|
+
// before the caller asks the gateway for anything.
|
|
937
|
+
await settlePointsTender({ orderId, userId: uid, pointsApplied, pointsBudget });
|
|
938
|
+
// Close the loop on any locked line this order settled: flip the offer to
|
|
939
|
+
// "paid" (its terminal status had NO server-side writer before 2026-08-21,
|
|
940
|
+
// so an accepted offer could be re-added and re-ordered) and back-link the
|
|
941
|
+
// winning bid to the order it became.
|
|
942
|
+
await finalizeLockedLines(group.map(({ item }) => item), orderId);
|
|
943
|
+
/*
|
|
944
|
+
* SB-UNI-N — fulfilment on payment, decided by CAPABILITY and by the
|
|
945
|
+
* seller's own opt-in. Fire-and-forget on the claim: the order is already
|
|
946
|
+
* persisted, so an exhausted pool is logged rather than thrown.
|
|
947
|
+
*
|
|
948
|
+
* 🛑 This used to read `listingType === "digital-code"`, which was wrong in a
|
|
949
|
+
* way a typecheck could never see. `digitalCode.codeDeliveryMethod` is
|
|
950
|
+
* seller-settable (`auto-claim` | `manual-email`), is in the seller form, is
|
|
951
|
+
* validated by the request schema, and two seeded listings already carry
|
|
952
|
+
* `manual-email` — but the type comparison auto-claimed a code regardless.
|
|
953
|
+
* A seller who deliberately chose to release codes by hand got instant issue
|
|
954
|
+
* anyway, and the setting looked implemented while doing nothing.
|
|
955
|
+
*
|
|
956
|
+
* `fulfilsOnPayment` / `awaitsManualRelease` answer the two questions this
|
|
957
|
+
* site actually has ("does this line complete on its own when the money
|
|
958
|
+
* lands?" / "is a human release owed?") out of
|
|
959
|
+
* `fulfilmentModeFor`, which reads the capability registry × the listing's
|
|
960
|
+
* opt-in. So enabling instant or deferred fulfilment on another listing type
|
|
961
|
+
* is a capability-row edit plus that type's flag — never an edit here.
|
|
962
|
+
*
|
|
963
|
+
* 🛑 `markAwaitingRelease` is AWAITED while the claim is not, and the
|
|
964
|
+
* asymmetry is deliberate: a claim that fails leaves the pool untouched and
|
|
965
|
+
* the line simply undelivered, whereas a `pending_release` that fails to
|
|
966
|
+
* write leaves a paid line indistinguishable from one whose pool was empty —
|
|
967
|
+
* the ambiguity that function exists to remove. One of those is a normal
|
|
968
|
+
* state the buyer should see; the other is an incident.
|
|
969
|
+
*/
|
|
970
|
+
const fulfilmentProduct = group[0]?.product;
|
|
971
|
+
if (fulfilsOnPayment(fulfilmentProduct?.listingType, fulfilmentProduct)) {
|
|
972
|
+
claimDigitalCodeForOrder(getAdminDb(), firstItem.productId, orderId, uid, {
|
|
973
|
+
userEmail: userEmail || undefined,
|
|
974
|
+
userName,
|
|
975
|
+
productTitle: firstItem.productTitle,
|
|
976
|
+
}).catch((e) => serverLogger.error("claimDigitalCode", { error: normalizeError(e).message }));
|
|
977
|
+
}
|
|
978
|
+
else if (awaitsManualRelease(fulfilmentProduct?.listingType, fulfilmentProduct)) {
|
|
979
|
+
await markAwaitingRelease(orderId, firstItem.productId);
|
|
980
|
+
}
|
|
981
|
+
for (const code of groupCouponCodes) {
|
|
982
|
+
const entry = couponUsageAccumulator.get(code);
|
|
983
|
+
if (entry)
|
|
984
|
+
entry.orderIds.push(orderId);
|
|
985
|
+
}
|
|
986
|
+
if (userEmail) {
|
|
987
|
+
emailsToSend.push({
|
|
988
|
+
to: userEmail,
|
|
989
|
+
userName,
|
|
990
|
+
orderId,
|
|
991
|
+
productTitle: orderItems.length > 1 ? `${orderItems.length} items` : firstItem.productTitle,
|
|
992
|
+
quantity: totalQuantity,
|
|
993
|
+
totalPrice: orderTotal,
|
|
994
|
+
currency: firstItem.currency ?? getDefaultCurrency(),
|
|
995
|
+
shippingAddress,
|
|
996
|
+
paymentMethod,
|
|
997
|
+
items: orderItems,
|
|
998
|
+
});
|
|
999
|
+
}
|
|
1000
|
+
emitOrderPlacedNotifications({
|
|
1001
|
+
orderId,
|
|
1002
|
+
buyerUid: uid,
|
|
1003
|
+
buyerName: userName,
|
|
1004
|
+
storeOwnerId,
|
|
1005
|
+
productLabel: orderItems.length > 1 ? `${orderItems.length} items` : firstItem.productTitle,
|
|
1006
|
+
paid,
|
|
1007
|
+
storeId,
|
|
1008
|
+
});
|
|
1009
|
+
}
|
|
732
1010
|
/**
|
|
733
1011
|
* Places one order for one seller-group of the checkout cart — fee math
|
|
734
1012
|
* (COD deposit/handling, EMI schedule), coupon apportionment, order-doc
|
|
735
1013
|
* creation, digital-code claim, and notification fan-out. Pushes into
|
|
736
|
-
* `ctx.orderIds` / `ctx.emailsToSend` and returns the group's
|
|
737
|
-
* so the caller can accumulate
|
|
1014
|
+
* `ctx.orderIds` / `ctx.emailsToSend` and returns the group's full,
|
|
1015
|
+
* fee-inclusive charged total (`orderTotal`) so the caller can accumulate
|
|
1016
|
+
* the checkout-wide `total` — 🛑 CORRECTED 2026-11-05: this used to return
|
|
1017
|
+
* `groupTotal` (the pre-fee goods subtotal only), while the sibling
|
|
1018
|
+
* `createPhonePeGroupOrder` returned `orderTotal` (the full amount) under
|
|
1019
|
+
* the identically-typed, identically-named `CheckoutOrderResult.total`.
|
|
1020
|
+
* Confirmed latent, not live-user-visible (the checkout success page reads
|
|
1021
|
+
* the freshly-fetched Firestore order's own `totalPrice`, which was always
|
|
1022
|
+
* `orderTotal`-correct on both paths) — but the in-memory return value is
|
|
1023
|
+
* summed across every seller-group in `orderGroups.reduce`-style checkout
|
|
1024
|
+
* orchestration, where only the full fee-inclusive figure is the correct
|
|
1025
|
+
* term (shipping/GST/fees are computed per-group already, never shared
|
|
1026
|
+
* across groups, so summing `orderTotal` per group cannot double-count
|
|
1027
|
+
* anything here).
|
|
738
1028
|
*/
|
|
739
1029
|
async function createOrderForGroup(group, orderType, ctx) {
|
|
740
|
-
const { paymentMethod, emiOptIn, emiTenureMonths, emiSettings, commissions, appliedCoupons, cartSubtotal, couponUsageAccumulator, uid, userName, userEmail, shippingAddress, deliverySnapshot, notes, adminBypass, adminBypassBy, adminBatchId, orderIds, emailsToSend, outOfStockPolicy, droppedItems, buyerState, gstSettings, siteContactUpiVpa, storeAddons, platformFeeByStore, selectedShippingQuote, useAllPoints, pointsBudget, } = ctx;
|
|
1030
|
+
const { paymentMethod, emiOptIn, emiTenureMonths, emiSettings, commissions, appliedCoupons, cartSubtotal, couponUsageAccumulator, uid, userName, userEmail, shippingAddress, deliverySnapshot, notes, adminBypass, adminBypassBy, adminBatchId, orderIds, emailsToSend, outOfStockPolicy, droppedItems, buyerState, gstSettings, siteContactUpiVpa, storeAddons, policyConsent, platformFeeByStore, selectedShippingQuote, selectedShippingOptions, useAllPoints, pointsBudget, } = ctx;
|
|
741
1031
|
const firstItem = group[0].item;
|
|
742
1032
|
const firstProduct = group[0].product;
|
|
743
1033
|
// Add-ons are this store's choice, not the cart's — see OrderGroupContext.
|
|
@@ -788,7 +1078,14 @@ async function createOrderForGroup(group, orderType, ctx) {
|
|
|
788
1078
|
* capped. It never throws — a parts list we could not read must not fail a
|
|
789
1079
|
* payment (see the module header).
|
|
790
1080
|
*/
|
|
791
|
-
|
|
1081
|
+
/*
|
|
1082
|
+
* Part 14 (parts freezing) REMOVED 2026-11-08 — owner decision. The parts
|
|
1083
|
+
* taxonomy (partGlossary · modelComposition) leaves the shop database
|
|
1084
|
+
* entirely; the wiki owns it as JSON and will expose an API for it, the way
|
|
1085
|
+
* it already does for tools. There is no composition to read here any more,
|
|
1086
|
+
* so this is the pure expansion it always wanted to be.
|
|
1087
|
+
*/
|
|
1088
|
+
const orderItems = baseOrderItems;
|
|
792
1089
|
const totalQuantity = group.reduce((sum, { item }) => sum + item.quantity, 0);
|
|
793
1090
|
/*
|
|
794
1091
|
* D44: the group's real goods value, so free-above-threshold can fire.
|
|
@@ -798,25 +1095,133 @@ async function createOrderForGroup(group, orderType, ctx) {
|
|
|
798
1095
|
* grouped line the two differ.
|
|
799
1096
|
*/
|
|
800
1097
|
const groupGoodsValue = group.reduce((sum, { item, product }) => sum + lineTotalFor(item, product), 0);
|
|
801
|
-
const { shippingFee: resolvedShippingFee, storeOwnerId, storeEmiEnabled, storeState, storeProtections, storeTaxIdentity, acceptsPoints, sharedPurchaseRates } = await resolveShippingCost(firstItem.storeId, { goodsValue: groupGoodsValue });
|
|
1098
|
+
const { shippingFee: resolvedShippingFee, shippingOffer, storeOwnerId, storeEmiEnabled, storeState, storeProtections, storeTaxIdentity, acceptsPoints, sharedPurchaseRates } = await resolveShippingCost(firstItem.storeId, { goodsValue: groupGoodsValue });
|
|
802
1099
|
/*
|
|
803
|
-
*
|
|
804
|
-
*
|
|
1100
|
+
* ════════════════════════════════════════════════════════════════════════
|
|
1101
|
+
* 🛑 SERVER AUTHORITY OVER THE SHIPPING FEE — owner's spec, 2026-11-08
|
|
1102
|
+
* ════════════════════════════════════════════════════════════════════════
|
|
1103
|
+
*
|
|
1104
|
+
* ## What was here, and what it cost
|
|
1105
|
+
*
|
|
1106
|
+
* shippingFee = roundShippingUp(selectedShippingQuote.chargedRate)
|
|
1107
|
+
*
|
|
1108
|
+
* `resolveShippingCost` was called, its answer destructured, and then
|
|
1109
|
+
* DISCARDED whenever the client posted a quote. Measured live on a ₹149 item:
|
|
1110
|
+
* an honest request charged **₹172.69**; a forged `{ chargedRate: 1 }`
|
|
1111
|
+
* charged **₹222.69**. A client-supplied number reached the charged total.
|
|
805
1112
|
*
|
|
806
|
-
*
|
|
807
|
-
*
|
|
808
|
-
*
|
|
809
|
-
*
|
|
1113
|
+
* The comment that stood here argued the trust was bounded because
|
|
1114
|
+
* `roundShippingUp` re-rounds the value. It does — onto a ₹50 step. ₹1
|
|
1115
|
+
* becomes ₹50 and ₹10,000 stays ₹10,000, so the "bound" was the attacker's
|
|
1116
|
+
* choice of multiple of fifty, in either direction. Undercutting was
|
|
1117
|
+
* unexploitable only because no seeded store had `shippingPricing` set, so
|
|
1118
|
+
* every resolved fee was ₹0 — a data accident due to expire the moment a
|
|
1119
|
+
* vendor saved a real rate.
|
|
810
1120
|
*
|
|
811
|
-
*
|
|
812
|
-
*
|
|
1121
|
+
* ## 🛑 Why the fix is NOT "reject any client shipping value"
|
|
1122
|
+
*
|
|
1123
|
+
* The owner's spec gives the buyer a real choice between the seller's own
|
|
1124
|
+
* rate and a live carrier quote, *"if they find the other cheap they can
|
|
1125
|
+
* choose whatever they wish"*. So the client MUST be able to say which option
|
|
1126
|
+
* it picked. What it must never say is what that option costs.
|
|
1127
|
+
*
|
|
1128
|
+
* Hence: the posted object contributes its `courierId` ONLY
|
|
1129
|
+
* (`requestedShippingOptionId` discards `rawRate` and `chargedRate`), the
|
|
1130
|
+
* option is re-priced from the seller's STORED offer plus a carrier quote
|
|
1131
|
+
* this server obtained itself, and an option the seller does not offer is a
|
|
1132
|
+
* REFUSAL rather than a fallback — charging the buyer for a method they did
|
|
1133
|
+
* not choose is the same wrong pointing the other way.
|
|
1134
|
+
*
|
|
1135
|
+
* ## 🛑 `shippingRequired` is a CAPABILITY read
|
|
1136
|
+
*
|
|
1137
|
+
* `cartRequiresShipping` asks the registry for `supportsShipping` on each
|
|
1138
|
+
* line. A digital-code group therefore acquires no fee and no fulfilment
|
|
1139
|
+
* obligation — not because this code knows what a digital code is, but
|
|
1140
|
+
* because no line in it supports shipping. No `listingType ===` anywhere.
|
|
1141
|
+
*
|
|
1142
|
+
* ## 🛑 Still FIRST GROUP ONLY
|
|
1143
|
+
*
|
|
1144
|
+
* Unchanged from before and for the unchanged reason: the picker quotes one
|
|
1145
|
+
* destination, and a cart split across sellers must not be charged the same
|
|
1146
|
+
* parcel rate once per seller. See the field's note on `OrderGroupContext`.
|
|
813
1147
|
*/
|
|
814
1148
|
const isFirstGroup = ctx.orderIds.length === 0;
|
|
815
|
-
const
|
|
816
|
-
|
|
817
|
-
|
|
1149
|
+
const groupRequiresShipping = cartRequiresShipping(group.map(({ product }) => ({ listingType: product.listingType })));
|
|
1150
|
+
/*
|
|
1151
|
+
* 🛑 THE PER-STORE PICK WINS, and the legacy cart-wide one is the fallback.
|
|
1152
|
+
*
|
|
1153
|
+
* `selectedShippingOptions[storeId]` is the shape the owner's spec needs —
|
|
1154
|
+
* each seller offers their own methods, so each group has its own answer, and
|
|
1155
|
+
* `mocks/18-shipping-fees.qm` shows two shipping lines in one order summary.
|
|
1156
|
+
* The legacy `selectedShippingQuote` stays usable for a tab opened before
|
|
1157
|
+
* that field existed, and stays FIRST-GROUP-ONLY for the reason it always
|
|
1158
|
+
* was: it quoted one destination for the whole cart, so honouring it on every
|
|
1159
|
+
* group would charge a multi-seller cart the same parcel rate N times.
|
|
1160
|
+
*/
|
|
1161
|
+
const requestedOptionId = selectedShippingOptions?.[firstItem.storeId] ??
|
|
1162
|
+
(isFirstGroup ? requestedShippingOptionId(selectedShippingQuote) : undefined);
|
|
1163
|
+
/*
|
|
1164
|
+
* The outbound call is skipped unless it can change the answer: the seller
|
|
1165
|
+
* must accept carrier quotes AND the buyer must have picked one. An ordinary
|
|
1166
|
+
* checkout against a self-shipping seller performs no carrier call at all,
|
|
1167
|
+
* which is what keeps this inside Rule #6's round-trip budget.
|
|
1168
|
+
*/
|
|
1169
|
+
const needsCarrierQuote = groupRequiresShipping &&
|
|
1170
|
+
shippingOffer.platformQuotesAccepted &&
|
|
1171
|
+
requestedOptionId !== undefined &&
|
|
1172
|
+
requestedOptionId !== CUSTOM_SHIPPING_OPTION_ID;
|
|
1173
|
+
const carrierOptions = needsCarrierQuote
|
|
1174
|
+
? await carrierOptionsForDestination(deliverySnapshot?.deliveryPincode, CHECKOUT_DEFAULT_PARCEL_WEIGHT_KG)
|
|
1175
|
+
: [];
|
|
1176
|
+
const selection = resolveShippingSelection({
|
|
1177
|
+
shippingRequired: groupRequiresShipping,
|
|
1178
|
+
offer: shippingOffer,
|
|
1179
|
+
goodsValue: groupGoodsValue,
|
|
1180
|
+
carrierOptions,
|
|
1181
|
+
requestedOptionId,
|
|
1182
|
+
});
|
|
1183
|
+
/*
|
|
1184
|
+
* 🛑 REFUSES rather than falling back, and the refusal happens BEFORE any
|
|
1185
|
+
* money moves on this path (`createCheckoutOrderAction` is the COD/manual
|
|
1186
|
+
* entry point; the gateway path runs the same resolution inside
|
|
1187
|
+
* `verifyAndPlaceGatewayOrderAction`). `groupEmiGate` directly below sets the
|
|
1188
|
+
* precedent and states the reason: *"silently producing a full-price order
|
|
1189
|
+
* from an EMI request is money the buyer did not agree to."* Silently
|
|
1190
|
+
* producing a differently-shipped order from a shipping request is the same
|
|
1191
|
+
* class of wrong.
|
|
1192
|
+
*/
|
|
1193
|
+
if (selection.kind === "refused") {
|
|
1194
|
+
throw new ValidationError(selection.message);
|
|
1195
|
+
}
|
|
1196
|
+
const shippingFee = selection.kind === "resolved"
|
|
1197
|
+
? selection.option.amount
|
|
1198
|
+
: selection.kind === "not-required"
|
|
818
1199
|
? 0
|
|
819
|
-
:
|
|
1200
|
+
: /*
|
|
1201
|
+
* `unselected` — this seller got no pick, so their stored single-mode
|
|
1202
|
+
* policy answers, exactly as it did before the picker existed. Still
|
|
1203
|
+
* a SERVER number: `resolveShippingCost` computed it from
|
|
1204
|
+
* `shippingPricing`, and nothing the client sent is in it.
|
|
1205
|
+
*
|
|
1206
|
+
* 🛑 The one case that charges ₹0 instead: a LATER group under the
|
|
1207
|
+
* LEGACY cart-wide quote, with no per-store pick anywhere. That quote
|
|
1208
|
+
* priced one parcel to one destination, so billing it again here
|
|
1209
|
+
* would charge the buyer twice for one courier — the behaviour this
|
|
1210
|
+
* branch has always had, preserved deliberately rather than
|
|
1211
|
+
* inherited. A per-store pick never reaches it.
|
|
1212
|
+
*/
|
|
1213
|
+
isFirstGroup || !selectedShippingQuote || selectedShippingOptions
|
|
1214
|
+
? resolvedShippingFee
|
|
1215
|
+
: 0;
|
|
1216
|
+
/**
|
|
1217
|
+
* What the buyer committed to, frozen so part C of the spec is evidenced.
|
|
1218
|
+
*
|
|
1219
|
+
* 🛑 Written only on the group that actually CARRIES the fee. A later group
|
|
1220
|
+
* in a multi-seller cart is charged ₹0 shipping, and recording a
|
|
1221
|
+
* self-fulfilment obligation there would bind a seller to a price they were
|
|
1222
|
+
* never paid.
|
|
1223
|
+
*/
|
|
1224
|
+
const shippingObligation = selection.kind === "resolved" ? selection.obligation : undefined;
|
|
820
1225
|
/*
|
|
821
1226
|
* Who issues this invoice — the seller if they have their own GSTIN, the
|
|
822
1227
|
* platform otherwise. ONE function decides, and it is the only place that
|
|
@@ -1216,7 +1621,7 @@ async function createOrderForGroup(group, orderType, ctx) {
|
|
|
1216
1621
|
orderType,
|
|
1217
1622
|
// How the buyer earned the right to buy at this price. `orderType` cannot
|
|
1218
1623
|
// answer that — it has five values, and both a settled win and a buyout
|
|
1219
|
-
// are "
|
|
1624
|
+
// are "collector-drop". Written ONCE here and never recomputed: the collector drop and
|
|
1220
1625
|
// offer documents it summarises are mutable and eventually archived.
|
|
1221
1626
|
sourceContext,
|
|
1222
1627
|
/*
|
|
@@ -1225,13 +1630,46 @@ async function createOrderForGroup(group, orderType, ctx) {
|
|
|
1225
1630
|
* carries the shipping fee — a later group in a multi-seller cart is
|
|
1226
1631
|
* charged ₹0 shipping, so recording a quote there would invite a credit
|
|
1227
1632
|
* against money that group never collected.
|
|
1633
|
+
*
|
|
1634
|
+
* 🛑 REBUILT FROM THE SERVER'S RESOLUTION, not from the posted object.
|
|
1635
|
+
* `rawRate` is the carrier's own figure as WE re-quoted it; it used to be
|
|
1636
|
+
* whatever the client sent, which meant `reconcileShipping` later compared
|
|
1637
|
+
* a seller's real spend against a buyer-supplied number. Only a platform
|
|
1638
|
+
* option has a carrier rate at all — the seller's own price is not a
|
|
1639
|
+
* carrier quote and must not masquerade as one, so a custom pick records
|
|
1640
|
+
* the obligation below and no `selectedShippingQuote`.
|
|
1228
1641
|
*/
|
|
1229
|
-
selectedShippingQuote:
|
|
1230
|
-
? {
|
|
1642
|
+
selectedShippingQuote: selection.kind === "resolved" && selection.option.kind === "platform"
|
|
1643
|
+
? {
|
|
1644
|
+
courierId: selection.option.courierId ?? selection.option.optionId,
|
|
1645
|
+
courierName: selection.option.courierName ?? selection.option.label,
|
|
1646
|
+
rawRate: carrierOptions.find((c) => c.courierId === selection.option.courierId)?.rawRate ??
|
|
1647
|
+
selection.option.amount,
|
|
1648
|
+
chargedRate: shippingFee,
|
|
1649
|
+
estimatedDays: selection.option.estimatedDays ?? 0,
|
|
1650
|
+
// Stamped server-side. A buyer-supplied timestamp is unverifiable,
|
|
1651
|
+
// and this field exists so a stale quote is recognisable later.
|
|
1652
|
+
quotedAt: new Date(),
|
|
1653
|
+
}
|
|
1231
1654
|
: undefined,
|
|
1655
|
+
/*
|
|
1656
|
+
* ── PART C: THE FULFILMENT OBLIGATION, RECORDED ───────────────────────
|
|
1657
|
+
*
|
|
1658
|
+
* Owner: *"if they have selected that, then it is up to the seller to
|
|
1659
|
+
* fulfil as is, they cannot use the platform to ship for the other, as we
|
|
1660
|
+
* have already taken money from the customer."*
|
|
1661
|
+
*
|
|
1662
|
+
* 🛑 Written at checkout because the rule is BROKEN at pack time, possibly
|
|
1663
|
+
* days later. A rule nobody can evidence after the fact is not a rule —
|
|
1664
|
+
* `mayBookPlatformLabel` reads this one field, and `reconcileShipping`
|
|
1665
|
+
* already computes both money directions (excess back to the buyer,
|
|
1666
|
+
* shortfall absorbed by the seller) from `chargedAmount` versus the real
|
|
1667
|
+
* spend. This flag is what says which of them the seller agreed to.
|
|
1668
|
+
*/
|
|
1669
|
+
shippingObligation,
|
|
1232
1670
|
offerId: firstItem.offerId ?? undefined,
|
|
1233
|
-
// Distinguishes a Buy Now purchase from a settled
|
|
1234
|
-
// orderType "
|
|
1671
|
+
// Distinguishes a Buy Now purchase from a settled collector drop win. Both are
|
|
1672
|
+
// orderType "collector-drop"; only this one gets the 24h admin-review window.
|
|
1235
1673
|
isBuyout: firstItem.isBuyout ? true : undefined,
|
|
1236
1674
|
status: adminBypass ? OrderStatusValues.PROCESSING : OrderStatusValues.PENDING,
|
|
1237
1675
|
paymentStatus: adminBypass ? PaymentStatusValues.PAID : PaymentStatusValues.PENDING,
|
|
@@ -1363,55 +1801,41 @@ async function createOrderForGroup(group, orderType, ctx) {
|
|
|
1363
1801
|
imageUrls: imageUrls.length > 0 ? imageUrls : undefined,
|
|
1364
1802
|
outOfStockPolicy,
|
|
1365
1803
|
droppedItems: droppedItems.length > 0 ? droppedItems : undefined,
|
|
1804
|
+
/*
|
|
1805
|
+
* Item 1.39 — the consent record, stamped on EVERY order this checkout
|
|
1806
|
+
* produced rather than on the first one.
|
|
1807
|
+
*
|
|
1808
|
+
* 🛑 A multi-seller cart splits into N orders and each is separately
|
|
1809
|
+
* cancellable, refundable and disputable, so each needs the agreement that
|
|
1810
|
+
* governs it. Writing it once and joining through a batch id would make
|
|
1811
|
+
* "what did this buyer agree to for this order" a query that can fail.
|
|
1812
|
+
*/
|
|
1813
|
+
policyConsent,
|
|
1366
1814
|
...extraOrderFields,
|
|
1367
1815
|
});
|
|
1368
1816
|
orderIds.push(order.id);
|
|
1369
|
-
|
|
1370
|
-
// before the caller asks the gateway for anything.
|
|
1371
|
-
await settlePointsTender({ orderId: order.id, userId: uid, pointsApplied, pointsBudget });
|
|
1372
|
-
// Close the loop on any locked line this order settled: flip the offer to
|
|
1373
|
-
// "paid" (its terminal status had NO server-side writer before 2026-08-21,
|
|
1374
|
-
// so an accepted offer could be re-added and re-ordered) and back-link the
|
|
1375
|
-
// winning bid to the order it became.
|
|
1376
|
-
await finalizeLockedLines(group.map(({ item }) => item), order.id);
|
|
1377
|
-
// SB-UNI-N — claim a digital code for digital-code orders (fire-and-forget,
|
|
1378
|
-
// order is already persisted so a claim failure is logged, not thrown).
|
|
1379
|
-
if ((group[0]?.product?.listingType ?? "standard") === "digital-code") {
|
|
1380
|
-
claimDigitalCodeForOrder(getAdminDb(), firstItem.productId, order.id, uid, {
|
|
1381
|
-
userEmail: userEmail || undefined,
|
|
1382
|
-
userName,
|
|
1383
|
-
productTitle: firstItem.productTitle,
|
|
1384
|
-
}).catch((e) => serverLogger.error("claimDigitalCode", { error: normalizeError(e).message }));
|
|
1385
|
-
}
|
|
1386
|
-
for (const code of groupCouponCodes) {
|
|
1387
|
-
const entry = couponUsageAccumulator.get(code);
|
|
1388
|
-
if (entry)
|
|
1389
|
-
entry.orderIds.push(order.id);
|
|
1390
|
-
}
|
|
1391
|
-
if (userEmail) {
|
|
1392
|
-
emailsToSend.push({
|
|
1393
|
-
to: userEmail,
|
|
1394
|
-
userName,
|
|
1395
|
-
orderId: order.id,
|
|
1396
|
-
productTitle: orderItems.length > 1 ? `${orderItems.length} items` : firstItem.productTitle,
|
|
1397
|
-
quantity: totalQuantity,
|
|
1398
|
-
totalPrice: orderTotal,
|
|
1399
|
-
currency: firstItem.currency ?? getDefaultCurrency(),
|
|
1400
|
-
shippingAddress,
|
|
1401
|
-
paymentMethod,
|
|
1402
|
-
items: orderItems,
|
|
1403
|
-
});
|
|
1404
|
-
}
|
|
1405
|
-
emitOrderPlacedNotifications({
|
|
1817
|
+
await finalizeOrderPlacement({
|
|
1406
1818
|
orderId: order.id,
|
|
1407
|
-
|
|
1408
|
-
|
|
1819
|
+
uid,
|
|
1820
|
+
group,
|
|
1821
|
+
pointsApplied,
|
|
1822
|
+
pointsBudget,
|
|
1823
|
+
firstItem,
|
|
1824
|
+
userEmail,
|
|
1825
|
+
userName,
|
|
1826
|
+
groupCouponCodes,
|
|
1827
|
+
couponUsageAccumulator,
|
|
1828
|
+
emailsToSend,
|
|
1829
|
+
orderItems,
|
|
1830
|
+
totalQuantity,
|
|
1831
|
+
orderTotal,
|
|
1832
|
+
shippingAddress,
|
|
1833
|
+
paymentMethod,
|
|
1409
1834
|
storeOwnerId,
|
|
1410
|
-
productLabel: orderItems.length > 1 ? `${orderItems.length} items` : firstItem.productTitle,
|
|
1411
1835
|
paid: adminBypass,
|
|
1412
1836
|
storeId: order.storeId,
|
|
1413
1837
|
});
|
|
1414
|
-
return
|
|
1838
|
+
return orderTotal;
|
|
1415
1839
|
}
|
|
1416
1840
|
/**
|
|
1417
1841
|
* Place order(s) from the user's cart in a single Firestore transaction.
|
|
@@ -1585,6 +2009,52 @@ export async function createCheckoutOrderAction(input) {
|
|
|
1585
2009
|
preTxProductById.set(preTxLookup.productIds[i], snap.data());
|
|
1586
2010
|
}
|
|
1587
2011
|
}
|
|
2012
|
+
/*
|
|
2013
|
+
* ── ITEM 1.39 — THE BLOCKING BUYER POLICY AGREEMENT ───────────────
|
|
2014
|
+
*
|
|
2015
|
+
* Pre-mutation and pre-capture. Everything between the cart read and here is
|
|
2016
|
+
* reads and validation; the transaction is far below. This is the last point
|
|
2017
|
+
* at which refusing costs nothing. On the COD/manual path "before the order"
|
|
2018
|
+
* and "before the money" are the same instant; on the gateway path they are
|
|
2019
|
+
* two different requests, which is why that path takes its consent at
|
|
2020
|
+
* create-order time instead (see `verifyAndPlaceGatewayOrderAction`).
|
|
2021
|
+
*
|
|
2022
|
+
* 🛑 Throws on absence or mismatch. A consentless order is REJECTED, never
|
|
2023
|
+
* placed-with-a-warning — the no-refund-after-reveal mechanic is only
|
|
2024
|
+
* defensible if the agreement that enables it was actually taken.
|
|
2025
|
+
*
|
|
2026
|
+
* 🛑 LISTING TYPES COME FROM THE PRODUCT DOCUMENTS — not the cart's
|
|
2027
|
+
* denormalised copy, and never the request. `CartItemDocument.listingType` is
|
|
2028
|
+
* written server-side at add-to-cart time, which makes it untampered but not
|
|
2029
|
+
* CURRENT: a product retyped to a concealed listing after it was added would
|
|
2030
|
+
* leave a stale `standard` on the line, and the reveal clause would be
|
|
2031
|
+
* silently dropped from the one order that most needs it.
|
|
2032
|
+
* `preTxProductById` is the authoritative read and is already in hand for the
|
|
2033
|
+
* max-per-user gate, so this costs no extra round trip — which is why the
|
|
2034
|
+
* gate sits here rather than beside the OTP check above.
|
|
2035
|
+
*
|
|
2036
|
+
* The cart copy is the FALLBACK for a line whose product could not be read
|
|
2037
|
+
* (deleted mid-checkout — the stock check below refuses it anyway), and
|
|
2038
|
+
* `standard` is the last resort: it carries `supportsShipping`, so the
|
|
2039
|
+
* no-refund-after-dispatch clause still applies rather than vanishing.
|
|
2040
|
+
*/
|
|
2041
|
+
const policyConsent = await assertBuyerPolicyConsent({
|
|
2042
|
+
uid,
|
|
2043
|
+
listingTypes: cartItems.map((item) => (preTxProductById.get(item.productId)?.listingType ??
|
|
2044
|
+
item.listingType ??
|
|
2045
|
+
"standard")),
|
|
2046
|
+
settings: siteSettings?.checkoutPolicies,
|
|
2047
|
+
submitted: input.policyConsent,
|
|
2048
|
+
capturedOn: "checkout",
|
|
2049
|
+
/*
|
|
2050
|
+
* 🛑 A REQUEST, re-verified inside the gate against
|
|
2051
|
+
* `admin:checkout:bypass` — never a trusted boolean. `adminBypass` arrives
|
|
2052
|
+
* on this action's own input, so the day a route wires it from a request
|
|
2053
|
+
* body a trusted flag here would make the whole consent gate switchable off
|
|
2054
|
+
* by any client. The gate answers 403 when the uid does not hold it.
|
|
2055
|
+
*/
|
|
2056
|
+
requestAdminBypass: adminBypass,
|
|
2057
|
+
});
|
|
1588
2058
|
/*
|
|
1589
2059
|
* Payment-method gate — before `enforceMaxPerUserForCart`, which runs count
|
|
1590
2060
|
* queries, because this answer needs no reads at all.
|
|
@@ -1595,18 +2065,93 @@ export async function createCheckoutOrderAction(input) {
|
|
|
1595
2065
|
* every member of every line against this map.
|
|
1596
2066
|
*
|
|
1597
2067
|
* 🛑 This ONE call site is complete coverage, and that is worth stating so
|
|
1598
|
-
* nobody adds a second. Only `cod`/`cash`/`emi` are ever blocked (
|
|
2068
|
+
* nobody adds a second. Only `cod`/`cash`/`emi` are ever blocked (collector drop,
|
|
1599
2069
|
* bundle, prize-draw) and all three arrive here; the Razorpay path is always
|
|
1600
2070
|
* `"online"`, which no rule blocks — and a throw there would land AFTER
|
|
1601
2071
|
* capture, taking the buyer's money and then refusing the order. Pre-capture
|
|
1602
2072
|
* is the only safe place for this, and the method is decided here.
|
|
1603
2073
|
*/
|
|
1604
|
-
|
|
2074
|
+
/*
|
|
2075
|
+
* 🛑 The third argument is NOT optional in effect, even though its type
|
|
2076
|
+
* allows omission. The gate FAILS CLOSED: a listing type carrying
|
|
2077
|
+
* `requiresGatewayPermission` (collector-drop, clearance) is refused
|
|
2078
|
+
* online payment unless the ACTIVE gateway declares it accepts that type.
|
|
2079
|
+
* Razorpay and PhonePe declare nothing, because both name "Bidding/Auction
|
|
2080
|
+
* houses" in their prohibited-merchant lists; only Cashfree opens them.
|
|
2081
|
+
*
|
|
2082
|
+
* Read off the registered provider rather than compared against the string
|
|
2083
|
+
* "cashfree", so a second permitted gateway is a change to that adapter and
|
|
2084
|
+
* not to this call site (Root Cause #61).
|
|
2085
|
+
*/
|
|
2086
|
+
/*
|
|
2087
|
+
* ── Phase 1c: WHICH gateway may collect, for the ONLINE tender ────────────
|
|
2088
|
+
*
|
|
2089
|
+
* 🛑 Gated on `paymentMethod === "online"`, and that gate is the rule rather
|
|
2090
|
+
* than an optimisation. The commingling this guards against is a property of
|
|
2091
|
+
* a GATEWAY CAPTURE: the money lands in the aggregator's escrow and is
|
|
2092
|
+
* settled out of it. COD, cash and a manual bank/UPI transfer involve no
|
|
2093
|
+
* capture at all — a manual transfer is already buyer-to-whoever-the-admin-
|
|
2094
|
+
* names — so applying the rule there would refuse the one set of tenders
|
|
2095
|
+
* that has no commingling problem.
|
|
2096
|
+
*
|
|
2097
|
+
* 🛑 Reachable, which is why this is not capture-route-only: `/api/checkout`
|
|
2098
|
+
* accepts `paymentMethod: "online"`, so this action creates orders for an
|
|
2099
|
+
* online tender BEFORE any capture exists. Guarding only
|
|
2100
|
+
* `/api/payment/create-order` would leave this entry point open.
|
|
2101
|
+
*
|
|
2102
|
+
* 🛑 RESOLVED NON-THROWING FIRST, so the gate below can be told which gateway
|
|
2103
|
+
* would really collect. Passing `getProviders().payment` there — the
|
|
2104
|
+
* process-level tie-break winner — would refuse a collector-drop whenever
|
|
2105
|
+
* PhonePe sorts ahead of an enabled Cashfree, i.e. exactly the configuration
|
|
2106
|
+
* Phase 1c exists to make work. The two gates then compose instead of
|
|
2107
|
+
* disagreeing.
|
|
2108
|
+
*/
|
|
2109
|
+
const collectingGateway = paymentMethod === "online"
|
|
2110
|
+
? resolveCollectingGatewayForCart({
|
|
2111
|
+
items: cartItems,
|
|
2112
|
+
productById: preTxProductById,
|
|
2113
|
+
platformStoreId: siteSettings?.payment?.platformStoreId,
|
|
2114
|
+
})
|
|
2115
|
+
: null;
|
|
2116
|
+
assertPaymentMethodAllowed(cartItems, preTxProductById, paymentMethod, {
|
|
2117
|
+
/*
|
|
2118
|
+
* The gateway that would actually collect when there is one; otherwise the
|
|
2119
|
+
* process default, which is what every non-online tender is measured
|
|
2120
|
+
* against and is unchanged. Either way `undefined` means ACCEPTS NOTHING
|
|
2121
|
+
* (`PaymentGateContext.gatewayAccepts`), so a failed resolution cannot
|
|
2122
|
+
* widen this.
|
|
2123
|
+
*/
|
|
2124
|
+
gatewayAccepts: collectingGateway
|
|
2125
|
+
? collectingGateway.provider?.acceptsRestrictedListingTypes
|
|
2126
|
+
: getProviders().payment?.acceptsRestrictedListingTypes,
|
|
2127
|
+
});
|
|
2128
|
+
/*
|
|
2129
|
+
* Thrown AFTER the listing-level gate, deliberately. A listing that forbids
|
|
2130
|
+
* online payment outright (`blockedPaymentMethods`) should say so in its own
|
|
2131
|
+
* words; the gateway refusal is the narrower, second reason and must not
|
|
2132
|
+
* mask it. When only this one binds it throws `GATEWAY_UNAVAILABLE_FOR_CART`
|
|
2133
|
+
* naming which of the two independent constraints applied.
|
|
2134
|
+
*/
|
|
2135
|
+
if (collectingGateway && !collectingGateway.resolution.ok) {
|
|
2136
|
+
/*
|
|
2137
|
+
* Re-resolves rather than re-throwing the stored resolution, because the
|
|
2138
|
+
* error SHAPE (code, `constraint`, `detail`) belongs to
|
|
2139
|
+
* `assertCollectingGateway` and must have exactly one definition — a
|
|
2140
|
+
* hand-rolled `Object.assign(new ValidationError(...))` here would be a
|
|
2141
|
+
* second one to drift from (Root Cause #61). The resolution is pure with
|
|
2142
|
+
* no IO, so the repeat costs nothing.
|
|
2143
|
+
*/
|
|
2144
|
+
assertCollectingGateway({
|
|
2145
|
+
items: cartItems,
|
|
2146
|
+
productById: preTxProductById,
|
|
2147
|
+
platformStoreId: siteSettings?.payment?.platformStoreId,
|
|
2148
|
+
});
|
|
2149
|
+
}
|
|
1605
2150
|
/*
|
|
1606
2151
|
* 🛑 The second axis needs its own assertion, and omitting it would have
|
|
1607
2152
|
* been a silent regression of a rule that already exists.
|
|
1608
2153
|
*
|
|
1609
|
-
* `
|
|
2154
|
+
* `clearanceRule.blockedPaymentMethods` lists `"emi"` because winner
|
|
1610
2155
|
* assignment waits on confirmed payment. Once EMI stopped being a tender,
|
|
1611
2156
|
* that entry stopped matching anything — the gate above would see
|
|
1612
2157
|
* `upi_manual` (explicitly ALLOWED for prize draws) and wave through an
|
|
@@ -1757,12 +2302,28 @@ export async function createCheckoutOrderAction(input) {
|
|
|
1757
2302
|
const emailsToSend = [];
|
|
1758
2303
|
const cartSubtotal = orderGroups.reduce((s, { items: g }) => s + g.reduce((gs, { item, product }) => gs + lineTotalFor(item, product), 0), 0);
|
|
1759
2304
|
const couponUsageAccumulator = new Map();
|
|
1760
|
-
|
|
1761
|
-
|
|
2305
|
+
/*
|
|
2306
|
+
* The buyer-facing platform fee: a TAPERED per-unit rate, summed per cart
|
|
2307
|
+
* line, then GST. See `DEFAULT_PLATFORM_FEE_UNIT_BANDS` for the owner's three
|
|
2308
|
+
* rulings and for the delta against `mocks/18-shipping-fees.qm`, which still
|
|
2309
|
+
* draws a flat ₹10 per LINE.
|
|
2310
|
+
*/
|
|
2311
|
+
/*
|
|
2312
|
+
* 🛑 `item.quantity` PER LINE, as an array — never a flattened total and
|
|
2313
|
+
* never `expandCartLineToOrderRows`'s output.
|
|
2314
|
+
*
|
|
2315
|
+
* Per line because the taper bands per line: 8 units as two lines of 4 bills
|
|
2316
|
+
* at ₹10 each (₹80); as one line of 8 it bills at ₹8 (₹64). Never the
|
|
2317
|
+
* expansion because a BX-53 deck set is ONE listing purchased — ₹10, not ₹60
|
|
2318
|
+
* — however many components the box holds (owner, 2026-11-08).
|
|
2319
|
+
*/
|
|
2320
|
+
const lineUnitsOf = (g) => g.map(({ item }) => item.quantity ?? 0);
|
|
2321
|
+
const lineUnitsByStore = new Map(orderGroups.map(({ items: g }) => [g[0].item.storeId, lineUnitsOf(g)]));
|
|
2322
|
+
const cartLineUnits = orderGroups.flatMap(({ items: g }) => lineUnitsOf(g));
|
|
1762
2323
|
const platformFeeByStore = allocateCheckoutFees(orderGroups.map(({ items: g }) => [
|
|
1763
2324
|
g[0].item.storeId,
|
|
1764
2325
|
g.reduce((sum, { item, product }) => sum + lineTotalFor(item, product), 0),
|
|
1765
|
-
]), computeCheckoutFees(cartSubtotal, commissions));
|
|
2326
|
+
]), computeCheckoutFees(cartSubtotal, commissions, cartLineUnits), lineUnitsByStore, commissions);
|
|
1766
2327
|
/*
|
|
1767
2328
|
* ── The checkout's points budget, read ONCE (D46/D47) ─────────────────────
|
|
1768
2329
|
*
|
|
@@ -1807,8 +2368,10 @@ export async function createCheckoutOrderAction(input) {
|
|
|
1807
2368
|
gstSettings: siteSettings?.gst,
|
|
1808
2369
|
siteContactUpiVpa: siteSettings?.contact?.upiVpa,
|
|
1809
2370
|
storeAddons: cart.storeAddons,
|
|
2371
|
+
policyConsent,
|
|
1810
2372
|
platformFeeByStore,
|
|
1811
2373
|
selectedShippingQuote: input.selectedShippingQuote,
|
|
2374
|
+
selectedShippingOptions: input.selectedShippingOptions,
|
|
1812
2375
|
productById: checkoutProductById,
|
|
1813
2376
|
useAllPoints,
|
|
1814
2377
|
pointsBudget,
|
|
@@ -1816,6 +2379,13 @@ export async function createCheckoutOrderAction(input) {
|
|
|
1816
2379
|
for (const { items: group, orderType } of orderGroups) {
|
|
1817
2380
|
total += await createOrderForGroup(group, orderType, groupCtx);
|
|
1818
2381
|
}
|
|
2382
|
+
/*
|
|
2383
|
+
* Item 1.39 — backlink the consent to the orders it covered. Never awaited
|
|
2384
|
+
* for correctness: the authoritative copy is already on each order document,
|
|
2385
|
+
* so this is the convenience index and a failure must not undo a successful
|
|
2386
|
+
* placement. See `attachOrdersToPolicyConsent`, which swallows and logs.
|
|
2387
|
+
*/
|
|
2388
|
+
await attachOrdersToPolicyConsent(policyConsent.consentId, orderIds);
|
|
1819
2389
|
await flushCouponUsageAccumulator(couponUsageAccumulator, uid);
|
|
1820
2390
|
/*
|
|
1821
2391
|
* ── 🛑 THE POINTS REDEMPTION BLOCK WAS DELETED HERE, 2026-10-21 (D46) ─────
|
|
@@ -1900,6 +2470,8 @@ const EMPTY_PRICING_PREVIEW = {
|
|
|
1900
2470
|
couponDiscount: 0,
|
|
1901
2471
|
platformFee: 0,
|
|
1902
2472
|
gstOnFee: 0,
|
|
2473
|
+
platformFeeUnitCount: 0,
|
|
2474
|
+
platformFeeLines: [],
|
|
1903
2475
|
sharedPurchaseFee: 0,
|
|
1904
2476
|
total: 0,
|
|
1905
2477
|
pointsApplied: 0,
|
|
@@ -1996,7 +2568,36 @@ export async function previewCheckoutPricing(input) {
|
|
|
1996
2568
|
* and then the order path (equally unpassed) charged it. Preview and charge
|
|
1997
2569
|
* agreed, and both were wrong in the same direction.
|
|
1998
2570
|
*/
|
|
1999
|
-
const { shippingFee: groupShippingFee, storeState, storeProtections, storeEmiEnabled, acceptsPoints, sharedPurchaseRates: previewSharedRates } = await resolveShippingCost(firstItem.storeId, { goodsValue: groupTotal });
|
|
2571
|
+
const { shippingFee: groupShippingFee, shippingOffer: groupShippingOffer, storeState, storeProtections, storeEmiEnabled, acceptsPoints, sharedPurchaseRates: previewSharedRates } = await resolveShippingCost(firstItem.storeId, { goodsValue: groupTotal });
|
|
2572
|
+
/*
|
|
2573
|
+
* ── WHAT THE BUYER MAY CHOOSE, priced by the server ──────────────────
|
|
2574
|
+
*
|
|
2575
|
+
* Built from the seller's STORED offer plus a carrier quote this server
|
|
2576
|
+
* obtained, so the picker offers exactly what `resolveShippingSelection`
|
|
2577
|
+
* will accept at order time. See the field's note on
|
|
2578
|
+
* `CheckoutPricingPreviewStore` for why offering anything else means the
|
|
2579
|
+
* buyer meets a refusal after pressing pay.
|
|
2580
|
+
*
|
|
2581
|
+
* 🛑 `cartRequiresShipping` is a CAPABILITY read (`supportsShipping` off
|
|
2582
|
+
* the registry). A digital-code group offers nothing and is charged
|
|
2583
|
+
* nothing — no listing-type comparison anywhere in the decision.
|
|
2584
|
+
*
|
|
2585
|
+
* 🛑 The carrier call is skipped unless the seller accepts carrier quotes.
|
|
2586
|
+
* The preview runs on every control the buyer touches, so an unconditional
|
|
2587
|
+
* outbound call here would be a rate-limited third-party request per
|
|
2588
|
+
* keystroke. A self-shipping seller's options are pure arithmetic.
|
|
2589
|
+
*/
|
|
2590
|
+
const groupRequiresShipping = cartRequiresShipping(group.map(({ product }) => ({ listingType: product?.listingType })));
|
|
2591
|
+
const previewCarrierOptions = groupRequiresShipping && groupShippingOffer.platformQuotesAccepted
|
|
2592
|
+
? await carrierOptionsForDestination(resolvedAddress?.postalCode, CHECKOUT_DEFAULT_PARCEL_WEIGHT_KG)
|
|
2593
|
+
: [];
|
|
2594
|
+
const groupShippingOptions = groupRequiresShipping
|
|
2595
|
+
? buildShippingOptions({
|
|
2596
|
+
offer: groupShippingOffer,
|
|
2597
|
+
goodsValue: groupTotal,
|
|
2598
|
+
carrierOptions: previewCarrierOptions,
|
|
2599
|
+
})
|
|
2600
|
+
: [];
|
|
2000
2601
|
// Add-ons are per store, read off the cart document — the same entry
|
|
2001
2602
|
// createOrderForGroup will read when the order is actually placed.
|
|
2002
2603
|
const addons = cart.storeAddons?.[firstItem.storeId] ?? {};
|
|
@@ -2047,8 +2648,18 @@ export async function previewCheckoutPricing(input) {
|
|
|
2047
2648
|
* to have snapshotted it. The snapshot matters at the other two moments —
|
|
2048
2649
|
* order creation (so the written row is authoritative) and claim time (so a
|
|
2049
2650
|
* seller cannot flip the switch after the sale).
|
|
2651
|
+
*
|
|
2652
|
+
* 🛑 THROUGH `isFinalSale`, never `product?.finalSale === true`. The field
|
|
2653
|
+
* is optional and the platform default is TRUE, so the bare comparison
|
|
2654
|
+
* reads "not final sale" for every listing that has never set it — which
|
|
2655
|
+
* is 53 of 53 products in the live catalogue (measured 2026-11-08). That
|
|
2656
|
+
* made this preview offer SALE protection on lines that the order row
|
|
2657
|
+
* written seconds later marks `finalSale: true`, and which
|
|
2658
|
+
* `requestReturnAction`/`processRefundAction` then refuse: a fee quoted and
|
|
2659
|
+
* charged for cover whose claim is guaranteed to be declined.
|
|
2660
|
+
* `final-sale.ts` names this exact spelling as wrong in its header.
|
|
2050
2661
|
*/
|
|
2051
|
-
const groupHasFinalSale = group.some(({ product }) => product
|
|
2662
|
+
const groupHasFinalSale = group.some(({ product }) => isFinalSale(product));
|
|
2052
2663
|
/*
|
|
2053
2664
|
* ── S5a in the PREVIEW ───────────────────────────────────────────────────
|
|
2054
2665
|
*
|
|
@@ -2167,6 +2778,13 @@ export async function previewCheckoutPricing(input) {
|
|
|
2167
2778
|
hasFinalSaleItem: groupHasFinalSale,
|
|
2168
2779
|
acceptsPoints,
|
|
2169
2780
|
sharedPurchaseFee: groupSharedPurchaseFee,
|
|
2781
|
+
/*
|
|
2782
|
+
* What the buyer may pick, priced server-side. Carried per STORE because
|
|
2783
|
+
* shipping is charged per store and the cart splits on `storeId` — a
|
|
2784
|
+
* cart-wide option list would offer one seller's custom rate for another
|
|
2785
|
+
* seller's parcel.
|
|
2786
|
+
*/
|
|
2787
|
+
shippingOptions: groupShippingOptions,
|
|
2170
2788
|
// Filled by the tender pass below — it needs each store's share of the
|
|
2171
2789
|
// one capped commission, which is only allocatable once every group is
|
|
2172
2790
|
// known.
|
|
@@ -2187,15 +2805,23 @@ export async function previewCheckoutPricing(input) {
|
|
|
2187
2805
|
const sharedPurchaseFeeTotal = sum((s) => s.sharedPurchaseFee);
|
|
2188
2806
|
const gstAmount = sum((s) => s.gstAmount);
|
|
2189
2807
|
const couponDiscount = sum((s) => s.couponDiscount);
|
|
2190
|
-
// One
|
|
2191
|
-
//
|
|
2192
|
-
//
|
|
2193
|
-
//
|
|
2194
|
-
//
|
|
2195
|
-
//
|
|
2196
|
-
//
|
|
2197
|
-
//
|
|
2198
|
-
|
|
2808
|
+
// One fee for the whole checkout, on every payment method — deliberately not
|
|
2809
|
+
// per store, so it is not added to the per-store rows above. The whole object
|
|
2810
|
+
// is kept (not just the two fields) because the points tender below
|
|
2811
|
+
// re-allocates it per store through `allocateCheckoutFees`, which takes a
|
|
2812
|
+
// `CheckoutFees` — and `totalFee` carries the `minimumTransactionFee` floor,
|
|
2813
|
+
// which is exactly the field D41 found had no consumer anywhere.
|
|
2814
|
+
// Destructuring it away here would be how it loses its second one.
|
|
2815
|
+
//
|
|
2816
|
+
// 🛑 `cartLineUnits` is built from the SAME `orderGroups` the per-store
|
|
2817
|
+
// rows above were built from, so the fee the buyer is SHOWN and the fee the
|
|
2818
|
+
// order path CHARGES are derived from one line set rather than two that
|
|
2819
|
+
// happen to agree — and under a per-line taper the SHAPE of that set changes
|
|
2820
|
+
// the answer, not just its sum.
|
|
2821
|
+
const previewLineUnitsOf = (g) => g.map(({ item }) => item.quantity ?? 0);
|
|
2822
|
+
const previewLineUnitsByStore = new Map(orderGroups.map(({ items: g }) => [g[0].item.storeId, previewLineUnitsOf(g)]));
|
|
2823
|
+
const cartLineUnits = orderGroups.flatMap(({ items: g }) => previewLineUnitsOf(g));
|
|
2824
|
+
const checkoutFees = computeCheckoutFees(cartSubtotal, commissions, cartLineUnits);
|
|
2199
2825
|
const { platformFee, gstOnFee } = checkoutFees;
|
|
2200
2826
|
/*
|
|
2201
2827
|
* 🛑 `gstAmount` is NOT a term, and leaving it in was a shown-vs-charged
|
|
@@ -2258,7 +2884,7 @@ export async function previewCheckoutPricing(input) {
|
|
|
2258
2884
|
const previewUseAllPoints = cart.useAllPoints === true;
|
|
2259
2885
|
const previewBalance = previewUseAllPoints ? await safePointsBalance(uid) : 0;
|
|
2260
2886
|
if (previewUseAllPoints && previewBalance > 0) {
|
|
2261
|
-
const feeByStore = allocateCheckoutFees(stores.map((s) => [s.storeId, s.subtotal]), checkoutFees);
|
|
2887
|
+
const feeByStore = allocateCheckoutFees(stores.map((s) => [s.storeId, s.subtotal]), checkoutFees, previewLineUnitsByStore, commissions);
|
|
2262
2888
|
const { perGroup } = allocatePointsAcrossGroups(stores.map((s) => {
|
|
2263
2889
|
const share = feeByStore.get(s.storeId);
|
|
2264
2890
|
return {
|
|
@@ -2291,6 +2917,8 @@ export async function previewCheckoutPricing(input) {
|
|
|
2291
2917
|
couponDiscount,
|
|
2292
2918
|
platformFee,
|
|
2293
2919
|
gstOnFee,
|
|
2920
|
+
platformFeeUnitCount: checkoutFees.unitCount,
|
|
2921
|
+
platformFeeLines: checkoutFees.lines,
|
|
2294
2922
|
total,
|
|
2295
2923
|
pointsApplied,
|
|
2296
2924
|
// Equal to `total` when no points apply, so every existing reader of
|
|
@@ -2452,7 +3080,7 @@ async function refundDroppedItemsForPhonePeCheckout(input) {
|
|
|
2452
3080
|
* from the inline version this replaced.
|
|
2453
3081
|
*/
|
|
2454
3082
|
async function createPhonePeGroupOrder(group, orderType, ctx) {
|
|
2455
|
-
const { appliedCoupons, cartSubtotal, storeAddons, platformFeeByStore, siteSettings, uid, userName, userEmail, merchantOrderId,
|
|
3083
|
+
const { appliedCoupons, cartSubtotal, storeAddons, platformFeeByStore, policyConsent, siteSettings, uid, userName, userEmail, merchantOrderId, gatewayOrderId, transactionId, shippingAddress, notes, outOfStockPolicy, unavailablePaid, orderIds, emailsToSend, couponUsageAccumulator, productById: phonepeProductById, buyerState, useAllPoints, pointsBudget,
|
|
2456
3084
|
/*
|
|
2457
3085
|
* 🛑 All three were DECLARED on the params above and never destructured,
|
|
2458
3086
|
* so the body referenced them as free names: `emiOptIn`/`emiTenureMonths`
|
|
@@ -2461,7 +3089,7 @@ async function createPhonePeGroupOrder(group, orderType, ctx) {
|
|
|
2461
3089
|
* why appkit's own `tsc` is the gate for this file and not a reading of
|
|
2462
3090
|
* the diff.
|
|
2463
3091
|
*/
|
|
2464
|
-
emiOptIn, emiTenureMonths, deliverySnapshot, } = ctx;
|
|
3092
|
+
emiOptIn, emiTenureMonths, deliverySnapshot, splitByStore, } = ctx;
|
|
2465
3093
|
/*
|
|
2466
3094
|
* Which online gateway actually took the money, read off the registered
|
|
2467
3095
|
* provider rather than passed in — exactly one is registered per process
|
|
@@ -2471,13 +3099,43 @@ async function createPhonePeGroupOrder(group, orderType, ctx) {
|
|
|
2471
3099
|
*/
|
|
2472
3100
|
const gatewayName = getProviders().payment?.name ?? "phonepe";
|
|
2473
3101
|
const firstItem = group[0].item;
|
|
3102
|
+
/*
|
|
3103
|
+
* What this seller was instructed to be settled out of this capture, if
|
|
3104
|
+
* anything. Resolved once here rather than three times in the order literal
|
|
3105
|
+
* below — a repeated `Map.get(...)!` is three chances for one of them to read
|
|
3106
|
+
* a different key.
|
|
3107
|
+
*/
|
|
3108
|
+
const splitForThisStore = splitByStore?.get(firstItem.storeId);
|
|
2474
3109
|
const groupTotal = group.reduce((sum, { item, product }) => sum + lineTotalFor(item, product), 0);
|
|
2475
3110
|
// Reuses the same store/seller lookup as the COD/UPI path above instead
|
|
2476
3111
|
// of re-implementing it inline — was two sequential findById calls per
|
|
2477
3112
|
// seller group here, duplicated from resolveShippingCost.
|
|
2478
3113
|
// D44: `groupTotal` is computed just above — pass it so a free-above
|
|
2479
3114
|
// threshold can fire and an unpriceable store is recorded.
|
|
2480
|
-
const { shippingFee, storeOwnerId, storeState, storeTaxIdentity, storeProtections, acceptsPoints, sharedPurchaseRates, storeEmiEnabled } = await resolveShippingCost(firstItem.storeId, { goodsValue: groupTotal });
|
|
3115
|
+
const { shippingFee, shippingOffer, storeOwnerId, storeState, storeTaxIdentity, storeProtections, acceptsPoints, sharedPurchaseRates, storeEmiEnabled } = await resolveShippingCost(firstItem.storeId, { goodsValue: groupTotal });
|
|
3116
|
+
/*
|
|
3117
|
+
* ── PART C ON THE ONLINE PATH, as far as it can honestly go ──────────────
|
|
3118
|
+
*
|
|
3119
|
+
* ⚠ GAP, STATED RATHER THAN PAPERED OVER: this path does NOT yet honour
|
|
3120
|
+
* the buyer's per-store shipping option. It prices shipping from the seller's
|
|
3121
|
+
* stored policy, and so does the capture route
|
|
3122
|
+
* (`POST /api/payment/create-order`) and the post-capture guard — all three
|
|
3123
|
+
* agree, so there is no client-trust hole here and never was; what is missing
|
|
3124
|
+
* is the buyer CHOICE half of the owner's spec. Wiring it means changing the
|
|
3125
|
+
* capture, the guard and this writer in one commit, because a guard expecting
|
|
3126
|
+
* a differently-priced shipping term throws on an order already paid for.
|
|
3127
|
+
*
|
|
3128
|
+
* What CAN be recorded honestly is the obligation a seller's offer implies
|
|
3129
|
+
* when it leaves no choice: a seller who offers only their own shipping is
|
|
3130
|
+
* self-fulfilling whatever the buyer did or did not pick.
|
|
3131
|
+
* `impliedObligation` answers `null` the moment there is a real choice, so
|
|
3132
|
+
* nothing here invents a contract. Without it every online order would carry
|
|
3133
|
+
* no obligation at all, and `mayBookPlatformLabel` fails OPEN on absence —
|
|
3134
|
+
* i.e. the one gate part C depends on would be inert for the entire online
|
|
3135
|
+
* path.
|
|
3136
|
+
*/
|
|
3137
|
+
const gatewayGroupRequiresShipping = cartRequiresShipping(group.map(({ product }) => ({ listingType: product?.listingType })));
|
|
3138
|
+
const gatewayShippingObligation = impliedObligation(shippingOffer, shippingFee, gatewayGroupRequiresShipping) ?? undefined;
|
|
2481
3139
|
/*
|
|
2482
3140
|
* The instalment schedule for THIS seller group, through the same helper the
|
|
2483
3141
|
* COD/manual writer uses — not a copy of its block. Two hand-written
|
|
@@ -2548,8 +3206,15 @@ async function createPhonePeGroupOrder(group, orderType, ctx) {
|
|
|
2548
3206
|
* and the one live store has `supportsSaleProtection` unset — but both of
|
|
2549
3207
|
* those are a settings toggle away, and an under-charge that appears the
|
|
2550
3208
|
* moment a flag flips is worse than one that is visible now.
|
|
3209
|
+
*
|
|
3210
|
+
* 🛑 `isFinalSale(product)`, not `product?.finalSale === true` — see the
|
|
3211
|
+
* matching note in the preview above. `finalSale` is optional with a default
|
|
3212
|
+
* of TRUE, so the bare comparison opted every one of the 53 catalogue
|
|
3213
|
+
* listings OUT of final sale and let sale protection be billed on a line the
|
|
3214
|
+
* written order row marks `finalSale: true`. This is the CHARGED path, so
|
|
3215
|
+
* here it was money taken for a claim the refund gate will decline.
|
|
2551
3216
|
*/
|
|
2552
|
-
const groupHasFinalSale = group.some(({ product }) => product
|
|
3217
|
+
const groupHasFinalSale = group.some(({ product }) => isFinalSale(product));
|
|
2553
3218
|
const { shippingProtectionFee: shipmentProtectionFee, saleProtectionFee } = computeProtectionFees({
|
|
2554
3219
|
subtotal: groupTotal,
|
|
2555
3220
|
selected: {
|
|
@@ -2685,7 +3350,8 @@ async function createPhonePeGroupOrder(group, orderType, ctx) {
|
|
|
2685
3350
|
* other: an accepted offer paid through PhonePe was recorded at the
|
|
2686
3351
|
* seller's list price.
|
|
2687
3352
|
*/
|
|
2688
|
-
|
|
3353
|
+
// Part 14 removed — see the note at the other call site.
|
|
3354
|
+
const orderItems = basePhonepeItems;
|
|
2689
3355
|
const totalQuantity = group.reduce((sum, { item }) => sum + item.quantity, 0);
|
|
2690
3356
|
const imageUrls = [
|
|
2691
3357
|
...new Set(group
|
|
@@ -2728,12 +3394,12 @@ async function createPhonePeGroupOrder(group, orderType, ctx) {
|
|
|
2728
3394
|
orderType,
|
|
2729
3395
|
// How the buyer earned the right to buy at this price. `orderType` cannot
|
|
2730
3396
|
// answer that — it has five values, and both a settled win and a buyout
|
|
2731
|
-
// are "
|
|
3397
|
+
// are "collector-drop". Written ONCE here and never recomputed: the collector drop and
|
|
2732
3398
|
// offer documents it summarises are mutable and eventually archived.
|
|
2733
3399
|
sourceContext,
|
|
2734
3400
|
offerId: firstItem.offerId ?? undefined,
|
|
2735
|
-
// Distinguishes a Buy Now purchase from a settled
|
|
2736
|
-
// orderType "
|
|
3401
|
+
// Distinguishes a Buy Now purchase from a settled collector drop win. Both are
|
|
3402
|
+
// orderType "collector-drop"; only this one gets the 24h admin-review window.
|
|
2737
3403
|
isBuyout: firstItem.isBuyout ? true : undefined,
|
|
2738
3404
|
status: OrderStatusValues.CONFIRMED,
|
|
2739
3405
|
paymentStatus: PaymentStatusValues.PAID,
|
|
@@ -2750,7 +3416,22 @@ async function createPhonePeGroupOrder(group, orderType, ctx) {
|
|
|
2750
3416
|
*/
|
|
2751
3417
|
paymentId: merchantOrderId,
|
|
2752
3418
|
paymentRecord: {
|
|
2753
|
-
|
|
3419
|
+
/*
|
|
3420
|
+
* 🛑 Was a 2-way ternary (`razorpay` / else `phonepe`) with no `cashfree`
|
|
3421
|
+
* branch — exactly the bug a 2-value check always risks once a third
|
|
3422
|
+
* provider registers. Every Cashfree-settled order recorded
|
|
3423
|
+
* `method: "phonepe"` and no `cashfreeOrderId`, which is wrong audit
|
|
3424
|
+
* trail for a real, live gateway (Cashfree is the one this project
|
|
3425
|
+
* uses specifically for collector-drop/clearance compliance — see
|
|
3426
|
+
* CLAUDE.md § payment-cashfree). `gatewayName` is read off the
|
|
3427
|
+
* REGISTERED provider three lines above this function's own top, so
|
|
3428
|
+
* this is never a value the caller could get wrong.
|
|
3429
|
+
*/
|
|
3430
|
+
method: gatewayName === "razorpay"
|
|
3431
|
+
? "razorpay"
|
|
3432
|
+
: gatewayName === "cashfree"
|
|
3433
|
+
? "cashfree"
|
|
3434
|
+
: "phonepe",
|
|
2754
3435
|
transactionId: transactionId ?? merchantOrderId,
|
|
2755
3436
|
/*
|
|
2756
3437
|
* 🛑 What the gateway actually CAPTURED, which is `amountDue` once points
|
|
@@ -2768,10 +3449,43 @@ async function createPhonePeGroupOrder(group, orderType, ctx) {
|
|
|
2768
3449
|
merchantOrderId,
|
|
2769
3450
|
...(gatewayName === "razorpay"
|
|
2770
3451
|
? { razorpayOrderId: merchantOrderId, razorpayPaymentId: transactionId }
|
|
2771
|
-
:
|
|
3452
|
+
: gatewayName === "cashfree"
|
|
3453
|
+
? { cashfreeOrderId: gatewayOrderId }
|
|
3454
|
+
: { phonepeOrderId: gatewayOrderId }),
|
|
2772
3455
|
transactionId,
|
|
2773
3456
|
},
|
|
2774
3457
|
},
|
|
3458
|
+
/*
|
|
3459
|
+
* ── Split settlement: this seller's share never entered our account ─────
|
|
3460
|
+
*
|
|
3461
|
+
* 🛑 **THE DOUBLE-PAYMENT GUARD'S ONLY WRITER.** `orderNeedsManualPayout`
|
|
3462
|
+
* reads it, and both mark-shipped writers consult that before setting
|
|
3463
|
+
* `payoutStatus: "eligible"`. Without this field the weekly and automatic
|
|
3464
|
+
* sweeps would create a `payouts` row for the FULL share of an order the
|
|
3465
|
+
* aggregator has already settled — the seller paid twice, once out of
|
|
3466
|
+
* escrow and once out of the platform's own balance.
|
|
3467
|
+
*
|
|
3468
|
+
* 🛑 Only written when the capture CARRIED an instruction for this store.
|
|
3469
|
+
* It is never inferred from the gateway's name or from the store being
|
|
3470
|
+
* third-party: if the split field had been silently ignored by the gateway
|
|
3471
|
+
* (the one assumption in `payment-cashfree` whose failure mode is silent),
|
|
3472
|
+
* an inferred flag would mark the order settled and the seller would never
|
|
3473
|
+
* be paid at all. A missing entry here means the ordinary payout path,
|
|
3474
|
+
* which is the safe direction — a seller chasing a late payout is
|
|
3475
|
+
* recoverable; one who was never paid and whose order says otherwise is
|
|
3476
|
+
* not.
|
|
3477
|
+
*/
|
|
3478
|
+
splitSettlement: splitForThisStore
|
|
3479
|
+
? {
|
|
3480
|
+
gateway: splitForThisStore.gateway || gatewayName,
|
|
3481
|
+
vendorId: splitForThisStore.vendorId,
|
|
3482
|
+
vendorAmount: splitForThisStore.amount,
|
|
3483
|
+
// 🛑 The payout row's own `requestedAt`, never `new Date()` here —
|
|
3484
|
+
// the settle request can be minutes after the capture.
|
|
3485
|
+
instructedAt: splitForThisStore.instructedAt,
|
|
3486
|
+
merchantOrderId,
|
|
3487
|
+
}
|
|
3488
|
+
: undefined,
|
|
2775
3489
|
shippingAddress,
|
|
2776
3490
|
notes,
|
|
2777
3491
|
platformFee,
|
|
@@ -2780,6 +3494,12 @@ async function createPhonePeGroupOrder(group, orderType, ctx) {
|
|
|
2780
3494
|
// leaving the refund path to re-derive it from live percentages (D32).
|
|
2781
3495
|
platformFeeGst: platformFeeGst > 0 ? platformFeeGst : undefined,
|
|
2782
3496
|
shippingFee: shippingFee > 0 ? shippingFee : undefined,
|
|
3497
|
+
/*
|
|
3498
|
+
* The obligation this seller's offer IMPLIES, when it implies one. See the
|
|
3499
|
+
* block above `gatewayShippingObligation` for the gap this partially covers
|
|
3500
|
+
* and why it is partial rather than invented.
|
|
3501
|
+
*/
|
|
3502
|
+
shippingObligation: gatewayShippingObligation,
|
|
2783
3503
|
whatsappNotifyAddon: whatsappNotifyFee > 0 ? true : undefined,
|
|
2784
3504
|
whatsappNotifyFee: whatsappNotifyFee > 0 ? whatsappNotifyFee : undefined,
|
|
2785
3505
|
giftWrapAddon: giftWrapFee > 0 ? true : undefined,
|
|
@@ -2833,51 +3553,34 @@ async function createPhonePeGroupOrder(group, orderType, ctx) {
|
|
|
2833
3553
|
imageUrls: imageUrls.length > 0 ? imageUrls : undefined,
|
|
2834
3554
|
outOfStockPolicy,
|
|
2835
3555
|
droppedItems: unavailablePaid.length > 0 ? unavailablePaid : undefined,
|
|
3556
|
+
/*
|
|
3557
|
+
* Item 1.39 — the consent taken at CREATE-ORDER time, before the capture.
|
|
3558
|
+
* Loaded back by id from the gateway's own passthrough channel rather than
|
|
3559
|
+
* re-taken here: there is no buyer in the room on the webhook path, and
|
|
3560
|
+
* asking for consent after the money moved would be meaningless anyway.
|
|
3561
|
+
*/
|
|
3562
|
+
policyConsent,
|
|
2836
3563
|
...extraOrderFields,
|
|
2837
3564
|
});
|
|
2838
3565
|
orderIds.push(order.id);
|
|
2839
|
-
|
|
2840
|
-
// COD/manual path. See `settlePointsTender`.
|
|
2841
|
-
await settlePointsTender({ orderId: order.id, userId: uid, pointsApplied, pointsBudget });
|
|
2842
|
-
// Close the loop on any locked line this order settled: flip the offer to
|
|
2843
|
-
// "paid" (its terminal status had NO server-side writer before 2026-08-21,
|
|
2844
|
-
// so an accepted offer could be re-added and re-ordered) and back-link the
|
|
2845
|
-
// winning bid to the order it became.
|
|
2846
|
-
await finalizeLockedLines(group.map(({ item }) => item), order.id);
|
|
2847
|
-
// SB-UNI-N — claim a digital code for digital-code orders (fire-and-forget,
|
|
2848
|
-
// order is already persisted so a claim failure is logged, not thrown).
|
|
2849
|
-
if ((group[0]?.product?.listingType ?? "standard") === "digital-code") {
|
|
2850
|
-
claimDigitalCodeForOrder(getAdminDb(), firstItem.productId, order.id, uid, {
|
|
2851
|
-
userEmail: userEmail || undefined,
|
|
2852
|
-
userName,
|
|
2853
|
-
productTitle: firstItem.productTitle,
|
|
2854
|
-
}).catch((e) => serverLogger.error("claimDigitalCode", { error: normalizeError(e).message }));
|
|
2855
|
-
}
|
|
2856
|
-
for (const code of groupCouponCodes) {
|
|
2857
|
-
const entry = couponUsageAccumulator.get(code);
|
|
2858
|
-
if (entry)
|
|
2859
|
-
entry.orderIds.push(order.id);
|
|
2860
|
-
}
|
|
2861
|
-
if (userEmail) {
|
|
2862
|
-
emailsToSend.push({
|
|
2863
|
-
to: userEmail,
|
|
2864
|
-
userName,
|
|
2865
|
-
orderId: order.id,
|
|
2866
|
-
productTitle: orderItems.length > 1 ? `${orderItems.length} items` : firstItem.productTitle,
|
|
2867
|
-
quantity: totalQuantity,
|
|
2868
|
-
totalPrice: orderTotal,
|
|
2869
|
-
currency: firstItem.currency ?? getDefaultCurrency(),
|
|
2870
|
-
shippingAddress,
|
|
2871
|
-
paymentMethod: PaymentMethodValues.ONLINE,
|
|
2872
|
-
items: orderItems,
|
|
2873
|
-
});
|
|
2874
|
-
}
|
|
2875
|
-
emitOrderPlacedNotifications({
|
|
3566
|
+
await finalizeOrderPlacement({
|
|
2876
3567
|
orderId: order.id,
|
|
2877
|
-
|
|
2878
|
-
|
|
3568
|
+
uid,
|
|
3569
|
+
group,
|
|
3570
|
+
pointsApplied,
|
|
3571
|
+
pointsBudget,
|
|
3572
|
+
firstItem,
|
|
3573
|
+
userEmail,
|
|
3574
|
+
userName,
|
|
3575
|
+
groupCouponCodes,
|
|
3576
|
+
couponUsageAccumulator,
|
|
3577
|
+
emailsToSend,
|
|
3578
|
+
orderItems,
|
|
3579
|
+
totalQuantity,
|
|
3580
|
+
orderTotal,
|
|
3581
|
+
shippingAddress,
|
|
3582
|
+
paymentMethod: PaymentMethodValues.ONLINE,
|
|
2879
3583
|
storeOwnerId,
|
|
2880
|
-
productLabel: orderItems.length > 1 ? `${orderItems.length} items` : firstItem.productTitle,
|
|
2881
3584
|
paid: true,
|
|
2882
3585
|
storeId: order.storeId,
|
|
2883
3586
|
});
|
|
@@ -3082,6 +3785,28 @@ export async function verifyAndPlaceGatewayOrderAction(input) {
|
|
|
3082
3785
|
const outOfStockPolicy = input.outOfStockPolicy ??
|
|
3083
3786
|
intent?.outOfStockPolicy ??
|
|
3084
3787
|
OutOfStockPolicyValues.CANCEL_ORDER;
|
|
3788
|
+
/*
|
|
3789
|
+
* ── ITEM 1.39 — THE CONSENT, RESOLVED NOT RE-TAKEN ────────────────────────
|
|
3790
|
+
*
|
|
3791
|
+
* On this path the money is ALREADY CAPTURED, so there is nothing left to
|
|
3792
|
+
* gate: asking for consent here would be asking a buyer whose card has been
|
|
3793
|
+
* charged whether they agree. The enforcement therefore happens one request
|
|
3794
|
+
* earlier, in `POST /api/payment/create-order`, which writes a
|
|
3795
|
+
* `buyerPolicyConsents` record BEFORE calling the gateway and packs its id
|
|
3796
|
+
* into the gateway's own passthrough channel.
|
|
3797
|
+
*
|
|
3798
|
+
* What this line does is read that record back and prove it belongs to this
|
|
3799
|
+
* buyer. Its failure mode is deliberately 5xx rather than 4xx (see
|
|
3800
|
+
* `POLICY_CONSENT_UNRESOLVED_CODE`): a missing record means our own
|
|
3801
|
+
* pre-capture write is unreadable, not that the buyer did anything wrong, so
|
|
3802
|
+
* the honest answer is "ask us again" — which makes the gateway's retry
|
|
3803
|
+
* schedule the recovery path. The one outcome that is not permitted is
|
|
3804
|
+
* placing an order with no consent record on it.
|
|
3805
|
+
*/
|
|
3806
|
+
const policyConsent = await loadBuyerPolicyConsent({
|
|
3807
|
+
consentId: intent?.policyConsentId,
|
|
3808
|
+
uid,
|
|
3809
|
+
});
|
|
3085
3810
|
// Add-on fees are no longer resolved here. They are per store, and this
|
|
3086
3811
|
// function has no single store — each group reads its own selection off
|
|
3087
3812
|
// `cart.storeAddons` inside createPhonePeGroupOrder.
|
|
@@ -3167,6 +3892,70 @@ export async function verifyAndPlaceGatewayOrderAction(input) {
|
|
|
3167
3892
|
const product = productByIdPaid.get(firstMember) ?? null;
|
|
3168
3893
|
return { item, product };
|
|
3169
3894
|
});
|
|
3895
|
+
/*
|
|
3896
|
+
* ── Phase 1c at SETTLE: resolve and RECORD. Deliberately does NOT throw. ──
|
|
3897
|
+
*
|
|
3898
|
+
* 🛑 THIS IS THE ONE PLACE THE FAIL-CLOSED RULE MUST NOT REFUSE, and the
|
|
3899
|
+
* reason is arithmetic rather than taste. By the time this runs the gateway
|
|
3900
|
+
* has already captured — the `status !== "paid"` check above is what let us
|
|
3901
|
+
* get here. The funds have therefore already settled wherever the collecting
|
|
3902
|
+
* gateway settles them, so throwing does not un-commingle anything: it only
|
|
3903
|
+
* denies the buyer the order their money has already paid for. That is the
|
|
3904
|
+
* money-taken/no-order failure class this function carries two separate 🛑
|
|
3905
|
+
* blocks about (the `ADDRESS_REQUIRED` tombstone, `order_TqJvzY4gVjR2cc`,
|
|
3906
|
+
* ₹2,511.80 and a manual refund).
|
|
3907
|
+
*
|
|
3908
|
+
* The enforcement point is CAPTURE — `/api/payment/create-order` and the
|
|
3909
|
+
* `"online"` branch of `createCheckoutOrderAction`, both of which refuse
|
|
3910
|
+
* before a payment session exists. This is the detector for the case those
|
|
3911
|
+
* two did not cover: the cart can gain another seller's line between the
|
|
3912
|
+
* capture request and this one (`assertCanAddNewItems` only blocks adding
|
|
3913
|
+
* while a HIGHER lane is pending, so a standard line can still arrive), and
|
|
3914
|
+
* the webhook path reaches here with no session at all.
|
|
3915
|
+
*
|
|
3916
|
+
* So the obligation here is VISIBILITY. A multi-vendor order collected by a
|
|
3917
|
+
* gateway that cannot split means the platform now owes those vendors a
|
|
3918
|
+
* payout from its own balance — a compliance incident an operator has to
|
|
3919
|
+
* know about and resolve out of band. Silently placing the order and saying
|
|
3920
|
+
* nothing is what makes that invisible, and invisible is the whole failure
|
|
3921
|
+
* mode: a commingled capture looks exactly like a successful checkout.
|
|
3922
|
+
*
|
|
3923
|
+
* Best-effort on purpose — neither the log nor the notification may fail a
|
|
3924
|
+
* placement whose payment has already been taken.
|
|
3925
|
+
*/
|
|
3926
|
+
const settlementCheck = resolveCollectingGatewayForCart({
|
|
3927
|
+
items: settleItems,
|
|
3928
|
+
productById: productByIdPaid,
|
|
3929
|
+
platformStoreId: siteSettings?.payment?.platformStoreId,
|
|
3930
|
+
});
|
|
3931
|
+
if (!settlementCheck.resolution.ok) {
|
|
3932
|
+
const collectingGateway = getProviders().payment?.name ?? "unknown";
|
|
3933
|
+
serverLogger.error("SETTLEMENT COMPLIANCE: a captured payment was settled by a gateway that cannot satisfy this cart", {
|
|
3934
|
+
merchantOrderId,
|
|
3935
|
+
gateway: collectingGateway,
|
|
3936
|
+
constraint: settlementCheck.resolution.failedConstraint ?? "none",
|
|
3937
|
+
detail: settlementCheck.resolution.detail,
|
|
3938
|
+
});
|
|
3939
|
+
await adminNotificationsRepository
|
|
3940
|
+
.create({
|
|
3941
|
+
category: "payouts",
|
|
3942
|
+
title: "Payment collected by a gateway that cannot split this cart",
|
|
3943
|
+
body: `Payment ${merchantOrderId} was captured by "${collectingGateway}" for a cart ` +
|
|
3944
|
+
`that needed more (${settlementCheck.resolution.failedConstraint ?? "no gateway enabled"}). ` +
|
|
3945
|
+
`${settlementCheck.resolution.detail ?? ""} The order is being placed — the buyer has ` +
|
|
3946
|
+
`already paid — but any third-party seller's share is now in the platform's own ` +
|
|
3947
|
+
`account and must be settled manually.`,
|
|
3948
|
+
severity: "error",
|
|
3949
|
+
isRead: false,
|
|
3950
|
+
entityType: "order",
|
|
3951
|
+
entityId: merchantOrderId,
|
|
3952
|
+
audienceUserIds: [],
|
|
3953
|
+
})
|
|
3954
|
+
.catch((notifyErr) => {
|
|
3955
|
+
void normalizeError(notifyErr);
|
|
3956
|
+
serverLogger.error("verifyAndPlaceGatewayOrderAction: failed to write admin notification for a settlement-compliance incident", { merchantOrderId });
|
|
3957
|
+
});
|
|
3958
|
+
}
|
|
3170
3959
|
// SB6-C — maxPerUser cap check before we touch any state.
|
|
3171
3960
|
await enforceMaxPerUserForCart({
|
|
3172
3961
|
userId: uid,
|
|
@@ -3248,7 +4037,17 @@ export async function verifyAndPlaceGatewayOrderAction(input) {
|
|
|
3248
4037
|
// per group — see the same note in `previewCheckoutPricing`. `totalFee`
|
|
3249
4038
|
// carries the `minimumTransactionFee` floor, and destructuring it away is
|
|
3250
4039
|
// how it lost every consumer once already (D41).
|
|
3251
|
-
|
|
4040
|
+
/*
|
|
4041
|
+
* 🛑 `sum(item.quantity)` over the same available set the capture route
|
|
4042
|
+
* priced (`POST /api/payment/create-order` sums its own `activeItems`).
|
|
4043
|
+
* This guard runs AFTER the money has moved, so a count that disagreed with
|
|
4044
|
+
* the capture's would make it expect a different fee and throw on a paid
|
|
4045
|
+
* order — the exact post-capture-throw shape the comment above is about,
|
|
4046
|
+
* which is why the multiplier has to be derived from the same collection
|
|
4047
|
+
* rather than recounted from a different one.
|
|
4048
|
+
*/
|
|
4049
|
+
const expectedLineUnits = productChecks.map(({ item }) => item.quantity ?? 0);
|
|
4050
|
+
const expectedFees = computeCheckoutFees(cartSubtotalRs, commissionRates, expectedLineUnits);
|
|
3252
4051
|
const { platformFee: expectedPlatformFee, gstOnFee: expectedGstOnFee } = expectedFees;
|
|
3253
4052
|
// Same per-seller-group shipping sum /api/payment/create-order charged
|
|
3254
4053
|
// upfront (and the same resolveShippingCost createPhonePeGroupOrder
|
|
@@ -3389,7 +4188,11 @@ export async function verifyAndPlaceGatewayOrderAction(input) {
|
|
|
3389
4188
|
g.items[0].item.storeId,
|
|
3390
4189
|
g.items.reduce((gs, { item, product }) => gs + lineTotalFor(item, product), 0),
|
|
3391
4190
|
]);
|
|
3392
|
-
|
|
4191
|
+
// By UNIT COUNT, matching the capture route and both order paths — the
|
|
4192
|
+
// apportionment weight had to change with the fee model, and a guard
|
|
4193
|
+
// weighting it differently would expect a different per-group share.
|
|
4194
|
+
const guardLineUnits = new Map(expectedShippingGroups.map((g) => [g.items[0].item.storeId, g.items.map(({ item }) => item.quantity ?? 0)]));
|
|
4195
|
+
const guardFeeByGroup = allocateCheckoutFees(guardSubtotals, expectedFees, guardLineUnits, commissionRates);
|
|
3393
4196
|
const guardCouponByGroup = computeCartCouponDiscount(cart.appliedCoupons ?? [], expectedShippingGroups.map((g) => ({
|
|
3394
4197
|
storeId: g.items[0].item.storeId,
|
|
3395
4198
|
lines: g.items.map(({ item, product }) => ({
|
|
@@ -3499,11 +4302,15 @@ export async function verifyAndPlaceGatewayOrderAction(input) {
|
|
|
3499
4302
|
const cartSubtotal = orderGroups.reduce((s, { items: g }) => s +
|
|
3500
4303
|
g.reduce((gs, { item, product }) => gs + lineTotalFor(item, product), 0), 0);
|
|
3501
4304
|
const couponUsageAccumulator = new Map();
|
|
3502
|
-
// Same
|
|
4305
|
+
// Same tapered per-unit fee + exact per-store split as the COD/UPI path.
|
|
4306
|
+
const gatewayCommissions = siteSettings?.commissions ?? CHECKOUT_DEFAULT_COMMISSIONS;
|
|
4307
|
+
const gatewayLineUnitsOf = (g) => g.map(({ item }) => item.quantity ?? 0);
|
|
4308
|
+
const gatewayLineUnitsByStore = new Map(orderGroups.map(({ items: g }) => [g[0].item.storeId, gatewayLineUnitsOf(g)]));
|
|
4309
|
+
const gatewayCartLineUnits = orderGroups.flatMap(({ items: g }) => gatewayLineUnitsOf(g));
|
|
3503
4310
|
const platformFeeByStore = allocateCheckoutFees(orderGroups.map(({ items: g }) => [
|
|
3504
4311
|
g[0].item.storeId,
|
|
3505
4312
|
g.reduce((sum, { item, product }) => sum + lineTotalFor(item, product), 0),
|
|
3506
|
-
]), computeCheckoutFees(cartSubtotal,
|
|
4313
|
+
]), computeCheckoutFees(cartSubtotal, gatewayCommissions, gatewayCartLineUnits), gatewayLineUnitsByStore, gatewayCommissions);
|
|
3507
4314
|
/*
|
|
3508
4315
|
* The points budget for this checkout — one read, zero when not opted in.
|
|
3509
4316
|
* See the identical pair in the COD/manual path for why it is a shared
|
|
@@ -3517,18 +4324,49 @@ export async function verifyAndPlaceGatewayOrderAction(input) {
|
|
|
3517
4324
|
*/
|
|
3518
4325
|
const useAllPoints = cart.useAllPoints === true;
|
|
3519
4326
|
const pointsBudget = { remaining: useAllPoints ? await safePointsBalance(uid) : 0 };
|
|
4327
|
+
/*
|
|
4328
|
+
* ── What the gateway was INSTRUCTED to settle to each vendor ──────────────
|
|
4329
|
+
*
|
|
4330
|
+
* One bounded single-field query for the whole capture, so each order can
|
|
4331
|
+
* record whether ITS seller's share went straight to them out of escrow.
|
|
4332
|
+
* That record is the double-payment guard: without it the payout sweeps would
|
|
4333
|
+
* later create a full payout for a share the aggregator has already settled.
|
|
4334
|
+
*
|
|
4335
|
+
* 🛑 READ, never recomputed. The instruction was built in the capture request
|
|
4336
|
+
* (`/api/payment/create-order`), which is the only place that held the vendor
|
|
4337
|
+
* registrations and the exact amounts. The cart can gain a line between that
|
|
4338
|
+
* request and this one — which is exactly why the settlement-compliance
|
|
4339
|
+
* detector above exists — so a recomputation here would quietly disagree with
|
|
4340
|
+
* what was actually sent.
|
|
4341
|
+
*
|
|
4342
|
+
* 🛑 Best-effort: an unreadable payout row must not fail a placement whose
|
|
4343
|
+
* payment has already been taken (the money-taken/no-order class this
|
|
4344
|
+
* function carries two 🛑 blocks about). An empty map means "no split
|
|
4345
|
+
* recorded", which routes the order down the ORDINARY payout path — a seller
|
|
4346
|
+
* chasing a late payout is recoverable; one whose order wrongly claims it was
|
|
4347
|
+
* already settled would never be paid at all.
|
|
4348
|
+
*/
|
|
4349
|
+
let splitByStore = new Map();
|
|
4350
|
+
try {
|
|
4351
|
+
splitByStore = await payoutRepository.findBySettlementReference(merchantOrderId);
|
|
4352
|
+
}
|
|
4353
|
+
catch (err) {
|
|
4354
|
+
const normalized = normalizeError(err);
|
|
4355
|
+
serverLogger.error("verifyAndPlaceGatewayOrderAction: could not read the split-settlement records for this capture — orders will be placed on the ORDINARY payout path", { merchantOrderId, error: normalized.message });
|
|
4356
|
+
}
|
|
3520
4357
|
for (const { items: group, orderType } of orderGroups) {
|
|
3521
4358
|
total += await createPhonePeGroupOrder(group, orderType, {
|
|
3522
4359
|
appliedCoupons,
|
|
3523
4360
|
cartSubtotal,
|
|
3524
4361
|
storeAddons: cart.storeAddons,
|
|
3525
4362
|
platformFeeByStore,
|
|
4363
|
+
policyConsent,
|
|
3526
4364
|
siteSettings,
|
|
3527
4365
|
uid,
|
|
3528
4366
|
userName,
|
|
3529
4367
|
userEmail,
|
|
3530
4368
|
merchantOrderId,
|
|
3531
|
-
|
|
4369
|
+
gatewayOrderId: gatewayOrder.gatewayOrderId,
|
|
3532
4370
|
transactionId: gatewayOrder.transactionId,
|
|
3533
4371
|
shippingAddress,
|
|
3534
4372
|
/*
|
|
@@ -3568,8 +4406,16 @@ export async function verifyAndPlaceGatewayOrderAction(input) {
|
|
|
3568
4406
|
*/
|
|
3569
4407
|
emiOptIn: cart.emiPlan?.tenureMonths !== undefined,
|
|
3570
4408
|
emiTenureMonths: cart.emiPlan?.tenureMonths,
|
|
4409
|
+
splitByStore,
|
|
3571
4410
|
});
|
|
3572
4411
|
}
|
|
4412
|
+
/*
|
|
4413
|
+
* Item 1.39 — backlink, same as the COD/manual path. On THIS path it carries
|
|
4414
|
+
* extra diagnostic weight: a consent record with a captured payment behind it
|
|
4415
|
+
* and no order ids is the 2026-10-21 shape (money taken, no order), so the
|
|
4416
|
+
* absence of this link is itself a signal worth being able to query for.
|
|
4417
|
+
*/
|
|
4418
|
+
await attachOrdersToPolicyConsent(policyConsent.consentId, orderIds);
|
|
3573
4419
|
await flushCouponUsageAccumulator(couponUsageAccumulator, uid);
|
|
3574
4420
|
// SB-UNI-5 2026-05-13 — bundle-aware batch decrement. We iterate the
|
|
3575
4421
|
// cumulative `decrements` map (one entry per unique member product) so a
|