@riverbankcms/sdk 0.130.0 → 0.132.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +85 -0
- package/README.md +1 -1
- package/dist/{PreviewEditorSidebar-DiEpbOdw.mjs → PreviewEditorSidebar-DKQ5eFK9.mjs} +365 -106
- package/dist/{PreviewEditorUI-C6MvxnIa.mjs → PreviewEditorUI-CNTcOjCC.mjs} +3 -3
- package/dist/{PreviewQueryProvider-C2rnoPz6.mjs → PreviewQueryProvider-D51gQaG3.mjs} +1 -1
- package/dist/{SdkPreviewModeRuntime-DRXA_m5L.mjs → SdkPreviewModeRuntime-DJu3qu33.mjs} +91 -25
- package/dist/{SiteChromeCustomizeContext-BTHdv5_-.mjs → SiteChromeCustomizeContext-2TzT3vbj.mjs} +12577 -9240
- package/dist/_dts/ai/src/contracts/proposals.d.ts +991 -142
- package/dist/_dts/ai/src/contracts/siteStyleProposalSchemas.d.ts +1092 -148
- package/dist/_dts/api/src/accountApi.d.ts +213 -0
- package/dist/_dts/api/src/accountEndpointDefinitions.d.ts +30 -0
- package/dist/_dts/api/src/accountEndpoints.d.ts +254 -0
- package/dist/_dts/api/src/apiCallParams.d.ts +60 -0
- package/dist/_dts/api/src/bookingConfig.d.ts +18 -24
- package/dist/_dts/api/src/bookingManagementEndpoints.d.ts +12 -24
- package/dist/_dts/api/src/bookingManagementEventEndpointTypes.d.ts +44 -0
- package/dist/_dts/api/src/bookingSettingsSections.d.ts +9 -0
- package/dist/_dts/api/src/bookingVerticals.d.ts +1 -140
- package/dist/_dts/api/src/commercePortalEndpoints.d.ts +47 -12
- package/dist/_dts/api/src/contentRuntime.d.ts +2 -1
- package/dist/_dts/api/src/courses.d.ts +1 -19
- package/dist/_dts/api/src/endpoints.d.ts +885 -721
- package/dist/_dts/api/src/event-destination-policy.d.ts +2 -2
- package/dist/_dts/api/src/eventManagementContracts.d.ts +173 -7
- package/dist/_dts/api/src/eventManagementEndpointDefinitions.d.ts +58 -0
- package/dist/_dts/api/src/giftingDashboard.d.ts +117 -0
- package/dist/_dts/api/src/giftingEndpointDefinitions.d.ts +124 -0
- package/dist/_dts/api/src/index.d.ts +12 -4
- package/dist/_dts/api/src/indexCoreTypes.d.ts +1 -0
- package/dist/_dts/api/src/indexExtendedTypes.d.ts +1 -0
- package/dist/_dts/api/src/media.d.ts +1 -0
- package/dist/_dts/api/src/navigation/dashboardBookingsNav.d.ts +3 -4
- package/dist/_dts/api/src/oauth.d.ts +8 -0
- package/dist/_dts/api/src/preview-auth.d.ts +26 -0
- package/dist/_dts/api/src/publicEventEndpointDefinitions.d.ts +11 -0
- package/dist/_dts/api/src/publicExperience/eventEndpoints.d.ts +29 -16
- package/dist/_dts/api/src/publicExperience/sharedTypes.d.ts +2 -0
- package/dist/_dts/api/src/publicExperience/wholeSeriesEndpoints.d.ts +1 -1
- package/dist/_dts/api/src/sdk-event-upsert.d.ts +3 -1
- package/dist/_dts/api/src/sdkBlockUpsertContracts.d.ts +48 -0
- package/dist/_dts/api/src/sdkBookingVerticalContracts.d.ts +29 -0
- package/dist/_dts/api/src/sdkContracts.d.ts +14 -45
- package/dist/_dts/api/src/sdkEndpointDefinitions.d.ts +23 -0
- package/dist/_dts/api/src/sdkEventCategoryContracts.d.ts +9 -0
- package/dist/_dts/api/src/sdkSettingsContracts.d.ts +25 -0
- package/dist/_dts/api/src/sdkThemeCatalogContracts.d.ts +20 -0
- package/dist/_dts/api/src/sdkThemeWire.d.ts +54 -12
- package/dist/_dts/api/src/settings/permissions.d.ts +2 -2
- package/dist/_dts/api/src/siteApiKeyEndpointDefinitions.d.ts +66 -0
- package/dist/_dts/api/src/siteInfrastructure.d.ts +3 -3
- package/dist/_dts/api/src/siteOnboarding.d.ts +3 -3
- package/dist/_dts/api/src/siteOperations.d.ts +1 -1
- package/dist/_dts/api/src/sitePlatformEndpoints.d.ts +16 -14
- package/dist/_dts/api/src/siteRuntimeEndpoints.d.ts +0 -3
- package/dist/_dts/api/src/types.d.ts +8 -61
- package/dist/_dts/block-form/src/client/index.d.ts +15 -23
- package/dist/_dts/block-form/src/index.d.ts +23 -22
- package/dist/_dts/blocks/src/PageRenderer.d.ts +2 -13
- package/dist/_dts/blocks/src/contracts/non-block-islands.d.ts +9 -0
- package/dist/_dts/blocks/src/contracts/proof-block-islands.d.ts +26 -44
- package/dist/_dts/blocks/src/index.d.ts +1 -1
- package/dist/_dts/blocks/src/primitives/layout/Grid.d.ts +18 -1
- package/dist/_dts/blocks/src/subroutes/fold.d.ts +2 -1
- package/dist/_dts/blocks/src/system/blocks/appointment-booking.d.ts +1 -0
- package/dist/_dts/blocks/src/system/blocks/courses/shared/index.d.ts +0 -3
- package/dist/_dts/blocks/src/system/blocks/courses/shared/pricing.d.ts +2 -50
- package/dist/_dts/blocks/src/system/blocks/courses/shared/schemas.d.ts +1 -929
- package/dist/_dts/blocks/src/system/blocks/courses/shared/types.d.ts +1 -97
- package/dist/_dts/blocks/src/system/blocks/event-details.d.ts +39 -6
- package/dist/_dts/blocks/src/system/blocks/events/event-calendar.d.ts +2 -1
- package/dist/_dts/blocks/src/system/blocks/events/event-listing.d.ts +3 -3
- package/dist/_dts/blocks/src/system/blocks/events/event-spotlight.d.ts +2 -3
- package/dist/_dts/blocks/src/system/blocks/events/shared/filtering.d.ts +2 -2
- package/dist/_dts/blocks/src/system/blocks/events/shared/schemas.d.ts +64 -3
- package/dist/_dts/blocks/src/system/blocks/events/shared/types.d.ts +26 -31
- package/dist/_dts/blocks/src/system/blocks/events/whole-series/index.d.ts +3 -0
- package/dist/_dts/blocks/src/system/blocks/events/whole-series/pricing.d.ts +50 -0
- package/dist/_dts/blocks/src/system/blocks/events/whole-series/schemas.d.ts +135 -0
- package/dist/_dts/blocks/src/system/blocks/events/whole-series/types.d.ts +81 -0
- package/dist/_dts/blocks/src/system/blocks/feature-cards.d.ts +25 -1
- package/dist/_dts/blocks/src/system/blocks/media-text.d.ts +16 -39
- package/dist/_dts/blocks/src/system/blocks/offerings-preview/model.d.ts +1 -1
- package/dist/_dts/blocks/src/system/blocks/site-header.d.ts +0 -1
- package/dist/_dts/blocks/src/system/blocks/team-members.d.ts +4 -63
- package/dist/_dts/blocks/src/system/customize/backgrounds.d.ts +1 -3
- package/dist/_dts/blocks/src/system/fields/boxStyles.d.ts +13 -2
- package/dist/_dts/blocks/src/system/fields/gridLayout.d.ts +20 -0
- package/dist/_dts/blocks/src/system/node/fragments/classNameBinding.d.ts +6 -1
- package/dist/_dts/blocks/src/system/node/fragments/styledCard.d.ts +31 -0
- package/dist/_dts/blocks/src/system/node/validation-constants.d.ts +1 -1
- package/dist/_dts/blocks/src/system/runtime/api/endpoints.d.ts +4 -0
- package/dist/_dts/blocks/src/system/runtime/api/types/courses.d.ts +0 -1
- package/dist/_dts/blocks/src/system/runtime/api/types/events.d.ts +0 -1
- package/dist/_dts/blocks/src/system/runtime/blockComposition.d.ts +1 -1
- package/dist/_dts/blocks/src/system/runtime/components/registry.client.d.ts +45 -72
- package/dist/_dts/blocks/src/system/runtime/components/runtime-backed-blocks.d.ts +21 -36
- package/dist/_dts/blocks/src/system/runtime/hooks/useHeadlessBookingFlow.state.d.ts +4 -2
- package/dist/_dts/blocks/src/system/runtime/hooks/useHeadlessWholeSeriesRegistrationFlow.d.ts +6 -6
- package/dist/_dts/blocks/src/system/runtime/nodes/booking-form.headless.state.d.ts +24 -8
- package/dist/_dts/blocks/src/system/runtime/nodes/booking-form.server.d.ts +8 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/booking-form.validationErrors.d.ts +17 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/course-page-surface-scope.d.ts +2 -5
- package/dist/_dts/blocks/src/system/runtime/nodes/course-registration.client.d.ts +4 -2
- package/dist/_dts/blocks/src/system/runtime/nodes/course-registration.interactive.d.ts +19 -7
- package/dist/_dts/blocks/src/system/runtime/nodes/event-details/logic.d.ts +25 -4
- package/dist/_dts/blocks/src/system/runtime/nodes/event-details/presentation.d.ts +75 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-details/view.d.ts +4 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/event-details.client.d.ts +5 -2
- package/dist/_dts/blocks/src/system/runtime/nodes/event-details.server.d.ts +5 -2
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/PaymentSelectionStep.d.ts +4 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/RegistrationClosedState.d.ts +5 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/SiteCreditPreviewPanel.d.ts +6 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/event-registration.headless.planning.d.ts +1 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/eventPaymentOptions.d.ts +2 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/eventScope.d.ts +1 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/hooks.d.ts +17 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/registrationSurface.d.ts +3 -3
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/siteCreditPreview.d.ts +51 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/types.d.ts +3 -3
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/useEventRegistrationWizard.d.ts +2 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/{course-registration → event-registration/whole-series}/BookingModeStep.d.ts +1 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/{course-registration → event-registration/whole-series}/CheckIcon.d.ts +1 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/{course-registration → event-registration/whole-series}/ErrorStep.d.ts +1 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/{course-registration → event-registration/whole-series}/MembershipHero.d.ts +3 -3
- package/dist/_dts/blocks/src/system/runtime/nodes/{course-registration → event-registration/whole-series}/PaymentFailedStep.d.ts +1 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/whole-series/StepIndicator.d.ts +6 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/{course-registration → event-registration/whole-series}/VerifyingTimeoutStep.d.ts +1 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/whole-series/WholeSeriesRegistrationActiveSteps.d.ts +9 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/{course-registration/CourseRegistrationErrorBoundary.d.ts → event-registration/whole-series/WholeSeriesRegistrationErrorBoundary.d.ts} +5 -2
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/whole-series/WholeSeriesRegistrationTerminalContent.d.ts +8 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/whole-series/WholeSeriesRegistrationWizard.d.ts +8 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/whole-series/components.d.ts +45 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/{course-registration → event-registration/whole-series}/index.d.ts +4 -4
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/whole-series/presentation.d.ts +7 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/whole-series/pricing.d.ts +14 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/{course-registration → event-registration/whole-series}/types.d.ts +18 -16
- package/dist/_dts/blocks/src/system/runtime/nodes/{course-registration/useCourseEligibility.d.ts → event-registration/whole-series/useWholeSeriesEligibility.d.ts} +6 -6
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/whole-series/useWholeSeriesPaymentVerification.d.ts +10 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/whole-series/useWholeSeriesRegistrationActions.d.ts +35 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/{course-registration/useCourseRegistrationPortal.d.ts → event-registration/whole-series/useWholeSeriesRegistrationPortal.d.ts} +2 -2
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/whole-series/useWholeSeriesRegistrationSelection.d.ts +35 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/whole-series/useWholeSeriesRegistrationWizard.d.ts +185 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/{course-registration/useCourseWaitlistSelection.d.ts → event-registration/whole-series/useWholeSeriesWaitlistSelection.d.ts} +5 -5
- package/dist/_dts/blocks/src/system/runtime/nodes/{course-registration → event-registration/whole-series}/utils.d.ts +4 -4
- package/dist/_dts/blocks/src/system/runtime/nodes/{course-registration → event-registration/whole-series}/whole-series-registration.headless.contract.d.ts +5 -7
- package/dist/_dts/blocks/src/system/runtime/nodes/{course-registration → event-registration/whole-series}/whole-series-registration.headless.planning.d.ts +2 -2
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/whole-series/wholeSeriesPageSurfaceScope.d.ts +17 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/{course-registration/courseRegistrationViewState.d.ts → event-registration/whole-series/wholeSeriesRegistrationViewState.d.ts} +7 -7
- package/dist/_dts/blocks/src/system/runtime/nodes/{course-registration → event-registration/whole-series}/wizardSteps.d.ts +4 -4
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration.interactive.d.ts +24 -54
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration.server.d.ts +1 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/events/EventCombined.client.d.ts +2 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/events/EventCombined.interactive.d.ts +3 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/events/EventListing.interactive.d.ts +12 -11
- package/dist/_dts/blocks/src/system/runtime/nodes/events/EventListing.server.d.ts +3 -2
- package/dist/_dts/blocks/src/system/runtime/nodes/events/EventSpotlight.d.ts +3 -2
- package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/EventCard.d.ts +3 -2
- package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/EventDetailModal.d.ts +4 -3
- package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/EventModalCloseButton.d.ts +7 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/EventModals.d.ts +4 -3
- package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/WeekBoardView.d.ts +14 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/eventCollectionContract.d.ts +59 -2
- package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/utils.d.ts +4 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/shared/MagicLinkForm.d.ts +1 -1
- package/dist/_dts/blocks/src/system/runtime/shared/components/DiscountCodeDisclosure.d.ts +12 -12
- package/dist/_dts/blocks/src/system/runtime/shared/components/FeedbackMessage.d.ts +17 -1
- package/dist/_dts/blocks/src/system/runtime/shared/components/index.d.ts +1 -1
- package/dist/_dts/blocks/src/system/runtime/shared/useWaitlistClaim.d.ts +1 -0
- package/dist/_dts/blocks/src/system/spacing.d.ts +1 -1
- package/dist/_dts/blocks/src/system/transforms/registry/_utils/boxStyleClassNames.d.ts +109 -0
- package/dist/_dts/blocks/src/system/transforms/registry/_utils/surfaceForegroundStyles.d.ts +4 -0
- package/dist/_dts/blocks/src/system/transforms/registry/boxStyles.d.ts +40 -3
- package/dist/_dts/blocks/src/system/transforms/registry/index.d.ts +1 -0
- package/dist/_dts/blocks/src/system/transforms/registry/layout.d.ts +4 -37
- package/dist/_dts/blocks/src/system/transforms/typed.d.ts +1 -4
- package/dist/_dts/commerce/src/purchase/bookingInstalmentSchedule.d.ts +13 -0
- package/dist/_dts/commerce/src/purchase/cancellationPolicy.d.ts +7 -0
- package/dist/_dts/commerce/src/purchase/canonicalRefundPlanner.d.ts +48 -0
- package/dist/_dts/commerce/src/purchase/checkoutCollectionPlan.d.ts +39 -0
- package/dist/_dts/commerce/src/purchase/checkoutCommitPlan.d.ts +40 -0
- package/dist/_dts/commerce/src/purchase/checkoutDiscountContextPlanning.d.ts +80 -0
- package/dist/_dts/commerce/src/purchase/checkoutErrorCodes.d.ts +1 -0
- package/dist/_dts/commerce/src/purchase/checkoutOrderItemProjection.d.ts +22 -0
- package/dist/_dts/commerce/src/purchase/checkoutPaymentFlow.d.ts +50 -0
- package/dist/_dts/commerce/src/purchase/checkoutPaymentPlanPlanning.d.ts +30 -0
- package/dist/_dts/commerce/src/purchase/checkoutPaymentTermPlanning.d.ts +10 -0
- package/dist/_dts/commerce/src/purchase/checkoutPaymentTerms.d.ts +53 -0
- package/dist/_dts/commerce/src/purchase/checkoutQuantity.d.ts +8 -0
- package/dist/_dts/commerce/src/purchase/checkoutSessionMetadata.d.ts +76 -0
- package/dist/_dts/commerce/src/purchase/checkoutSettlement.d.ts +46 -0
- package/dist/_dts/commerce/src/purchase/checkoutStripeFinalizationPlanning.d.ts +12 -0
- package/dist/_dts/commerce/src/purchase/checkoutStripeSessionPlanning.d.ts +125 -0
- package/dist/_dts/commerce/src/purchase/checkoutValidatedItemPlanning.d.ts +55 -0
- package/dist/_dts/commerce/src/purchase/confirmationEmailPayment.d.ts +91 -0
- package/dist/_dts/commerce/src/purchase/discountApplication.d.ts +74 -0
- package/dist/_dts/commerce/src/purchase/index.d.ts +55 -0
- package/dist/_dts/commerce/src/purchase/oneTimeCheckoutPlanning.d.ts +86 -0
- package/dist/_dts/commerce/src/purchase/order-number.d.ts +33 -0
- package/dist/_dts/commerce/src/purchase/orderCancellationPlan.d.ts +19 -0
- package/dist/_dts/commerce/src/purchase/orderCompletionEmailPlan.d.ts +71 -0
- package/dist/_dts/commerce/src/purchase/orderConfirmationPlanning.d.ts +120 -0
- package/dist/_dts/commerce/src/purchase/orderFulfillmentPlan.d.ts +81 -0
- package/dist/_dts/commerce/src/purchase/orderFulfillmentResult.d.ts +8 -0
- package/dist/_dts/commerce/src/purchase/orderHistoryLedgerFilters.d.ts +1 -0
- package/dist/_dts/commerce/src/purchase/orderHistorySource.d.ts +11 -0
- package/dist/_dts/commerce/src/purchase/orderInstalmentAdminSettlement.d.ts +43 -0
- package/dist/_dts/commerce/src/purchase/orderInstalmentClosure.d.ts +29 -0
- package/dist/_dts/commerce/src/purchase/orderInstalmentLifecycle.d.ts +44 -0
- package/dist/_dts/commerce/src/purchase/orderInstalmentPayoff.d.ts +24 -0
- package/dist/_dts/commerce/src/purchase/orderInstalmentPlan.d.ts +40 -0
- package/dist/_dts/commerce/src/purchase/orderItemMetadata.d.ts +151 -0
- package/dist/_dts/commerce/src/purchase/orderItemSupport.d.ts +14 -0
- package/dist/_dts/commerce/src/purchase/orderListFilters.d.ts +3 -0
- package/dist/_dts/commerce/src/purchase/orderPaymentLinkPlanning.d.ts +60 -0
- package/dist/_dts/commerce/src/purchase/orderPaymentReceipt.d.ts +184 -0
- package/dist/_dts/commerce/src/purchase/orderPaymentState.d.ts +135 -0
- package/dist/_dts/commerce/src/purchase/orderPlanningTypes.d.ts +102 -0
- package/dist/_dts/commerce/src/purchase/orderRefundPlanning.d.ts +50 -0
- package/dist/_dts/commerce/src/purchase/orderRefundPolicy.d.ts +36 -0
- package/dist/_dts/commerce/src/purchase/orderTotals.d.ts +23 -0
- package/dist/_dts/commerce/src/purchase/orderTypes.d.ts +39 -0
- package/dist/_dts/commerce/src/purchase/pendingCheckoutSessionClaim.d.ts +1 -0
- package/dist/_dts/commerce/src/purchase/persistedCheckoutLines.d.ts +27 -0
- package/dist/_dts/commerce/src/purchase/protectedDepositRefundPolicy.d.ts +86 -0
- package/dist/_dts/commerce/src/purchase/refundPolicy.d.ts +8 -0
- package/dist/_dts/commerce/src/purchase/refundRailSplit.d.ts +40 -0
- package/dist/_dts/commerce/src/purchase/result.d.ts +2 -0
- package/dist/_dts/commerce/src/purchase/settlement.d.ts +97 -0
- package/dist/_dts/commerce/src/purchase/shopRefundPlanning.d.ts +43 -0
- package/dist/_dts/commerce/src/purchase/stateTransitions.d.ts +31 -0
- package/dist/_dts/commerce/src/purchase/stripeMinimumCharge.d.ts +10 -0
- package/dist/_dts/commerce/src/purchase/types.d.ts +168 -0
- package/dist/_dts/commerce/src/shop/shipmentEligibility.d.ts +14 -0
- package/dist/_dts/commerce/src/utils/assertNever.d.ts +1 -0
- package/dist/_dts/content-editor/src/components/ContentFieldsForm.d.ts +2 -2
- package/dist/_dts/content-model/src/content-types/builtin-schemas.d.ts +10 -6
- package/dist/_dts/content-model/src/content-types/builtins.d.ts +10 -6
- package/dist/_dts/core/src/booking-vertical-catalog.d.ts +741 -0
- package/dist/_dts/core/src/booking-vertical-config.d.ts +66 -0
- package/dist/_dts/core/src/booking-vertical-definitions.d.ts +68 -0
- package/dist/_dts/{api/src/bookingVerticalPreset.d.ts → core/src/booking-vertical-preset.d.ts} +1 -1
- package/dist/_dts/core/src/booking-verticals.d.ts +98 -0
- package/dist/_dts/core/src/branded.d.ts +4 -0
- package/dist/_dts/core/src/event-page-selection.d.ts +22 -0
- package/dist/_dts/core/src/event-page-surface-subject.d.ts +25 -4
- package/dist/_dts/core/src/event-pricing.d.ts +5 -0
- package/dist/_dts/core/src/event-series-behaviour.d.ts +16 -0
- package/dist/_dts/core/src/index.d.ts +6 -0
- package/dist/_dts/core/src/public-event-booking-availability.d.ts +8 -0
- package/dist/_dts/core/src/secret.d.ts +44 -0
- package/dist/_dts/db/src/generated/supabase/database.types.d.ts +413 -0
- package/dist/_dts/db/src/schemas/forms.d.ts +4 -4
- package/dist/_dts/editor-blocks/src/BlockEditor.d.ts +2 -1
- package/dist/_dts/editor-blocks/src/BlockForm.d.ts +2 -2
- package/dist/_dts/editor-blocks/src/block-editor/BlockCard.d.ts +2 -2
- package/dist/_dts/editor-blocks/src/block-editor/BlockCardBody.d.ts +1 -1
- package/dist/_dts/editor-blocks/src/block-editor/BlockCardHeader.d.ts +1 -1
- package/dist/_dts/editor-blocks/src/block-editor/SortableBlockItem.d.ts +1 -1
- package/dist/_dts/editor-blocks/src/block-editor/hooks/useBlockValidationManifests.d.ts +1 -1
- package/dist/_dts/editor-blocks/src/block-editor/preparedManifest.d.ts +1 -1
- package/dist/_dts/editor-blocks/src/blockPayload.d.ts +1 -1
- package/dist/_dts/editor-blocks/src/index.d.ts +2 -2
- package/dist/_dts/editor-blocks/src/media/MediaField.d.ts +2 -2
- package/dist/_dts/editor-blocks/src/widgets/button/ButtonField.d.ts +1 -1
- package/dist/_dts/editor-blocks/src/widgets/button/ButtonVariantField.d.ts +1 -1
- package/dist/_dts/editor-blocks/src/widgets/button/index.d.ts +1 -1
- package/dist/_dts/editor-blocks/src/widgets/content-type-select/ContentTypeSelectField.d.ts +1 -1
- package/dist/_dts/editor-blocks/src/widgets/entry-picker/EntryPickerField.d.ts +1 -1
- package/dist/_dts/editor-blocks/src/widgets/entry-picker/index.d.ts +1 -1
- package/dist/_dts/editor-blocks/src/widgets/icon-picker/IconPickerField.d.ts +1 -1
- package/dist/_dts/editor-blocks/src/widgets/inline-text/InlineTextField.d.ts +1 -1
- package/dist/_dts/editor-blocks/src/widgets/link/LinkField.d.ts +2 -2
- package/dist/_dts/editor-blocks/src/widgets/offerings-preview/OfferingsPreviewGroupOrderField.d.ts +1 -1
- package/dist/_dts/editor-blocks/src/widgets/reference/ReferenceField.d.ts +2 -2
- package/dist/_dts/editor-blocks/src/widgets/rich-text/RichTextField.d.ts +2 -2
- package/dist/_dts/editor-blocks/src/widgets/site-option-picker/SiteOptionPickerField.d.ts +1 -1
- package/dist/_dts/editor-blocks/src/widgets/site-option-picker/utils.d.ts +1 -1
- package/dist/_dts/media-core/src/fileUploadCompletion.d.ts +3 -0
- package/dist/_dts/media-core/src/fileUploadDurableFinalization.d.ts +2 -0
- package/dist/_dts/media-core/src/identifiers.d.ts +10 -0
- package/dist/_dts/media-core/src/mediaWriteNormalizer.d.ts +2 -6
- package/dist/_dts/media-core/src/types.d.ts +2 -1
- package/dist/_dts/media-editor/src/index.d.ts +2 -2
- package/dist/_dts/media-editor/src/mediaSelection.d.ts +1 -22
- package/dist/_dts/media-editor/src/useMediaSelection.d.ts +0 -9
- package/dist/_dts/preview-next/src/client/blocks/useBlockCustomizeControls.d.ts +1 -1
- package/dist/_dts/preview-next/src/client/preview/ButtonHoverRoleControls.d.ts +10 -0
- package/dist/_dts/preview-next/src/client/preview/ButtonStylePicker.d.ts +3 -2
- package/dist/_dts/preview-next/src/client/preview/EntryEditorPanel.d.ts +1 -1
- package/dist/_dts/preview-next/src/client/preview/EntrySlotBlockEditorPanel.d.ts +1 -1
- package/dist/_dts/preview-next/src/client/preview/PreviewEditorSidebar.d.ts +3 -1
- package/dist/_dts/preview-next/src/client/preview/PreviewShell.d.ts +4 -1
- package/dist/_dts/preview-next/src/client/preview/PreviewShellLayout.d.ts +2 -1
- package/dist/_dts/preview-next/src/client/preview/PreviewSiteFontStorageContext.d.ts +6 -0
- package/dist/_dts/preview-next/src/client/preview/StyleConfigurator.d.ts +3 -1
- package/dist/_dts/preview-next/src/client/preview/StyleConfiguratorWarningNotice.d.ts +7 -0
- package/dist/_dts/preview-next/src/client/preview/siteFontPreview.d.ts +5 -0
- package/dist/_dts/preview-next/src/client/preview/siteStylePreviewPlanner.d.ts +1 -1
- package/dist/_dts/preview-next/src/client/sdk/contentStorage.d.ts +10 -0
- package/dist/_dts/preview-next/src/client/widgets/widgetOverrides.d.ts +1 -1
- package/dist/_dts/preview-next/src/index.d.ts +1 -0
- package/dist/_dts/preview-next/src/keepAlive.d.ts +3 -5
- package/dist/_dts/preview-next/src/refresh-contract.d.ts +1 -0
- package/dist/_dts/preview-next/src/route-contract.d.ts +7 -0
- package/dist/_dts/sdk/src/client/eventSubrouteReadOperations.d.ts +11 -0
- package/dist/_dts/sdk/src/client/types.d.ts +12 -5
- package/dist/_dts/sdk/src/components.d.ts +1 -1
- package/dist/_dts/sdk/src/contracts/index.d.ts +1 -1
- package/dist/_dts/sdk/src/contracts/page.d.ts +2 -13
- package/dist/_dts/sdk/src/contracts/system-block-content.d.ts +64 -54
- package/dist/_dts/sdk/src/next/pageMetadataProjection.d.ts +7 -0
- package/dist/_dts/sdk/src/next/resolveEventPageSubroute.d.ts +12 -0
- package/dist/_dts/sdk/src/preview-next/keep-alive.d.ts +1 -1
- package/dist/_dts/sdk/src/public-api/contracts.d.ts +5 -19
- package/dist/_dts/sdk/src/public-api/eventSubrouteContracts.d.ts +12 -0
- package/dist/_dts/sdk/src/public-api/runtime.d.ts +1 -1
- package/dist/_dts/sdk/src/rendering/client.d.ts +44 -0
- package/dist/_dts/sdk/src/rendering/components/Layout.d.ts +1 -1
- package/dist/_dts/sdk/src/rendering/index.d.ts +1 -1
- package/dist/_dts/sdk/src/rendering/islands/types.d.ts +9 -1
- package/dist/_dts/sdk/src/routing/entrySubroutes.d.ts +1 -1
- package/dist/_dts/sdk/src/routing/resolveOccurrence.d.ts +4 -3
- package/dist/_dts/sdk/src/routing/resolvePageContent.d.ts +7 -3
- package/dist/_dts/sdk/src/theme-bridge/types.d.ts +4 -2
- package/dist/_dts/sdk/src/version.d.ts +1 -1
- package/dist/_dts/theme-core/src/buttons/buttonSurfaceContext.d.ts +1 -1
- package/dist/_dts/theme-core/src/buttons/contextualHover.d.ts +41 -0
- package/dist/_dts/theme-core/src/buttons/index.d.ts +1 -0
- package/dist/_dts/theme-core/src/buttons/resolveButtonColourStates.d.ts +3 -0
- package/dist/_dts/theme-core/src/buttons/resolveButtonHoverTreatment.d.ts +14 -0
- package/dist/_dts/theme-core/src/buttons/styles/domain.d.ts +21 -4
- package/dist/_dts/theme-core/src/buttons/styles/recipes/flatInk.d.ts +92 -0
- package/dist/_dts/theme-core/src/buttons/styles/recipes/staticRecipes.d.ts +10 -150
- package/dist/_dts/theme-core/src/buttons/styles/registry.d.ts +57 -102
- package/dist/_dts/theme-core/src/buttons/styles/selection.d.ts +50 -2
- package/dist/_dts/theme-core/src/buttons/types.d.ts +29 -0
- package/dist/_dts/theme-core/src/cards/core.d.ts +54 -10
- package/dist/_dts/theme-core/src/cards/decorations.d.ts +33 -0
- package/dist/_dts/theme-core/src/cards/generateDefaultCardSystem.d.ts +7 -2
- package/dist/_dts/theme-core/src/cards/index.d.ts +3 -0
- package/dist/_dts/theme-core/src/cards/openCardVariant.d.ts +24 -0
- package/dist/_dts/theme-core/src/cards/roles.d.ts +38 -0
- package/dist/_dts/theme-core/src/cards/siteStyleDefaults.d.ts +53 -8
- package/dist/_dts/theme-core/src/cards/types.d.ts +474 -28
- package/dist/_dts/theme-core/src/generated/containerResponsiveThemeCss.d.ts +1 -1
- package/dist/_dts/theme-core/src/header/legacyHeaderVariant.d.ts +59 -0
- package/dist/_dts/theme-core/src/header/paintTargets.d.ts +2 -2
- package/dist/_dts/theme-core/src/header/scrollTreatment.d.ts +3 -2
- package/dist/_dts/theme-core/src/mock-themes/all.d.ts +30 -138
- package/dist/_dts/theme-core/src/palette/utils/contrast.d.ts +1 -0
- package/dist/_dts/theme-core/src/palette/utils/opaqueSurfaceColor.d.ts +6 -0
- package/dist/_dts/theme-core/src/runtime/buildThemeRuntimeFromBridge.d.ts +1 -1
- package/dist/_dts/theme-core/src/schema.d.ts +302 -107
- package/dist/_dts/theme-core/src/site-styles/appearancePresetCatalog.d.ts +111 -102
- package/dist/_dts/theme-core/src/site-styles/appearancePresetResolution.d.ts +12 -1
- package/dist/_dts/theme-core/src/site-styles/appearancePresetTypes.d.ts +9 -4
- package/dist/_dts/theme-core/src/site-styles/backgroundAppearance.d.ts +0 -20
- package/dist/_dts/theme-core/src/site-styles/blockAppearancePresets.d.ts +111 -102
- package/dist/_dts/theme-core/src/site-styles/buttonSelectionCompiler.d.ts +18 -0
- package/dist/_dts/theme-core/src/site-styles/cardRoleVocabulary.d.ts +48 -0
- package/dist/_dts/theme-core/src/site-styles/compilationPlan.d.ts +21 -0
- package/dist/_dts/theme-core/src/site-styles/designState.d.ts +21 -385
- package/dist/_dts/theme-core/src/site-styles/generatedSchemas.d.ts +10 -18
- package/dist/_dts/theme-core/src/site-styles/headerLayoutTypes.d.ts +2 -4
- package/dist/_dts/theme-core/src/site-styles/headerOpeningForeground.d.ts +2 -9
- package/dist/_dts/theme-core/src/site-styles/headerOpeningSection.d.ts +0 -2
- package/dist/_dts/theme-core/src/site-styles/index.d.ts +5 -0
- package/dist/_dts/theme-core/src/site-styles/pageDesignAppearanceAvailability.d.ts +3 -0
- package/dist/_dts/theme-core/src/site-styles/pageDesignEditorCapabilities.d.ts +22 -0
- package/dist/_dts/theme-core/src/site-styles/pageDesignEditorModel.d.ts +9 -8
- package/dist/_dts/theme-core/src/site-styles/pageDesignIntentEquality.d.ts +3 -0
- package/dist/_dts/theme-core/src/site-styles/previewCompiler.d.ts +2 -11
- package/dist/_dts/theme-core/src/site-styles/previewRuntimeCapabilities.d.ts +19 -0
- package/dist/_dts/theme-core/src/site-styles/runtimeBackgroundResolution.d.ts +9 -0
- package/dist/_dts/theme-core/src/site-styles/runtimeCompiler.d.ts +1 -62
- package/dist/_dts/theme-core/src/site-styles/selectionFallbackWarning.d.ts +15 -0
- package/dist/_dts/theme-core/src/site-styles/sourceCatalogs.d.ts +13 -12
- package/dist/_dts/theme-core/src/site-styles/types.d.ts +62 -39
- package/dist/_dts/theme-core/src/siteChromePlanning.d.ts +9 -9
- package/dist/_dts/theme-core/src/status/generateStatusCss.d.ts +1 -0
- package/dist/_dts/theme-core/src/surfaces/index.d.ts +1 -0
- package/dist/_dts/theme-core/src/surfaces/resolveSurfaceForeground.d.ts +39 -0
- package/dist/_dts/ui/src/navigation-tabs.d.ts +5 -2
- package/dist/client/{DiscountCodeDisclosure-Ur-Xx1U_.mjs → DiscountCodeDisclosure-DO7llLxm.mjs} +12 -12
- package/dist/client/{EventCombined.client-EhscD4U6.mjs → EventCombined.client-xID7zN__.mjs} +38 -50
- package/dist/client/{EventListing.client-Bn26cFTY.mjs → EventListing.client-CriBslp0.mjs} +2 -2
- package/dist/client/{FeedbackMessage-ByMrs3cr.mjs → FeedbackMessage-CtLvvS_d.mjs} +15 -3
- package/dist/client/{LeafletStaticMap-BUw9Ntzr.mjs → LeafletStaticMap-DYmHnM8g.mjs} +1 -1
- package/dist/client/{StepIndicator-BfbdiVQI.mjs → StepIndicator-CGixP_LW.mjs} +3 -3
- package/dist/client/{CourseRegistrationWizard-Bvtz9G9g.mjs → WholeSeriesRegistrationWizard-BEjzSiOA.mjs} +1410 -1247
- package/dist/client/{accordion-CjIeof73.mjs → accordion-CgFbnnnQ.mjs} +1 -1
- package/dist/client/{bookingForm-DwEeovf_.mjs → bookingForm-dUyGpbxc.mjs} +56 -39
- package/dist/client/bookings.mjs +1096 -731
- package/dist/client/{carousel-BMrfgOba.mjs → carousel-BvBwkUzx.mjs} +2 -2
- package/dist/client/{carousel.client-CpwTUhIo.mjs → carousel.client-59G_WMr4.mjs} +1 -1
- package/dist/client/{cart-rXEdxTdb.mjs → cart-DiZENT2E.mjs} +3 -3
- package/dist/client/{checkout-D3JlSzh3.mjs → checkout-Dq13KIgR.mjs} +3 -3
- package/dist/client/client.mjs +10645 -6794
- package/dist/client/{colorStyles-BWpj_h4C.mjs → colorStyles-CrxJrPjJ.mjs} +277 -1
- package/dist/client/{context-CJz1Vlsz.mjs → context-B83PiNzm.mjs} +6 -21
- package/dist/client/{courseRegistration-DO5XvMAA.mjs → courseRegistration-CKC5NmyH.mjs} +11 -5
- package/dist/client/{eventCalendar-DO6rTqCn.mjs → eventCalendar-BF0Jatfw.mjs} +42 -45
- package/dist/client/{eventCombined-bJ3i_ovU.mjs → eventCombined-BuoCF8je.mjs} +3 -3
- package/dist/client/{eventDetails-CCbrXE7o.mjs → eventDetails-CKwh0S9s.mjs} +276 -94
- package/dist/client/{eventListing-Bdlt9YTm.mjs → eventListing-eUxaWFaB.mjs} +3 -3
- package/dist/client/{eventRegistration-B02lt6iY.mjs → eventRegistration-CfkNOkPb.mjs} +630 -138
- package/dist/client/{form-DrUBAAox.mjs → form-C17H1c_H.mjs} +4 -4
- package/dist/client/{headerSection-MzqvHL6T.mjs → headerSection-DEwUmrtt.mjs} +2 -2
- package/dist/client/hooks.mjs +3224 -2485
- package/dist/client/{locationMap-DG8BxTBm.mjs → locationMap-Pf2QwuvW.mjs} +3 -3
- package/dist/client/{media-CNE1Z-wb.mjs → media-BOHuueS5.mjs} +16 -4
- package/dist/client/{newsletterForm-BzO-Td3p.mjs → newsletterForm-BWQAH5Sv.mjs} +4 -4
- package/dist/client/pricing-CVdvbopJ.mjs +195 -0
- package/dist/client/{productDetail-CfQ7rhVK.mjs → productDetail-BZi1Fa_G.mjs} +3 -3
- package/dist/client/{productList-C23rOLUi.mjs → productList-qq-55DNk.mjs} +3 -3
- package/dist/client/{propsDecoder-CAZdhwjs.mjs → propsDecoder-BxmqPKdP.mjs} +859 -650
- package/dist/client/rendering/client.mjs +8658 -7862
- package/dist/client/rendering/islands.mjs +20 -20
- package/dist/client/rendering.mjs +11437 -7446
- package/dist/client/{scrollToBlock-DSSqVQr1.mjs → scrollToBlock-B3CcKdtG.mjs} +1 -1
- package/dist/client/{shop-BMToKLK7.mjs → shop-DNWJPut5.mjs} +7 -7
- package/dist/client/{shop-commerce-DB4JRKmp.mjs → shop-commerce-BhvQCosS.mjs} +8 -8
- package/dist/client/{shop-commerce-store-BOqSIOuc.mjs → shop-commerce-store-B04sCNnW.mjs} +1 -1
- package/dist/client/{shopShared-B6SK9DZv.mjs → shopShared-DNNgZlmW.mjs} +5 -5
- package/dist/client/{useEventFilters-CULOa4nB.mjs → useEventFilters-CUmhE24_.mjs} +329 -84
- package/dist/client/{usePolling-BGG_8-jl.mjs → usePolling-M5jG675x.mjs} +3 -3
- package/dist/preview-next/before-render.mjs +439 -168
- package/dist/preview-next/client/runtime.mjs +4 -4
- package/dist/preview-next/keepAlive.mjs +7593 -29
- package/dist/preview-next/middleware.mjs +433 -167
- package/dist/{previewAuthStore-_GXFRg2W.mjs → previewAuthStore-BFKd4LrN.mjs} +432 -167
- package/dist/{sdk-runtime-hhSOMShR.mjs → sdk-runtime-BEXb1wqo.mjs} +2 -2
- package/dist/{separator-flRaFc14.mjs → separator-DGMuip1D.mjs} +1 -1
- package/dist/server/components.mjs +9596 -6347
- package/dist/server/config-validation.mjs +3224 -2486
- package/dist/server/config.mjs +3224 -2486
- package/dist/server/data.mjs +3224 -2485
- package/dist/server/index.mjs +486 -200
- package/dist/server/manifest.mjs +0 -1
- package/dist/server/next.mjs +10343 -7188
- package/dist/server/page-converter.mjs +1828 -2094
- package/dist/server/prebuild.mjs +1 -1
- package/dist/server/rendering/server.mjs +6750 -4519
- package/dist/server/rendering.mjs +9591 -6342
- package/dist/server/routing.mjs +3403 -1594
- package/dist/server/server.mjs +3274 -2671
- package/dist/server/theme-bridge.mjs +2979 -1639
- package/dist/server/theme.mjs +590 -176
- package/dist/styles/index.css +1896 -1129
- package/package.json +3 -2
- package/dist/_dts/api/src/bookingVerticalCatalog.d.ts +0 -746
- package/dist/_dts/block-form/src/client/blockDraftSaveability.d.ts +0 -1
- package/dist/_dts/block-form/src/widgets/index.d.ts +0 -20
- package/dist/_dts/blocks/src/system/runtime/api/requestBody.d.ts +0 -7
- package/dist/_dts/blocks/src/system/runtime/nodes/course-registration/CourseRegistrationWizard.d.ts +0 -3
- package/dist/_dts/blocks/src/system/runtime/nodes/course-registration/StepIndicator.d.ts +0 -6
- package/dist/_dts/blocks/src/system/runtime/nodes/course-registration/components.d.ts +0 -45
- package/dist/_dts/blocks/src/system/runtime/nodes/course-registration/pricing.d.ts +0 -14
- package/dist/_dts/blocks/src/system/runtime/nodes/course-registration/useCoursePaymentVerification.d.ts +0 -9
- package/dist/_dts/blocks/src/system/runtime/nodes/course-registration/useCourseRegistrationActions.d.ts +0 -35
- package/dist/_dts/blocks/src/system/runtime/nodes/course-registration/useCourseRegistrationSelection.d.ts +0 -31
- package/dist/_dts/blocks/src/system/runtime/nodes/course-registration/useCourseRegistrationWizard.d.ts +0 -102
- package/dist/client/clsx-DgIEfj3H.mjs +0 -16
- package/dist/client/eventProductEligibility-AVxyCB1u.mjs +0 -50
- package/dist/client/pricing-NgK7ozkg.mjs +0 -174
- /package/dist/_dts/blocks/src/system/runtime/nodes/{course-registration → event-registration/whole-series}/PortalAuthSidebar.d.ts +0 -0
- /package/dist/_dts/blocks/src/system/runtime/nodes/{course-registration → event-registration/whole-series}/SuccessStep.d.ts +0 -0
- /package/dist/_dts/blocks/src/system/runtime/nodes/{course-registration → event-registration/whole-series}/WaitlistStep.d.ts +0 -0
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import { type BookingFlexibleBalanceContractStatus, type NonNegativeCents, type OrderFlexibleBalanceContractId, type OrderInstalmentPlanStatus, type OrderPaymentPlanId, type Result } from '../../../core/src/index';
|
|
2
|
+
import type { OrderPaymentMethod, OrderStatus } from './orderTypes';
|
|
3
|
+
export type PaymentTerms = Readonly<{
|
|
4
|
+
kind: 'immediate';
|
|
5
|
+
}> | Readonly<{
|
|
6
|
+
kind: 'manual';
|
|
7
|
+
}> | Readonly<{
|
|
8
|
+
kind: 'flexible_balance';
|
|
9
|
+
contractId: OrderFlexibleBalanceContractId;
|
|
10
|
+
status: BookingFlexibleBalanceContractStatus;
|
|
11
|
+
dueAt: string | null;
|
|
12
|
+
upfrontAmountCents: NonNegativeCents;
|
|
13
|
+
}> | Readonly<{
|
|
14
|
+
kind: 'instalment_plan';
|
|
15
|
+
paymentPlanId: OrderPaymentPlanId;
|
|
16
|
+
status: OrderInstalmentPlanStatus;
|
|
17
|
+
nextDueAt: string | null;
|
|
18
|
+
nextDueAmountCents: NonNegativeCents | null;
|
|
19
|
+
}>;
|
|
20
|
+
export type OrderPaymentPosition = Readonly<{
|
|
21
|
+
kind: 'not_required';
|
|
22
|
+
reason: 'free' | 'waived' | 'pass' | 'membership';
|
|
23
|
+
totalCents: NonNegativeCents;
|
|
24
|
+
collectedCents: NonNegativeCents;
|
|
25
|
+
refundedCents: NonNegativeCents;
|
|
26
|
+
outstandingCents: NonNegativeCents;
|
|
27
|
+
}> | Readonly<{
|
|
28
|
+
kind: 'waived';
|
|
29
|
+
totalCents: NonNegativeCents;
|
|
30
|
+
collectedCents: NonNegativeCents;
|
|
31
|
+
waivedCents: NonNegativeCents;
|
|
32
|
+
refundedCents: NonNegativeCents;
|
|
33
|
+
outstandingCents: 0 & NonNegativeCents;
|
|
34
|
+
terms: PaymentTerms;
|
|
35
|
+
}> | Readonly<{
|
|
36
|
+
kind: 'unpaid';
|
|
37
|
+
totalCents: NonNegativeCents;
|
|
38
|
+
collectedCents: NonNegativeCents;
|
|
39
|
+
refundedCents: NonNegativeCents;
|
|
40
|
+
outstandingCents: NonNegativeCents;
|
|
41
|
+
terms: PaymentTerms;
|
|
42
|
+
}> | Readonly<{
|
|
43
|
+
kind: 'partially_paid';
|
|
44
|
+
totalCents: NonNegativeCents;
|
|
45
|
+
collectedCents: NonNegativeCents;
|
|
46
|
+
refundedCents: NonNegativeCents;
|
|
47
|
+
outstandingCents: NonNegativeCents;
|
|
48
|
+
terms: PaymentTerms;
|
|
49
|
+
}> | Readonly<{
|
|
50
|
+
kind: 'paid';
|
|
51
|
+
totalCents: NonNegativeCents;
|
|
52
|
+
collectedCents: NonNegativeCents;
|
|
53
|
+
refundedCents: NonNegativeCents;
|
|
54
|
+
outstandingCents: 0 & NonNegativeCents;
|
|
55
|
+
settledVia: Exclude<OrderPaymentMethod, 'waived'>;
|
|
56
|
+
terms: PaymentTerms;
|
|
57
|
+
}> | Readonly<{
|
|
58
|
+
kind: 'collection_failed';
|
|
59
|
+
totalCents: NonNegativeCents;
|
|
60
|
+
collectedCents: NonNegativeCents;
|
|
61
|
+
refundedCents: NonNegativeCents;
|
|
62
|
+
outstandingCents: NonNegativeCents;
|
|
63
|
+
terms: PaymentTerms;
|
|
64
|
+
}> | Readonly<{
|
|
65
|
+
kind: 'refunded';
|
|
66
|
+
totalCents: NonNegativeCents;
|
|
67
|
+
collectedCents: NonNegativeCents;
|
|
68
|
+
refundedCents: NonNegativeCents;
|
|
69
|
+
outstandingCents: 0 & NonNegativeCents;
|
|
70
|
+
terms: PaymentTerms;
|
|
71
|
+
}> | Readonly<{
|
|
72
|
+
kind: 'cancelled';
|
|
73
|
+
totalCents: NonNegativeCents;
|
|
74
|
+
collectedCents: NonNegativeCents;
|
|
75
|
+
refundedCents: NonNegativeCents;
|
|
76
|
+
outstandingCents: 0 & NonNegativeCents;
|
|
77
|
+
terms: PaymentTerms;
|
|
78
|
+
}>;
|
|
79
|
+
export type OrderPaymentPositionInconsistency = Readonly<{
|
|
80
|
+
kind: 'paid_exceeds_collectable';
|
|
81
|
+
}> | Readonly<{
|
|
82
|
+
kind: 'refunded_exceeds_collected';
|
|
83
|
+
}> | Readonly<{
|
|
84
|
+
kind: 'projection_receipt_mismatch';
|
|
85
|
+
projection: 'flexible_balance' | 'instalment_plan';
|
|
86
|
+
}> | Readonly<{
|
|
87
|
+
kind: 'conflicting_payment_terms';
|
|
88
|
+
}> | Readonly<{
|
|
89
|
+
kind: 'managed_terms_for_non_monetary_order';
|
|
90
|
+
}>;
|
|
91
|
+
export type OrderPaymentPositionInput = Readonly<{
|
|
92
|
+
status: OrderStatus;
|
|
93
|
+
paymentMethod: OrderPaymentMethod;
|
|
94
|
+
grandTotalCents: NonNegativeCents;
|
|
95
|
+
paidCents: NonNegativeCents;
|
|
96
|
+
waivedCents: NonNegativeCents;
|
|
97
|
+
refundedCents: NonNegativeCents;
|
|
98
|
+
flexibleBalance: Readonly<{
|
|
99
|
+
contractId: OrderFlexibleBalanceContractId;
|
|
100
|
+
status: BookingFlexibleBalanceContractStatus;
|
|
101
|
+
remainingBalanceCents: NonNegativeCents;
|
|
102
|
+
dueAt: string | null;
|
|
103
|
+
upfrontAmountCents: NonNegativeCents;
|
|
104
|
+
}> | null;
|
|
105
|
+
instalmentPlan: Readonly<{
|
|
106
|
+
paymentPlanId: OrderPaymentPlanId;
|
|
107
|
+
status: OrderInstalmentPlanStatus;
|
|
108
|
+
remainingBalanceCents: NonNegativeCents;
|
|
109
|
+
nextDueAt: string | null;
|
|
110
|
+
nextDueAmountCents: NonNegativeCents | null;
|
|
111
|
+
}> | null;
|
|
112
|
+
hasCollectionFailure?: boolean;
|
|
113
|
+
}>;
|
|
114
|
+
export declare function calculateOrderBalanceDueCents(input: Readonly<{
|
|
115
|
+
grandTotalCents: NonNegativeCents;
|
|
116
|
+
paidCents: NonNegativeCents;
|
|
117
|
+
waivedCents?: NonNegativeCents;
|
|
118
|
+
}>): Result<NonNegativeCents, Extract<OrderPaymentPositionInconsistency, {
|
|
119
|
+
kind: 'paid_exceeds_collectable';
|
|
120
|
+
}>>;
|
|
121
|
+
export declare function deriveOrderPaymentPosition(input: OrderPaymentPositionInput): Result<OrderPaymentPosition, OrderPaymentPositionInconsistency>;
|
|
122
|
+
export type PaymentPresentation = Readonly<{
|
|
123
|
+
tone: 'neutral' | 'positive' | 'warning' | 'critical';
|
|
124
|
+
label: 'Not required' | 'Waived' | 'Unpaid' | 'Partially paid' | 'Paid' | 'Payment failed' | 'Refunded' | 'Cancelled';
|
|
125
|
+
collectedCents: NonNegativeCents;
|
|
126
|
+
refundedCents: NonNegativeCents;
|
|
127
|
+
outstandingCents: NonNegativeCents;
|
|
128
|
+
dueAt: string | null;
|
|
129
|
+
nextDueAt: string | null;
|
|
130
|
+
}>;
|
|
131
|
+
export declare function buildPaymentPresentation(position: OrderPaymentPosition): PaymentPresentation;
|
|
132
|
+
export declare function hasOnlineOrderPaymentPath(input: Readonly<{
|
|
133
|
+
position: OrderPaymentPosition;
|
|
134
|
+
paymentMethod: OrderPaymentMethod;
|
|
135
|
+
}>): boolean;
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import type { AttendeeId } from '../../../core/src/index';
|
|
2
|
+
import type { AppointmentOrderItemMetadata, CourseEnrollmentOrderItemMetadata, EventTicketOrderItemMetadata, MembershipOrderItemMetadata, PassOrderItemMetadata, ProductOrderItemMetadata } from './orderItemMetadata';
|
|
3
|
+
import type { OrderItemReconciliationState, OrderItemCommitState } from './orderTypes';
|
|
4
|
+
/**
|
|
5
|
+
* Structural input records for pure order-planning helpers.
|
|
6
|
+
*
|
|
7
|
+
* Dashboard OrderItemRecord rows satisfy this shape, but this package keeps the
|
|
8
|
+
* boundary structural so commerce planning code does not depend on dashboard DB
|
|
9
|
+
* helper types. Tests and non-dashboard callers can provide the same domain
|
|
10
|
+
* facts without pulling in the app's data-access layer.
|
|
11
|
+
*/
|
|
12
|
+
type OrderItemPlanningBase = Readonly<{
|
|
13
|
+
id: string;
|
|
14
|
+
orderId: string;
|
|
15
|
+
siteId: string;
|
|
16
|
+
quantity: number;
|
|
17
|
+
subtotalCents: number | null;
|
|
18
|
+
discountCents: number | null;
|
|
19
|
+
creditCents: number | null;
|
|
20
|
+
netTotalCents: number | null;
|
|
21
|
+
totalCents: number | null;
|
|
22
|
+
refundedCents: number | null;
|
|
23
|
+
unitPriceCents: number | null;
|
|
24
|
+
createdAt: string;
|
|
25
|
+
fulfilledAt: string | null;
|
|
26
|
+
fulfillmentClaimedAt: string | null;
|
|
27
|
+
fulfillmentClaimToken: string | null;
|
|
28
|
+
commitState: OrderItemCommitState;
|
|
29
|
+
reconciliationState: OrderItemReconciliationState;
|
|
30
|
+
cancelledAt: string | null;
|
|
31
|
+
cancelledReason: string | null;
|
|
32
|
+
cancellationCategory: string | null;
|
|
33
|
+
cancellationInternalNote: string | null;
|
|
34
|
+
}>;
|
|
35
|
+
export type EventTicketOrderItemPlanningRecord = OrderItemPlanningBase & Readonly<{
|
|
36
|
+
kind: 'event_ticket';
|
|
37
|
+
metadata: EventTicketOrderItemMetadata;
|
|
38
|
+
eventAttendeeId: AttendeeId | null;
|
|
39
|
+
productId: null;
|
|
40
|
+
productVariantId: null;
|
|
41
|
+
customerPassId: null;
|
|
42
|
+
courseEnrollmentId: null;
|
|
43
|
+
appointmentId: null;
|
|
44
|
+
customerMembershipId: null;
|
|
45
|
+
}>;
|
|
46
|
+
export type ProductOrderItemPlanningRecord = OrderItemPlanningBase & Readonly<{
|
|
47
|
+
kind: 'product';
|
|
48
|
+
metadata: ProductOrderItemMetadata;
|
|
49
|
+
productId: string;
|
|
50
|
+
productVariantId: string | null;
|
|
51
|
+
eventAttendeeId: null;
|
|
52
|
+
customerPassId: null;
|
|
53
|
+
courseEnrollmentId: null;
|
|
54
|
+
appointmentId: null;
|
|
55
|
+
customerMembershipId: null;
|
|
56
|
+
}>;
|
|
57
|
+
export type PassOrderItemPlanningRecord = OrderItemPlanningBase & Readonly<{
|
|
58
|
+
kind: 'pass';
|
|
59
|
+
metadata: PassOrderItemMetadata;
|
|
60
|
+
customerPassId: string | null;
|
|
61
|
+
eventAttendeeId: AttendeeId | null;
|
|
62
|
+
productId: null;
|
|
63
|
+
productVariantId: null;
|
|
64
|
+
courseEnrollmentId: null;
|
|
65
|
+
appointmentId: null;
|
|
66
|
+
customerMembershipId: null;
|
|
67
|
+
}>;
|
|
68
|
+
export type CourseEnrollmentOrderItemPlanningRecord = OrderItemPlanningBase & Readonly<{
|
|
69
|
+
kind: 'course_enrollment';
|
|
70
|
+
metadata: CourseEnrollmentOrderItemMetadata;
|
|
71
|
+
courseEnrollmentId: string | null;
|
|
72
|
+
eventAttendeeId: null;
|
|
73
|
+
productId: null;
|
|
74
|
+
productVariantId: null;
|
|
75
|
+
customerPassId: null;
|
|
76
|
+
appointmentId: null;
|
|
77
|
+
customerMembershipId: null;
|
|
78
|
+
}>;
|
|
79
|
+
export type AppointmentOrderItemPlanningRecord = OrderItemPlanningBase & Readonly<{
|
|
80
|
+
kind: 'appointment';
|
|
81
|
+
metadata: AppointmentOrderItemMetadata;
|
|
82
|
+
appointmentId: string | null;
|
|
83
|
+
eventAttendeeId: null;
|
|
84
|
+
productId: null;
|
|
85
|
+
productVariantId: null;
|
|
86
|
+
customerPassId: string | null;
|
|
87
|
+
courseEnrollmentId: null;
|
|
88
|
+
customerMembershipId: null;
|
|
89
|
+
}>;
|
|
90
|
+
export type MembershipOrderItemPlanningRecord = OrderItemPlanningBase & Readonly<{
|
|
91
|
+
kind: 'membership';
|
|
92
|
+
metadata: MembershipOrderItemMetadata;
|
|
93
|
+
customerMembershipId: string | null;
|
|
94
|
+
eventAttendeeId: AttendeeId | null;
|
|
95
|
+
productId: null;
|
|
96
|
+
productVariantId: null;
|
|
97
|
+
customerPassId: null;
|
|
98
|
+
courseEnrollmentId: null;
|
|
99
|
+
appointmentId: null;
|
|
100
|
+
}>;
|
|
101
|
+
export type OrderItemPlanningRecord = EventTicketOrderItemPlanningRecord | ProductOrderItemPlanningRecord | PassOrderItemPlanningRecord | CourseEnrollmentOrderItemPlanningRecord | AppointmentOrderItemPlanningRecord | MembershipOrderItemPlanningRecord;
|
|
102
|
+
export {};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { type OrderItemId, type NonNegativeCents, type Result } from '../../../core/src/index';
|
|
2
|
+
export type OrderRefundLineInput = Readonly<{
|
|
3
|
+
orderItemId: OrderItemId;
|
|
4
|
+
netTotalCents: NonNegativeCents;
|
|
5
|
+
alreadyRefundedCents?: NonNegativeCents;
|
|
6
|
+
}>;
|
|
7
|
+
export type RequestedOrderLineRefund = Readonly<{
|
|
8
|
+
orderItemId: OrderItemId;
|
|
9
|
+
amountCents: NonNegativeCents;
|
|
10
|
+
}>;
|
|
11
|
+
export type PlannedOrderLineRefund = Readonly<{
|
|
12
|
+
orderItemId: OrderItemId;
|
|
13
|
+
requestedCents: NonNegativeCents;
|
|
14
|
+
refundableRemainingCents: NonNegativeCents;
|
|
15
|
+
appliedCents: NonNegativeCents;
|
|
16
|
+
}>;
|
|
17
|
+
export type OrderRefundPlan = Readonly<{
|
|
18
|
+
lines: PlannedOrderLineRefund[];
|
|
19
|
+
requestedTotalCents: NonNegativeCents;
|
|
20
|
+
appliedTotalCents: NonNegativeCents;
|
|
21
|
+
nextRefundedCents: NonNegativeCents;
|
|
22
|
+
nextStatus: 'partially_refunded' | 'refunded' | null;
|
|
23
|
+
}>;
|
|
24
|
+
export type SettledOrderRefundLine = Readonly<{
|
|
25
|
+
orderItemId: OrderItemId;
|
|
26
|
+
requestedCents: NonNegativeCents;
|
|
27
|
+
appliedCents: NonNegativeCents;
|
|
28
|
+
}>;
|
|
29
|
+
export type SettledOrderRefundPlan = Readonly<{
|
|
30
|
+
lines: SettledOrderRefundLine[];
|
|
31
|
+
refundedTotalCents: NonNegativeCents;
|
|
32
|
+
}>;
|
|
33
|
+
export declare function planOrderRefund(options: {
|
|
34
|
+
paidCents: NonNegativeCents;
|
|
35
|
+
currentRefundedCents: NonNegativeCents;
|
|
36
|
+
lines: ReadonlyArray<OrderRefundLineInput>;
|
|
37
|
+
requestedLineRefunds: ReadonlyArray<RequestedOrderLineRefund>;
|
|
38
|
+
}): Result<OrderRefundPlan, string>;
|
|
39
|
+
export declare function planOrderRefundSummaryUpdate(options: {
|
|
40
|
+
paidCents: NonNegativeCents;
|
|
41
|
+
currentRefundedCents: NonNegativeCents;
|
|
42
|
+
nextRefundedCents: NonNegativeCents;
|
|
43
|
+
}): Result<Readonly<{
|
|
44
|
+
refundedCents: NonNegativeCents;
|
|
45
|
+
nextStatus: 'partially_refunded' | 'refunded' | null;
|
|
46
|
+
}>, string>;
|
|
47
|
+
export declare function settleOrderRefundPlan(options: {
|
|
48
|
+
planned: OrderRefundPlan;
|
|
49
|
+
actualRefundedCents: NonNegativeCents;
|
|
50
|
+
}): Result<SettledOrderRefundPlan, string>;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { type NonNegativeCents, type Result } from '../../../core/src/index';
|
|
2
|
+
import type { OrderItemKind } from './orderTypes';
|
|
3
|
+
export declare const ORDER_REFUND_MODES: readonly ["refund_only", "refund_and_revoke"];
|
|
4
|
+
export type OrderRefundMode = (typeof ORDER_REFUND_MODES)[number];
|
|
5
|
+
export declare const ORDER_REFUND_ENTITLEMENT_ACTION_STATUSES: readonly ["not_requested", "pending", "succeeded", "reconciliation_needed"];
|
|
6
|
+
export type OrderRefundEntitlementActionStatus = (typeof ORDER_REFUND_ENTITLEMENT_ACTION_STATUSES)[number];
|
|
7
|
+
export type OrderRefundRevocationCandidate = Readonly<{
|
|
8
|
+
orderItemId: string;
|
|
9
|
+
kind: OrderItemKind;
|
|
10
|
+
refundableRemainingCents: NonNegativeCents;
|
|
11
|
+
plannedAppliedCents: NonNegativeCents;
|
|
12
|
+
}>;
|
|
13
|
+
export type PlannedOrderRefundEntitlementAction = Readonly<{
|
|
14
|
+
refundMode: 'refund_only';
|
|
15
|
+
entitlementActionStatus: 'not_requested';
|
|
16
|
+
revokedOrderItemIds: readonly [];
|
|
17
|
+
}> | Readonly<{
|
|
18
|
+
refundMode: 'refund_and_revoke';
|
|
19
|
+
entitlementActionStatus: 'pending';
|
|
20
|
+
revokedOrderItemIds: readonly string[];
|
|
21
|
+
}>;
|
|
22
|
+
export declare function planOrderRefundEntitlementAction(options: {
|
|
23
|
+
refundMode: OrderRefundMode;
|
|
24
|
+
lines: ReadonlyArray<OrderRefundRevocationCandidate>;
|
|
25
|
+
}): Result<PlannedOrderRefundEntitlementAction, string>;
|
|
26
|
+
export declare function settleOrderRefundEntitlementAction(options: {
|
|
27
|
+
planned: PlannedOrderRefundEntitlementAction;
|
|
28
|
+
settledLines: ReadonlyArray<{
|
|
29
|
+
orderItemId: string;
|
|
30
|
+
appliedCents: NonNegativeCents;
|
|
31
|
+
}>;
|
|
32
|
+
plannedLines: ReadonlyArray<{
|
|
33
|
+
orderItemId: string;
|
|
34
|
+
refundableRemainingCents: NonNegativeCents;
|
|
35
|
+
}>;
|
|
36
|
+
}): Result<readonly string[], string>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { type Cents, type NonNegativeCents } from '../../../core/src/index';
|
|
2
|
+
export type OrderGrandTotalSource = Readonly<{
|
|
3
|
+
subtotalCents: NonNegativeCents;
|
|
4
|
+
discountCents: NonNegativeCents;
|
|
5
|
+
taxCents: NonNegativeCents;
|
|
6
|
+
shippingCents: NonNegativeCents;
|
|
7
|
+
}>;
|
|
8
|
+
export type OrderReceiptTotalSource = OrderGrandTotalSource & Readonly<{
|
|
9
|
+
creditCents: NonNegativeCents;
|
|
10
|
+
}>;
|
|
11
|
+
export type RawOrderGrandTotalSource = Readonly<{
|
|
12
|
+
subtotalCents: number;
|
|
13
|
+
discountCents: number;
|
|
14
|
+
taxCents: number;
|
|
15
|
+
shippingCents: number;
|
|
16
|
+
}>;
|
|
17
|
+
export type RawOrderReceiptTotalSource = RawOrderGrandTotalSource & Readonly<{
|
|
18
|
+
creditCents: number;
|
|
19
|
+
}>;
|
|
20
|
+
export declare function brandOrderGrandTotalSource(source: RawOrderGrandTotalSource): OrderGrandTotalSource;
|
|
21
|
+
export declare function brandOrderReceiptTotalSource(source: RawOrderReceiptTotalSource): OrderReceiptTotalSource;
|
|
22
|
+
export declare function computeOrderGrandTotalCents(order: OrderGrandTotalSource): Cents;
|
|
23
|
+
export declare function computeOrderReceiptTotalCents(order: OrderReceiptTotalSource): NonNegativeCents;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
export declare const ORDER_STATUSES: readonly ["pending", "paid", "partially_refunded", "refunded", "failed", "cancelled"];
|
|
2
|
+
export type OrderStatus = (typeof ORDER_STATUSES)[number];
|
|
3
|
+
export declare function isOrderStatus(value: string): value is OrderStatus;
|
|
4
|
+
export declare const ORDER_PAYMENT_METHODS: readonly ["stripe", "store_credit", "mixed", "pass_redemption", "membership_access", "free", "manual", "waived"];
|
|
5
|
+
export type OrderPaymentMethod = (typeof ORDER_PAYMENT_METHODS)[number];
|
|
6
|
+
export declare function isOrderPaymentMethod(value: string): value is OrderPaymentMethod;
|
|
7
|
+
export declare const CHECKOUT_COMMIT_STATES: readonly ["pending", "committing", "committed", "compensated"];
|
|
8
|
+
export type CheckoutCommitState = (typeof CHECKOUT_COMMIT_STATES)[number];
|
|
9
|
+
export declare function isCheckoutCommitState(value: string): value is CheckoutCommitState;
|
|
10
|
+
export declare const ORDER_CHECKOUT_RECONCILIATION_STATES: readonly ["not_needed", "evidence_pending", "needed"];
|
|
11
|
+
export type OrderCheckoutReconciliationState = (typeof ORDER_CHECKOUT_RECONCILIATION_STATES)[number];
|
|
12
|
+
export declare function isOrderCheckoutReconciliationState(value: string): value is OrderCheckoutReconciliationState;
|
|
13
|
+
export declare const ORDER_ITEM_RECONCILIATION_STATES: readonly ["not_needed", "needed"];
|
|
14
|
+
export type OrderItemReconciliationState = (typeof ORDER_ITEM_RECONCILIATION_STATES)[number];
|
|
15
|
+
export declare function isOrderItemReconciliationState(value: string): value is OrderItemReconciliationState;
|
|
16
|
+
export declare const ORDER_ITEM_COMMIT_STATES: readonly ["pending", "committed", "compensated"];
|
|
17
|
+
export type OrderItemCommitState = (typeof ORDER_ITEM_COMMIT_STATES)[number];
|
|
18
|
+
export declare function isOrderItemCommitState(value: string): value is OrderItemCommitState;
|
|
19
|
+
export declare const RESERVATION_FINALIZATION_STATES: readonly ["not_applicable", "reserved", "consumed", "released"];
|
|
20
|
+
export type ReservationFinalizationState = (typeof RESERVATION_FINALIZATION_STATES)[number];
|
|
21
|
+
export declare function isReservationFinalizationState(value: string): value is ReservationFinalizationState;
|
|
22
|
+
export type CheckoutPaymentRail = 'bypass' | 'stripe';
|
|
23
|
+
export type CheckoutCommitFailureStep = 'credit_consumption' | 'membership_provision' | 'fulfillment' | 'discount_redemption' | 'payment_record';
|
|
24
|
+
export type CheckoutCompensationDecision = Readonly<{
|
|
25
|
+
kind: 'release_reservations';
|
|
26
|
+
reason: string;
|
|
27
|
+
}> | Readonly<{
|
|
28
|
+
kind: 'compensate_order';
|
|
29
|
+
reason: string;
|
|
30
|
+
}> | Readonly<{
|
|
31
|
+
kind: 'mark_reconciliation_needed';
|
|
32
|
+
reason: string;
|
|
33
|
+
}>;
|
|
34
|
+
export declare const DISCOUNT_REDEMPTION_STATUSES: readonly ["pending", "redeemed", "released", "expired"];
|
|
35
|
+
export type DiscountRedemptionStatus = (typeof DISCOUNT_REDEMPTION_STATUSES)[number];
|
|
36
|
+
export declare function isDiscountRedemptionStatus(value: string): value is DiscountRedemptionStatus;
|
|
37
|
+
export declare const ORDER_ITEM_KINDS: readonly ["event_ticket", "product", "pass", "course_enrollment", "appointment", "membership"];
|
|
38
|
+
export type OrderItemKind = (typeof ORDER_ITEM_KINDS)[number];
|
|
39
|
+
export declare function isOrderItemKind(value: string): value is OrderItemKind;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function isPendingOrderCheckoutSessionClaim(stripeCheckoutSessionId: string | null): boolean;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { type Result, type CheckoutLineId } from '../../../core/src/index';
|
|
2
|
+
import { type RefundableLineSettlement } from './settlement';
|
|
3
|
+
import { type PositiveCheckoutQuantity } from './checkoutQuantity';
|
|
4
|
+
export type PersistedCheckoutLineKind = 'event_ticket' | 'product' | 'pass' | 'course_enrollment' | 'appointment' | 'membership';
|
|
5
|
+
export type PersistedCheckoutLineInput = Readonly<{
|
|
6
|
+
id: string;
|
|
7
|
+
kind: PersistedCheckoutLineKind;
|
|
8
|
+
quantity: number;
|
|
9
|
+
subtotalCents: number | null;
|
|
10
|
+
discountCents: number | null;
|
|
11
|
+
creditCents: number | null;
|
|
12
|
+
netTotalCents: number | null;
|
|
13
|
+
totalCents: number | null;
|
|
14
|
+
metadata: Readonly<{
|
|
15
|
+
checkoutLineId?: CheckoutLineId;
|
|
16
|
+
displayName?: string;
|
|
17
|
+
}>;
|
|
18
|
+
}>;
|
|
19
|
+
export type PersistedCheckoutLine = Readonly<{
|
|
20
|
+
orderItemId: string;
|
|
21
|
+
checkoutLineId: CheckoutLineId | null;
|
|
22
|
+
kind: PersistedCheckoutLineKind;
|
|
23
|
+
quantity: PositiveCheckoutQuantity;
|
|
24
|
+
displayName: string;
|
|
25
|
+
settlement: RefundableLineSettlement;
|
|
26
|
+
}>;
|
|
27
|
+
export declare function projectPersistedCheckoutLines(items: ReadonlyArray<PersistedCheckoutLineInput>): Result<readonly PersistedCheckoutLine[], string>;
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { type BookingDepositRefundPolicy, type BookingInstalmentPlanConfig, type NonNegativeCents } from '../../../core/src/index';
|
|
2
|
+
import type { OrderPaymentPurpose } from './orderPaymentReceipt';
|
|
3
|
+
export type ProtectedDepositPolicySubject = Readonly<{
|
|
4
|
+
kind: 'none';
|
|
5
|
+
}> | Readonly<{
|
|
6
|
+
kind: 'protected_deposit';
|
|
7
|
+
sourceKind: 'flexible_balance' | 'instalment_plan';
|
|
8
|
+
protectedDepositAmountCents: NonNegativeCents;
|
|
9
|
+
depositRefundability: BookingDepositRefundPolicy;
|
|
10
|
+
}>;
|
|
11
|
+
export type ProtectedDepositRefundExposure = Readonly<{
|
|
12
|
+
subject: ProtectedDepositPolicySubject;
|
|
13
|
+
totalRemainingRefundableCents: NonNegativeCents;
|
|
14
|
+
policyRefundableCents: NonNegativeCents;
|
|
15
|
+
protectedDepositRemainingCents: NonNegativeCents;
|
|
16
|
+
}>;
|
|
17
|
+
export type ProtectedDepositRefundRequest = Readonly<{
|
|
18
|
+
kind: 'full_remaining';
|
|
19
|
+
}> | Readonly<{
|
|
20
|
+
kind: 'partial_amount';
|
|
21
|
+
amountCents: NonNegativeCents;
|
|
22
|
+
}>;
|
|
23
|
+
export type AdminProtectedDepositRefundDecision = Readonly<{
|
|
24
|
+
kind: 'allowed';
|
|
25
|
+
requestedAmountCents: NonNegativeCents;
|
|
26
|
+
canonicalRemainingRefundableCents: NonNegativeCents;
|
|
27
|
+
touchesProtectedDeposit: boolean;
|
|
28
|
+
exposure: ProtectedDepositRefundExposure;
|
|
29
|
+
}> | Readonly<{
|
|
30
|
+
kind: 'blocked';
|
|
31
|
+
errorCode: 'already_refunded' | 'amount_exceeds_remaining';
|
|
32
|
+
errorMessage: string;
|
|
33
|
+
requestedAmountCents: NonNegativeCents;
|
|
34
|
+
exposure: ProtectedDepositRefundExposure;
|
|
35
|
+
}> | Readonly<{
|
|
36
|
+
kind: 'admin_override_required';
|
|
37
|
+
errorCode: 'deposit_refund_override_required';
|
|
38
|
+
errorMessage: string;
|
|
39
|
+
requestedAmountCents: NonNegativeCents;
|
|
40
|
+
exposure: ProtectedDepositRefundExposure;
|
|
41
|
+
}>;
|
|
42
|
+
export type PolicyOnlyProtectedDepositRefundDecision = Readonly<{
|
|
43
|
+
kind: 'allowed';
|
|
44
|
+
requestedAmountCents: NonNegativeCents;
|
|
45
|
+
canonicalRemainingRefundableCents: NonNegativeCents;
|
|
46
|
+
exposure: ProtectedDepositRefundExposure;
|
|
47
|
+
}> | Readonly<{
|
|
48
|
+
kind: 'blocked';
|
|
49
|
+
errorCode: 'already_refunded' | 'amount_exceeds_remaining' | 'non_refundable_deposit_remaining';
|
|
50
|
+
errorMessage: string;
|
|
51
|
+
requestedAmountCents: NonNegativeCents;
|
|
52
|
+
exposure: ProtectedDepositRefundExposure;
|
|
53
|
+
}>;
|
|
54
|
+
export declare function buildProtectedDepositPolicySubjectFromFlexibleBalance(input: Readonly<{
|
|
55
|
+
upfrontAmountCents: NonNegativeCents;
|
|
56
|
+
depositRefundability: BookingDepositRefundPolicy;
|
|
57
|
+
}>): ProtectedDepositPolicySubject;
|
|
58
|
+
export declare function buildProtectedDepositPolicySubjectFromInstalmentPlan(plan: BookingInstalmentPlanConfig): ProtectedDepositPolicySubject;
|
|
59
|
+
export declare function calculateProtectedDepositRefundExposure(input: Readonly<{
|
|
60
|
+
subject: ProtectedDepositPolicySubject;
|
|
61
|
+
itemTotalCents: NonNegativeCents;
|
|
62
|
+
itemRefundedCents: NonNegativeCents;
|
|
63
|
+
collectedRemainingCents: NonNegativeCents;
|
|
64
|
+
}>): ProtectedDepositRefundExposure;
|
|
65
|
+
/**
|
|
66
|
+
* Calculates policy exposure for one receipt allocation.
|
|
67
|
+
*
|
|
68
|
+
* A protected deposit is collected by the initial-checkout receipt. Later
|
|
69
|
+
* paydowns and instalments therefore remain independently refundable even
|
|
70
|
+
* while the entity still has a non-refundable deposit balance.
|
|
71
|
+
*/
|
|
72
|
+
export declare function calculateReceiptProtectedDepositRefundExposure(input: Readonly<{
|
|
73
|
+
subject: ProtectedDepositPolicySubject;
|
|
74
|
+
receiptPurpose: OrderPaymentPurpose['kind'];
|
|
75
|
+
allocatedCents: NonNegativeCents;
|
|
76
|
+
refundedCents: NonNegativeCents;
|
|
77
|
+
}>): ProtectedDepositRefundExposure;
|
|
78
|
+
export declare function planAdminProtectedDepositRefund(input: Readonly<{
|
|
79
|
+
exposure: ProtectedDepositRefundExposure;
|
|
80
|
+
request: ProtectedDepositRefundRequest;
|
|
81
|
+
allowProtectedDepositOverride: boolean;
|
|
82
|
+
}>): AdminProtectedDepositRefundDecision;
|
|
83
|
+
export declare function planPolicyOnlyProtectedDepositRefund(input: Readonly<{
|
|
84
|
+
exposure: ProtectedDepositRefundExposure;
|
|
85
|
+
request: ProtectedDepositRefundRequest;
|
|
86
|
+
}>): PolicyOnlyProtectedDepositRefundDecision;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export type ShopRefundablePaymentMethod = 'stripe' | 'mixed' | 'store_credit';
|
|
2
|
+
/**
|
|
3
|
+
* Whether an order's payment method supports refunds through the shop refund flow.
|
|
4
|
+
*
|
|
5
|
+
* Pass redemption, membership access, and free orders cannot be refunded
|
|
6
|
+
* through Stripe or site credit — they need domain-specific handling.
|
|
7
|
+
*/
|
|
8
|
+
export declare function isShopRefundablePaymentMethod(paymentMethod: string): paymentMethod is ShopRefundablePaymentMethod;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { type NonNegativeCents, type Result } from '../../../core/src/index';
|
|
2
|
+
/**
|
|
3
|
+
* Typed result of a rail-aware refund split.
|
|
4
|
+
* Prevents confusing cash/credit amounts at call sites.
|
|
5
|
+
*/
|
|
6
|
+
export type RefundRailSplit = Readonly<{
|
|
7
|
+
cashCents: NonNegativeCents;
|
|
8
|
+
creditCents: NonNegativeCents;
|
|
9
|
+
}>;
|
|
10
|
+
type RefundLineAllocation = Readonly<{
|
|
11
|
+
orderItemId: string;
|
|
12
|
+
appliedCents: number;
|
|
13
|
+
}>;
|
|
14
|
+
/** Minimal shape of a refund record for rail-aware splitting. */
|
|
15
|
+
type RefundWithAllocations = Readonly<{
|
|
16
|
+
refundRail: 'cash' | 'credit' | 'mixed';
|
|
17
|
+
lineAllocations: ReadonlyArray<RefundLineAllocation>;
|
|
18
|
+
}>;
|
|
19
|
+
/**
|
|
20
|
+
* For mixed-payment items, compute remaining refundable amount per rail.
|
|
21
|
+
* Must account for prior refunds that already consumed part of each rail.
|
|
22
|
+
*
|
|
23
|
+
* The allocation order (credit before cash) is an accounting convention
|
|
24
|
+
* that determines *how much* goes to each rail — it does NOT imply
|
|
25
|
+
* execution order. The caller decides execution order (typically cash
|
|
26
|
+
* first so Stripe settles before issuing site credit).
|
|
27
|
+
*
|
|
28
|
+
* Pure function — no DB calls. Testable with just numbers.
|
|
29
|
+
*/
|
|
30
|
+
export declare function computeRailAwareRefundSplit(originalCashCents: NonNegativeCents, originalCreditCents: NonNegativeCents, priorCashRefunded: NonNegativeCents, priorCreditRefunded: NonNegativeCents, totalRefundCents: NonNegativeCents): RefundRailSplit;
|
|
31
|
+
/**
|
|
32
|
+
* Summarize prior successful refunds by rail for a specific order item.
|
|
33
|
+
* Reads from line_allocations in order_refunds records.
|
|
34
|
+
*
|
|
35
|
+
* Pure function — just array reduction.
|
|
36
|
+
*/
|
|
37
|
+
export declare function summarizePriorRefundsByRail(refunds: ReadonlyArray<RefundWithAllocations>, orderItemId: string): Result<RefundRailSplit, Readonly<{
|
|
38
|
+
kind: 'mixed_rail_attribution_missing';
|
|
39
|
+
}>>;
|
|
40
|
+
export {};
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { type Brand, type NonNegativeCents, type Result } from '../../../core/src/index';
|
|
2
|
+
export type CurrencyCode = Brand<string, 'CurrencyCode'>;
|
|
3
|
+
export type SubtotalCents = Brand<number, 'SubtotalCents'>;
|
|
4
|
+
export type DiscountCents = Brand<number, 'DiscountCents'>;
|
|
5
|
+
export type CreditAppliedCents = Brand<number, 'CreditAppliedCents'>;
|
|
6
|
+
export type StripeChargeCents = Brand<number, 'StripeChargeCents'>;
|
|
7
|
+
export type RefundedCents = Brand<number, 'RefundedCents'>;
|
|
8
|
+
export type RefundableTotalCents = Brand<number, 'RefundableTotalCents'>;
|
|
9
|
+
export type Money<C extends CurrencyCode = CurrencyCode> = Readonly<{
|
|
10
|
+
amountCents: NonNegativeCents;
|
|
11
|
+
currency: C;
|
|
12
|
+
}>;
|
|
13
|
+
export type CurrencyValidationResult = {
|
|
14
|
+
ok: true;
|
|
15
|
+
currency: CurrencyCode;
|
|
16
|
+
} | {
|
|
17
|
+
ok: false;
|
|
18
|
+
reason: 'empty_cart' | 'mixed_currency' | 'invalid_currency';
|
|
19
|
+
currencies: string[];
|
|
20
|
+
};
|
|
21
|
+
export type AllocationInput<TLineId extends string = string> = {
|
|
22
|
+
lineId: TLineId;
|
|
23
|
+
basisCents: NonNegativeCents;
|
|
24
|
+
maxReducibleCents: NonNegativeCents;
|
|
25
|
+
};
|
|
26
|
+
export type LineAllocation<TLineId extends string = string> = {
|
|
27
|
+
lineId: TLineId;
|
|
28
|
+
amountCents: NonNegativeCents;
|
|
29
|
+
};
|
|
30
|
+
export type AllocationResult<TLineId extends string = string> = {
|
|
31
|
+
requestedCents: NonNegativeCents;
|
|
32
|
+
appliedCents: NonNegativeCents;
|
|
33
|
+
allocations: LineAllocation<TLineId>[];
|
|
34
|
+
};
|
|
35
|
+
export type SettledOrderLine = {
|
|
36
|
+
lineId: string;
|
|
37
|
+
subtotalCents: NonNegativeCents;
|
|
38
|
+
discountCents: NonNegativeCents;
|
|
39
|
+
creditCents: NonNegativeCents;
|
|
40
|
+
netTotalCents: NonNegativeCents;
|
|
41
|
+
};
|
|
42
|
+
export type LineSettlementBreakdown = Readonly<{
|
|
43
|
+
subtotalCents: SubtotalCents;
|
|
44
|
+
discountCents: DiscountCents;
|
|
45
|
+
creditAppliedCents: CreditAppliedCents;
|
|
46
|
+
stripeChargeCents: StripeChargeCents;
|
|
47
|
+
}>;
|
|
48
|
+
export type LineSettlementMoneyField = 'subtotalCents' | 'discountCents' | 'creditAppliedCents' | 'stripeChargeCents' | 'alreadyRefundedCents';
|
|
49
|
+
export type LineSettlementBreakdownError<TLineId extends string = string> = Readonly<{
|
|
50
|
+
_tag: 'invalid_line_money';
|
|
51
|
+
lineId: TLineId;
|
|
52
|
+
field: LineSettlementMoneyField;
|
|
53
|
+
message: string;
|
|
54
|
+
}> | Readonly<{
|
|
55
|
+
_tag: 'inconsistent_line_totals';
|
|
56
|
+
lineId: TLineId;
|
|
57
|
+
message: string;
|
|
58
|
+
}>;
|
|
59
|
+
export type RefundableLineSettlementError<TLineId extends string = string> = LineSettlementBreakdownError<TLineId> | Readonly<{
|
|
60
|
+
_tag: 'refunded_exceeds_refundable_total';
|
|
61
|
+
lineId: TLineId;
|
|
62
|
+
message: string;
|
|
63
|
+
}>;
|
|
64
|
+
export type RefundableLineSettlement = Readonly<{
|
|
65
|
+
line: LineSettlementBreakdown;
|
|
66
|
+
refundableTotalCents: RefundableTotalCents;
|
|
67
|
+
alreadyRefundedCents: RefundedCents;
|
|
68
|
+
}>;
|
|
69
|
+
export declare function normalizeCurrencyCode(raw: string): CurrencyCode;
|
|
70
|
+
export declare function toSubtotalCents(raw: number): SubtotalCents;
|
|
71
|
+
export declare function toDiscountCents(raw: number): DiscountCents;
|
|
72
|
+
export declare function toCreditAppliedCents(raw: number): CreditAppliedCents;
|
|
73
|
+
export declare function toStripeChargeCents(raw: number): StripeChargeCents;
|
|
74
|
+
export declare function toRefundedCents(raw: number): RefundedCents;
|
|
75
|
+
export declare function toRefundableTotalCents(raw: number): RefundableTotalCents;
|
|
76
|
+
export declare function money<C extends CurrencyCode>(amountCents: number, currency: C): Money<C>;
|
|
77
|
+
export declare function buildLineSettlementBreakdown<TLineId extends string>(options: Readonly<{
|
|
78
|
+
lineId: TLineId;
|
|
79
|
+
subtotalCents: number;
|
|
80
|
+
discountCents: number;
|
|
81
|
+
creditAppliedCents: number;
|
|
82
|
+
stripeChargeCents: number;
|
|
83
|
+
}>): Result<LineSettlementBreakdown, LineSettlementBreakdownError<TLineId>>;
|
|
84
|
+
export declare function buildRefundableLineSettlement<TLineId extends string>(options: Readonly<{
|
|
85
|
+
lineId: TLineId;
|
|
86
|
+
subtotalCents: number;
|
|
87
|
+
discountCents: number;
|
|
88
|
+
creditAppliedCents: number;
|
|
89
|
+
stripeChargeCents: number;
|
|
90
|
+
alreadyRefundedCents: number;
|
|
91
|
+
}>): Result<RefundableLineSettlement, RefundableLineSettlementError<TLineId>>;
|
|
92
|
+
export declare function refundableRemainingCents(settlement: RefundableLineSettlement): NonNegativeCents;
|
|
93
|
+
export declare function ensureSingleCurrency(lines: ReadonlyArray<{
|
|
94
|
+
currency: string;
|
|
95
|
+
}>): CurrencyValidationResult;
|
|
96
|
+
export declare function allocateReductionCents<TLineId extends string = string>(inputs: ReadonlyArray<AllocationInput<TLineId>>, requestedCents: number): AllocationResult<TLineId>;
|
|
97
|
+
export declare function assertSettledOrderLineInvariants(lines: ReadonlyArray<SettledOrderLine>): void;
|