@riverbankcms/sdk 0.148.0 → 0.149.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.
Files changed (154) hide show
  1. package/README.md +1 -1
  2. package/dist/{PreviewEditorSidebar-DvEPG3Z2.mjs → PreviewEditorSidebar-DBKln68M.mjs} +103 -66
  3. package/dist/{PreviewEditorUI-D6eb6fkx.mjs → PreviewEditorUI-DpRX4Mum.mjs} +3 -6
  4. package/dist/{PreviewQueryProvider-5znTyJuz.mjs → PreviewQueryProvider-C0mndwHB.mjs} +3 -3
  5. package/dist/{SdkPreviewModeRuntime-DJ6utQ_R.mjs → SdkPreviewModeRuntime-DJPmPY-r.mjs} +95 -67
  6. package/dist/{SiteChromeCustomizeContext-CFJYh6vo.mjs → SiteChromeCustomizeContext-JYA0cJ_Z.mjs} +982 -734
  7. package/dist/_dts/api/src/bookingConfig.d.ts +33 -48
  8. package/dist/_dts/api/src/bookingManagementEndpoints.d.ts +2 -6
  9. package/dist/_dts/api/src/bookingOperations.d.ts +5 -7
  10. package/dist/_dts/api/src/bookingRecords.d.ts +15 -11
  11. package/dist/_dts/api/src/bookingRefundOutcomes.d.ts +5 -5
  12. package/dist/_dts/api/src/clientErrorReporting.d.ts +11 -0
  13. package/dist/_dts/api/src/commercePortalEndpoints.d.ts +0 -2
  14. package/dist/_dts/api/src/common/cancellation.d.ts +23 -0
  15. package/dist/_dts/api/src/customerMembershipOutcomes.d.ts +1 -1
  16. package/dist/_dts/api/src/endpoints.d.ts +2 -10
  17. package/dist/_dts/api/src/eventManagementContracts.d.ts +4 -7
  18. package/dist/_dts/api/src/index.d.ts +3 -3
  19. package/dist/_dts/api/src/publicAppointmentBookingContracts.d.ts +2 -2
  20. package/dist/_dts/api/src/publicExperience/commerceEndpoints.d.ts +2 -29
  21. package/dist/_dts/api/src/request.d.ts +1 -1
  22. package/dist/_dts/api/src/sdk-event-upsert.d.ts +1 -1
  23. package/dist/_dts/api/src/sdkPullEventContracts.d.ts +1 -1
  24. package/dist/_dts/api/src/siteOperations.d.ts +6 -2
  25. package/dist/_dts/blocks/src/contracts/index.d.ts +1 -1
  26. package/dist/_dts/blocks/src/contracts/non-block-islands.d.ts +2 -2
  27. package/dist/_dts/blocks/src/contracts/proof-block-islands.d.ts +38 -10
  28. package/dist/_dts/blocks/src/portal/types.d.ts +9 -6
  29. package/dist/_dts/blocks/src/system/blocks/events/shared/schemas.d.ts +24 -24
  30. package/dist/_dts/blocks/src/system/blocks/events/shared/types.d.ts +1 -1
  31. package/dist/_dts/blocks/src/system/blocks/shared/bookingPaymentTerms.d.ts +84 -160
  32. package/dist/_dts/blocks/src/system/blocks/shop.d.ts +2 -2
  33. package/dist/_dts/blocks/src/system/blocks/shop.shared.d.ts +31 -4
  34. package/dist/_dts/blocks/src/system/runtime/api/types/appointments.d.ts +2 -2
  35. package/dist/_dts/blocks/src/system/runtime/api/types/core.d.ts +3 -1
  36. package/dist/_dts/blocks/src/system/runtime/components/registry.client.d.ts +48 -6
  37. package/dist/_dts/blocks/src/system/runtime/components/runtime-backed-blocks.d.ts +24 -3
  38. package/dist/_dts/blocks/src/system/runtime/hooks/useBookingNowIso.d.ts +8 -0
  39. package/dist/_dts/blocks/src/system/runtime/nodes/booking-form.state.d.ts +2 -1
  40. package/dist/_dts/blocks/src/system/runtime/nodes/commerce/shared/display.d.ts +9 -2
  41. package/dist/_dts/blocks/src/system/runtime/nodes/event-details/presentation.d.ts +14 -2
  42. package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/PaymentSelectionStep.d.ts +2 -0
  43. package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/eventPaymentOptions.d.ts +3 -3
  44. package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/useEventRegistrationWizard.d.ts +4 -0
  45. package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/eventCollectionContract.d.ts +24 -24
  46. package/dist/_dts/blocks/src/system/runtime/nodes/shop.interactive.d.ts +41 -6
  47. package/dist/_dts/blocks/src/system/runtime/shared/bookingPaymentOptions.d.ts +7 -2
  48. package/dist/_dts/commerce/src/purchase/bookingPaymentSelection.d.ts +54 -0
  49. package/dist/_dts/commerce/src/purchase/checkoutCommitPlan.d.ts +58 -13
  50. package/dist/_dts/commerce/src/purchase/checkoutErrorCodes.d.ts +1 -1
  51. package/dist/_dts/commerce/src/purchase/checkoutPaymentPlanPlanning.d.ts +16 -21
  52. package/dist/_dts/commerce/src/purchase/checkoutPaymentTerms.d.ts +23 -40
  53. package/dist/_dts/commerce/src/purchase/checkoutSessionMetadata.d.ts +2 -2
  54. package/dist/_dts/commerce/src/purchase/checkoutStripeSessionPlanning.d.ts +5 -4
  55. package/dist/_dts/commerce/src/purchase/index.d.ts +1 -3
  56. package/dist/_dts/commerce/src/purchase/membershipOrderItemMetadata.d.ts +4 -0
  57. package/dist/_dts/commerce/src/purchase/oneTimeCheckoutPlanning.d.ts +9 -4
  58. package/dist/_dts/commerce/src/purchase/orderInstalmentClosure.d.ts +13 -1
  59. package/dist/_dts/commerce/src/purchase/orderInstalmentLifecycle.d.ts +5 -0
  60. package/dist/_dts/commerce/src/purchase/orderItemMetadata.d.ts +3 -1
  61. package/dist/_dts/commerce/src/purchase/orderTypes.d.ts +7 -1
  62. package/dist/_dts/commerce/src/purchase/refundRailSplit.d.ts +1 -1
  63. package/dist/_dts/commerce/src/purchase/stateTransitions.d.ts +2 -2
  64. package/dist/_dts/commerce/src/purchase/stripeMinimumCharge.d.ts +6 -0
  65. package/dist/_dts/commerce/src/purchase/types.d.ts +2 -1
  66. package/dist/_dts/content-editor/src/controller/editLeaseHandover.d.ts +30 -0
  67. package/dist/_dts/content-editor/src/lib/browserStorage.d.ts +5 -0
  68. package/dist/_dts/core/src/booking-flexible-balance.d.ts +2 -2
  69. package/dist/_dts/core/src/booking-instalment-deposit.d.ts +20 -0
  70. package/dist/_dts/core/src/booking-live-payment-terms.d.ts +72 -0
  71. package/dist/_dts/core/src/booking-payment-options.d.ts +24 -0
  72. package/dist/_dts/core/src/booking-payment-schemas.d.ts +522 -0
  73. package/dist/_dts/core/src/branded.d.ts +3 -0
  74. package/dist/_dts/core/src/edit-lease.d.ts +5 -0
  75. package/dist/_dts/core/src/index.d.ts +3 -0
  76. package/dist/_dts/db/src/generated/supabase/database.types.d.ts +297 -36
  77. package/dist/_dts/media-editor/src/MediaPickerDialog.d.ts +3 -1
  78. package/dist/_dts/media-editor/src/MediaPickerMiniDialog.d.ts +10 -0
  79. package/dist/_dts/media-editor/src/index.d.ts +2 -0
  80. package/dist/_dts/preview-next/src/client/preview/PreviewEntryControllerProvider.d.ts +0 -1
  81. package/dist/_dts/preview-next/src/client/preview/PreviewShell.d.ts +1 -1
  82. package/dist/_dts/preview-next/src/client/previewAuthStore.d.ts +7 -0
  83. package/dist/_dts/preview-next/src/constants.d.ts +4 -0
  84. package/dist/_dts/preview-next/src/keepAlive.d.ts +1 -0
  85. package/dist/_dts/sdk/src/rendering/islands/types.d.ts +2 -12
  86. package/dist/_dts/sdk/src/version.d.ts +1 -1
  87. package/dist/_dts/theme-core/src/site-styles/pageDesignIntent.d.ts +0 -5
  88. package/dist/_dts/ui/src/color-picker.d.ts +1 -1
  89. package/dist/_dts/ui/src/palette/useHexDraft.d.ts +7 -0
  90. package/dist/client/{BookingMailingListNote-CzRt2dF_.mjs → BookingMailingListNote-Cr3EeTP5.mjs} +408 -69
  91. package/dist/client/{DemoBookingPortalAccess-mxqwap3f.mjs → DemoBookingPortalAccess-BFGB1Fay.mjs} +2 -2
  92. package/dist/client/{EventCombined.client-CDb11igO.mjs → EventCombined.client-DKYV0_ft.mjs} +6 -6
  93. package/dist/client/{EventListing.client-EgYhzKPa.mjs → EventListing.client-B9UIcEYc.mjs} +2 -2
  94. package/dist/client/{LeafletStaticMap-gtmtaA2b.mjs → LeafletStaticMap-CFLPkP0K.mjs} +1 -1
  95. package/dist/client/{TerminalPanel-DvNUP5ot.mjs → TerminalPanel-JjmgxEsR.mjs} +1 -1
  96. package/dist/client/{ThemedButton-C7CeUJjW.mjs → ThemedButton-CKV1Jh2m.mjs} +1 -1
  97. package/dist/client/{accordion-kjvt49rA.mjs → accordion-DXWIfT3T.mjs} +1 -1
  98. package/dist/client/{bookingForm-pbRZordh.mjs → bookingForm-CjZgHNvv.mjs} +11 -8
  99. package/dist/client/bookings.mjs +424 -320
  100. package/dist/client/{carousel-f4Zbmicv.mjs → carousel-DSLikmvZ.mjs} +1 -1
  101. package/dist/client/{cart-DO20An50.mjs → cart-HDjWReFt.mjs} +3 -3
  102. package/dist/client/{checkout-Du5amDR_.mjs → checkout-CUvRZA3W.mjs} +3 -3
  103. package/dist/client/client.mjs +963 -866
  104. package/dist/client/{context-eW97E945.mjs → context-DFmaZa-Q.mjs} +1 -1
  105. package/dist/client/{dates-jPCirRea.mjs → dates-BBep1JnF.mjs} +2 -2
  106. package/dist/client/{eventCalendar-C2M-iE4j.mjs → eventCalendar-zEobhxo4.mjs} +9 -9
  107. package/dist/client/{eventCombined-W6ns3LHg.mjs → eventCombined-Dp7bz5k-.mjs} +4 -4
  108. package/dist/client/{eventDetails-CR-GT0f0.mjs → eventDetails-FE-zqTt7.mjs} +4 -4
  109. package/dist/client/{eventListing-BK8AfYZz.mjs → eventListing-BMt5snal.mjs} +4 -4
  110. package/dist/client/{eventRegistration-BJSd4KUu.mjs → eventRegistration-O6ZxHfOb.mjs} +67 -342
  111. package/dist/client/{form-BvpfbQaT.mjs → form-DFa1D8vt.mjs} +3 -3
  112. package/dist/client/{headerSection-I5sUQ8x-.mjs → headerSection-CmjHLR-N.mjs} +3 -3
  113. package/dist/client/hooks.mjs +160 -129
  114. package/dist/client/{locationMap-BLvwf9_f.mjs → locationMap-BXKP_lGh.mjs} +3 -3
  115. package/dist/client/{newsletterForm-DrQ2weE8.mjs → newsletterForm-CU-HmxGx.mjs} +3 -3
  116. package/dist/client/{pricing-BES87mrR.mjs → pricing-KEAEsibq.mjs} +1 -1
  117. package/dist/client/{productDetail-Url9jcc5.mjs → productDetail-Ckp7MGnt.mjs} +3 -3
  118. package/dist/client/{productList-DE7ngEZJ.mjs → productList-D91V0sYa.mjs} +3 -3
  119. package/dist/client/{propsDecoder-D1OtGXDV.mjs → propsDecoder-DZd6RJeA.mjs} +155 -77
  120. package/dist/client/rendering/client.mjs +3356 -3192
  121. package/dist/client/rendering/islands.mjs +17 -17
  122. package/dist/client/rendering.mjs +956 -841
  123. package/dist/client/{routeIslandApiConfig-BG9Y-SHg.mjs → routeIslandApiConfig-E1EkhhYY.mjs} +1 -1
  124. package/dist/client/{shop-CJkuySJ3.mjs → shop-4F2jLQPI.mjs} +12 -13
  125. package/dist/client/{shop-commerce-4rKj5n9h.mjs → shop-commerce-BbfCJjB3.mjs} +6 -6
  126. package/dist/client/{shop-commerce-store-Bxm75Pg6.mjs → shop-commerce-store-vicweP2K.mjs} +1 -1
  127. package/dist/client/{shopShared-DpoQDWfz.mjs → shopShared-DlONJt0T.mjs} +4 -4
  128. package/dist/client/{useEventFilters-D8HliSqR.mjs → useEventFilters-COYyL3m7.mjs} +6 -6
  129. package/dist/preview-next/before-render.mjs +15 -22
  130. package/dist/preview-next/client/runtime.mjs +4 -4
  131. package/dist/preview-next/constants.mjs +5 -1
  132. package/dist/preview-next/index.mjs +5 -1
  133. package/dist/preview-next/keepAlive.mjs +149 -82
  134. package/dist/preview-next/middleware.mjs +15 -22
  135. package/dist/{previewAuthStore-BXXF3hhW.mjs → previewAuthStore-BBmV7UsW.mjs} +49 -29
  136. package/dist/{sdk-runtime-C2a05WjL.mjs → sdk-runtime-CwvFFjB-.mjs} +2 -2
  137. package/dist/{separator-CuNhBAhS.mjs → separator-ByL72zUT.mjs} +1 -1
  138. package/dist/server/components.mjs +167 -131
  139. package/dist/server/config-validation.mjs +160 -129
  140. package/dist/server/config.mjs +160 -129
  141. package/dist/server/data.mjs +160 -129
  142. package/dist/server/index.mjs +20 -27
  143. package/dist/server/next.mjs +174 -156
  144. package/dist/server/page-converter.mjs +145 -65
  145. package/dist/server/prebuild.mjs +1 -1
  146. package/dist/server/rendering/server.mjs +169 -131
  147. package/dist/server/rendering.mjs +167 -131
  148. package/dist/server/routing.mjs +165 -118
  149. package/dist/server/server.mjs +167 -154
  150. package/package.json +1 -1
  151. package/dist/_dts/api/src/bookingPaymentTermSchemas.d.ts +0 -123
  152. package/dist/_dts/commerce/src/purchase/checkoutPaymentTermPlanning.d.ts +0 -10
  153. package/dist/_dts/commerce/src/purchase/checkoutValidatedItemPlanning.d.ts +0 -55
  154. package/dist/_dts/commerce/src/purchase/orderInstalmentPayoff.d.ts +0 -24
