@saasicat/core 1.0.0-rc.20 → 1.0.0-rc.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -564,6 +564,15 @@ interface PaymentMethodSetupSession {
564
564
  redirectUrl: string;
565
565
  /** The customer the payment method is set up for, created if none was given. */
566
566
  customerRef: string;
567
+ /**
568
+ * The last moment a confirmation of this session can still arrive: the end
569
+ * of its form, after which nobody can complete it, plus the time the
570
+ * gateway goes on retrying a confirmation it could not deliver. `null` for
571
+ * a gateway that states neither. A sign-up's promo code slot is held until
572
+ * then, so a form paid shortly before its end still finds its slot when the
573
+ * confirmation arrives late, and an abandoned form gives it back.
574
+ */
575
+ confirmableUntil: Date | null;
567
576
  /**
568
577
  * A confirmation the gateway already holds when the session starts, to be
569
578
  * handled like any callback. Only a gateway without a form of its own has
@@ -915,6 +924,11 @@ interface PromoCode {
915
924
  validUntil: string | null;
916
925
  maxRedemptions: number | null;
917
926
  redemptionsCount: number;
927
+ /**
928
+ * Slots held for checkouts that started and have not concluded. A code has
929
+ * a free slot while `redemptionsCount + heldCount` is below `maxRedemptions`.
930
+ */
931
+ heldCount: number;
918
932
  appliesToPlans: PlanId[];
919
933
  appliesToBilling: BillingCycle | null;
920
934
  firstTimeCustomersOnly: boolean;
@@ -1729,8 +1743,35 @@ type PromotionResult = {
1729
1743
  original: number;
1730
1744
  months: number;
1731
1745
  };
1732
- /** Applies the promotion math to a base price. */
1746
+ /**
1747
+ * Applies the promotion math to a base price, or `null` where the promotion
1748
+ * takes nothing off it.
1749
+ *
1750
+ * The discounted price stays between 0 and the base price, whatever the
1751
+ * promotion states: a promotion lowers the price of what it is on and nothing
1752
+ * else. Creating one refuses a value no price could make sense of, but whether
1753
+ * an intro price or an amount fits depends on the price it meets — which
1754
+ * differs per plan and rhythm and moves when a new version is published — so
1755
+ * the bound is held here, where every place that resolves a promotion reads it:
1756
+ * the public catalogue, a checkout offer, the operator's preview.
1757
+ */
1733
1758
  declare function applyPromo(promo: PromotionRow | null, basePrice: number | null): PromotionResult | null;
1759
+ /** A promotion on a price, and what it makes of that price. */
1760
+ interface PromotionOnPrice {
1761
+ promotion: PromotionRow;
1762
+ result: PromotionResult;
1763
+ }
1764
+ /**
1765
+ * The promotion a price carries: the one `pickActivePromo` selects for the key,
1766
+ * language and rhythm, where `applyPromo` finds that it lowers the price at
1767
+ * all — or `null`.
1768
+ *
1769
+ * One question, asked the same way by every place that shows or charges a
1770
+ * promotion: the public catalogue, a checkout offer, and the operator's
1771
+ * preview. A promotion that lowers nothing is no promotion there, so it carries
1772
+ * no badge and takes nothing off.
1773
+ */
1774
+ declare function promotionOnPrice(promotions: PromotionRow[], targetKey: string, locale: string, cycle: 'monthly' | 'yearly', basePrice: number | null, today?: Date, targetType?: PromotionTargetType): PromotionOnPrice | null;
1734
1775
 
1735
1776
  type CheckoutOfferLineItemKind = 'plan' | 'bundle' | 'discount';
1736
1777
  /** Frozen billable line item in the offer. */
@@ -2015,12 +2056,32 @@ interface PublicComparisonRow {
2015
2056
  /** Quotas only: display unit. */
2016
2057
  unit?: string;
2017
2058
  }
2059
+ /**
2060
+ * What this installation takes a new payment method with, so a page offering the
2061
+ * plans can say it before anybody reaches the form.
2062
+ *
2063
+ * It is the account `config/saas.yaml#payments.newPaymentMethods` names, with the
2064
+ * gateway bound for it — the same account a sign-up's payment step and a tenant's
2065
+ * own change both go to. Whether an installation runs sign-ups at all is not part
2066
+ * of it: that is the application's own wiring, and the application knows it.
2067
+ *
2068
+ * Which account it is and who keeps the payment method stay inside: a prospect is
2069
+ * told that a card or a direct debit will be asked for, not where it is kept.
2070
+ */
2071
+ interface PublicNewPaymentMethods {
2072
+ /** Whether a new payment method is taken here at all. */
2073
+ taken: boolean;
2074
+ /** The methods the form offers, in the order the installation names them; empty where none is taken. */
2075
+ methods: PaymentMethodType[];
2076
+ }
2018
2077
  /** Response of `GET /public/marketing-catalog`. */
2019
2078
  interface PublicMarketingCatalogResponse {
2020
2079
  locale: string;
2021
2080
  currency: string;
2022
2081
  /** VAT rate in percent — for the CheckoutOffer price breakdown. */
2023
2082
  vatRate: number;
2083
+ /** What a new payment method is taken with here, if one is taken. */
2084
+ newPaymentMethods: PublicNewPaymentMethods;
2024
2085
  /** Visible, marketed plans — sorted by `priority` DESC. */
2025
2086
  plans: PublicMarketingPlan[];
2026
2087
  /**
@@ -2390,7 +2451,7 @@ declare const CATALOGUE_KEYS: ReadonlySet<keyof PlanCatalog>;
2390
2451
  */
2391
2452
  declare function planCatalogSettingsOf(catalog: PlanCatalog): PlanCatalogSettings;
2392
2453
  /** Everything in the catalogue that is configuration, as it was resolved. */
2393
- declare function settingsSubtreeOf(catalog: PlanCatalog): AppliedSettingsValues;
2454
+ declare function settingsSubtreeOf(catalog: PlanCatalog | PlanCatalogSettings): AppliedSettingsValues;
2394
2455
  /**
2395
2456
  * `JSON.stringify` with object keys in sorted order at every depth, so that two
2396
2457
  * documents saying the same thing in a different order serialise identically.
@@ -2858,6 +2919,11 @@ interface PromoCodeRecord {
2858
2919
  validUntil: Date | null;
2859
2920
  maxRedemptions: number | null;
2860
2921
  redemptionsCount: number;
2922
+ /**
2923
+ * Slots held for checkouts that started and have not concluded
2924
+ * (`PromoCodeHoldRepository`). An adapter without holds reports 0.
2925
+ */
2926
+ heldCount: number;
2861
2927
  appliesToPlans: string[];
2862
2928
  appliesToBilling: BillingCycle | null;
2863
2929
  firstTimeCustomersOnly: boolean;
@@ -2947,7 +3013,7 @@ interface PromoCodeRedemptionListItem extends PromoCodeRedemptionRecord {
2947
3013
  /**
2948
3014
  * Adapter for PromoCode persistence. Atomic slot reservation lives in the
2949
3015
  * adapter because it is DB-specific (Postgres `UPDATE ... WHERE ... AND
2950
- * (maxRedemptions IS NULL OR redemptionsCount < maxRedemptions)`).
3016
+ * (maxRedemptions IS NULL OR redemptionsCount + heldCount < maxRedemptions)`).
2951
3017
  */
2952
3018
  interface PromoCodeRepository {
2953
3019
  findById(id: string): Promise<PromoCodeRecord | null>;
@@ -2958,12 +3024,17 @@ interface PromoCodeRepository {
2958
3024
  softDelete(id: string): Promise<void>;
2959
3025
  /**
2960
3026
  * Atomic slot reservation: increments `redemptionsCount` and checks
2961
- * `status === 'ACTIVE' && (maxRedemptions IS NULL || redemptionsCount < maxRedemptions)`.
3027
+ * `status === 'ACTIVE' && (maxRedemptions IS NULL || redemptionsCount + heldCount < maxRedemptions)`.
2962
3028
  * Returns true if the slot was reserved, false if EXHAUSTED
2963
- * or the status is not ACTIVE.
3029
+ * or the status is not ACTIVE. A slot held for a checkout is not free, so
3030
+ * an adapter that keeps holds counts `heldCount` here.
2964
3031
  */
2965
3032
  claimSlot(id: string, tx?: TransactionContext): Promise<boolean>;
2966
- /** Sets the status to `EXHAUSTED` when `redemptionsCount >= maxRedemptions`. */
3033
+ /**
3034
+ * Sets the status to `EXHAUSTED` when `redemptionsCount >= maxRedemptions`.
3035
+ * Holds do not count: a code full only because of held slots stays ACTIVE,
3036
+ * and gets its slots back when the holds end.
3037
+ */
2967
3038
  markExhaustedIfFull(id: string, tx?: TransactionContext): Promise<void>;
2968
3039
  /** Decrements `redemptionsCount` by 1 (min 0); EXHAUSTED → ACTIVE. */
2969
3040
  releaseSlot(id: string, tx?: TransactionContext): Promise<void>;
@@ -2973,6 +3044,98 @@ interface PromoCodeRepository {
2973
3044
  */
2974
3045
  expireDueCodes(now: Date): Promise<number>;
2975
3046
  }
3047
+ /**
3048
+ * A slot of a code kept for a checkout offer, from the start of its checkout
3049
+ * until the checkout concludes, the offer's code changes, or `expiresAt`
3050
+ * passes, whichever comes first. For a sign-up, `expiresAt` is the last moment
3051
+ * a confirmation of its payment form can arrive
3052
+ * (`PaymentMethodSetupSession.confirmableUntil`), not the checkout's lifetime.
3053
+ */
3054
+ interface PromoCodeHoldRecord {
3055
+ id: string;
3056
+ promoCodeId: string;
3057
+ checkoutOfferId: string;
3058
+ expiresAt: Date;
3059
+ createdAt: Date;
3060
+ }
3061
+ /** What `PromoCodeHoldRepository.take` did. */
3062
+ type PromoCodeHoldTaken = {
3063
+ outcome: 'taken';
3064
+ hold: PromoCodeHoldRecord;
3065
+ }
3066
+ /** The code is not ACTIVE, is deleted, or has no free slot. */
3067
+ | {
3068
+ outcome: 'no-slot';
3069
+ }
3070
+ /** The offer holds a slot already, perhaps taken by a concurrent call. */
3071
+ | {
3072
+ outcome: 'offer-holds-one';
3073
+ };
3074
+ /**
3075
+ * Adapter for the slots a code keeps for checkouts. Every method that ends a
3076
+ * hold deletes its row and gives its slot back in one statement, so a hold is
3077
+ * counted in `PromoCodeRecord.heldCount` exactly as long as its row exists.
3078
+ *
3079
+ * Optional in the promo module: an adapter that has no holds leaves
3080
+ * `heldCount` at 0, and taking a hold then refuses to start rather than
3081
+ * quietly holding nothing.
3082
+ */
3083
+ interface PromoCodeHoldRepository {
3084
+ /** The offer's hold, live or past its expiry and not yet given back. */
3085
+ findByCheckoutOffer(checkoutOfferId: string, tx?: TransactionContext): Promise<PromoCodeHoldRecord | null>;
3086
+ /**
3087
+ * Takes a slot of an ACTIVE, undeleted code for the offer, atomically with
3088
+ * `claimSlot`'s rule: `maxRedemptions IS NULL OR redemptionsCount +
3089
+ * heldCount < maxRedemptions`. An offer holds one slot at most. Runs on a
3090
+ * transaction of its own: a checkout starts outside any other, and the
3091
+ * slot is committed before the gateway's form opens.
3092
+ */
3093
+ take(hold: {
3094
+ promoCodeId: string;
3095
+ checkoutOfferId: string;
3096
+ expiresAt: Date;
3097
+ }): Promise<PromoCodeHoldTaken>;
3098
+ /**
3099
+ * Moves the expiry of the offer's hold on that code to `expiresAt`, and
3100
+ * never earlier than it stands: the later of the two is written in the one
3101
+ * statement, so a start of the same checkout that asks for less cannot
3102
+ * shorten the slot a form opened by another start relies on, however the
3103
+ * two interleave. False when the offer holds no slot of it any more — it
3104
+ * ended in the meantime.
3105
+ */
3106
+ extend(checkoutOfferId: string, promoCodeId: string, expiresAt: Date): Promise<boolean>;
3107
+ /** Ends the offer's hold and gives its slot back. False when it had none. */
3108
+ release(checkoutOfferId: string, tx?: TransactionContext): Promise<boolean>;
3109
+ /**
3110
+ * Ends the offer's hold and gives its slot back only while it still expires
3111
+ * at `expiresAt` — the hold as the caller wrote it. A hold another start
3112
+ * moved since stays, and so does its slot, in the same statement. False when
3113
+ * nothing was given back.
3114
+ */
3115
+ releaseIfUnmoved(checkoutOfferId: string, expiresAt: Date): Promise<boolean>;
3116
+ /**
3117
+ * Marks the offer's hold, if it is live at `now`, as the slot of the
3118
+ * redemption that runs on `tx`. The mark never outlives the transaction: the
3119
+ * redemption turns the hold into its slot (`convertHandedOver`), or the
3120
+ * caller releases it before committing. False when the offer has no live
3121
+ * hold.
3122
+ */
3123
+ handOver(checkoutOfferId: string, now: Date, tx: TransactionContext): Promise<boolean>;
3124
+ /**
3125
+ * Turns the hold of that code handed over on `tx` into a redemption's slot:
3126
+ * the row goes, `heldCount` drops by one and `redemptionsCount` rises by one,
3127
+ * whatever the code's status. False when nothing was handed over on `tx`.
3128
+ */
3129
+ convertHandedOver(promoCodeId: string, tx: TransactionContext): Promise<boolean>;
3130
+ /**
3131
+ * Ends every hold past its expiry at `now` — of one code when `promoCodeId`
3132
+ * is given — and gives the slots back. A hold handed over on `tx` is left
3133
+ * to the conclusion running there; one handed over on another running
3134
+ * transaction is waited for, and is gone once that transaction ends.
3135
+ * Returns how many ended.
3136
+ */
3137
+ expireDue(now: Date, promoCodeId?: string, tx?: TransactionContext): Promise<number>;
3138
+ }
2976
3139
  /** Adapter for PromoCodeRedemption persistence. */
2977
3140
  interface PromoCodeRedemptionRepository {
2978
3141
  findBySubscription(subscriptionId: string, tx?: TransactionContext): Promise<PromoCodeRedemptionRecord | null>;
@@ -3054,7 +3217,14 @@ interface ContractLineItemRecord {
3054
3217
  descriptionSnapshot: string | null;
3055
3218
  quantity: number;
3056
3219
  unit: string | null;
3220
+ /**
3221
+ * What the line costs over one of its billing periods, `quantity` already
3222
+ * in it — not a unit price. A contract's totals take its lines as they
3223
+ * stand, each counted as often as it falls due in one period of the
3224
+ * contract, and are refused where they do not add up.
3225
+ */
3057
3226
  priceNet: number;
3227
+ /** `priceNet` with the line's share of the tax its rhythm owes. */
3058
3228
  priceGross: number;
3059
3229
  billingCycle: 'monthly' | 'yearly';
3060
3230
  /**
@@ -3832,6 +4002,14 @@ interface CancelSubscriptionResult {
3832
4002
  alreadyCanceled: boolean;
3833
4003
  }
3834
4004
  interface TenantSubscriptionWritePort {
4005
+ /**
4006
+ * Whether the writes that change a plan — the immediate change and the
4007
+ * onboarding selection — bind the subscription's `planVersionId` to the
4008
+ * version they sell. A contract freeze records the bound version, so it
4009
+ * refuses to start beside a write that says `false`. Left out, it is taken
4010
+ * on trust: the platform cannot see into a write it did not ship.
4011
+ */
4012
+ readonly bindsPlanVersion?: boolean;
3835
4013
  /** Immediate change: set plan + cycle, clear pending fields, optionally reset the period. */
3836
4014
  changePlanImmediate(tenantId: string, input: ImmediatePlanChangeInput): Promise<{
3837
4015
  plan: string;
@@ -4110,13 +4288,14 @@ interface AdminResourcesPort {
4110
4288
  }
4111
4289
  /**
4112
4290
  * Read adapter for the current AdminManifest. The consumer implementation
4113
- * delegates to its `AdminManifestService.getManifest()`. The platform CLI
4114
- * uses this for `<app> manifest dump|hash|check` etc.
4291
+ * delegates to its `AdminManifestService.getManifest()`, which reads the plan
4292
+ * catalogue on every call and therefore answers asynchronously. The platform
4293
+ * CLI uses this for `<app> manifest dump|hash|check` etc.
4115
4294
  */
4116
4295
  interface ManifestAccessPort {
4117
- getManifest(): AdminManifest;
4296
+ getManifest(): Promise<AdminManifest>;
4118
4297
  /** Optional: forces a rebuild from the contributions (e.g. after code reload). */
4119
- rebuild?(): AdminManifest;
4298
+ rebuild?(): Promise<AdminManifest>;
4120
4299
  }
4121
4300
  /**
4122
4301
  * Adapter for the RLS bypass context. Platform code calls `runWithBypass`,
@@ -4606,6 +4785,26 @@ interface SubscriberPaymentMethodSetupMatch {
4606
4785
  sessionRef: string;
4607
4786
  subscriberId: string;
4608
4787
  }
4788
+ /**
4789
+ * Which payment method a read by reference asks about.
4790
+ *
4791
+ * All three together, because `(gatewayAccount, paymentMethodRef)` is unique
4792
+ * account-wide rather than per subscriber: without the subscriber the question
4793
+ * has no answer that is this caller's.
4794
+ *
4795
+ * One argument rather than three strings in a row, for the reason
4796
+ * `SubscriberPaymentMethodSetupMatch` is one — at a call site three strings of
4797
+ * the same type can be swapped with nothing saying so — and for a second that
4798
+ * is specific to a port. `TransactionContext` is `unknown`, so it accepts a
4799
+ * string: against a positional signature, an implementation whose parameters
4800
+ * are offset by one typechecks and then reads the account out of the
4801
+ * subscriber's place. Against an object it does not.
4802
+ */
4803
+ interface SubscriberPaymentMethodReference {
4804
+ subscriberId: string;
4805
+ gatewayAccount: string;
4806
+ paymentMethodRef: string;
4807
+ }
4609
4808
  interface RecordSubscriberPaymentMethodResult {
4610
4809
  method: SubscriberPaymentMethodRecord;
4611
4810
  outcome: RecordSubscriberPaymentMethodOutcome;
@@ -4666,24 +4865,66 @@ interface PaymentEventLog {
4666
4865
  *
4667
4866
  * A subscriber has at most one `ACTIVE` payment method; the database holds
4668
4867
  * that, so two confirmations recorded at once for one subscriber end with one.
4868
+ *
4869
+ * **Within an account, a reference belongs to exactly one subscriber**, and
4870
+ * keeps belonging to it once a newer payment method has replaced it. Every
4871
+ * method that reaches a payment method therefore names the subscriber it is
4872
+ * about, and an implementation answers about that one only. `accountsInUse` is
4873
+ * the exception and says so at itself: it counts accounts rather than handing
4874
+ * out a row.
4875
+ *
4876
+ * That matters on a gateway callback, which is where these are reached: it
4877
+ * arrives without a session, so an installation that keeps its tenants apart
4878
+ * with a policy lifts that policy for it, and what the question names is then
4879
+ * all that bounds it.
4669
4880
  */
4670
4881
  interface SubscriberPaymentMethodRepository {
4671
4882
  /**
4672
4883
  * Records a confirmed payment method for its subscriber, under a lock on the
4673
4884
  * subscriber so two confirmations take turns. See
4674
4885
  * `RecordSubscriberPaymentMethodOutcome` for the three outcomes.
4886
+ *
4887
+ * A confirmation carrying a reference **another** subscriber holds is a
4888
+ * fourth case and has no outcome: it is refused with
4889
+ * `ForeignPaymentMethodReferenceError`, because the account's reference is
4890
+ * that subscriber's and answering `already-recorded` would hand its payment
4891
+ * method to a caller acting for somebody else.
4892
+ *
4893
+ * Two subscribers can reach that reference at the same time: the lock is on
4894
+ * the subscriber, so confirmations for two of them do not take turns, and a
4895
+ * read sees nothing of a row the other has not committed. Reading is
4896
+ * therefore not enough to decide it. **Claim the reference with the first
4897
+ * write, conflict-free** — `ON CONFLICT DO NOTHING` on its unique key, or
4898
+ * whatever the store spells that as — and refuse when the claim takes no
4899
+ * row. Both shipped adapters do exactly that, and it is what lets the
4900
+ * refusal say the same thing everywhere: the key decides, not an error
4901
+ * whose shape belongs to one driver.
4902
+ *
4903
+ * The order is part of the contract, not an implementation detail. Because
4904
+ * the claim is the first write, a refusal leaves the caller's transaction
4905
+ * as it found it — nothing to undo, and nothing that makes it unusable.
4906
+ * An implementation that writes before it claims cannot promise that.
4675
4907
  */
4676
4908
  recordConfirmed(data: RecordSubscriberPaymentMethodData, tx?: TransactionContext): Promise<RecordSubscriberPaymentMethodResult>;
4677
4909
  /** The subscriber's payment method in use, or `null` when it has none. */
4678
4910
  findActive(subscriberId: string, tx?: TransactionContext): Promise<SubscriberPaymentMethodRecord | null>;
4679
4911
  /**
4680
- * The payment method an account's reference names, whatever its status.
4912
+ * The payment method the reference names, whatever its status — and `null`
4913
+ * when that subscriber holds none under it, which includes the case of
4914
+ * another subscriber holding the reference.
4681
4915
  *
4682
4916
  * The one read that reaches a payment method a newer one replaced, which is
4683
4917
  * how `@saasicat/persistence-testing` verifies that an implementation keeps
4684
4918
  * the history rather than overwriting the row (`SC-PRIC-030`).
4919
+ *
4920
+ * The subscriber is what bounds the read. Without it an implementation
4921
+ * would have only the account's reference to go on, which is unique
4922
+ * account-wide: inside a tenant's context a policy would answer `null` and
4923
+ * on a gateway callback, where that policy is lifted, the same call would
4924
+ * answer with somebody else's row. One question, two answers by where it
4925
+ * was asked, is what naming the subscriber removes.
4685
4926
  */
4686
- findByReference(gatewayAccount: string, paymentMethodRef: string, tx?: TransactionContext): Promise<SubscriberPaymentMethodRecord | null>;
4927
+ findByReference(reference: SubscriberPaymentMethodReference, tx?: TransactionContext): Promise<SubscriberPaymentMethodRecord | null>;
4687
4928
  /**
4688
4929
  * Every account that holds a payment method in use, each once.
4689
4930
  *
@@ -4895,6 +5136,8 @@ interface SaaSiCatPersistencePromo {
4895
5136
  validationLogRepository: PersistenceProvider<PromoCodeValidationLogRepository>;
4896
5137
  subscriptionLookup: PersistenceProvider<PromoSubscriptionLookup>;
4897
5138
  revenueAggregator: PersistenceProvider<PromoRevenueDeductionAggregator>;
5139
+ /** The slots a code keeps for checkouts; left out, no checkout holds one. */
5140
+ holdRepository?: PersistenceProvider<PromoCodeHoldRepository>;
4898
5141
  }
4899
5142
  /**
4900
5143
  * Aggregate persistence bundle. Produced by adapter factories such as
@@ -5006,6 +5249,12 @@ declare const CATALOG_ERROR_CODES: {
5006
5249
  readonly FEATURE_NOT_FOUND: "FEATURE_NOT_FOUND";
5007
5250
  readonly QUOTA_NOT_FOUND: "QUOTA_NOT_FOUND";
5008
5251
  readonly PROMOTION_NOT_FOUND: "PROMOTION_NOT_FOUND";
5252
+ /**
5253
+ * A promotion's value is not one its type takes: a percentage above 0 and
5254
+ * at most 100, an amount above 0, an intro price of at least 0 for a whole
5255
+ * number of months, or a whole number of free months.
5256
+ */
5257
+ readonly PROMOTION_VALUE_INVALID: "PROMOTION_VALUE_INVALID";
5009
5258
  readonly MARKETING_PROJECTION_NOT_FOUND: "MARKETING_PROJECTION_NOT_FOUND";
5010
5259
  readonly PLAN_ALREADY_EXISTS: "PLAN_ALREADY_EXISTS";
5011
5260
  readonly BUNDLE_ALREADY_EXISTS: "BUNDLE_ALREADY_EXISTS";
@@ -5152,6 +5401,13 @@ declare const CONTRACT_ERROR_CODES: {
5152
5401
  readonly SUBSCRIPTION_CONTRACT_LINE_ITEM_TAX_MISMATCH: "SUBSCRIPTION_CONTRACT_LINE_ITEM_TAX_MISMATCH";
5153
5402
  readonly SUBSCRIPTION_CONTRACT_TAX_RATE_NOT_PERCENT: "SUBSCRIPTION_CONTRACT_TAX_RATE_NOT_PERCENT";
5154
5403
  readonly SUBSCRIPTION_CONTRACT_LINE_ITEM_CURRENCY_MISMATCH: "SUBSCRIPTION_CONTRACT_LINE_ITEM_CURRENCY_MISMATCH";
5404
+ /**
5405
+ * The lines do not add up to a total the contract states, counted as often
5406
+ * as each falls due in one period. `field` names the total.
5407
+ */
5408
+ readonly SUBSCRIPTION_CONTRACT_LINES_DO_NOT_ADD_UP: "SUBSCRIPTION_CONTRACT_LINES_DO_NOT_ADD_UP";
5409
+ /** Something that takes money off states a negative amount. */
5410
+ readonly SUBSCRIPTION_CONTRACT_DISCOUNT_NEGATIVE: "SUBSCRIPTION_CONTRACT_DISCOUNT_NEGATIVE";
5155
5411
  readonly SUBSCRIPTION_CONTRACT_TERMINATION_BEFORE_START: "SUBSCRIPTION_CONTRACT_TERMINATION_BEFORE_START";
5156
5412
  readonly CHECKOUT_OFFER_NOT_FOUND: "CHECKOUT_OFFER_NOT_FOUND";
5157
5413
  readonly CHECKOUT_OFFER_EXPIRED: "CHECKOUT_OFFER_EXPIRED";
@@ -5359,6 +5615,13 @@ declare const PLATFORM_ERROR_CODES: {
5359
5615
  readonly SUBSCRIPTION_CONTRACT_LINE_ITEM_TAX_MISMATCH: "SUBSCRIPTION_CONTRACT_LINE_ITEM_TAX_MISMATCH";
5360
5616
  readonly SUBSCRIPTION_CONTRACT_TAX_RATE_NOT_PERCENT: "SUBSCRIPTION_CONTRACT_TAX_RATE_NOT_PERCENT";
5361
5617
  readonly SUBSCRIPTION_CONTRACT_LINE_ITEM_CURRENCY_MISMATCH: "SUBSCRIPTION_CONTRACT_LINE_ITEM_CURRENCY_MISMATCH";
5618
+ /**
5619
+ * The lines do not add up to a total the contract states, counted as often
5620
+ * as each falls due in one period. `field` names the total.
5621
+ */
5622
+ readonly SUBSCRIPTION_CONTRACT_LINES_DO_NOT_ADD_UP: "SUBSCRIPTION_CONTRACT_LINES_DO_NOT_ADD_UP";
5623
+ /** Something that takes money off states a negative amount. */
5624
+ readonly SUBSCRIPTION_CONTRACT_DISCOUNT_NEGATIVE: "SUBSCRIPTION_CONTRACT_DISCOUNT_NEGATIVE";
5362
5625
  readonly SUBSCRIPTION_CONTRACT_TERMINATION_BEFORE_START: "SUBSCRIPTION_CONTRACT_TERMINATION_BEFORE_START";
5363
5626
  readonly CHECKOUT_OFFER_NOT_FOUND: "CHECKOUT_OFFER_NOT_FOUND";
5364
5627
  readonly CHECKOUT_OFFER_EXPIRED: "CHECKOUT_OFFER_EXPIRED";
@@ -5527,6 +5790,12 @@ declare const PLATFORM_ERROR_CODES: {
5527
5790
  readonly FEATURE_NOT_FOUND: "FEATURE_NOT_FOUND";
5528
5791
  readonly QUOTA_NOT_FOUND: "QUOTA_NOT_FOUND";
5529
5792
  readonly PROMOTION_NOT_FOUND: "PROMOTION_NOT_FOUND";
5793
+ /**
5794
+ * A promotion's value is not one its type takes: a percentage above 0 and
5795
+ * at most 100, an amount above 0, an intro price of at least 0 for a whole
5796
+ * number of months, or a whole number of free months.
5797
+ */
5798
+ readonly PROMOTION_VALUE_INVALID: "PROMOTION_VALUE_INVALID";
5530
5799
  readonly MARKETING_PROJECTION_NOT_FOUND: "MARKETING_PROJECTION_NOT_FOUND";
5531
5800
  readonly PLAN_ALREADY_EXISTS: "PLAN_ALREADY_EXISTS";
5532
5801
  readonly BUNDLE_ALREADY_EXISTS: "BUNDLE_ALREADY_EXISTS";
@@ -6310,6 +6579,16 @@ interface StartCheckoutInput {
6310
6579
  successUrl: string;
6311
6580
  /** Where the gateway's form sends the person who leaves it. */
6312
6581
  cancelUrl: string;
6582
+ /**
6583
+ * The checkout offer the sign-up concludes on activation. When it carries a
6584
+ * promo code, a slot of that code is held for it from this step until a
6585
+ * confirmation of the gateway's form can no longer arrive
6586
+ * (`PaymentMethodSetupSession.confirmableUntil`), so the code cannot run
6587
+ * out between this step and the payment confirmation; a code that cannot
6588
+ * be held refuses the step before the gateway's form opens. Left out,
6589
+ * nothing is held.
6590
+ */
6591
+ checkoutOfferId?: string | null;
6313
6592
  }
6314
6593
  interface StartCheckoutResult {
6315
6594
  pendingRegistrationId: string;
@@ -6589,6 +6868,44 @@ interface CanonicalSubscriberPaymentMethodRow {
6589
6868
  declare function toSubscriberPaymentMethodRecord(row: CanonicalSubscriberPaymentMethodRow): SubscriberPaymentMethodRecord;
6590
6869
  /** The columns a confirmed payment method is written with, and nothing a caller added beside them. */
6591
6870
  declare function subscriberPaymentMethodColumns(data: RecordSubscriberPaymentMethodData): Omit<CanonicalSubscriberPaymentMethodRow, 'id' | 'status' | 'replacedAt' | 'createdAt'>;
6871
+ /**
6872
+ * A confirmation naming a reference that belongs to another subscriber.
6873
+ *
6874
+ * `(gatewayAccount, paymentMethodRef)` is unique account-wide rather than per
6875
+ * subscriber, and that is what makes the reference one subscriber's for good:
6876
+ * the second row cannot be written. This is the same boundary drawn for the
6877
+ * caller, so that a confirmation is refused rather than answered as the
6878
+ * duplicate of a payment method that is not this subscriber's — on a gateway
6879
+ * callback, which arrives without a session and with the tenant policy lifted,
6880
+ * so nothing else there bounds the question.
6881
+ *
6882
+ * That a provider issues a reference once per payer is a property of that
6883
+ * provider and no promise of this platform's, which is why the condition is
6884
+ * checked rather than assumed.
6885
+ *
6886
+ * It names neither the subscriber that holds the reference nor the tenant
6887
+ * behind it: whoever reads the log of the refused confirmation is on the other
6888
+ * side of the boundary this refusal draws. The account and the reference are
6889
+ * carried as fields so that a caller can say which confirmation was refused
6890
+ * without taking the sentence apart.
6891
+ */
6892
+ declare class ForeignPaymentMethodReferenceError extends Error {
6893
+ readonly gatewayAccount: string;
6894
+ readonly paymentMethodRef: string;
6895
+ readonly code = "FOREIGN_PAYMENT_METHOD_REFERENCE";
6896
+ constructor(gatewayAccount: string, paymentMethodRef: string);
6897
+ }
6898
+ /** Realm-safe type guard, like `isPaymentCallbackRejectedError`. */
6899
+ declare function isForeignPaymentMethodReferenceError(error: unknown): error is ForeignPaymentMethodReferenceError;
6900
+ /**
6901
+ * Refuses a reference of `gatewayAccount` that another subscriber already
6902
+ * holds, where the row could be read.
6903
+ *
6904
+ * A write cannot rely on this alone: a read does not see a row a concurrent
6905
+ * transaction has not committed. What the reference's unique key refuses is
6906
+ * refused with the same error — see `SubscriberPaymentMethodRepository`.
6907
+ */
6908
+ declare function refuseForeignPaymentMethodReference(recorded: Pick<CanonicalSubscriberPaymentMethodRow, 'subscriberId' | 'gatewayAccount' | 'paymentMethodRef'>, subscriberId: string): void;
6592
6909
 
6593
6910
  /** A `subscription_contracts` row as either adapter reads it back. */
6594
6911
  interface CanonicalContractRow {
@@ -6733,4 +7050,4 @@ declare function resolveErrorMessage(body: ResolvableErrorBody, overrides?: Part
6733
7050
 
6734
7051
  declare const ERROR_MESSAGES_DE: Record<PlatformErrorCode, string>;
6735
7052
 
6736
- export { ACTIVE_SUBSCRIPTION_CONTRACT_STATUSES, AUTH_ERROR_CODES, type ActionKey, type ActivationOrchestrator, type ActivePlanVersionWhere, type ActivePlanVersionWhereWithEndsAt, type ActiveVersionWhere, type ActiveVersionWhereWithEndsAt, type ActorTag, type AdminActor, type AdminAuditListFilter, type AdminManifest, type AdminResourcesPort, type AdminSubscriptionListRow, type AdminTenantDetail, type AdminTenantListFilter, type AdminTenantListRow, type AdminTenantStateResult, type AdminUserListFilter, type AdminUserListRow, type AppliedSettingsPort, type AppliedSettingsRecord, type AppliedSettingsValues, type ApplyOnboardingSelectionInput, type ApplyOnboardingSelectionResult, type ApprovedCatalogKeys, type AuditActionDef, type AuditEntry, type AuditPort, type AuditQuery, type AuditQueryPort, type AuditStatsPort, type AuditStatsSnapshot, type AuthErrorCode, BILLING_ERROR_CODES, BUNDLE_PRICE_LOOKUP_LIMIT, type BillingCycle, type BillingErrorCode, type BundleAvailabilityState, type BundleCompatibility, type BundleFeatureShape, type BundleListFilter, type BundlePricingOverride, type BundleRepository, type BundleRow, type BundleVersionFields, type BundleVersionMutationResult, type BundleVersionRow, CATALOGUE_KEYS, CATALOG_ERROR_CODES, CONTRACT_ERROR_CODES, type CancelSubscriptionBundleData, type CancelSubscriptionInput, type CancelSubscriptionResult, type CancellationNoticePeriods, type CanonicalContractLineItemRow, type CanonicalContractRow, type CanonicalPlanRow, type CanonicalPlanVersionRow, type CanonicalRunningContractRow, type CanonicalSubscriberCorrectionRow, type CanonicalSubscriberPaymentMethodRow, type CanonicalSubscriberRow, type CapabilityCatalogEntryRow, type CapabilityCodeStatus, type CapabilityKey, type CapabilityKind, type CatalogEntryFilter, type CatalogEntryI18n, type CatalogEntryI18nFields, type CatalogEntryRepository, type CatalogErrorCode, type ChangeDirection, type CheckoutOfferFilter, type CheckoutOfferLineItem, type CheckoutOfferLineItemKind, type CheckoutOfferPriceBreakdown, type CheckoutOfferPromoCodeSnapshot, type CheckoutOfferPromotionSnapshot, type CheckoutOfferRepository, type CheckoutOfferRow, type CheckoutOfferSelection, type CheckoutOfferSelectionUpdate, type CheckoutOfferStatus, type CleanupResult, type CliUserRow, type ComponentKey, type ConfiguratorCatalog, type ConfiguratorMarketingProvider, type ConfiguratorModel, type ConfiguratorPlanMarketing, type ConfiguratorPlanVersionRow, type ConfiguratorPriceBreakdown, type ConfiguratorSourcesLookup, type ConfirmedPaymentMethod, type ContractErrorCode, type ContractIssuerParty, type ContractLineItemKind, type ContractLineItemRecord, type ContractSubscriberParty, type CreateBundleData, type CreateBundleVersionDraftData, type CreateCheckoutOfferData, type CreateMarketingProjectionData, type CreatePlanData, type CreatePlanVersionDraftData, type CreatePromoCodeData, type CreatePromoCodeRequest, type CreatePromotionData, type CreateSubscriberData, type CreateSubscriptionBundleData, type CreateSubscriptionContractData, type CreateSuperAdminCliInput, type CreateTenantInput, type DiffResult, type DiscoveredCapability, type DiscoveredFeature, type DiscoveredQuota, type DiscoveredQuotaPolicy, type DiscoveryCodeStatus, type DiscoverySnapshot, type DiscoveryStatus, ERROR_MESSAGES_DE, ERROR_MESSAGES_EN, type EffectiveLimitsSnapshot, type EmailPort, type ErrorMessageParams, FEATURE_NOT_LICENSED, type FeatureCatalogEntryRow, type FeatureDef, type FeatureKey, type FeatureNotLicensedBody, type FeatureRequiresIndex, type FeatureTier, type FeatureUiMeta, type FeatureUiRegistry, type FinalActivationResult, type FirstTimeCustomerCheck, type ImmediatePlanChangeInput, type InvoiceLineItemSnapshot, type IssuerCorrectionFault, type IssuerIdentityChange, type KpiCardDef, type KpiDisplayHint, LEGAL_IDENTITY_FIELDS, type LegalIdentity, type LegalIdentityField, MARKETING_PRIORITY_MAX, MARKETING_PRIORITY_MIN, type ManifestAccessPort, type ManifestContribution, type MarketingProjectionFilter, type MarketingProjectionRepository, type MarketingProjectionRow, type MarketingSettingsRepository, type MarketingSettingsRow, type MarketingTargetType, type MarketingTopFeature, type MaskedPaymentMethod, type MfaPort, type NewContractLineItemData, type NewSettingsChange, type NewSubscriberDetails, type NewSubscriptionContractData, OTP_RATE_LIMIT_MAX_SENDS, OTP_RATE_LIMIT_WINDOW_MINUTES, OTP_TTL_MINUTES, OTP_VERIFY_MAX_ATTEMPTS, type OnboardingPromoRedemption, type OnboardingSelectionRequest, type OnboardingSelectionResponse, PASSWORD_RESET_TTL_MINUTES, PAYMENT_ERROR_CODES, PAYMENT_METHOD_TYPES, PENDING_CHECKOUT_TTL_DAYS, PENDING_EMAIL_TTL_HOURS, PENDING_ONBOARDING_TTL_DAYS, PLATFORM_ERROR_CODES, PROMO_ERROR_CODES, type Paginated, type PartyAddress, type PasswordHasher, type PasswordResetCliResult, PaymentCallbackRejectedError, type PaymentErrorCode, type PaymentEventClaim, type PaymentEventLog, type PaymentGateway, type PaymentGatewayCallback, type PaymentGatewayEvent, type PaymentMethodHolder, type PaymentMethodSetupSession, type PaymentMethodSetupSubject, type PaymentMethodType, type PendingRegistration, type PendingRegistrationCreateInput, type PendingRegistrationRepository, type PendingRegistrationSnapshot, type PendingRegistrationUpdateInput, type PersistenceCapabilities, PersistenceCapabilityError, type PersistenceClassRef, type PersistenceInjectionToken, type PersistenceProvider, type PlanCatalog, type PlanCatalogApp, type PlanCatalogImportReport, type PlanCatalogImportSink, type PlanCatalogIssuer, type PlanCatalogIssuerCorrection, type PlanCatalogLookup, type PlanCatalogMarketing, type PlanCatalogNotifications, type PlanCatalogPaymentAccount, type PlanCatalogPayments, type PlanCatalogReadSink, type PlanCatalogReadSnapshot, type PlanCatalogSettings, type PlanCatalogSubscribers, type PlanCatalogTenantBilling, type PlanDef, type PlanId, type PlanListFilter, type PlanRepository, type PlanRow, type PlanVersion, type PlanVersionFields, type PlanVersionMappingFields, type PlanVersionMutationResult, type PlanVersionRecord, type PlanVersionRepository, type PlanVersionRow, type PlatformErrorBody, type PlatformErrorCode, type PlatformRole, type PlatformUserDto, PlatformUserExistsError, type ProjectPageDef, type PromoCode, type PromoCodeDurationType, type PromoCodeFilter, type PromoCodeRecord, type PromoCodeRedemption, type PromoCodeRedemptionListItem, type PromoCodeRedemptionRecord, type PromoCodeRedemptionRepository, type PromoCodeRedemptionStatus, type PromoCodeRepository, type PromoCodeStatsPort, type PromoCodeStatsSnapshot, type PromoCodeStatus, type PromoCodeValidationLog, type PromoCodeValidationLogRepository, type PromoCodeValidationResult, type PromoCodeValueType, type PromoErrorCode, type PromoPreviewInvalidReason, type PromoPreviewRequest, type PromoPreviewResponse, type PromoPreviewValidResponse, type PromoRevenueDeductionAggregator, type PromoSubscriptionLookup, type PromotionBillingCycle, type PromotionI18n, type PromotionI18nFields, type PromotionRepository, type PromotionResult, type PromotionRow, type PromotionStatus, type PromotionTargetType, type PromotionType, type PromotionValue, type PublicBootResponse, type PublicComparisonRow, type PublicMarketingBundle, type PublicMarketingCatalogResponse, type PublicMarketingPlan, type PublicMarketingPromo, type PublicSignupPlan, type PublishBundleVersionData, type PublishBundleVersionMeta, type PublishPlanVersionData, type QuotaCatalogEntryRow, type QuotaEnforcementMode, type QuotaKey, type QuotaProvider, REGISTRATION_ERROR_CODES, REGISTRATION_RESUME_TTL_MINUTES, REGISTRATION_STEP_BY_STATUS, type ReassignTenantAdminCliResult, type RecommendablePlan, type RecordSubscriberPaymentMethodData, type RecordSubscriberPaymentMethodOutcome, type RecordSubscriberPaymentMethodResult, type RedeemPromoInTransactionCallback, type RegistrationActivation, type RegistrationAuditContext, type RegistrationAuditEvent, type RegistrationAuditEventType, type RegistrationAuditLogger, type RegistrationBillingDetails, type RegistrationConfigSelection, type RegistrationConfiguratorLookup, type RegistrationErrorCode, type RegistrationOtpDelivery, type RegistrationPromoPreview, type RegistrationResumeDelivery, type RegistrationResumeTokenSigner, type RegistrationStatus, type RegistrationStep, type RequiredCapabilities, type ResolvableErrorBody, type ResumeRegistrationInput, type ResumeRegistrationResult, type ReviewCatalogEntryData, type RlsBypassPort, type RunningContractIssuer, type RunningContractIssuers, SETTINGS_ERROR_CODES, SETUP_ERROR_CODES, SUBSCRIBER_ERROR_CODES, type SaaSiCatPersistenceAdapter, type SaaSiCatPersistenceAdminResources, type SaaSiCatPersistenceCatalog, type SaaSiCatPersistenceCore, type SaaSiCatPersistenceEntitlement, type SaaSiCatPersistencePayments, type SaaSiCatPersistencePromo, type SaaSiCatPersistenceTenantBilling, type SaveRegistrationConfigInput, type SaveRegistrationConfigResult, type ScheduledPlanChangeInput, type SelectPlanInput, type SelectPlanResult, type SelectableBundleShape, type SelfServiceBlockedPlans, type SetCatalogEntryReviewData, type SettingsChangeFilter, type SettingsChangeRecord, type SettingsDifference, type SettingsErrorCode, type SetupConfirmMfaRequest, type SetupConfirmMfaResponse, type SetupErrorCode, type SetupRequest, type SetupResult, type SetupStatusResponse, type SlugAvailabilityCheck, type StandardPageDef, type StandardPageKey, type StartCheckoutInput, type StartCheckoutResult, type StartPaymentMethodSetupInput, type StartRegistrationInput, type StartRegistrationResult, type StoredBundleStem, type StrictModeWarning, type StrictModeWarningCode, type SubscriberContact, type SubscriberContactChange, type SubscriberCorrectionData, type SubscriberCorrectionRecord, type SubscriberCorrectionResult, type SubscriberDetails, type SubscriberErrorCode, type SubscriberIdentityCorrection, type SubscriberIdentityDelta, type SubscriberIdentityValues, type SubscriberPaymentMethodRecord, type SubscriberPaymentMethodRepository, type SubscriberPaymentMethodSetupData, type SubscriberPaymentMethodSetupMatch, type SubscriberPaymentMethodStatus, type SubscriberRecord, type SubscriberRepository, type Subscription, type SubscriptionBundleRecord, type SubscriptionBundleRepository, type SubscriptionBundleView, type SubscriptionContractFilter, type SubscriptionContractInvoiceSnapshot, type SubscriptionContractParties, type SubscriptionContractPriceSnapshot, type SubscriptionContractRecord, type SubscriptionContractRepository, type SubscriptionContractStatus, type SubscriptionRecord, type SubscriptionRepository, type SubscriptionStatsPort, type SubscriptionStatsSnapshot, type SubscriptionStatus, type SubscriptionUsagePort, type SubscriptionUsageRecord, type SuperAdminProvisioningPort, type SyncDiscoveryResult, type TenantActionDef, type TenantColumnDef, type TenantDto, type TenantListFilter, type TenantPort, type TenantSubscriptionWritePort, type TerminateSubscriptionContractData, type TopPromoCode, type TransactionContext, type TransactionRunner, type UpdateBundleData, type UpdateBundleVersionDraftData, type UpdateCatalogEntryBaseData, type UpdateCatalogEntryI18nData, type UpdateCheckoutOfferData, type UpdateMarketingProjectionData, type UpdateMarketingSettingsData, type UpdatePlanData, type UpdatePlanVersionDraftData, type UpdatePromoCodeData, type UpdatePromoCodeRequest, type UpdatePromotionData, type UpsellOffer, type UpsellOfferResolver, type UpsertCapabilityEntryData, type UpsertFeatureCatalogEntryInput, type UpsertFeatureEntryData, type UpsertPlanInput, type UpsertPlanVersionInput, type UpsertQuotaEntryData, type UpsertResult, type UsageSnapshotPort, type UserAccountLookup, type UserListFilter, type UserManagementPort, type UserPort, type VerifyRegistrationOtpResult, type VersionChange, type VersionChangeDirection, type VersionEditability, type VersionEditableReason, type VersionedEntityBase, applyPromo, assertPersistenceCapabilities, buildActivePlanVersionWhere, buildActiveVersionWhere, buildFeatureRequiresIndex, bundleDraftDefaults, bundleStemDefaults, canonicalJson, classifyBundleVersionDiff, classifyIssuerChange, classifyPlanDiff, collectUnsatisfiedRequires, contractPartiesOf, coverageExcludingSelf, definedFields, diffSettings, formatCustomerNumber, formatErrorMessage, identityCorrectionDelta, isBundleRedundant, isPaymentCallbackRejectedError, isPlatformUserExistsError, isVersionEditable, issuerIdentityOf, keepOneRecommended, missingRequiresFor, movedIdentityFields, pickActivePromo, planCatalogSettingsOf, previousUtcDay, promoStatus, readQuotaRecord, readQuotaValue, recordedIssuerIdentity, resolveBundleAvailability, resolveErrorMessage, sameLegalIdentity, selectChargeableBundles, settingsSubtreeOf, startOfUtcDay, subscriberFromRegistration, subscriberPaymentMethodColumns, toBundleStemRow, toContractLineItemRecord, toPlanRow, toPlanVersionRow, toRunningContractIssuer, toSubscriberCorrectionRecord, toSubscriberPaymentMethodRecord, toSubscriberRecord, toSubscriptionContractRecord };
7053
+ export { ACTIVE_SUBSCRIPTION_CONTRACT_STATUSES, AUTH_ERROR_CODES, type ActionKey, type ActivationOrchestrator, type ActivePlanVersionWhere, type ActivePlanVersionWhereWithEndsAt, type ActiveVersionWhere, type ActiveVersionWhereWithEndsAt, type ActorTag, type AdminActor, type AdminAuditListFilter, type AdminManifest, type AdminResourcesPort, type AdminSubscriptionListRow, type AdminTenantDetail, type AdminTenantListFilter, type AdminTenantListRow, type AdminTenantStateResult, type AdminUserListFilter, type AdminUserListRow, type AppliedSettingsPort, type AppliedSettingsRecord, type AppliedSettingsValues, type ApplyOnboardingSelectionInput, type ApplyOnboardingSelectionResult, type ApprovedCatalogKeys, type AuditActionDef, type AuditEntry, type AuditPort, type AuditQuery, type AuditQueryPort, type AuditStatsPort, type AuditStatsSnapshot, type AuthErrorCode, BILLING_ERROR_CODES, BUNDLE_PRICE_LOOKUP_LIMIT, type BillingCycle, type BillingErrorCode, type BundleAvailabilityState, type BundleCompatibility, type BundleFeatureShape, type BundleListFilter, type BundlePricingOverride, type BundleRepository, type BundleRow, type BundleVersionFields, type BundleVersionMutationResult, type BundleVersionRow, CATALOGUE_KEYS, CATALOG_ERROR_CODES, CONTRACT_ERROR_CODES, type CancelSubscriptionBundleData, type CancelSubscriptionInput, type CancelSubscriptionResult, type CancellationNoticePeriods, type CanonicalContractLineItemRow, type CanonicalContractRow, type CanonicalPlanRow, type CanonicalPlanVersionRow, type CanonicalRunningContractRow, type CanonicalSubscriberCorrectionRow, type CanonicalSubscriberPaymentMethodRow, type CanonicalSubscriberRow, type CapabilityCatalogEntryRow, type CapabilityCodeStatus, type CapabilityKey, type CapabilityKind, type CatalogEntryFilter, type CatalogEntryI18n, type CatalogEntryI18nFields, type CatalogEntryRepository, type CatalogErrorCode, type ChangeDirection, type CheckoutOfferFilter, type CheckoutOfferLineItem, type CheckoutOfferLineItemKind, type CheckoutOfferPriceBreakdown, type CheckoutOfferPromoCodeSnapshot, type CheckoutOfferPromotionSnapshot, type CheckoutOfferRepository, type CheckoutOfferRow, type CheckoutOfferSelection, type CheckoutOfferSelectionUpdate, type CheckoutOfferStatus, type CleanupResult, type CliUserRow, type ComponentKey, type ConfiguratorCatalog, type ConfiguratorMarketingProvider, type ConfiguratorModel, type ConfiguratorPlanMarketing, type ConfiguratorPlanVersionRow, type ConfiguratorPriceBreakdown, type ConfiguratorSourcesLookup, type ConfirmedPaymentMethod, type ContractErrorCode, type ContractIssuerParty, type ContractLineItemKind, type ContractLineItemRecord, type ContractSubscriberParty, type CreateBundleData, type CreateBundleVersionDraftData, type CreateCheckoutOfferData, type CreateMarketingProjectionData, type CreatePlanData, type CreatePlanVersionDraftData, type CreatePromoCodeData, type CreatePromoCodeRequest, type CreatePromotionData, type CreateSubscriberData, type CreateSubscriptionBundleData, type CreateSubscriptionContractData, type CreateSuperAdminCliInput, type CreateTenantInput, type DiffResult, type DiscoveredCapability, type DiscoveredFeature, type DiscoveredQuota, type DiscoveredQuotaPolicy, type DiscoveryCodeStatus, type DiscoverySnapshot, type DiscoveryStatus, ERROR_MESSAGES_DE, ERROR_MESSAGES_EN, type EffectiveLimitsSnapshot, type EmailPort, type ErrorMessageParams, FEATURE_NOT_LICENSED, type FeatureCatalogEntryRow, type FeatureDef, type FeatureKey, type FeatureNotLicensedBody, type FeatureRequiresIndex, type FeatureTier, type FeatureUiMeta, type FeatureUiRegistry, type FinalActivationResult, type FirstTimeCustomerCheck, ForeignPaymentMethodReferenceError, type ImmediatePlanChangeInput, type InvoiceLineItemSnapshot, type IssuerCorrectionFault, type IssuerIdentityChange, type KpiCardDef, type KpiDisplayHint, LEGAL_IDENTITY_FIELDS, type LegalIdentity, type LegalIdentityField, MARKETING_PRIORITY_MAX, MARKETING_PRIORITY_MIN, type ManifestAccessPort, type ManifestContribution, type MarketingProjectionFilter, type MarketingProjectionRepository, type MarketingProjectionRow, type MarketingSettingsRepository, type MarketingSettingsRow, type MarketingTargetType, type MarketingTopFeature, type MaskedPaymentMethod, type MfaPort, type NewContractLineItemData, type NewSettingsChange, type NewSubscriberDetails, type NewSubscriptionContractData, OTP_RATE_LIMIT_MAX_SENDS, OTP_RATE_LIMIT_WINDOW_MINUTES, OTP_TTL_MINUTES, OTP_VERIFY_MAX_ATTEMPTS, type OnboardingPromoRedemption, type OnboardingSelectionRequest, type OnboardingSelectionResponse, PASSWORD_RESET_TTL_MINUTES, PAYMENT_ERROR_CODES, PAYMENT_METHOD_TYPES, PENDING_CHECKOUT_TTL_DAYS, PENDING_EMAIL_TTL_HOURS, PENDING_ONBOARDING_TTL_DAYS, PLATFORM_ERROR_CODES, PROMO_ERROR_CODES, type Paginated, type PartyAddress, type PasswordHasher, type PasswordResetCliResult, PaymentCallbackRejectedError, type PaymentErrorCode, type PaymentEventClaim, type PaymentEventLog, type PaymentGateway, type PaymentGatewayCallback, type PaymentGatewayEvent, type PaymentMethodHolder, type PaymentMethodSetupSession, type PaymentMethodSetupSubject, type PaymentMethodType, type PendingRegistration, type PendingRegistrationCreateInput, type PendingRegistrationRepository, type PendingRegistrationSnapshot, type PendingRegistrationUpdateInput, type PersistenceCapabilities, PersistenceCapabilityError, type PersistenceClassRef, type PersistenceInjectionToken, type PersistenceProvider, type PlanCatalog, type PlanCatalogApp, type PlanCatalogImportReport, type PlanCatalogImportSink, type PlanCatalogIssuer, type PlanCatalogIssuerCorrection, type PlanCatalogLookup, type PlanCatalogMarketing, type PlanCatalogNotifications, type PlanCatalogPaymentAccount, type PlanCatalogPayments, type PlanCatalogReadSink, type PlanCatalogReadSnapshot, type PlanCatalogSettings, type PlanCatalogSubscribers, type PlanCatalogTenantBilling, type PlanDef, type PlanId, type PlanListFilter, type PlanRepository, type PlanRow, type PlanVersion, type PlanVersionFields, type PlanVersionMappingFields, type PlanVersionMutationResult, type PlanVersionRecord, type PlanVersionRepository, type PlanVersionRow, type PlatformErrorBody, type PlatformErrorCode, type PlatformRole, type PlatformUserDto, PlatformUserExistsError, type ProjectPageDef, type PromoCode, type PromoCodeDurationType, type PromoCodeFilter, type PromoCodeHoldRecord, type PromoCodeHoldRepository, type PromoCodeHoldTaken, type PromoCodeRecord, type PromoCodeRedemption, type PromoCodeRedemptionListItem, type PromoCodeRedemptionRecord, type PromoCodeRedemptionRepository, type PromoCodeRedemptionStatus, type PromoCodeRepository, type PromoCodeStatsPort, type PromoCodeStatsSnapshot, type PromoCodeStatus, type PromoCodeValidationLog, type PromoCodeValidationLogRepository, type PromoCodeValidationResult, type PromoCodeValueType, type PromoErrorCode, type PromoPreviewInvalidReason, type PromoPreviewRequest, type PromoPreviewResponse, type PromoPreviewValidResponse, type PromoRevenueDeductionAggregator, type PromoSubscriptionLookup, type PromotionBillingCycle, type PromotionI18n, type PromotionI18nFields, type PromotionOnPrice, type PromotionRepository, type PromotionResult, type PromotionRow, type PromotionStatus, type PromotionTargetType, type PromotionType, type PromotionValue, type PublicBootResponse, type PublicComparisonRow, type PublicMarketingBundle, type PublicMarketingCatalogResponse, type PublicMarketingPlan, type PublicMarketingPromo, type PublicNewPaymentMethods, type PublicSignupPlan, type PublishBundleVersionData, type PublishBundleVersionMeta, type PublishPlanVersionData, type QuotaCatalogEntryRow, type QuotaEnforcementMode, type QuotaKey, type QuotaProvider, REGISTRATION_ERROR_CODES, REGISTRATION_RESUME_TTL_MINUTES, REGISTRATION_STEP_BY_STATUS, type ReassignTenantAdminCliResult, type RecommendablePlan, type RecordSubscriberPaymentMethodData, type RecordSubscriberPaymentMethodOutcome, type RecordSubscriberPaymentMethodResult, type RedeemPromoInTransactionCallback, type RegistrationActivation, type RegistrationAuditContext, type RegistrationAuditEvent, type RegistrationAuditEventType, type RegistrationAuditLogger, type RegistrationBillingDetails, type RegistrationConfigSelection, type RegistrationConfiguratorLookup, type RegistrationErrorCode, type RegistrationOtpDelivery, type RegistrationPromoPreview, type RegistrationResumeDelivery, type RegistrationResumeTokenSigner, type RegistrationStatus, type RegistrationStep, type RequiredCapabilities, type ResolvableErrorBody, type ResumeRegistrationInput, type ResumeRegistrationResult, type ReviewCatalogEntryData, type RlsBypassPort, type RunningContractIssuer, type RunningContractIssuers, SETTINGS_ERROR_CODES, SETUP_ERROR_CODES, SUBSCRIBER_ERROR_CODES, type SaaSiCatPersistenceAdapter, type SaaSiCatPersistenceAdminResources, type SaaSiCatPersistenceCatalog, type SaaSiCatPersistenceCore, type SaaSiCatPersistenceEntitlement, type SaaSiCatPersistencePayments, type SaaSiCatPersistencePromo, type SaaSiCatPersistenceTenantBilling, type SaveRegistrationConfigInput, type SaveRegistrationConfigResult, type ScheduledPlanChangeInput, type SelectPlanInput, type SelectPlanResult, type SelectableBundleShape, type SelfServiceBlockedPlans, type SetCatalogEntryReviewData, type SettingsChangeFilter, type SettingsChangeRecord, type SettingsDifference, type SettingsErrorCode, type SetupConfirmMfaRequest, type SetupConfirmMfaResponse, type SetupErrorCode, type SetupRequest, type SetupResult, type SetupStatusResponse, type SlugAvailabilityCheck, type StandardPageDef, type StandardPageKey, type StartCheckoutInput, type StartCheckoutResult, type StartPaymentMethodSetupInput, type StartRegistrationInput, type StartRegistrationResult, type StoredBundleStem, type StrictModeWarning, type StrictModeWarningCode, type SubscriberContact, type SubscriberContactChange, type SubscriberCorrectionData, type SubscriberCorrectionRecord, type SubscriberCorrectionResult, type SubscriberDetails, type SubscriberErrorCode, type SubscriberIdentityCorrection, type SubscriberIdentityDelta, type SubscriberIdentityValues, type SubscriberPaymentMethodRecord, type SubscriberPaymentMethodReference, type SubscriberPaymentMethodRepository, type SubscriberPaymentMethodSetupData, type SubscriberPaymentMethodSetupMatch, type SubscriberPaymentMethodStatus, type SubscriberRecord, type SubscriberRepository, type Subscription, type SubscriptionBundleRecord, type SubscriptionBundleRepository, type SubscriptionBundleView, type SubscriptionContractFilter, type SubscriptionContractInvoiceSnapshot, type SubscriptionContractParties, type SubscriptionContractPriceSnapshot, type SubscriptionContractRecord, type SubscriptionContractRepository, type SubscriptionContractStatus, type SubscriptionRecord, type SubscriptionRepository, type SubscriptionStatsPort, type SubscriptionStatsSnapshot, type SubscriptionStatus, type SubscriptionUsagePort, type SubscriptionUsageRecord, type SuperAdminProvisioningPort, type SyncDiscoveryResult, type TenantActionDef, type TenantColumnDef, type TenantDto, type TenantListFilter, type TenantPort, type TenantSubscriptionWritePort, type TerminateSubscriptionContractData, type TopPromoCode, type TransactionContext, type TransactionRunner, type UpdateBundleData, type UpdateBundleVersionDraftData, type UpdateCatalogEntryBaseData, type UpdateCatalogEntryI18nData, type UpdateCheckoutOfferData, type UpdateMarketingProjectionData, type UpdateMarketingSettingsData, type UpdatePlanData, type UpdatePlanVersionDraftData, type UpdatePromoCodeData, type UpdatePromoCodeRequest, type UpdatePromotionData, type UpsellOffer, type UpsellOfferResolver, type UpsertCapabilityEntryData, type UpsertFeatureCatalogEntryInput, type UpsertFeatureEntryData, type UpsertPlanInput, type UpsertPlanVersionInput, type UpsertQuotaEntryData, type UpsertResult, type UsageSnapshotPort, type UserAccountLookup, type UserListFilter, type UserManagementPort, type UserPort, type VerifyRegistrationOtpResult, type VersionChange, type VersionChangeDirection, type VersionEditability, type VersionEditableReason, type VersionedEntityBase, applyPromo, assertPersistenceCapabilities, buildActivePlanVersionWhere, buildActiveVersionWhere, buildFeatureRequiresIndex, bundleDraftDefaults, bundleStemDefaults, canonicalJson, classifyBundleVersionDiff, classifyIssuerChange, classifyPlanDiff, collectUnsatisfiedRequires, contractPartiesOf, coverageExcludingSelf, definedFields, diffSettings, formatCustomerNumber, formatErrorMessage, identityCorrectionDelta, isBundleRedundant, isForeignPaymentMethodReferenceError, isPaymentCallbackRejectedError, isPlatformUserExistsError, isVersionEditable, issuerIdentityOf, keepOneRecommended, missingRequiresFor, movedIdentityFields, pickActivePromo, planCatalogSettingsOf, previousUtcDay, promoStatus, promotionOnPrice, readQuotaRecord, readQuotaValue, recordedIssuerIdentity, refuseForeignPaymentMethodReference, resolveBundleAvailability, resolveErrorMessage, sameLegalIdentity, selectChargeableBundles, settingsSubtreeOf, startOfUtcDay, subscriberFromRegistration, subscriberPaymentMethodColumns, toBundleStemRow, toContractLineItemRecord, toPlanRow, toPlanVersionRow, toRunningContractIssuer, toSubscriberCorrectionRecord, toSubscriberPaymentMethodRecord, toSubscriberRecord, toSubscriptionContractRecord };