@@ -2018,6 +2018,16 @@ function isRecord$18(value) {
2018
2018
  return typeof value === "object" && value !== null && !Array.isArray(value);
2019
2019
  }
2020
2020
  //#endregion
2021
+ //#region ../core/src/booking-payment-options.ts
2022
+ /** Automatic instalments and a flexible balance cannot share one booking offer. */
2023
+ function validateBookingPaymentOptionKinds(kinds) {
2024
+ if (kinds.length === 0) return err$1("no_options");
2025
+ const uniqueKinds = new Set(kinds);
2026
+ if (uniqueKinds.size !== kinds.length) return err$1("duplicate_kind");
2027
+ if (uniqueKinds.has("instalment_plan") && uniqueKinds.has("flexible_balance")) return err$1("incompatible_collection_options");
2028
+ return ok$1(void 0);
2029
+ }
2030
+ //#endregion
2021
2031
  //#region ../core/src/booking-time-zone.ts
2022
2032
  const TIME_ZONE_VALIDITY_CACHE_LIMIT = 100;
2023
2033
  const timeZoneValidityCache = /* @__PURE__ */ new Map();
@@ -4098,7 +4108,8 @@ const CLIENT_ERROR_REPORT_LIMITS = {
4098
4108
  stack: 8e3,
4099
4109
  digest: 128,
4100
4110
  componentStack: 8e3,
4101
- sourceLocation: 1024
4111
+ sourceLocation: 1024,
4112
+ navigationAgeMs: 6e4
4102
4113
  };
4103
4114
  const clientErrorEventSchema = z.enum([
4104
4115
  "dashboard:route-error",
@@ -4115,7 +4126,17 @@ z.object({
4115
4126
  stack: z.string().max(CLIENT_ERROR_REPORT_LIMITS.stack).nullable(),
4116
4127
  digest: z.string().max(CLIENT_ERROR_REPORT_LIMITS.digest).nullable(),
4117
4128
  componentStack: z.string().max(CLIENT_ERROR_REPORT_LIMITS.componentStack).nullable(),
4118
- sourceLocation: z.string().max(CLIENT_ERROR_REPORT_LIMITS.sourceLocation).nullable()
4129
+ sourceLocation: z.string().max(CLIENT_ERROR_REPORT_LIMITS.sourceLocation).nullable(),
4130
+ navigation: z.object({
4131
+ fromPathname: z.string().regex(/^\/[^?#]*$/).max(CLIENT_ERROR_REPORT_LIMITS.pathname),
4132
+ toPathname: z.string().regex(/^\/[^?#]*$/).max(CLIENT_ERROR_REPORT_LIMITS.pathname),
4133
+ type: z.enum([
4134
+ "push",
4135
+ "replace",
4136
+ "traverse"
4137
+ ]),
4138
+ ageMs: z.number().int().min(0).max(CLIENT_ERROR_REPORT_LIMITS.navigationAgeMs)
4139
+ }).strict().nullable().optional()
4119
4140
  }).strict();
4120
4141
  const API_ENDPOINTS$1 = {
4121
4142
  ...SITE_LIFECYCLE_ENDPOINT_DEFINITIONS,
@@ -7872,24 +7893,6 @@ const API_ENDPOINTS$1 = {
7872
7893
  "server:internal_error"
7873
7894
  ]
7874
7895
  },
7875
- syncBookingPassWithStripe: {
7876
- path: "/sites/{siteId}/bookings/passes/{passId}/sync-stripe",
7877
- method: "POST",
7878
- tags: [
7879
- "site-{siteId}",
7880
- "passes-{siteId}",
7881
- "pass-{passId}"
7882
- ],
7883
- auth: "user",
7884
- responseKind: "json",
7885
- errors: [
7886
- "validation:invalid_input",
7887
- "auth:forbidden",
7888
- "resource:not_found",
7889
- "resource:conflict",
7890
- "server:internal_error"
7891
- ]
7892
- },
7893
7896
  refundCustomerPass: {
7894
7897
  path: "/sites/{siteId}/bookings/customer-passes/{customerPassId}/refund",
7895
7898
  method: "POST",
@@ -9353,7 +9356,7 @@ const API_ENDPOINTS$1 = {
9353
9356
  ]
9354
9357
  },
9355
9358
  cancelFlexibleBalanceBookingDueToNonPayment: {
9356
- path: "/sites/{siteId}/shop/orders/{orderId}/items/{orderItemId}/flexible-balance/cancel-due-to-non-payment",
9359
+ path: "/sites/{siteId}/shop/orders/{orderId}/flexible-balance/cancel-due-to-non-payment",
9357
9360
  method: "POST",
9358
9361
  auth: "user",
9359
9362
  responseKind: "json",
@@ -9364,7 +9367,7 @@ const API_ENDPOINTS$1 = {
9364
9367
  ]
9365
9368
  },
9366
9369
  reopenFlexibleBalanceBookingAfterNonPaymentCancellation: {
9367
- path: "/sites/{siteId}/shop/orders/{orderId}/items/{orderItemId}/flexible-balance/reopen",
9370
+ path: "/sites/{siteId}/shop/orders/{orderId}/flexible-balance/reopen",
9368
9371
  method: "POST",
9369
9372
  auth: "user",
9370
9373
  responseKind: "json",
@@ -9869,14 +9872,14 @@ async function parseSuccessResponse(endpoint, response, config) {
9869
9872
  default: return buildSuccessEnvelope(void 0, requestId);
9870
9873
  }
9871
9874
  }
9872
- function createRawCMSClient(headers = {}, baseUrl) {
9875
+ function createRawCMSClient(getHeaders = () => ({}), baseUrl) {
9873
9876
  return ({ endpoint, body, params, options = {} }) => {
9874
9877
  const plan = buildApiRequestPlan({
9875
9878
  endpoint,
9876
9879
  body,
9877
9880
  params,
9878
9881
  options,
9879
- headers,
9882
+ headers: getHeaders(),
9880
9883
  baseUrl: normalizeCmsApiBaseUrl(baseUrl ?? resolveApiBaseUrl()),
9881
9884
  sdkVersion
9882
9885
  });
@@ -9982,13 +9985,13 @@ function createParsedClient(rawClient) {
9982
9985
  };
9983
9986
  }
9984
9987
  function createCMSClient(headers = {}, baseUrl) {
9985
- return createParsedClient(createRawCMSClient(headers, baseUrl));
9988
+ return createParsedClient(createRawCMSClient(() => headers, baseUrl));
9986
9989
  }
9987
9990
  function createInternalAPIClient(baseUrl) {
9988
9991
  return createCMSClient({}, baseUrl);
9989
9992
  }
9990
9993
  function createBearerAPIClient(token, baseUrl) {
9991
- return createCMSClient({ Authorization: `Bearer ${token}` }, baseUrl);
9994
+ return createParsedClient(createRawCMSClient(() => ({ Authorization: `Bearer ${typeof token === "function" ? token() : token}` }), baseUrl));
9992
9995
  }
9993
9996
  //#endregion
9994
9997
  //#region src/client/cache.ts
@@ -10102,7 +10105,7 @@ var SimpleCache = class {
10102
10105
  * 1. This constant
10103
10106
  * 2. The "version" field in package.json
10104
10107
  */
10105
- const SDK_VERSION = "0.148.0";
10108
+ const SDK_VERSION = "0.149.0";
10106
10109
  //#endregion
10107
10110
  //#region src/client/error.ts
10108
10111
  let _Symbol$for;
@@ -37043,68 +37046,115 @@ const weeklySlotAvailabilityBlockDefinition = {
37043
37046
  } }
37044
37047
  };
37045
37048
  //#endregion
37046
- //#region ../blocks/src/system/blocks/shared/bookingPaymentTerms.ts
37047
- const bookingDepositRefundPolicySchema$1 = z.enum(["refundable", "non_refundable"]);
37048
- const bookingInstalmentPlanSchema$1 = z.union([
37049
- z.object({
37050
- kind: z.literal("deposit_plus_one_remainder"),
37051
- depositAmountCents: z.number().int().min(0),
37052
- depositRefundability: bookingDepositRefundPolicySchema$1,
37053
- remainderDueCount: z.number().int().positive(),
37054
- intervalUnit: z.enum([
37055
- "day",
37056
- "week",
37057
- "month"
37058
- ])
37059
- }),
37060
- z.object({
37061
- kind: z.literal("deposit_plus_scheduled_instalments"),
37062
- depositAmountCents: z.number().int().min(0),
37063
- depositRefundability: bookingDepositRefundPolicySchema$1,
37064
- instalmentCount: z.number().int().positive(),
37065
- intervalCount: z.number().int().positive(),
37066
- intervalUnit: z.enum([
37067
- "day",
37068
- "week",
37069
- "month"
37070
- ])
37071
- }),
37072
- z.object({
37073
- kind: z.literal("equal_scheduled_instalments"),
37074
- instalmentCount: z.number().int().positive(),
37075
- intervalCount: z.number().int().positive(),
37076
- intervalUnit: z.enum([
37077
- "day",
37078
- "week",
37079
- "month"
37080
- ])
37081
- })
37082
- ]);
37083
- const bookingFlexibleBalanceDueDateRuleSchema$1 = z.union([z.object({
37084
- kind: z.literal("relative_to_start_date"),
37085
- daysBeforeStart: z.number().int().positive()
37086
- }), z.object({
37087
- kind: z.literal("fixed_calendar_date"),
37088
- dueAt: z.string().datetime()
37089
- })]);
37090
- const bookingFlexibleBalanceConfigSchema$1 = z.object({
37091
- upfrontAmountCents: z.number().int().min(0),
37092
- dueDateRule: bookingFlexibleBalanceDueDateRuleSchema$1,
37093
- depositRefundability: bookingDepositRefundPolicySchema$1
37094
- });
37095
- const blockBookingPaymentCollectionOptionSchema = z.union([
37096
- z.object({ kind: z.literal("upfront") }),
37097
- z.object({ kind: z.literal("deferred_manual") }),
37098
- z.object({
37099
- kind: z.literal("instalment_plan"),
37100
- plan: bookingInstalmentPlanSchema$1
37101
- }),
37102
- z.object({
37103
- kind: z.literal("flexible_balance"),
37104
- config: bookingFlexibleBalanceConfigSchema$1
37105
- })
37049
+ //#region ../core/src/booking-payment-schemas.ts
37050
+ const stripObject = (shape) => z.object(shape);
37051
+ const strictObject = (shape) => z.strictObject(shape);
37052
+ const depositRefundPolicySchema = z.enum(["refundable", "non_refundable"]);
37053
+ const intervalUnitSchema = z.enum([
37054
+ "day",
37055
+ "week",
37056
+ "month"
37106
37057
  ]);
37107
- const blockBookingPaymentTermsSchema = z.object({ allowedOptions: z.array(blockBookingPaymentCollectionOptionSchema).min(1) });
37058
+ const nonNegativeIntegerSchema = z.number().int().nonnegative();
37059
+ const positiveIntegerSchema = z.number().int().positive();
37060
+ function createInstalmentPlanSchema(object) {
37061
+ return z.discriminatedUnion("kind", [
37062
+ object({
37063
+ kind: z.literal("deposit_plus_one_remainder"),
37064
+ depositAmountCents: nonNegativeIntegerSchema,
37065
+ depositRefundability: depositRefundPolicySchema,
37066
+ remainderDueCount: positiveIntegerSchema,
37067
+ intervalUnit: intervalUnitSchema
37068
+ }),
37069
+ object({
37070
+ kind: z.literal("deposit_plus_scheduled_instalments"),
37071
+ depositAmountCents: nonNegativeIntegerSchema,
37072
+ depositRefundability: depositRefundPolicySchema,
37073
+ instalmentCount: positiveIntegerSchema,
37074
+ intervalCount: positiveIntegerSchema,
37075
+ intervalUnit: intervalUnitSchema
37076
+ }),
37077
+ object({
37078
+ kind: z.literal("equal_scheduled_instalments"),
37079
+ instalmentCount: positiveIntegerSchema,
37080
+ intervalCount: positiveIntegerSchema,
37081
+ intervalUnit: intervalUnitSchema
37082
+ })
37083
+ ]);
37084
+ }
37085
+ function createFlexibleBalanceSchemas(object) {
37086
+ const dueDateRule = z.discriminatedUnion("kind", [object({
37087
+ kind: z.literal("relative_to_start_date"),
37088
+ daysBeforeStart: positiveIntegerSchema
37089
+ }), object({
37090
+ kind: z.literal("fixed_calendar_date"),
37091
+ dueAt: z.string().datetime()
37092
+ })]);
37093
+ return {
37094
+ dueDateRule,
37095
+ config: object({
37096
+ upfrontAmountCents: nonNegativeIntegerSchema,
37097
+ dueDateRule,
37098
+ depositRefundability: depositRefundPolicySchema
37099
+ })
37100
+ };
37101
+ }
37102
+ const paymentOptionKindsMessages = {
37103
+ no_options: "Choose at least one way for customers to pay.",
37104
+ duplicate_kind: "Choose each payment option only once.",
37105
+ incompatible_collection_options: "Offer instalments or a deposit with the rest paid later, but not both."
37106
+ };
37107
+ function buildBookingPaymentOptionSchemas(object) {
37108
+ const instalmentPlan = createInstalmentPlanSchema(object);
37109
+ const flexibleBalance = createFlexibleBalanceSchemas(object);
37110
+ const paymentCollectionOption = z.discriminatedUnion("kind", [
37111
+ object({ kind: z.literal("upfront") }),
37112
+ object({ kind: z.literal("deferred_manual") }),
37113
+ object({
37114
+ kind: z.literal("instalment_plan"),
37115
+ plan: instalmentPlan
37116
+ }),
37117
+ object({
37118
+ kind: z.literal("flexible_balance"),
37119
+ config: flexibleBalance.config
37120
+ })
37121
+ ]);
37122
+ const paymentTerms = object({ allowedOptions: z.array(paymentCollectionOption) }).superRefine(({ allowedOptions }, ctx) => {
37123
+ const result = validateBookingPaymentOptionKinds(allowedOptions.map(({ kind }) => kind));
37124
+ if (!result.ok) ctx.addIssue({
37125
+ code: "custom",
37126
+ path: ["allowedOptions"],
37127
+ message: paymentOptionKindsMessages[result.error]
37128
+ });
37129
+ });
37130
+ const paymentOptionsChoice = z.discriminatedUnion("source", [z.strictObject({ source: z.literal("default") }), z.strictObject({
37131
+ source: z.literal("custom"),
37132
+ paymentTerms
37133
+ })]);
37134
+ return {
37135
+ depositRefundPolicy: depositRefundPolicySchema,
37136
+ instalmentPlan,
37137
+ flexibleBalanceDueDateRule: flexibleBalance.dueDateRule,
37138
+ flexibleBalanceConfig: flexibleBalance.config,
37139
+ paymentCollectionOption,
37140
+ paymentTerms,
37141
+ paymentOptionsChoice
37142
+ };
37143
+ }
37144
+ function createBookingPaymentOptionSchemas(mode) {
37145
+ return mode === "strict" ? buildBookingPaymentOptionSchemas(strictObject) : buildBookingPaymentOptionSchemas(stripObject);
37146
+ }
37147
+ const bookingPaymentOptionSchemas = createBookingPaymentOptionSchemas("strip");
37148
+ bookingPaymentOptionSchemas.depositRefundPolicy;
37149
+ bookingPaymentOptionSchemas.instalmentPlan;
37150
+ bookingPaymentOptionSchemas.flexibleBalanceDueDateRule;
37151
+ bookingPaymentOptionSchemas.flexibleBalanceConfig;
37152
+ bookingPaymentOptionSchemas.paymentCollectionOption;
37153
+ const bookingPaymentTermsSchema = bookingPaymentOptionSchemas.paymentTerms;
37154
+ bookingPaymentOptionSchemas.paymentOptionsChoice;
37155
+ //#endregion
37156
+ //#region ../blocks/src/system/blocks/shared/bookingPaymentTerms.ts
37157
+ const blockBookingPaymentTermsSchema = bookingPaymentTermsSchema;
37108
37158
  //#endregion
37109
37159
  //#region ../blocks/src/system/blocks/shared/bookingConsent.ts
37110
37160
  const blockBookingConsentSchema = z.object({
@@ -37706,7 +37756,7 @@ const publicPassProductCollectionSchema = z.object({ passes: z.array(publicPassP
37706
37756
  /**
37707
37757
  * Public membership product for shop display
37708
37758
  */
37709
- const publicMembershipProductSchema = z.object({
37759
+ const publicMembershipProductFields = {
37710
37760
  id: z.string(),
37711
37761
  name: z.string(),
37712
37762
  description: z.string().nullable(),
@@ -37715,7 +37765,16 @@ const publicMembershipProductSchema = z.object({
37715
37765
  billingInterval: z.enum(["month", "year"]),
37716
37766
  eligibleCategoryIds: z.array(z.string()),
37717
37767
  eligibleCategoryNames: z.array(z.string())
37768
+ };
37769
+ const purchasablePublicMembershipProductSchema = z.object({
37770
+ ...publicMembershipProductFields,
37771
+ purchaseAvailability: z.literal("purchasable")
37718
37772
  });
37773
+ const publicMembershipProductSchema = z.discriminatedUnion("purchaseAvailability", [purchasablePublicMembershipProductSchema, z.object({
37774
+ ...publicMembershipProductFields,
37775
+ purchaseAvailability: z.literal("display_only"),
37776
+ unavailabilityReason: z.literal("online_payments_unavailable")
37777
+ })]);
37719
37778
  const publicMembershipProductCollectionSchema = z.object({ memberships: z.array(publicMembershipProductSchema) });
37720
37779
  //#endregion
37721
37780
  //#region ../blocks/src/system/blocks/event-registration.shared.ts
@@ -43672,7 +43731,7 @@ function buildPassesMembershipsDisplay(options) {
43672
43731
  product: pass
43673
43732
  } : {
43674
43733
  kind: "unavailable",
43675
- label: "Online purchasing coming soon."
43734
+ label: "Online purchasing is unavailable."
43676
43735
  }
43677
43736
  };
43678
43737
  });
@@ -43682,7 +43741,14 @@ function buildPassesMembershipsDisplay(options) {
43682
43741
  description: options.showDescriptions ? membership.description : null,
43683
43742
  priceLabel: formatCommercePrice(membership.price, membership.currency),
43684
43743
  intervalLabel: formatInterval(membership.billingInterval),
43685
- actionLabel: options.membershipActionLabel
43744
+ action: membership.purchaseAvailability === "purchasable" ? {
43745
+ kind: "purchase",
43746
+ label: options.membershipActionLabel,
43747
+ product: membership
43748
+ } : {
43749
+ kind: "unavailable",
43750
+ label: "Online purchasing is unavailable."
43751
+ }
43686
43752
  }));
43687
43753
  return {
43688
43754
  kind: "passes-memberships",
@@ -43902,7 +43968,14 @@ const membershipCardDisplaySchema = z.object({
43902
43968
  description: z.string().nullable(),
43903
43969
  priceLabel: z.string(),
43904
43970
  intervalLabel: z.string(),
43905
- actionLabel: z.string()
43971
+ action: z.discriminatedUnion("kind", [z.object({
43972
+ kind: z.literal("purchase"),
43973
+ label: z.string(),
43974
+ product: purchasablePublicMembershipProductSchema
43975
+ }), z.object({
43976
+ kind: z.literal("unavailable"),
43977
+ label: z.string()
43978
+ })])
43906
43979
  });
43907
43980
  const passesMembershipsDisplaySchema = z.object({
43908
43981
  kind: z.literal("passes-memberships"),
@@ -51138,6 +51211,7 @@ const CANONICAL_REFUND_PLANNER_ERROR_CODES = [
51138
51211
  "refund_failed"
51139
51212
  ];
51140
51213
  const CANONICAL_ADMIN_REFUND_FAILURE_CODES = [
51214
+ "refund_blocked_by_live_payment_terms",
51141
51215
  ...CANONICAL_REFUND_PLANNER_ERROR_CODES,
51142
51216
  "payment_intent_not_found",
51143
51217
  "stripe_error",
@@ -51153,6 +51227,7 @@ const CANONICAL_ADMIN_REFUND_FAILURE_CODES = [
51153
51227
  //#endregion
51154
51228
  //#region ../api/src/bookingRefundOutcomes.ts
51155
51229
  const STANDARD_LINE_ITEM_REFUND_INVALID_CODES = [
51230
+ "refund_blocked_by_live_payment_terms",
51156
51231
  "missing_amount",
51157
51232
  "invalid_amount",
51158
51233
  "amount_exceeds_remaining",
@@ -51515,68 +51590,6 @@ function collectText(node) {
51515
51590
  }
51516
51591
  z.enum(["public", "unlisted"], { error: "visibility must be 'public' or 'unlisted'" });
51517
51592
  //#endregion
51518
- //#region ../api/src/bookingPaymentTermSchemas.ts
51519
- const bookingDepositRefundPolicySchema = z.enum(["refundable", "non_refundable"]);
51520
- const bookingInstalmentPlanSchema = z.discriminatedUnion("kind", [
51521
- z.object({
51522
- kind: z.literal("deposit_plus_one_remainder"),
51523
- depositAmountCents: z.number().int().nonnegative(),
51524
- depositRefundability: bookingDepositRefundPolicySchema,
51525
- remainderDueCount: z.number().int().positive(),
51526
- intervalUnit: z.enum([
51527
- "day",
51528
- "week",
51529
- "month"
51530
- ])
51531
- }),
51532
- z.object({
51533
- kind: z.literal("deposit_plus_scheduled_instalments"),
51534
- depositAmountCents: z.number().int().nonnegative(),
51535
- depositRefundability: bookingDepositRefundPolicySchema,
51536
- instalmentCount: z.number().int().positive(),
51537
- intervalCount: z.number().int().positive(),
51538
- intervalUnit: z.enum([
51539
- "day",
51540
- "week",
51541
- "month"
51542
- ])
51543
- }),
51544
- z.object({
51545
- kind: z.literal("equal_scheduled_instalments"),
51546
- instalmentCount: z.number().int().positive(),
51547
- intervalCount: z.number().int().positive(),
51548
- intervalUnit: z.enum([
51549
- "day",
51550
- "week",
51551
- "month"
51552
- ])
51553
- })
51554
- ]);
51555
- const bookingFlexibleBalanceDueDateRuleSchema = z.discriminatedUnion("kind", [z.object({
51556
- kind: z.literal("relative_to_start_date"),
51557
- daysBeforeStart: z.number().int().positive()
51558
- }), z.object({
51559
- kind: z.literal("fixed_calendar_date"),
51560
- dueAt: z.string().datetime()
51561
- })]);
51562
- const bookingFlexibleBalanceConfigSchema = z.object({
51563
- upfrontAmountCents: z.number().int().nonnegative(),
51564
- dueDateRule: bookingFlexibleBalanceDueDateRuleSchema,
51565
- depositRefundability: bookingDepositRefundPolicySchema
51566
- });
51567
- z.discriminatedUnion("kind", [
51568
- z.object({ kind: z.literal("upfront") }),
51569
- z.object({ kind: z.literal("deferred_manual") }),
51570
- z.object({
51571
- kind: z.literal("instalment_plan"),
51572
- plan: bookingInstalmentPlanSchema
51573
- }),
51574
- z.object({
51575
- kind: z.literal("flexible_balance"),
51576
- config: bookingFlexibleBalanceConfigSchema
51577
- })
51578
- ]);
51579
- //#endregion
51580
51593
  //#region ../api/src/aiPlayground.ts
51581
51594
  /**
51582
51595
  * RFC-6902 JSON Patch Operations
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riverbankcms/sdk",
3
- "version": "0.148.0",
3
+ "version": "0.149.0",
4
4
  "description": "Riverbank CMS SDK for headless content consumption",
5
5
  "main": "./dist/server/index.mjs",
6
6
  "module": "./dist/server/index.mjs",
@@ -1,123 +0,0 @@
1
- import { z } from 'zod';
2
- export declare const bookingDepositRefundPolicySchema: z.ZodEnum<{
3
- refundable: "refundable";
4
- non_refundable: "non_refundable";
5
- }>;
6
- export declare const bookingInstalmentPlanSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
7
- kind: z.ZodLiteral<"deposit_plus_one_remainder">;
8
- depositAmountCents: z.ZodNumber;
9
- depositRefundability: z.ZodEnum<{
10
- refundable: "refundable";
11
- non_refundable: "non_refundable";
12
- }>;
13
- remainderDueCount: z.ZodNumber;
14
- intervalUnit: z.ZodEnum<{
15
- day: "day";
16
- week: "week";
17
- month: "month";
18
- }>;
19
- }, z.core.$strip>, z.ZodObject<{
20
- kind: z.ZodLiteral<"deposit_plus_scheduled_instalments">;
21
- depositAmountCents: z.ZodNumber;
22
- depositRefundability: z.ZodEnum<{
23
- refundable: "refundable";
24
- non_refundable: "non_refundable";
25
- }>;
26
- instalmentCount: z.ZodNumber;
27
- intervalCount: z.ZodNumber;
28
- intervalUnit: z.ZodEnum<{
29
- day: "day";
30
- week: "week";
31
- month: "month";
32
- }>;
33
- }, z.core.$strip>, z.ZodObject<{
34
- kind: z.ZodLiteral<"equal_scheduled_instalments">;
35
- instalmentCount: z.ZodNumber;
36
- intervalCount: z.ZodNumber;
37
- intervalUnit: z.ZodEnum<{
38
- day: "day";
39
- week: "week";
40
- month: "month";
41
- }>;
42
- }, z.core.$strip>], "kind">;
43
- export declare const bookingFlexibleBalanceDueDateRuleSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
44
- kind: z.ZodLiteral<"relative_to_start_date">;
45
- daysBeforeStart: z.ZodNumber;
46
- }, z.core.$strip>, z.ZodObject<{
47
- kind: z.ZodLiteral<"fixed_calendar_date">;
48
- dueAt: z.ZodString;
49
- }, z.core.$strip>], "kind">;
50
- export declare const bookingFlexibleBalanceConfigSchema: z.ZodObject<{
51
- upfrontAmountCents: z.ZodNumber;
52
- dueDateRule: z.ZodDiscriminatedUnion<[z.ZodObject<{
53
- kind: z.ZodLiteral<"relative_to_start_date">;
54
- daysBeforeStart: z.ZodNumber;
55
- }, z.core.$strip>, z.ZodObject<{
56
- kind: z.ZodLiteral<"fixed_calendar_date">;
57
- dueAt: z.ZodString;
58
- }, z.core.$strip>], "kind">;
59
- depositRefundability: z.ZodEnum<{
60
- refundable: "refundable";
61
- non_refundable: "non_refundable";
62
- }>;
63
- }, z.core.$strip>;
64
- export declare const bookingPaymentCollectionOptionSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
65
- kind: z.ZodLiteral<"upfront">;
66
- }, z.core.$strip>, z.ZodObject<{
67
- kind: z.ZodLiteral<"deferred_manual">;
68
- }, z.core.$strip>, z.ZodObject<{
69
- kind: z.ZodLiteral<"instalment_plan">;
70
- plan: z.ZodDiscriminatedUnion<[z.ZodObject<{
71
- kind: z.ZodLiteral<"deposit_plus_one_remainder">;
72
- depositAmountCents: z.ZodNumber;
73
- depositRefundability: z.ZodEnum<{
74
- refundable: "refundable";
75
- non_refundable: "non_refundable";
76
- }>;
77
- remainderDueCount: z.ZodNumber;
78
- intervalUnit: z.ZodEnum<{
79
- day: "day";
80
- week: "week";
81
- month: "month";
82
- }>;
83
- }, z.core.$strip>, z.ZodObject<{
84
- kind: z.ZodLiteral<"deposit_plus_scheduled_instalments">;
85
- depositAmountCents: z.ZodNumber;
86
- depositRefundability: z.ZodEnum<{
87
- refundable: "refundable";
88
- non_refundable: "non_refundable";
89
- }>;
90
- instalmentCount: z.ZodNumber;
91
- intervalCount: z.ZodNumber;
92
- intervalUnit: z.ZodEnum<{
93
- day: "day";
94
- week: "week";
95
- month: "month";
96
- }>;
97
- }, z.core.$strip>, z.ZodObject<{
98
- kind: z.ZodLiteral<"equal_scheduled_instalments">;
99
- instalmentCount: z.ZodNumber;
100
- intervalCount: z.ZodNumber;
101
- intervalUnit: z.ZodEnum<{
102
- day: "day";
103
- week: "week";
104
- month: "month";
105
- }>;
106
- }, z.core.$strip>], "kind">;
107
- }, z.core.$strip>, z.ZodObject<{
108
- kind: z.ZodLiteral<"flexible_balance">;
109
- config: z.ZodObject<{
110
- upfrontAmountCents: z.ZodNumber;
111
- dueDateRule: z.ZodDiscriminatedUnion<[z.ZodObject<{
112
- kind: z.ZodLiteral<"relative_to_start_date">;
113
- daysBeforeStart: z.ZodNumber;
114
- }, z.core.$strip>, z.ZodObject<{
115
- kind: z.ZodLiteral<"fixed_calendar_date">;
116
- dueAt: z.ZodString;
117
- }, z.core.$strip>], "kind">;
118
- depositRefundability: z.ZodEnum<{
119
- refundable: "refundable";
120
- non_refundable: "non_refundable";
121
- }>;
122
- }, z.core.$strip>;
123
- }, z.core.$strip>], "kind">;
@@ -1,10 +0,0 @@
1
- import type { BookingFlexibleBalanceConfig } from '../../../core/src/index';
2
- import type { CheckoutPaymentTermLine, CheckoutPaymentTerms } from './checkoutPaymentTerms';
3
- import type { CheckoutStripeRequiredPaymentTerms } from './checkoutPaymentPlanPlanning';
4
- export type AttendeeBookingCheckoutPaymentSelectionSnapshot<TFlexibleBalanceConfig extends BookingFlexibleBalanceConfig> = Readonly<{
5
- bookingStartAt?: string | null;
6
- selectedCollectionOptionKind?: 'upfront' | 'deferred_manual' | 'instalment_plan' | 'flexible_balance' | null;
7
- selectedFlexibleBalanceConfig?: TFlexibleBalanceConfig | null;
8
- }>;
9
- export declare function attendeeBookingPaymentSelectionToCheckoutPaymentTermLine<TFlexibleBalanceConfig extends BookingFlexibleBalanceConfig>(selection: AttendeeBookingCheckoutPaymentSelectionSnapshot<TFlexibleBalanceConfig>): CheckoutPaymentTermLine<never, TFlexibleBalanceConfig>;
10
- export declare function checkoutPaymentTermsToStripeRequiredPaymentTerms<TInstalmentPlan, TFlexibleBalanceConfig extends BookingFlexibleBalanceConfig>(paymentTerms: CheckoutPaymentTerms<TInstalmentPlan, TFlexibleBalanceConfig>): CheckoutStripeRequiredPaymentTerms<TInstalmentPlan, TFlexibleBalanceConfig>;
@@ -1,55 +0,0 @@
1
- import type { BookingFlexibleBalanceConfig } from '../../../core/src/index';
2
- import type { CheckoutPaymentTermCollectionOptionKind } from './checkoutPaymentTerms';
3
- export type SelectedAppointmentCheckoutCollectionOption<TInstalmentPlan, TFlexibleBalanceConfig extends BookingFlexibleBalanceConfig> = Readonly<{
4
- kind: 'upfront' | 'deferred_manual';
5
- }> | Readonly<{
6
- kind: 'instalment_plan';
7
- plan: TInstalmentPlan;
8
- }> | Readonly<{
9
- kind: 'flexible_balance';
10
- config: TFlexibleBalanceConfig;
11
- }> | null;
12
- export type SelectedAttendeeBookingCheckoutCollectionOption<TFlexibleBalanceConfig extends BookingFlexibleBalanceConfig> = Readonly<{
13
- kind: 'upfront' | 'deferred_manual';
14
- }> | Readonly<{
15
- kind: 'flexible_balance';
16
- config: TFlexibleBalanceConfig;
17
- }> | null;
18
- export type AttendeeBookingCollectionOptionInput<TFlexibleBalanceConfig extends BookingFlexibleBalanceConfig> = Readonly<{
19
- kind: 'upfront' | 'deferred_manual';
20
- }> | Readonly<{
21
- kind: 'flexible_balance';
22
- config: TFlexibleBalanceConfig;
23
- }> | Readonly<{
24
- kind: 'instalment_plan';
25
- }> | null;
26
- export type ValidatedAttendeeBookingPaymentSelection<TFlexibleBalanceConfig extends BookingFlexibleBalanceConfig> = Readonly<{
27
- bookingStartAt: string;
28
- selectedCollectionOptionKind: 'flexible_balance';
29
- selectedFlexibleBalanceConfig: TFlexibleBalanceConfig;
30
- }> | Readonly<{
31
- bookingStartAt: string;
32
- selectedCollectionOptionKind: Exclude<CheckoutPaymentTermCollectionOptionKind, 'flexible_balance'> | null;
33
- selectedFlexibleBalanceConfig: null;
34
- }>;
35
- export type ValidatedAppointmentPaymentSelection<TInstalmentPlan, TFlexibleBalanceConfig extends BookingFlexibleBalanceConfig> = Readonly<{
36
- selectedCollectionOptionKind: 'instalment_plan';
37
- selectedInstalmentPlan: TInstalmentPlan;
38
- selectedFlexibleBalanceConfig: null;
39
- }> | Readonly<{
40
- selectedCollectionOptionKind: 'flexible_balance';
41
- selectedInstalmentPlan: null;
42
- selectedFlexibleBalanceConfig: TFlexibleBalanceConfig;
43
- }> | Readonly<{
44
- selectedCollectionOptionKind: 'upfront' | 'deferred_manual' | null;
45
- selectedInstalmentPlan: null;
46
- selectedFlexibleBalanceConfig: null;
47
- }>;
48
- export declare function buildValidatedAttendeeBookingPaymentSelection<TFlexibleBalanceConfig extends BookingFlexibleBalanceConfig>(input: Readonly<{
49
- bookingStartAt: string;
50
- selectedCollectionOption: SelectedAttendeeBookingCheckoutCollectionOption<TFlexibleBalanceConfig>;
51
- }>): ValidatedAttendeeBookingPaymentSelection<TFlexibleBalanceConfig>;
52
- export declare function toSelectedAttendeeBookingCheckoutCollectionOption<TFlexibleBalanceConfig extends BookingFlexibleBalanceConfig>(option: AttendeeBookingCollectionOptionInput<TFlexibleBalanceConfig>): SelectedAttendeeBookingCheckoutCollectionOption<TFlexibleBalanceConfig>;
53
- export declare function buildValidatedAppointmentPaymentSelection<TInstalmentPlan, TFlexibleBalanceConfig extends BookingFlexibleBalanceConfig>(input: Readonly<{
54
- selectedCollectionOption: SelectedAppointmentCheckoutCollectionOption<TInstalmentPlan, TFlexibleBalanceConfig>;
55
- }>): ValidatedAppointmentPaymentSelection<TInstalmentPlan, TFlexibleBalanceConfig>;
@@ -1,24 +0,0 @@
1
- import { type NonNegativeCents } from '../../../core/src/index';
2
- import type { OrderInstalmentPhaseKind, OrderInstalmentPlanStatus, OrderInstalmentStatus } from './orderInstalmentPlan';
3
- type InstalmentPayoffPlanSnapshot = Readonly<{
4
- status: OrderInstalmentPlanStatus;
5
- remainingBalanceCents: NonNegativeCents;
6
- }>;
7
- type InstalmentPayoffRowSnapshot = Readonly<{
8
- id: string;
9
- phaseKind: OrderInstalmentPhaseKind;
10
- status: OrderInstalmentStatus;
11
- }>;
12
- export type OrderInstalmentPayoffPlan = Readonly<{
13
- kind: 'already_applied';
14
- }> | Readonly<{
15
- kind: 'apply';
16
- nextPlanStatus: 'cancelled_as_paid_early';
17
- nextRemainingBalanceCents: NonNegativeCents;
18
- instalmentIdsToCancel: readonly string[];
19
- }>;
20
- export declare function planOrderInstalmentPayoff(input: Readonly<{
21
- paymentPlan: InstalmentPayoffPlanSnapshot;
22
- instalments: readonly InstalmentPayoffRowSnapshot[];
23
- }>): OrderInstalmentPayoffPlan;
24
- export {};