@saasicat/core 1.0.0-rc.25 → 1.0.0-rc.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.build-stamp +1 -1
- package/dist/index.cjs +847 -11
- package/dist/index.d.cts +1530 -167
- package/dist/index.d.ts +1530 -167
- package/dist/index.js +807 -10
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -859,6 +859,18 @@ interface PlanCatalogSubscribers {
|
|
|
859
859
|
*/
|
|
860
860
|
customerNumberPrefix?: string;
|
|
861
861
|
}
|
|
862
|
+
/** `config/saas.yaml#invoicing`: how the invoices issued from the charge journal are numbered and when they are due. */
|
|
863
|
+
interface PlanCatalogInvoicing {
|
|
864
|
+
/** Put in front of every invoice number: `AHP` gives `AHP-2026-000123`. */
|
|
865
|
+
numberPrefix: string;
|
|
866
|
+
/** Days from an invoice's issue date to the day it is due (`SC-PRIC-046`). */
|
|
867
|
+
paymentTermDays: number;
|
|
868
|
+
/**
|
|
869
|
+
* What a business letter of the issuer states beyond the invoice's own
|
|
870
|
+
* content, line by line — copied onto every invoice issued (`SC-PRIC-077`).
|
|
871
|
+
*/
|
|
872
|
+
footer?: string[];
|
|
873
|
+
}
|
|
862
874
|
/** One account at a payment gateway, by the name `PlanCatalogPayments.accounts` gives it. */
|
|
863
875
|
interface PlanCatalogPaymentAccount {
|
|
864
876
|
/** The provider its bound adapter names itself as, e.g. `stripe`. */
|
|
@@ -916,6 +928,8 @@ interface PlanCatalogSettings {
|
|
|
916
928
|
issuer?: PlanCatalogIssuer;
|
|
917
929
|
/** How subscribers are numbered. Optional. */
|
|
918
930
|
subscribers?: PlanCatalogSubscribers;
|
|
931
|
+
/** How invoices are numbered and when they are due; named exactly where invoices are issued. */
|
|
932
|
+
invoicing?: PlanCatalogInvoicing;
|
|
919
933
|
/** The payment gateway accounts. Optional until payment methods are taken. */
|
|
920
934
|
payments?: PlanCatalogPayments;
|
|
921
935
|
}
|
|
@@ -2143,7 +2157,7 @@ interface AdminManifest {
|
|
|
2143
2157
|
actions?: AuditActionDef[];
|
|
2144
2158
|
};
|
|
2145
2159
|
}
|
|
2146
|
-
type StandardPageKey = 'dashboard' | 'tenants' | 'subscriptions' | 'promoCodes' | 'plans' | 'audit' | 'users' | 'pilots' | 'discovery' | 'bundles' | 'marketingCatalog' | 'platformEmail' | 'platformEmailHistory' | 'settings' | 'maintenance';
|
|
2160
|
+
type StandardPageKey = 'dashboard' | 'tenants' | 'subscriptions' | 'promoCodes' | 'plans' | 'audit' | 'users' | 'pilots' | 'discovery' | 'bundles' | 'marketingCatalog' | 'platformEmail' | 'platformEmailHistory' | 'settings' | 'maintenance' | 'featureWithdrawals';
|
|
2147
2161
|
interface StandardPageDef {
|
|
2148
2162
|
enabled: boolean;
|
|
2149
2163
|
requiredCapability?: CapabilityKey;
|
|
@@ -2431,6 +2445,35 @@ declare function grossFromNet(net: number, vatRate: number): number;
|
|
|
2431
2445
|
declare function netFromGross(gross: number, vatRate: number): number;
|
|
2432
2446
|
/** The tax a gross amount includes at a rate in per cent: gross × rate / (100 + rate). */
|
|
2433
2447
|
declare function computeIncludedVat(gross: number, vatRate: number): number;
|
|
2448
|
+
/** One tax rate's part of an invoice: the net of its lines and the tax on that net. */
|
|
2449
|
+
interface TaxAtRate {
|
|
2450
|
+
/** In per cent. */
|
|
2451
|
+
rate: number;
|
|
2452
|
+
net: number;
|
|
2453
|
+
tax: number;
|
|
2454
|
+
}
|
|
2455
|
+
/** An invoice's tax, rate by rate, and the totals it states. */
|
|
2456
|
+
interface TaxPerRate {
|
|
2457
|
+
/** One entry per rate the lines carry, the lowest rate first. */
|
|
2458
|
+
rates: TaxAtRate[];
|
|
2459
|
+
net: number;
|
|
2460
|
+
tax: number;
|
|
2461
|
+
gross: number;
|
|
2462
|
+
}
|
|
2463
|
+
/**
|
|
2464
|
+
* An invoice's tax by the rule of EN 16931: the lines' net is summed per rate,
|
|
2465
|
+
* the rate is applied to each sum and rounded once, and the gross is the net
|
|
2466
|
+
* plus that tax.
|
|
2467
|
+
*
|
|
2468
|
+
* Never the sum of the lines' own rounded taxes, which can differ by cents —
|
|
2469
|
+
* ten lines of 12.34 at 19 % carry 2.34 each, 23.40 together, while 19 % of
|
|
2470
|
+
* 123.40 is 23.45 — and an electronic invoice whose stated tax differs from
|
|
2471
|
+
* the one its format computes is rejected.
|
|
2472
|
+
*/
|
|
2473
|
+
declare function taxPerRate(lines: readonly {
|
|
2474
|
+
net: number;
|
|
2475
|
+
rate: number;
|
|
2476
|
+
}[]): TaxPerRate;
|
|
2434
2477
|
|
|
2435
2478
|
type CheckoutOfferLineItemKind = 'plan' | 'bundle' | 'discount';
|
|
2436
2479
|
/** Frozen billable line item in the offer. */
|
|
@@ -2894,6 +2937,23 @@ interface FeatureUiMeta {
|
|
|
2894
2937
|
plannedOnly?: boolean;
|
|
2895
2938
|
/** true = base infrastructure, included in every plan (not bookable). */
|
|
2896
2939
|
core?: boolean;
|
|
2940
|
+
/**
|
|
2941
|
+
* Set where the feature is withdrawn now or from a date ahead: each
|
|
2942
|
+
* withdrawal of it not over yet, the earliest first — why, from when, and
|
|
2943
|
+
* until when where it is lifted from a date ahead. A feature withdrawn
|
|
2944
|
+
* again from the day it returns carries both. A page that shows the
|
|
2945
|
+
* feature as part of a plan or an add-on shows this beside it, so whoever
|
|
2946
|
+
* concludes knows before they do.
|
|
2947
|
+
*/
|
|
2948
|
+
withdrawn?: readonly FeatureWithdrawalMark[];
|
|
2949
|
+
}
|
|
2950
|
+
/** One withdrawal of a feature, as a catalogue marks it beside the feature. */
|
|
2951
|
+
interface FeatureWithdrawalMark {
|
|
2952
|
+
readonly reason: string;
|
|
2953
|
+
/** ISO 8601. */
|
|
2954
|
+
readonly effectiveFrom: string;
|
|
2955
|
+
/** ISO 8601, where it is lifted from a date ahead. */
|
|
2956
|
+
readonly liftedFrom: string | null;
|
|
2897
2957
|
}
|
|
2898
2958
|
/** Map FeatureKey → UI metadata. Consumer apps supply a complete table. */
|
|
2899
2959
|
type FeatureUiRegistry = Record<string, FeatureUiMeta>;
|
|
@@ -3220,8 +3280,312 @@ interface BundleVersionSwitchResult {
|
|
|
3220
3280
|
readonly takesEffectAt: string;
|
|
3221
3281
|
}
|
|
3222
3282
|
|
|
3283
|
+
/** What a reduction is named for: a plan, or an add-on, by its key. */
|
|
3284
|
+
type FeatureWithdrawalLineKind = 'plan' | 'bundle';
|
|
3285
|
+
/**
|
|
3286
|
+
* The net amount the price of a plan, or of an add-on, is reduced by for one
|
|
3287
|
+
* whole period of `billingCycle` without the feature. A plan or an add-on that
|
|
3288
|
+
* grants the feature and is not named is not reduced.
|
|
3289
|
+
*/
|
|
3290
|
+
interface FeatureWithdrawalReduction {
|
|
3291
|
+
readonly kind: FeatureWithdrawalLineKind;
|
|
3292
|
+
/** The plan key, or the add-on's (bundle's) key. */
|
|
3293
|
+
readonly key: string;
|
|
3294
|
+
readonly billingCycle: BillingCycle;
|
|
3295
|
+
readonly amountNet: number;
|
|
3296
|
+
}
|
|
3297
|
+
/** The longest reason a withdrawal carries: the operator's words to the subscribers, not a document. */
|
|
3298
|
+
declare const FEATURE_WITHDRAWAL_REASON_MAX_LENGTH = 1000;
|
|
3299
|
+
/** A withdrawal as it is kept: one per announcement. */
|
|
3300
|
+
interface FeatureWithdrawalRecord {
|
|
3301
|
+
readonly id: string;
|
|
3302
|
+
readonly featureKey: string;
|
|
3303
|
+
/** Why, in the operator's words, as the subscribers are shown it. */
|
|
3304
|
+
readonly reason: string;
|
|
3305
|
+
/** From when the feature is granted to nobody. */
|
|
3306
|
+
readonly effectiveFrom: Date;
|
|
3307
|
+
/** From when it is granted again, once the operator has lifted the withdrawal. */
|
|
3308
|
+
readonly liftedFrom: Date | null;
|
|
3309
|
+
readonly reductions: readonly FeatureWithdrawalReduction[];
|
|
3310
|
+
readonly announcedAt: Date;
|
|
3311
|
+
/** Who announced it — an actor tag, as the audit log writes it. */
|
|
3312
|
+
readonly announcedBy: string;
|
|
3313
|
+
readonly liftedAt: Date | null;
|
|
3314
|
+
readonly liftedBy: string | null;
|
|
3315
|
+
/**
|
|
3316
|
+
* When the subscriptions it reaches were read and their notices recorded;
|
|
3317
|
+
* null until then. Announcing records the withdrawal first and reads who it
|
|
3318
|
+
* reaches once it is recorded, so that a change concluded while it was
|
|
3319
|
+
* being announced is not missed — the quarter-hourly run tells the ones
|
|
3320
|
+
* still null.
|
|
3321
|
+
*/
|
|
3322
|
+
readonly toldAt: Date | null;
|
|
3323
|
+
}
|
|
3324
|
+
type NewFeatureWithdrawal = Pick<FeatureWithdrawalRecord, 'featureKey' | 'reason' | 'effectiveFrom' | 'reductions' | 'announcedAt' | 'announcedBy'>;
|
|
3325
|
+
/** What lifting a withdrawal records. */
|
|
3326
|
+
interface FeatureWithdrawalLift {
|
|
3327
|
+
readonly liftedFrom: Date;
|
|
3328
|
+
readonly liftedAt: Date;
|
|
3329
|
+
readonly liftedBy: string;
|
|
3330
|
+
}
|
|
3331
|
+
/**
|
|
3332
|
+
* Whether `withdrawal` takes its feature away at `at`. A withdrawal lifted
|
|
3333
|
+
* before its date never does.
|
|
3334
|
+
*/
|
|
3335
|
+
declare function isFeatureWithdrawnAt(withdrawal: Pick<FeatureWithdrawalRecord, 'effectiveFrom' | 'liftedFrom'>, at: Date): boolean;
|
|
3336
|
+
/** The features `withdrawals` take away at `at`. */
|
|
3337
|
+
declare function featuresWithdrawnAt(withdrawals: readonly Pick<FeatureWithdrawalRecord, 'featureKey' | 'effectiveFrom' | 'liftedFrom'>[], at: Date): Set<string>;
|
|
3338
|
+
/**
|
|
3339
|
+
* The first moment after `at` at which what `withdrawals` take away changes —
|
|
3340
|
+
* one takes effect, or is lifted — or null where none is still to come.
|
|
3341
|
+
*/
|
|
3342
|
+
declare function nextWithdrawalChange(withdrawals: readonly Pick<FeatureWithdrawalRecord, 'effectiveFrom' | 'liftedFrom'>[], at: Date): Date | null;
|
|
3343
|
+
/**
|
|
3344
|
+
* The manifest capability that announces withdrawing a feature. The platform
|
|
3345
|
+
* sets it where it serves the routes, and the admin UI offers the action only
|
|
3346
|
+
* where it is set.
|
|
3347
|
+
*/
|
|
3348
|
+
declare const FEATURE_WITHDRAWAL_CAPABILITY = "features.withdraw";
|
|
3349
|
+
/**
|
|
3350
|
+
* A line of a subscription a withdrawal reaches: the plan in the rhythm it is
|
|
3351
|
+
* billed in, or one booking of an add-on.
|
|
3352
|
+
*/
|
|
3353
|
+
interface FeatureWithdrawalLine {
|
|
3354
|
+
readonly line: FeatureWithdrawalLineKind;
|
|
3355
|
+
/** The plan key, or the add-on's key. */
|
|
3356
|
+
readonly key: string;
|
|
3357
|
+
/** The plan's or the add-on's name, as the subscriber reads it. */
|
|
3358
|
+
readonly label: string;
|
|
3359
|
+
/** The booking, where the line is an add-on's; null for the plan. */
|
|
3360
|
+
readonly subscriptionBundleId: string | null;
|
|
3361
|
+
readonly billingCycle: BillingCycle;
|
|
3362
|
+
}
|
|
3363
|
+
/** A line as the subscriber was told of it: with the reduction it carries, or null for none. */
|
|
3364
|
+
interface FeatureWithdrawalNoticeLine extends FeatureWithdrawalLine {
|
|
3365
|
+
readonly reductionNet: number | null;
|
|
3366
|
+
}
|
|
3367
|
+
/**
|
|
3368
|
+
* A feature the subscription holds is withdrawn. Sent once per subscription and
|
|
3369
|
+
* withdrawal, at the announcement, and kept as it was sent: it is the record of
|
|
3370
|
+
* which lines the withdrawal reached and what each is reduced by.
|
|
3371
|
+
*/
|
|
3372
|
+
interface FeatureWithdrawnNotice {
|
|
3373
|
+
readonly kind: 'feature-withdrawn';
|
|
3374
|
+
readonly tenantId: string;
|
|
3375
|
+
readonly subscriptionId: string;
|
|
3376
|
+
readonly withdrawalId: string;
|
|
3377
|
+
readonly featureKey: string;
|
|
3378
|
+
readonly featureLabel: string;
|
|
3379
|
+
readonly reason: string;
|
|
3380
|
+
/** ISO 8601. */
|
|
3381
|
+
readonly effectiveFrom: string;
|
|
3382
|
+
readonly lines: readonly FeatureWithdrawalNoticeLine[];
|
|
3383
|
+
/**
|
|
3384
|
+
* Whether the subscription holds the feature through special terms its
|
|
3385
|
+
* contract records and through no line: then it may end at once, and no
|
|
3386
|
+
* reduction applies by itself.
|
|
3387
|
+
*/
|
|
3388
|
+
readonly specialTerms: boolean;
|
|
3389
|
+
}
|
|
3390
|
+
/** A withdrawn feature is granted again. Sent once to every subscription told of the withdrawal. */
|
|
3391
|
+
interface FeatureWithdrawalLiftedNotice {
|
|
3392
|
+
readonly kind: 'feature-withdrawal-lifted';
|
|
3393
|
+
readonly tenantId: string;
|
|
3394
|
+
readonly subscriptionId: string;
|
|
3395
|
+
readonly withdrawalId: string;
|
|
3396
|
+
readonly featureKey: string;
|
|
3397
|
+
readonly featureLabel: string;
|
|
3398
|
+
/** ISO 8601. */
|
|
3399
|
+
readonly liftedFrom: string;
|
|
3400
|
+
}
|
|
3401
|
+
/**
|
|
3402
|
+
* The subscription, or one booking of it, ended at once while a feature it
|
|
3403
|
+
* holds was withdrawn: what the account credits the unused rest of the period
|
|
3404
|
+
* already charged from. Recorded by each attempt before it ends anything, so
|
|
3405
|
+
* the credit never lacks its record; an attempt whose end did not happen leaves
|
|
3406
|
+
* one behind, and only the one whose `endedAt` the subscription or the booking
|
|
3407
|
+
* records is sent, counted or credited (`endedAtOnceSubjectOf`).
|
|
3408
|
+
*/
|
|
3409
|
+
interface EndedAtOnceNotice {
|
|
3410
|
+
readonly kind: 'ended-at-once';
|
|
3411
|
+
readonly tenantId: string;
|
|
3412
|
+
readonly subscriptionId: string;
|
|
3413
|
+
/** The booking that ended; null where the subscription did, and every booking with it. */
|
|
3414
|
+
readonly subscriptionBundleId: string | null;
|
|
3415
|
+
readonly withdrawalId: string;
|
|
3416
|
+
readonly featureKey: string;
|
|
3417
|
+
readonly featureLabel: string;
|
|
3418
|
+
/** ISO 8601. */
|
|
3419
|
+
readonly endedAt: string;
|
|
3420
|
+
}
|
|
3421
|
+
/** A blocker or a refusal a person reads: a stable code and the values its sentence names. */
|
|
3422
|
+
interface FeatureWithdrawalBlocker {
|
|
3423
|
+
readonly code: string;
|
|
3424
|
+
readonly message: string;
|
|
3425
|
+
readonly params: Record<string, string | number>;
|
|
3426
|
+
}
|
|
3427
|
+
/** A subscription a withdrawal reaches, as the operator previews it. */
|
|
3428
|
+
interface FeatureWithdrawalReachedRow {
|
|
3429
|
+
readonly tenantId: string;
|
|
3430
|
+
readonly subscriptionId: string;
|
|
3431
|
+
readonly status: string;
|
|
3432
|
+
/** Each line with its price per period in its rhythm, net, or null where none is known. */
|
|
3433
|
+
readonly lines: readonly (FeatureWithdrawalLine & {
|
|
3434
|
+
readonly priceNet: number | null;
|
|
3435
|
+
})[];
|
|
3436
|
+
/** Whether it holds the feature through special terms its contract records, and through no line. */
|
|
3437
|
+
readonly specialTerms: boolean;
|
|
3438
|
+
}
|
|
3439
|
+
/** A subscription holding the feature that the withdrawal does not reach: it ends by the date. */
|
|
3440
|
+
interface FeatureWithdrawalSkippedRow {
|
|
3441
|
+
readonly tenantId: string;
|
|
3442
|
+
readonly subscriptionId: string;
|
|
3443
|
+
readonly reason: 'ends-before';
|
|
3444
|
+
}
|
|
3445
|
+
/**
|
|
3446
|
+
* A plan or an add-on in a rhythm the withdrawal reaches, which the operator
|
|
3447
|
+
* may name a reduction for: how many lines it reaches and the lowest price
|
|
3448
|
+
* among them, which a reduction may not exceed.
|
|
3449
|
+
*/
|
|
3450
|
+
interface FeatureWithdrawalTarget {
|
|
3451
|
+
readonly kind: FeatureWithdrawalLineKind;
|
|
3452
|
+
readonly key: string;
|
|
3453
|
+
readonly label: string;
|
|
3454
|
+
readonly billingCycle: BillingCycle;
|
|
3455
|
+
readonly lines: number;
|
|
3456
|
+
readonly lowestPriceNet: number | null;
|
|
3457
|
+
}
|
|
3458
|
+
/** What announcing a withdrawal now would do. */
|
|
3459
|
+
interface FeatureWithdrawalPreview {
|
|
3460
|
+
readonly feature: {
|
|
3461
|
+
readonly key: string;
|
|
3462
|
+
readonly label: string;
|
|
3463
|
+
};
|
|
3464
|
+
/** ISO 8601: the date it would take effect. */
|
|
3465
|
+
readonly effectiveFrom: string;
|
|
3466
|
+
/** ISO 8601: the moment it is computed for. */
|
|
3467
|
+
readonly asOf: string;
|
|
3468
|
+
readonly reached: readonly FeatureWithdrawalReachedRow[];
|
|
3469
|
+
readonly skipped: readonly FeatureWithdrawalSkippedRow[];
|
|
3470
|
+
readonly targets: readonly FeatureWithdrawalTarget[];
|
|
3471
|
+
/** Empty where it may be announced as it stands. */
|
|
3472
|
+
readonly blockers: readonly FeatureWithdrawalBlocker[];
|
|
3473
|
+
}
|
|
3474
|
+
/** A withdrawal as the administration reads it: the record, its dates as ISO 8601. */
|
|
3475
|
+
interface FeatureWithdrawalRow {
|
|
3476
|
+
readonly id: string;
|
|
3477
|
+
readonly featureKey: string;
|
|
3478
|
+
readonly reason: string;
|
|
3479
|
+
readonly effectiveFrom: string;
|
|
3480
|
+
readonly liftedFrom: string | null;
|
|
3481
|
+
readonly reductions: readonly FeatureWithdrawalReduction[];
|
|
3482
|
+
readonly announcedAt: string;
|
|
3483
|
+
readonly announcedBy: string;
|
|
3484
|
+
readonly liftedAt: string | null;
|
|
3485
|
+
readonly liftedBy: string | null;
|
|
3486
|
+
/** When the subscriptions it reaches were told; null until then. */
|
|
3487
|
+
readonly toldAt: string | null;
|
|
3488
|
+
}
|
|
3489
|
+
/** The row the administration reads for `record`. */
|
|
3490
|
+
declare function featureWithdrawalRowOf(record: FeatureWithdrawalRecord): FeatureWithdrawalRow;
|
|
3491
|
+
/** What an announcement did. */
|
|
3492
|
+
interface FeatureWithdrawalAnnounced {
|
|
3493
|
+
readonly withdrawal: FeatureWithdrawalRow;
|
|
3494
|
+
/** Notices sent now; the rest are sent by the next run. */
|
|
3495
|
+
readonly told: number;
|
|
3496
|
+
readonly failed: number;
|
|
3497
|
+
}
|
|
3498
|
+
/** What lifting a withdrawal did. */
|
|
3499
|
+
interface FeatureWithdrawalLifted {
|
|
3500
|
+
readonly withdrawal: FeatureWithdrawalRow;
|
|
3501
|
+
readonly told: number;
|
|
3502
|
+
readonly failed: number;
|
|
3503
|
+
}
|
|
3504
|
+
/** A withdrawal as the administration lists it, with how far it has come. */
|
|
3505
|
+
interface FeatureWithdrawalView extends FeatureWithdrawalRow {
|
|
3506
|
+
readonly featureLabel: string;
|
|
3507
|
+
readonly progress: {
|
|
3508
|
+
/** The subscriptions it reached. */
|
|
3509
|
+
readonly reached: number;
|
|
3510
|
+
/** Of those, the ones whose notice reached somebody. */
|
|
3511
|
+
readonly told: number;
|
|
3512
|
+
/** The subscriptions and bookings that ended at once under it. */
|
|
3513
|
+
readonly endedAtOnce: number;
|
|
3514
|
+
};
|
|
3515
|
+
}
|
|
3516
|
+
/** A line of the tenant's subscription a withdrawal reached, as the tenant sees it now. */
|
|
3517
|
+
interface TenantFeatureWithdrawalLine extends FeatureWithdrawalNoticeLine {
|
|
3518
|
+
/**
|
|
3519
|
+
* Whether the reduction still applies: the line runs as it was reached.
|
|
3520
|
+
* A change of plan or rhythm the subscriber made ends it.
|
|
3521
|
+
*/
|
|
3522
|
+
readonly reduced: boolean;
|
|
3523
|
+
/**
|
|
3524
|
+
* Where a change scheduled before the announcement brings the line and has
|
|
3525
|
+
* not landed yet: when it lands, ISO 8601, from which the reduction
|
|
3526
|
+
* applies. Null otherwise.
|
|
3527
|
+
*/
|
|
3528
|
+
readonly fromChange: string | null;
|
|
3529
|
+
}
|
|
3530
|
+
/** A withdrawal reaching the tenant's subscription, beside its plan and its add-ons. */
|
|
3531
|
+
interface TenantFeatureWithdrawal {
|
|
3532
|
+
readonly withdrawalId: string;
|
|
3533
|
+
readonly featureKey: string;
|
|
3534
|
+
readonly featureLabel: string;
|
|
3535
|
+
readonly reason: string;
|
|
3536
|
+
/** ISO 8601. */
|
|
3537
|
+
readonly effectiveFrom: string;
|
|
3538
|
+
/** ISO 8601, once the operator has lifted it. */
|
|
3539
|
+
readonly liftedFrom: string | null;
|
|
3540
|
+
/** Whether it takes the feature away now. */
|
|
3541
|
+
readonly inEffect: boolean;
|
|
3542
|
+
readonly lines: readonly TenantFeatureWithdrawalLine[];
|
|
3543
|
+
readonly specialTerms: boolean;
|
|
3544
|
+
/** What may be ended at once now: the subscription, and which bookings. */
|
|
3545
|
+
readonly endable: {
|
|
3546
|
+
readonly subscription: boolean;
|
|
3547
|
+
readonly subscriptionBundleIds: readonly string[];
|
|
3548
|
+
};
|
|
3549
|
+
}
|
|
3550
|
+
/**
|
|
3551
|
+
* The features `withdrawals` take away at `now` or from a date ahead, and not
|
|
3552
|
+
* lifted by then, the earliest first: what a catalogue marks beside every plan
|
|
3553
|
+
* and add-on that grants them. A withdrawal lifted before its own date takes
|
|
3554
|
+
* nothing away. One feature can appear twice — withdrawn until a date, and
|
|
3555
|
+
* again from it.
|
|
3556
|
+
*/
|
|
3557
|
+
declare function withdrawnFeaturesOf(withdrawals: readonly FeatureWithdrawalRecord[], now: Date): WithdrawnFeature[];
|
|
3558
|
+
/**
|
|
3559
|
+
* A feature withdrawn now or from a date ahead, as a catalogue marks it beside
|
|
3560
|
+
* every plan and add-on that grants it, so whoever concludes is shown it first.
|
|
3561
|
+
*/
|
|
3562
|
+
interface WithdrawnFeature extends FeatureWithdrawalMark {
|
|
3563
|
+
readonly featureKey: string;
|
|
3564
|
+
}
|
|
3565
|
+
/** What ending at once now would credit, before the subscriber confirms it. */
|
|
3566
|
+
interface EndAtOncePreview {
|
|
3567
|
+
/** ISO 8601: the moment it ends. */
|
|
3568
|
+
readonly endsAt: string;
|
|
3569
|
+
/** The unused rest of what was charged, net, as a positive amount; 0 where nothing was charged. */
|
|
3570
|
+
readonly creditNet: number;
|
|
3571
|
+
/** ISO 4217, where anything is credited. */
|
|
3572
|
+
readonly currency: string | null;
|
|
3573
|
+
}
|
|
3574
|
+
/** What ending at once did. */
|
|
3575
|
+
interface EndedAtOnce extends EndAtOncePreview {
|
|
3576
|
+
readonly withdrawalId: string;
|
|
3577
|
+
/** The booking that ended; null where the subscription did. */
|
|
3578
|
+
readonly subscriptionBundleId: string | null;
|
|
3579
|
+
}
|
|
3580
|
+
/**
|
|
3581
|
+
* The subject an end at once is recorded under: the subscription or the
|
|
3582
|
+
* booking, and the moment the attempt names, so a later attempt records its
|
|
3583
|
+
* own moment rather than inheriting one whose end never happened.
|
|
3584
|
+
*/
|
|
3585
|
+
declare function endedAtOnceSubjectOf(subscriptionOrBookingId: string, at: Date): string;
|
|
3586
|
+
|
|
3223
3587
|
/** What a notice is about. */
|
|
3224
|
-
type SubscriptionNoticeKind = 'version-offered' | 'version-retired' | 'version-retirement-reminder' | 'bundle-version-retired' | 'bundle-version-retirement-reminder' | 'bundle-version-offered';
|
|
3588
|
+
type SubscriptionNoticeKind = 'version-offered' | 'version-retired' | 'version-retirement-reminder' | 'bundle-version-retired' | 'bundle-version-retirement-reminder' | 'bundle-version-offered' | 'feature-withdrawn' | 'feature-withdrawal-lifted' | 'ended-at-once';
|
|
3225
3589
|
/** Which notice: there is one per subscription, kind and subject. */
|
|
3226
3590
|
interface SubscriptionNoticeKey {
|
|
3227
3591
|
readonly tenantId: string;
|
|
@@ -3239,7 +3603,10 @@ interface SubscriptionNoticeKey {
|
|
|
3239
3603
|
* the retirement once. For `bundle-version-retirement-reminder`, the id of
|
|
3240
3604
|
* the add-on version retired as well: that booking is reminded of it once.
|
|
3241
3605
|
* For `bundle-version-offered`, the id of the add-on version offered: that
|
|
3242
|
-
* booking is told of the version once.
|
|
3606
|
+
* booking is told of the version once. For `feature-withdrawn` and
|
|
3607
|
+
* `feature-withdrawal-lifted`, the id of the withdrawal: a subscription is
|
|
3608
|
+
* told of each once. For `ended-at-once`, the id of what ended — the
|
|
3609
|
+
* subscription, or the booking — which ends once.
|
|
3243
3610
|
*/
|
|
3244
3611
|
readonly subject: string;
|
|
3245
3612
|
}
|
|
@@ -3292,7 +3659,7 @@ interface BundleVersionOfferedNotice {
|
|
|
3292
3659
|
readonly offer: BundleVersionOfferView;
|
|
3293
3660
|
}
|
|
3294
3661
|
/** A notice handed to the application to send. */
|
|
3295
|
-
type SubscriptionNotice = VersionOfferedNotice | VersionRetiredNotice | VersionRetirementReminder | BundleVersionRetiredNotice | BundleVersionRetirementReminder | BundleVersionOfferedNotice;
|
|
3662
|
+
type SubscriptionNotice = VersionOfferedNotice | VersionRetiredNotice | VersionRetirementReminder | BundleVersionRetiredNotice | BundleVersionRetirementReminder | BundleVersionOfferedNotice | FeatureWithdrawnNotice | FeatureWithdrawalLiftedNotice | EndedAtOnceNotice;
|
|
3296
3663
|
|
|
3297
3664
|
/**
|
|
3298
3665
|
* A `subscription_notices` row as either adapter reads it back. The two JSON
|
|
@@ -3391,6 +3758,31 @@ interface CanonicalBundleVersionRetirementRow {
|
|
|
3391
3758
|
/** Reads a row back as a record, naming each column rather than spreading the row. */
|
|
3392
3759
|
declare function toBundleVersionRetirementRecord(row: CanonicalBundleVersionRetirementRow): BundleVersionRetirementRecord;
|
|
3393
3760
|
|
|
3761
|
+
/**
|
|
3762
|
+
* A `feature_withdrawals` row as either adapter reads it back. `reductions` is
|
|
3763
|
+
* `unknown`: the database holds whatever was written to the column.
|
|
3764
|
+
*/
|
|
3765
|
+
interface CanonicalFeatureWithdrawalRow {
|
|
3766
|
+
id: string;
|
|
3767
|
+
featureKey: string;
|
|
3768
|
+
reason: string;
|
|
3769
|
+
effectiveFrom: Date;
|
|
3770
|
+
liftedFrom: Date | null;
|
|
3771
|
+
reductions: unknown;
|
|
3772
|
+
announcedAt: Date;
|
|
3773
|
+
announcedBy: string;
|
|
3774
|
+
liftedAt: Date | null;
|
|
3775
|
+
liftedBy: string | null;
|
|
3776
|
+
toldAt: Date | null;
|
|
3777
|
+
}
|
|
3778
|
+
/**
|
|
3779
|
+
* Reads a row back as a record, naming each column rather than spreading the
|
|
3780
|
+
* row. The reductions are checked rather than cast: they are what every
|
|
3781
|
+
* subscription the withdrawal reached is charged less by, and a value nobody
|
|
3782
|
+
* can read must stop at the read and name its row.
|
|
3783
|
+
*/
|
|
3784
|
+
declare function toFeatureWithdrawalRecord(row: CanonicalFeatureWithdrawalRow): FeatureWithdrawalRecord;
|
|
3785
|
+
|
|
3394
3786
|
/** A scheduled change as a subscription row holds it. */
|
|
3395
3787
|
interface ScheduledChangeColumns {
|
|
3396
3788
|
readonly pendingPlan: string | null;
|
|
@@ -3479,6 +3871,28 @@ declare function maintenanceRetryAfterSeconds(window: MaintenanceWindowRecord, n
|
|
|
3479
3871
|
*/
|
|
3480
3872
|
declare function parseZonedInstant(text: string): Date | null;
|
|
3481
3873
|
|
|
3874
|
+
/** A calendar day, `YYYY-MM-DD`. */
|
|
3875
|
+
type CalendarDay = string;
|
|
3876
|
+
/**
|
|
3877
|
+
* The day `at` falls on in `timeZone`. Throws a `RangeError` for a zone the
|
|
3878
|
+
* runtime does not know, and for no zone at all — without one `Intl` would
|
|
3879
|
+
* read the host's, and the day would depend on the machine.
|
|
3880
|
+
*/
|
|
3881
|
+
declare function dayInZone(at: Date, timeZone: string): CalendarDay;
|
|
3882
|
+
/**
|
|
3883
|
+
* The last day a period covers in `timeZone`. A period ends before `until`, so
|
|
3884
|
+
* its last moment is one millisecond earlier: a month from 1 October to
|
|
3885
|
+
* 1 November covers 31 October as its last day.
|
|
3886
|
+
*/
|
|
3887
|
+
declare function lastDayInZone(period: {
|
|
3888
|
+
from: Date;
|
|
3889
|
+
until: Date;
|
|
3890
|
+
}, timeZone: string): CalendarDay;
|
|
3891
|
+
/** The day `days` calendar days after `day`; months and years roll over as the calendar does. */
|
|
3892
|
+
declare function addDaysToDay(day: CalendarDay, days: number): CalendarDay;
|
|
3893
|
+
/** The year a day belongs to. */
|
|
3894
|
+
declare function yearOfDay(day: CalendarDay): number;
|
|
3895
|
+
|
|
3482
3896
|
/**
|
|
3483
3897
|
* The top-level blocks of `config/saas.yaml` that are the catalogue rather than
|
|
3484
3898
|
* the configuration, and the format marker.
|
|
@@ -4275,6 +4689,331 @@ interface PromoRevenueDeductionAggregator {
|
|
|
4275
4689
|
sumGrossForPromoCode(promoCodeId: string): Promise<string>;
|
|
4276
4690
|
}
|
|
4277
4691
|
|
|
4692
|
+
/**
|
|
4693
|
+
* What made the charge arise. activation: the first period of a subscription. renewal: a later period. planChange: what an immediate plan change adds. bundleBooking: the first, short period of an add-on. bundleChange: what an add-on's switch to a dearer version adds for the rest of its period. credit: a decision that reduces what is owed. correction: a counter-entry reversing an earlier charge, which is how the append-only journal answers a mistake. reductionTakenBack: a reduction granted in advance, taken back for the days it no longer covers — the feature it was granted for came back, or what it reduced ended at once.
|
|
4694
|
+
*/
|
|
4695
|
+
type SubscriberChargeOrigin = 'activation' | 'renewal' | 'planChange' | 'bundleBooking' | 'bundleChange' | 'credit' | 'correction' | 'reductionTakenBack';
|
|
4696
|
+
/**
|
|
4697
|
+
* Which kind of contract line the charge realises.
|
|
4698
|
+
*/
|
|
4699
|
+
type SubscriberChargeSource = 'plan' | 'bundle' | 'discount';
|
|
4700
|
+
/**
|
|
4701
|
+
* One charge in a subscriber's account: an amount that became due for a period, derived from a line of the contract in force. The journal is append-only — a charge is never updated, and a mistake is answered with a counter-entry rather than an edit, so the account says what happened rather than what somebody thinks today. A charge is net: the tax is decided by the tax adapter when the charge is invoiced, from the subscriber's origin on that day, and computed once per rate on the invoice.
|
|
4702
|
+
*/
|
|
4703
|
+
interface SubscriberCharge {
|
|
4704
|
+
/**
|
|
4705
|
+
* The charge's own identifier. Never shown to a customer as an invoice number: invoice numbering is sequential, gapless and legally constrained per country, and an identifier somebody has already seen on a screen cannot become one later without confusion.
|
|
4706
|
+
*/
|
|
4707
|
+
id: string;
|
|
4708
|
+
/**
|
|
4709
|
+
* The party the contract is concluded with, whose account this is. It outlives the tenant.
|
|
4710
|
+
*/
|
|
4711
|
+
subscriberId: string;
|
|
4712
|
+
/**
|
|
4713
|
+
* The tenant the subscription belonged to when the charge arose.
|
|
4714
|
+
*/
|
|
4715
|
+
tenantId: string;
|
|
4716
|
+
/**
|
|
4717
|
+
* The subscription the charge arose on. Part of the natural key.
|
|
4718
|
+
*/
|
|
4719
|
+
subscriptionId: string;
|
|
4720
|
+
/**
|
|
4721
|
+
* The contract whose line the charge realises.
|
|
4722
|
+
*/
|
|
4723
|
+
contractId: string;
|
|
4724
|
+
/**
|
|
4725
|
+
* The contract line the charge came from, so that every invoice line can be traced back to what was agreed.
|
|
4726
|
+
*/
|
|
4727
|
+
contractLineItemId: string;
|
|
4728
|
+
origin: SubscriberChargeOrigin;
|
|
4729
|
+
source: SubscriberChargeSource;
|
|
4730
|
+
/**
|
|
4731
|
+
* Which thing of its source the charge is for, stable across contracts: the subscription id for the plan, the booking id for an add-on, the discount's key for a discount. Part of the natural key (subscriptionId, source, sourceRef, periodStart, origin), which is unique — a charge derived twice is written once.
|
|
4732
|
+
*/
|
|
4733
|
+
sourceRef: string;
|
|
4734
|
+
/**
|
|
4735
|
+
* The start of the period the charge belongs to — the grouping key for an invoice.
|
|
4736
|
+
*/
|
|
4737
|
+
periodStart: string;
|
|
4738
|
+
periodEnd: string;
|
|
4739
|
+
/**
|
|
4740
|
+
* ISO 4217, as the contract line records it — recorded per charge so that a charge written in 2026 still means what it meant after the configured currency changes.
|
|
4741
|
+
*/
|
|
4742
|
+
currency: string;
|
|
4743
|
+
/**
|
|
4744
|
+
* Net, rounded to the currency's decimal places once, when the charge is written; the written figure is the truth from then on. Negative for a discount.
|
|
4745
|
+
*/
|
|
4746
|
+
amountNet: number;
|
|
4747
|
+
/**
|
|
4748
|
+
* When the amount became due. The account is ordered by this, not by when the row was written.
|
|
4749
|
+
*/
|
|
4750
|
+
bookedAt: string;
|
|
4751
|
+
createdAt: string;
|
|
4752
|
+
}
|
|
4753
|
+
|
|
4754
|
+
/** A charge as a store reads it back: the wire format, with its dates as dates. */
|
|
4755
|
+
interface SubscriberChargeRecord {
|
|
4756
|
+
id: string;
|
|
4757
|
+
subscriberId: string;
|
|
4758
|
+
tenantId: string;
|
|
4759
|
+
subscriptionId: string;
|
|
4760
|
+
contractId: string;
|
|
4761
|
+
contractLineItemId: string;
|
|
4762
|
+
origin: SubscriberChargeOrigin;
|
|
4763
|
+
source: SubscriberChargeSource;
|
|
4764
|
+
/** The subscription id for the plan, the booking id for an add-on, the discount's key. */
|
|
4765
|
+
sourceRef: string;
|
|
4766
|
+
periodStart: Date;
|
|
4767
|
+
periodEnd: Date;
|
|
4768
|
+
currency: string;
|
|
4769
|
+
/** Net, rounded to the cent when written. Negative for a discount. */
|
|
4770
|
+
amountNet: number;
|
|
4771
|
+
/** When the amount became due. */
|
|
4772
|
+
bookedAt: Date;
|
|
4773
|
+
createdAt: Date;
|
|
4774
|
+
}
|
|
4775
|
+
/** A charge to write: everything but what the store assigns. */
|
|
4776
|
+
type NewSubscriberCharge = Omit<SubscriberChargeRecord, 'id' | 'createdAt'>;
|
|
4777
|
+
/**
|
|
4778
|
+
* The manifest capability that announces the operator's view of an account.
|
|
4779
|
+
* The platform sets it where it serves the view, and the admin UI shows the
|
|
4780
|
+
* view only where it is set.
|
|
4781
|
+
*/
|
|
4782
|
+
declare const SUBSCRIBER_ACCOUNT_CAPABILITY = "charges.read";
|
|
4783
|
+
/** Whose account it is, as the operator is shown it. */
|
|
4784
|
+
interface AdminAccountHolder {
|
|
4785
|
+
id: string;
|
|
4786
|
+
/** What the customer quotes, and what an invoice will carry. */
|
|
4787
|
+
customerNumber: string;
|
|
4788
|
+
legalName: string;
|
|
4789
|
+
}
|
|
4790
|
+
/** One charge of an account, with the name its contract line gives it. */
|
|
4791
|
+
interface AdminAccountEntry {
|
|
4792
|
+
/** The charge as the journal holds it. */
|
|
4793
|
+
charge: SubscriberCharge;
|
|
4794
|
+
/**
|
|
4795
|
+
* The contract line's own title, as it was when the contract was
|
|
4796
|
+
* concluded, or `null` where that line cannot be read.
|
|
4797
|
+
*/
|
|
4798
|
+
title: string | null;
|
|
4799
|
+
}
|
|
4800
|
+
/**
|
|
4801
|
+
* A tenant's account as the operator reads it: the charges of the subscription
|
|
4802
|
+
* it holds, newest first — by when each became due, then by its period, then
|
|
4803
|
+
* the plan before its add-ons before its discounts.
|
|
4804
|
+
*
|
|
4805
|
+
* No total: without invoices and payments, a sum would be what was charged so
|
|
4806
|
+
* far, and it would be read as what is owed.
|
|
4807
|
+
*/
|
|
4808
|
+
interface AdminSubscriberAccount {
|
|
4809
|
+
/** `null` for a tenant that has no subscriber. */
|
|
4810
|
+
holder: AdminAccountHolder | null;
|
|
4811
|
+
entries: AdminAccountEntry[];
|
|
4812
|
+
}
|
|
4813
|
+
|
|
4814
|
+
/** The issuer an invoice names, as of its issue date. */
|
|
4815
|
+
interface SubscriptionInvoiceIssuer extends LegalIdentity, PartyAddress {
|
|
4816
|
+
}
|
|
4817
|
+
/** The subscriber an invoice names, copied from its record on the issue date. */
|
|
4818
|
+
interface SubscriptionInvoiceSubscriber extends LegalIdentity, PartyAddress {
|
|
4819
|
+
customerNumber: string;
|
|
4820
|
+
}
|
|
4821
|
+
/** One line of an invoice: one charge, as the invoice states it. */
|
|
4822
|
+
interface SubscriptionInvoiceLineRecord {
|
|
4823
|
+
id: string;
|
|
4824
|
+
invoiceId: string;
|
|
4825
|
+
/** From 1, in the order the invoice lists its lines. */
|
|
4826
|
+
position: number;
|
|
4827
|
+
/** The charge the line invoices; a charge stands on one invoice (`SC-PRIC-022`). */
|
|
4828
|
+
chargeId: string;
|
|
4829
|
+
/** The contract line the charge came from (`SC-AUD-013`). */
|
|
4830
|
+
contractLineItemId: string;
|
|
4831
|
+
/** What the line is for, as the contract line names it. */
|
|
4832
|
+
title: string;
|
|
4833
|
+
origin: SubscriberChargeOrigin;
|
|
4834
|
+
source: SubscriberChargeSource;
|
|
4835
|
+
/** The first day the charge covers, in the installation's time zone. */
|
|
4836
|
+
periodFrom: CalendarDay;
|
|
4837
|
+
/** The last day the charge covers, in the installation's time zone. */
|
|
4838
|
+
periodUntil: CalendarDay;
|
|
4839
|
+
/** Net, as the charge was written. Negative for a discount. */
|
|
4840
|
+
amountNet: number;
|
|
4841
|
+
/** In per cent: the rate of the invoice's treatment. */
|
|
4842
|
+
taxRate: number;
|
|
4843
|
+
}
|
|
4844
|
+
/** A line to write: everything but what the store assigns. */
|
|
4845
|
+
type NewSubscriptionInvoiceLine = Omit<SubscriptionInvoiceLineRecord, 'id' | 'invoiceId'>;
|
|
4846
|
+
/** An invoice as a store reads it back. */
|
|
4847
|
+
interface SubscriptionInvoiceRecord {
|
|
4848
|
+
id: string;
|
|
4849
|
+
/** `<prefix>-<year>-<sequence>`, e.g. `AHP-2026-000123` (`formatInvoiceNumber`). */
|
|
4850
|
+
number: string;
|
|
4851
|
+
numberPrefix: string;
|
|
4852
|
+
/** The year of the issue date, which the sequence restarts with. */
|
|
4853
|
+
numberYear: number;
|
|
4854
|
+
/** From 1 each year, without gaps. */
|
|
4855
|
+
numberSequence: number;
|
|
4856
|
+
tenantId: string;
|
|
4857
|
+
subscriberId: string;
|
|
4858
|
+
subscriptionId: string;
|
|
4859
|
+
/** The contract the invoiced charges belong to. */
|
|
4860
|
+
contractId: string;
|
|
4861
|
+
issuedAt: Date;
|
|
4862
|
+
/** The day it was issued, in the installation's time zone. */
|
|
4863
|
+
issueDate: CalendarDay;
|
|
4864
|
+
/** The day it is due: the issue date plus the payment term (`SC-PRIC-046`). */
|
|
4865
|
+
dueDate: CalendarDay;
|
|
4866
|
+
/** The first day its charges cover. */
|
|
4867
|
+
servicePeriodFrom: CalendarDay;
|
|
4868
|
+
/** The last day its charges cover. */
|
|
4869
|
+
servicePeriodUntil: CalendarDay;
|
|
4870
|
+
currency: string;
|
|
4871
|
+
issuer: SubscriptionInvoiceIssuer;
|
|
4872
|
+
subscriber: SubscriptionInvoiceSubscriber;
|
|
4873
|
+
/**
|
|
4874
|
+
* The lines `config/saas.yaml` named under `invoicing.footer` on the issue
|
|
4875
|
+
* date — what a business letter of the issuer states beyond the invoice's
|
|
4876
|
+
* own content (`SC-PRIC-077`); none where it named none.
|
|
4877
|
+
*/
|
|
4878
|
+
footer: string[];
|
|
4879
|
+
/** The treatment the tax adapter decided when it was issued, with its name and version. */
|
|
4880
|
+
taxTreatment: TaxTreatment;
|
|
4881
|
+
/** The tax, rate by rate, computed once per rate (`SC-PRIC-041`). */
|
|
4882
|
+
taxes: TaxAtRate[];
|
|
4883
|
+
totalNet: number;
|
|
4884
|
+
totalTax: number;
|
|
4885
|
+
totalGross: number;
|
|
4886
|
+
lines: SubscriptionInvoiceLineRecord[];
|
|
4887
|
+
createdAt: Date;
|
|
4888
|
+
}
|
|
4889
|
+
/**
|
|
4890
|
+
* An invoice to issue: everything but what the store assigns — the id, and
|
|
4891
|
+
* the number, which the store draws when it writes the invoice.
|
|
4892
|
+
*/
|
|
4893
|
+
interface NewSubscriptionInvoice extends Omit<SubscriptionInvoiceRecord, 'id' | 'number' | 'numberSequence' | 'lines' | 'createdAt'> {
|
|
4894
|
+
lines: NewSubscriptionInvoiceLine[];
|
|
4895
|
+
}
|
|
4896
|
+
/** How many digits an invoice number's sequence is written with, at least. */
|
|
4897
|
+
declare const INVOICE_SEQUENCE_DIGITS = 6;
|
|
4898
|
+
/**
|
|
4899
|
+
* The number an invoice carries: the prefix `config/saas.yaml` names, the year
|
|
4900
|
+
* the sequence counts in, and the sequence written with at least six digits —
|
|
4901
|
+
* `formatInvoiceNumber('AHP', 2026, 123)` is `AHP-2026-000123`.
|
|
4902
|
+
*/
|
|
4903
|
+
declare function formatInvoiceNumber(prefix: string, year: number, sequence: number): string;
|
|
4904
|
+
|
|
4905
|
+
/**
|
|
4906
|
+
* The manifest capability that announces the operator's download of an
|
|
4907
|
+
* invoice's archived document. The platform sets it where it serves the route.
|
|
4908
|
+
*/
|
|
4909
|
+
declare const INVOICE_DOCUMENT_CAPABILITY = "invoices.read";
|
|
4910
|
+
/** A rendered invoice: its bytes, as a file. */
|
|
4911
|
+
interface InvoiceDocument {
|
|
4912
|
+
content: Uint8Array;
|
|
4913
|
+
/** `application/pdf` for a ZUGFeRD invoice. */
|
|
4914
|
+
mediaType: string;
|
|
4915
|
+
/** What a person saving it would call it, such as `AHP-2026-000123.pdf`. */
|
|
4916
|
+
fileName: string;
|
|
4917
|
+
}
|
|
4918
|
+
/**
|
|
4919
|
+
* Renders an invoice into the file the tax adapter's law requires — the
|
|
4920
|
+
* application's own renderer, or the default one SaaSiCat ships.
|
|
4921
|
+
*
|
|
4922
|
+
* Given the invoice as it was issued, it renders the same bytes every time, so
|
|
4923
|
+
* a repeated attempt archives the file whose checksum was recorded. Whatever
|
|
4924
|
+
* it would take from the clock, such as a PDF's creation date, it takes from
|
|
4925
|
+
* the invoice's `issuedAt`. A renderer updated between two attempts renders
|
|
4926
|
+
* other bytes; while nothing is archived, those take the place of the ones
|
|
4927
|
+
* recorded, and the audit log says so (`SC-AUD-019`).
|
|
4928
|
+
*/
|
|
4929
|
+
interface InvoiceRenderer {
|
|
4930
|
+
render(invoice: SubscriptionInvoiceRecord): Promise<InvoiceDocument>;
|
|
4931
|
+
}
|
|
4932
|
+
/** A document to archive: the file, under its invoice, with the checksum recorded for it. */
|
|
4933
|
+
interface InvoiceDocumentToArchive extends InvoiceDocument {
|
|
4934
|
+
invoiceId: string;
|
|
4935
|
+
/** SHA-256 of `content`, lower-case hex. */
|
|
4936
|
+
checksum: string;
|
|
4937
|
+
archivedAt: Date;
|
|
4938
|
+
}
|
|
4939
|
+
/** A document as the archive hands it back. */
|
|
4940
|
+
type ArchivedInvoiceDocument = InvoiceDocumentToArchive;
|
|
4941
|
+
/**
|
|
4942
|
+
* Keeps each invoice's document, unalterable, for as long as the law asks —
|
|
4943
|
+
* in Germany 8 years from the end of the calendar year it was issued in, in
|
|
4944
|
+
* the European Union. The shipped adapters keep it in the database
|
|
4945
|
+
* (`SubscriptionInvoiceArchive`, which refuses every update and delete);
|
|
4946
|
+
* object storage with a retention lock is another way to implement it.
|
|
4947
|
+
*/
|
|
4948
|
+
interface InvoiceArchivePort {
|
|
4949
|
+
/**
|
|
4950
|
+
* Stores the document under its invoice. Storing it again with the same
|
|
4951
|
+
* checksum is the same write and changes nothing; another checksum for an
|
|
4952
|
+
* invoice already archived is refused with
|
|
4953
|
+
* `SUBSCRIPTION_INVOICE_DOCUMENT_CHANGED`, and the first stays.
|
|
4954
|
+
*/
|
|
4955
|
+
store(document: InvoiceDocumentToArchive): Promise<void>;
|
|
4956
|
+
/** The document archived under the invoice, or `null` where none is. */
|
|
4957
|
+
read(invoiceId: string): Promise<ArchivedInvoiceDocument | null>;
|
|
4958
|
+
/**
|
|
4959
|
+
* Why the archive would let a document it keeps be changed or removed, or
|
|
4960
|
+
* `null` where it would not. Asked when invoices start, which are refused
|
|
4961
|
+
* while it names a reason: an archive that is not unalterable keeps no
|
|
4962
|
+
* document as the law asks, and would only be found out at an audit.
|
|
4963
|
+
*/
|
|
4964
|
+
protectionProblem(): Promise<string | null>;
|
|
4965
|
+
}
|
|
4966
|
+
/** An invoice on its way to the subscriber. */
|
|
4967
|
+
interface InvoiceMail {
|
|
4968
|
+
invoice: SubscriptionInvoiceRecord;
|
|
4969
|
+
/** The invoice email on the subscriber's record. */
|
|
4970
|
+
to: string;
|
|
4971
|
+
/** The archived file, to attach. */
|
|
4972
|
+
document: InvoiceDocument;
|
|
4973
|
+
}
|
|
4974
|
+
/**
|
|
4975
|
+
* Sends an invoice to the subscriber with its file attached (`SC-PRIC-047`).
|
|
4976
|
+
*
|
|
4977
|
+
* The application words the message — in the subscriber's language, with a
|
|
4978
|
+
* link to the tenant's sign-in rather than to the file itself — and sends it
|
|
4979
|
+
* with its own mail infrastructure. It rejects where the message could not be
|
|
4980
|
+
* handed on; the platform then shows the failure to the operator, with the
|
|
4981
|
+
* rejection's message as the reason and the recipient's address taken out of
|
|
4982
|
+
* it, and tries again on the next run. The invoice stays issued either way: delivery is not
|
|
4983
|
+
* what makes it an invoice.
|
|
4984
|
+
*
|
|
4985
|
+
* A run claims the invoice before it calls this, so of several instances one
|
|
4986
|
+
* sends it. One that does not answer within a minute holds the invoice for
|
|
4987
|
+
* its answer: a late success is recorded, a late failure tried again.
|
|
4988
|
+
*/
|
|
4989
|
+
interface InvoiceMailPort {
|
|
4990
|
+
deliver(mail: InvoiceMail): Promise<void>;
|
|
4991
|
+
}
|
|
4992
|
+
/** Where an invoice's document stands, as the invoice records it. */
|
|
4993
|
+
interface SubscriptionInvoiceDocumentRecord {
|
|
4994
|
+
invoiceId: string;
|
|
4995
|
+
/** SHA-256 of the rendered file, lower-case hex, recorded before it is archived. */
|
|
4996
|
+
checksum: string;
|
|
4997
|
+
mediaType: string;
|
|
4998
|
+
fileName: string;
|
|
4999
|
+
/** In bytes. */
|
|
5000
|
+
size: number;
|
|
5001
|
+
renderedAt: Date;
|
|
5002
|
+
/** When the archive confirmed it; `null` while the invoice waits for its document. */
|
|
5003
|
+
archivedAt: Date | null;
|
|
5004
|
+
/**
|
|
5005
|
+
* When the run that is mailing it took it on; `null` while no run holds it.
|
|
5006
|
+
* A claim older than the lease is taken on by the next run.
|
|
5007
|
+
*/
|
|
5008
|
+
deliveryClaimedAt: Date | null;
|
|
5009
|
+
/** When it was handed to the mail; `null` until then. */
|
|
5010
|
+
deliveredAt: Date | null;
|
|
5011
|
+
/** The address it was sent to. */
|
|
5012
|
+
deliveredTo: string | null;
|
|
5013
|
+
}
|
|
5014
|
+
/** What is recorded of a rendering before its file is archived. */
|
|
5015
|
+
type NewInvoiceRendering = Pick<SubscriptionInvoiceDocumentRecord, 'checksum' | 'mediaType' | 'fileName' | 'size' | 'renderedAt'>;
|
|
5016
|
+
|
|
4278
5017
|
/** The adapter that gave an answer, recorded beside the answer. */
|
|
4279
5018
|
interface TaxAdapterIdentity {
|
|
4280
5019
|
/** The adapter's package name, such as `@saasicat/tax-de`. */
|
|
@@ -4433,6 +5172,53 @@ interface TaxAdapter extends TaxAdapterIdentity {
|
|
|
4433
5172
|
* an answer the adapter cannot read are each a check that did not complete.
|
|
4434
5173
|
*/
|
|
4435
5174
|
checkVatId(vatId: string, issuer: TaxIssuer): Promise<VatIdCheckOutcome>;
|
|
5175
|
+
/**
|
|
5176
|
+
* An invoice's tax by the rule this adapter's law names (`SC-PRIC-041`):
|
|
5177
|
+
* per rate, with the totals the invoice states. The amount it states is
|
|
5178
|
+
* the amount collected and the amount a payment settles.
|
|
5179
|
+
*/
|
|
5180
|
+
invoiceTax(lines: readonly InvoiceTaxLine[]): TaxPerRate;
|
|
5181
|
+
/**
|
|
5182
|
+
* What an invoice lacks of the content the law requires of it
|
|
5183
|
+
* (`SC-PRIC-027`), as the fields it misses — `issuer.taxIdentifier`,
|
|
5184
|
+
* `subscriber.postalCode` — or none where it is complete. Asked before the
|
|
5185
|
+
* number is drawn; an invoice that lacks anything is not issued.
|
|
5186
|
+
*/
|
|
5187
|
+
invoiceContentGaps(draft: InvoiceContentDraft): readonly string[];
|
|
5188
|
+
/**
|
|
5189
|
+
* What a rendered document lacks of the format the law requires
|
|
5190
|
+
* (`SC-PRIC-042`), or disagrees with in the invoice it was rendered from —
|
|
5191
|
+
* `format.embeddedXml`, `xml.totalGross` — or none where it is the file to
|
|
5192
|
+
* issue. A document with anything here is not archived, sent or offered;
|
|
5193
|
+
* the invoice keeps its number and waits for a document that passes.
|
|
5194
|
+
*/
|
|
5195
|
+
invoiceDocumentGaps(document: InvoiceDocument, invoice: SubscriptionInvoiceRecord): Promise<readonly string[]>;
|
|
5196
|
+
}
|
|
5197
|
+
/** A line as an invoice's tax is computed from it. */
|
|
5198
|
+
interface InvoiceTaxLine {
|
|
5199
|
+
net: number;
|
|
5200
|
+
/** In per cent. */
|
|
5201
|
+
rate: number;
|
|
5202
|
+
}
|
|
5203
|
+
/**
|
|
5204
|
+
* What an invoice says, without its number: what the adapter checks against
|
|
5205
|
+
* the content the law requires before the number is drawn.
|
|
5206
|
+
*/
|
|
5207
|
+
interface InvoiceContentDraft {
|
|
5208
|
+
issuer: LegalIdentity & PartyAddress;
|
|
5209
|
+
subscriber: LegalIdentity & PartyAddress;
|
|
5210
|
+
treatment: TaxTreatment;
|
|
5211
|
+
issueDate: string;
|
|
5212
|
+
dueDate: string;
|
|
5213
|
+
servicePeriod: {
|
|
5214
|
+
from: string;
|
|
5215
|
+
until: string;
|
|
5216
|
+
};
|
|
5217
|
+
lines: readonly {
|
|
5218
|
+
title: string;
|
|
5219
|
+
net: number;
|
|
5220
|
+
rate: number;
|
|
5221
|
+
}[];
|
|
4436
5222
|
}
|
|
4437
5223
|
|
|
4438
5224
|
type ContractLineItemKind = 'plan' | 'bundle' | 'discount';
|
|
@@ -5004,172 +5790,50 @@ type AdminVatIdCheckOutcome = {
|
|
|
5004
5790
|
/** When the service answered, as an ISO string. */
|
|
5005
5791
|
checkedAt: string;
|
|
5006
5792
|
service: string;
|
|
5007
|
-
/** Whether it is the check that counts for the number held now. */
|
|
5008
|
-
counts: boolean;
|
|
5009
|
-
} | {
|
|
5010
|
-
completed: false;
|
|
5011
|
-
reason: string;
|
|
5012
|
-
};
|
|
5013
|
-
/**
|
|
5014
|
-
* The answer to an operator's correction or check: the subscriber as it now
|
|
5015
|
-
* stands, and the check a VAT identification number got, where one was made.
|
|
5016
|
-
*/
|
|
5017
|
-
interface AdminSubscriberCorrected {
|
|
5018
|
-
subscriber: AdminTenantSubscriber;
|
|
5019
|
-
vatIdCheck: AdminVatIdCheckOutcome | null;
|
|
5020
|
-
}
|
|
5021
|
-
/**
|
|
5022
|
-
* One entry of a subscriber's history as the operator reads it, the latest
|
|
5023
|
-
* first: a correction of its legal identity, a change of its country or
|
|
5024
|
-
* business status, or a check of its VAT identification number. Dates are ISO
|
|
5025
|
-
* strings.
|
|
5026
|
-
*/
|
|
5027
|
-
type AdminSubscriberHistoryEntry = {
|
|
5028
|
-
kind: 'identity-corrected';
|
|
5029
|
-
at: string;
|
|
5030
|
-
by: string;
|
|
5031
|
-
previous: SubscriberIdentityValues;
|
|
5032
|
-
corrected: SubscriberIdentityValues;
|
|
5033
|
-
reason: string;
|
|
5034
|
-
} | {
|
|
5035
|
-
kind: 'tax-origin-changed';
|
|
5036
|
-
at: string;
|
|
5037
|
-
by: string;
|
|
5038
|
-
previous: SubscriberTaxOriginValues;
|
|
5039
|
-
changed: SubscriberTaxOriginValues;
|
|
5040
|
-
/** `null` for a change of the country with the contact details. */
|
|
5041
|
-
reason: string | null;
|
|
5042
|
-
} | {
|
|
5043
|
-
kind: 'vat-id-checked';
|
|
5044
|
-
at: string;
|
|
5045
|
-
vatId: string;
|
|
5046
|
-
valid: boolean;
|
|
5047
|
-
service: string;
|
|
5048
|
-
/** Whether it is the check that counts for the number held now. */
|
|
5049
|
-
counts: boolean;
|
|
5050
|
-
};
|
|
5051
|
-
|
|
5052
|
-
/**
|
|
5053
|
-
* What made the charge arise. activation: the first period of a subscription. renewal: a later period. planChange: what an immediate plan change adds. bundleBooking: the first, short period of an add-on. bundleChange: what an add-on's switch to a dearer version adds for the rest of its period. credit: a decision that reduces what is owed. correction: a counter-entry reversing an earlier charge, which is how the append-only journal answers a mistake.
|
|
5054
|
-
*/
|
|
5055
|
-
type SubscriberChargeOrigin = 'activation' | 'renewal' | 'planChange' | 'bundleBooking' | 'bundleChange' | 'credit' | 'correction';
|
|
5056
|
-
/**
|
|
5057
|
-
* Which kind of contract line the charge realises.
|
|
5058
|
-
*/
|
|
5059
|
-
type SubscriberChargeSource = 'plan' | 'bundle' | 'discount';
|
|
5060
|
-
/**
|
|
5061
|
-
* One charge in a subscriber's account: an amount that became due for a period, derived from a line of the contract in force. The journal is append-only — a charge is never updated, and a mistake is answered with a counter-entry rather than an edit, so the account says what happened rather than what somebody thinks today. A charge is net: the tax is decided by the tax adapter when the charge is invoiced, from the subscriber's origin on that day, and computed once per rate on the invoice.
|
|
5062
|
-
*/
|
|
5063
|
-
interface SubscriberCharge {
|
|
5064
|
-
/**
|
|
5065
|
-
* The charge's own identifier. Never shown to a customer as an invoice number: invoice numbering is sequential, gapless and legally constrained per country, and an identifier somebody has already seen on a screen cannot become one later without confusion.
|
|
5066
|
-
*/
|
|
5067
|
-
id: string;
|
|
5068
|
-
/**
|
|
5069
|
-
* The party the contract is concluded with, whose account this is. It outlives the tenant.
|
|
5070
|
-
*/
|
|
5071
|
-
subscriberId: string;
|
|
5072
|
-
/**
|
|
5073
|
-
* The tenant the subscription belonged to when the charge arose.
|
|
5074
|
-
*/
|
|
5075
|
-
tenantId: string;
|
|
5076
|
-
/**
|
|
5077
|
-
* The subscription the charge arose on. Part of the natural key.
|
|
5078
|
-
*/
|
|
5079
|
-
subscriptionId: string;
|
|
5080
|
-
/**
|
|
5081
|
-
* The contract whose line the charge realises.
|
|
5082
|
-
*/
|
|
5083
|
-
contractId: string;
|
|
5084
|
-
/**
|
|
5085
|
-
* The contract line the charge came from, so that every invoice line can be traced back to what was agreed.
|
|
5086
|
-
*/
|
|
5087
|
-
contractLineItemId: string;
|
|
5088
|
-
origin: SubscriberChargeOrigin;
|
|
5089
|
-
source: SubscriberChargeSource;
|
|
5090
|
-
/**
|
|
5091
|
-
* Which thing of its source the charge is for, stable across contracts: the subscription id for the plan, the booking id for an add-on, the discount's key for a discount. Part of the natural key (subscriptionId, source, sourceRef, periodStart, origin), which is unique — a charge derived twice is written once.
|
|
5092
|
-
*/
|
|
5093
|
-
sourceRef: string;
|
|
5094
|
-
/**
|
|
5095
|
-
* The start of the period the charge belongs to — the grouping key for an invoice.
|
|
5096
|
-
*/
|
|
5097
|
-
periodStart: string;
|
|
5098
|
-
periodEnd: string;
|
|
5099
|
-
/**
|
|
5100
|
-
* ISO 4217, as the contract line records it — recorded per charge so that a charge written in 2026 still means what it meant after the configured currency changes.
|
|
5101
|
-
*/
|
|
5102
|
-
currency: string;
|
|
5103
|
-
/**
|
|
5104
|
-
* Net, rounded to the currency's decimal places once, when the charge is written; the written figure is the truth from then on. Negative for a discount.
|
|
5105
|
-
*/
|
|
5106
|
-
amountNet: number;
|
|
5107
|
-
/**
|
|
5108
|
-
* When the amount became due. The account is ordered by this, not by when the row was written.
|
|
5109
|
-
*/
|
|
5110
|
-
bookedAt: string;
|
|
5111
|
-
createdAt: string;
|
|
5112
|
-
}
|
|
5113
|
-
|
|
5114
|
-
/** A charge as a store reads it back: the wire format, with its dates as dates. */
|
|
5115
|
-
interface SubscriberChargeRecord {
|
|
5116
|
-
id: string;
|
|
5117
|
-
subscriberId: string;
|
|
5118
|
-
tenantId: string;
|
|
5119
|
-
subscriptionId: string;
|
|
5120
|
-
contractId: string;
|
|
5121
|
-
contractLineItemId: string;
|
|
5122
|
-
origin: SubscriberChargeOrigin;
|
|
5123
|
-
source: SubscriberChargeSource;
|
|
5124
|
-
/** The subscription id for the plan, the booking id for an add-on, the discount's key. */
|
|
5125
|
-
sourceRef: string;
|
|
5126
|
-
periodStart: Date;
|
|
5127
|
-
periodEnd: Date;
|
|
5128
|
-
currency: string;
|
|
5129
|
-
/** Net, rounded to the cent when written. Negative for a discount. */
|
|
5130
|
-
amountNet: number;
|
|
5131
|
-
/** When the amount became due. */
|
|
5132
|
-
bookedAt: Date;
|
|
5133
|
-
createdAt: Date;
|
|
5134
|
-
}
|
|
5135
|
-
/** A charge to write: everything but what the store assigns. */
|
|
5136
|
-
type NewSubscriberCharge = Omit<SubscriberChargeRecord, 'id' | 'createdAt'>;
|
|
5793
|
+
/** Whether it is the check that counts for the number held now. */
|
|
5794
|
+
counts: boolean;
|
|
5795
|
+
} | {
|
|
5796
|
+
completed: false;
|
|
5797
|
+
reason: string;
|
|
5798
|
+
};
|
|
5137
5799
|
/**
|
|
5138
|
-
* The
|
|
5139
|
-
*
|
|
5140
|
-
* view only where it is set.
|
|
5800
|
+
* The answer to an operator's correction or check: the subscriber as it now
|
|
5801
|
+
* stands, and the check a VAT identification number got, where one was made.
|
|
5141
5802
|
*/
|
|
5142
|
-
|
|
5143
|
-
|
|
5144
|
-
|
|
5145
|
-
id: string;
|
|
5146
|
-
/** What the customer quotes, and what an invoice will carry. */
|
|
5147
|
-
customerNumber: string;
|
|
5148
|
-
legalName: string;
|
|
5149
|
-
}
|
|
5150
|
-
/** One charge of an account, with the name its contract line gives it. */
|
|
5151
|
-
interface AdminAccountEntry {
|
|
5152
|
-
/** The charge as the journal holds it. */
|
|
5153
|
-
charge: SubscriberCharge;
|
|
5154
|
-
/**
|
|
5155
|
-
* The contract line's own title, as it was when the contract was
|
|
5156
|
-
* concluded, or `null` where that line cannot be read.
|
|
5157
|
-
*/
|
|
5158
|
-
title: string | null;
|
|
5803
|
+
interface AdminSubscriberCorrected {
|
|
5804
|
+
subscriber: AdminTenantSubscriber;
|
|
5805
|
+
vatIdCheck: AdminVatIdCheckOutcome | null;
|
|
5159
5806
|
}
|
|
5160
5807
|
/**
|
|
5161
|
-
*
|
|
5162
|
-
*
|
|
5163
|
-
*
|
|
5164
|
-
*
|
|
5165
|
-
* No total: without invoices and payments, a sum would be what was charged so
|
|
5166
|
-
* far, and it would be read as what is owed.
|
|
5808
|
+
* One entry of a subscriber's history as the operator reads it, the latest
|
|
5809
|
+
* first: a correction of its legal identity, a change of its country or
|
|
5810
|
+
* business status, or a check of its VAT identification number. Dates are ISO
|
|
5811
|
+
* strings.
|
|
5167
5812
|
*/
|
|
5168
|
-
|
|
5169
|
-
|
|
5170
|
-
|
|
5171
|
-
|
|
5172
|
-
|
|
5813
|
+
type AdminSubscriberHistoryEntry = {
|
|
5814
|
+
kind: 'identity-corrected';
|
|
5815
|
+
at: string;
|
|
5816
|
+
by: string;
|
|
5817
|
+
previous: SubscriberIdentityValues;
|
|
5818
|
+
corrected: SubscriberIdentityValues;
|
|
5819
|
+
reason: string;
|
|
5820
|
+
} | {
|
|
5821
|
+
kind: 'tax-origin-changed';
|
|
5822
|
+
at: string;
|
|
5823
|
+
by: string;
|
|
5824
|
+
previous: SubscriberTaxOriginValues;
|
|
5825
|
+
changed: SubscriberTaxOriginValues;
|
|
5826
|
+
/** `null` for a change of the country with the contact details. */
|
|
5827
|
+
reason: string | null;
|
|
5828
|
+
} | {
|
|
5829
|
+
kind: 'vat-id-checked';
|
|
5830
|
+
at: string;
|
|
5831
|
+
vatId: string;
|
|
5832
|
+
valid: boolean;
|
|
5833
|
+
service: string;
|
|
5834
|
+
/** Whether it is the check that counts for the number held now. */
|
|
5835
|
+
counts: boolean;
|
|
5836
|
+
};
|
|
5173
5837
|
|
|
5174
5838
|
/**
|
|
5175
5839
|
* Snapshot form of a `Subscription` row for the EntitlementService
|
|
@@ -5381,6 +6045,26 @@ interface SubscriptionBundleRepository {
|
|
|
5381
6045
|
* them still move.
|
|
5382
6046
|
*/
|
|
5383
6047
|
listScheduledVersionsDue?(asOf: Date): Promise<SubscriptionBundleRecord[]>;
|
|
6048
|
+
/**
|
|
6049
|
+
* Ends at `input.at` the booking `subscriptionBundleId` whose cancellation
|
|
6050
|
+
* was declared for a later date, provided its effective date is still
|
|
6051
|
+
* `input.expectedCanceledEffectiveAt`, and answers it as it now stands;
|
|
6052
|
+
* null where its cancellation moved meanwhile, or it is gone. Both
|
|
6053
|
+
* cancellation fields become `input.at`. What a feature withdrawn for an
|
|
6054
|
+
* external reason lets a subscriber do, cancelled or not; a booking not
|
|
6055
|
+
* cancelled is ended through `cancel`.
|
|
6056
|
+
*
|
|
6057
|
+
* Optional, so a repository written before it keeps working; without it, a
|
|
6058
|
+
* booking already cancelled for a later date cannot be ended at once.
|
|
6059
|
+
*/
|
|
6060
|
+
endNow?(subscriptionBundleId: string, input: EndNowInput): Promise<SubscriptionBundleRecord | null>;
|
|
6061
|
+
}
|
|
6062
|
+
/** What ending at once something cancelled for a later date is told to write. */
|
|
6063
|
+
interface EndNowInput {
|
|
6064
|
+
/** The moment it ends, and the moment that is declared. */
|
|
6065
|
+
readonly at: Date;
|
|
6066
|
+
/** The effective date of the cancellation the caller read: the write is conditional on it. */
|
|
6067
|
+
readonly expectedCanceledEffectiveAt: Date;
|
|
5384
6068
|
}
|
|
5385
6069
|
/**
|
|
5386
6070
|
* Append-only repository for V3 SubscriptionContracts. Contracts are the
|
|
@@ -5565,6 +6249,113 @@ interface SubscriberLedgerRepository {
|
|
|
5565
6249
|
/** Every charge of one subscription, oldest period first. */
|
|
5566
6250
|
listBySubscription(subscriptionId: string, tx?: TransactionContext): Promise<SubscriberChargeRecord[]>;
|
|
5567
6251
|
}
|
|
6252
|
+
/**
|
|
6253
|
+
* The invoices issued from the charge journal, and the one number range they
|
|
6254
|
+
* are numbered in (`SC-PRIC-072`).
|
|
6255
|
+
*
|
|
6256
|
+
* An invoice is written once and never changed. Its number is drawn when it is
|
|
6257
|
+
* written, in the same transaction, so an invoice that fails to be written
|
|
6258
|
+
* leaves no gap; the range restarts at 1 each year.
|
|
6259
|
+
*/
|
|
6260
|
+
interface SubscriptionInvoiceRepository {
|
|
6261
|
+
/**
|
|
6262
|
+
* The subscriptions with a charge to invoice: a charge on no invoice in a
|
|
6263
|
+
* group — the charges booked at the same moment under the same contract —
|
|
6264
|
+
* that carries an amount (`SC-PRIC-048`). By id, at most `limit`, after
|
|
6265
|
+
* `after` where it is given, so a caller reads them page by page and a
|
|
6266
|
+
* subscription held back on one run never keeps the others from the next.
|
|
6267
|
+
*/
|
|
6268
|
+
listSubscriptionsWithUninvoicedCharges(page: {
|
|
6269
|
+
limit: number;
|
|
6270
|
+
after?: string;
|
|
6271
|
+
}, tx?: TransactionContext): Promise<string[]>;
|
|
6272
|
+
/** The charges of one subscription on no invoice, oldest period first. */
|
|
6273
|
+
listUninvoicedCharges(subscriptionId: string, tx?: TransactionContext): Promise<SubscriberChargeRecord[]>;
|
|
6274
|
+
/**
|
|
6275
|
+
* Draws the next number of the invoice's year and writes the invoice with
|
|
6276
|
+
* its lines, in one transaction — the caller's where it passes one. Two
|
|
6277
|
+
* calls at once draw two numbers one after the other, never the same one
|
|
6278
|
+
* and never with a gap between them.
|
|
6279
|
+
*
|
|
6280
|
+
* Refuses with `SUBSCRIPTION_INVOICE_CHARGE_INVOICED` (`moved`) where a
|
|
6281
|
+
* charge already stands on an invoice: nothing is written, and the number
|
|
6282
|
+
* is not drawn.
|
|
6283
|
+
*/
|
|
6284
|
+
issue(invoice: NewSubscriptionInvoice, tx?: TransactionContext): Promise<SubscriptionInvoiceRecord>;
|
|
6285
|
+
findById(id: string, tx?: TransactionContext): Promise<SubscriptionInvoiceRecord | null>;
|
|
6286
|
+
/** Every invoice of one subscriber, the latest number first. */
|
|
6287
|
+
listBySubscriber(subscriberId: string, tx?: TransactionContext): Promise<SubscriptionInvoiceRecord[]>;
|
|
6288
|
+
/**
|
|
6289
|
+
* The prefixes the issued invoices carry, at most two: one is the range,
|
|
6290
|
+
* a second one says the prefix was changed under it (`SC-PRIC-024`).
|
|
6291
|
+
*/
|
|
6292
|
+
listIssuedNumberPrefixes(tx?: TransactionContext): Promise<string[]>;
|
|
6293
|
+
/**
|
|
6294
|
+
* Records the rendering of an invoice's document before its file is
|
|
6295
|
+
* archived (`SC-AUD-019`), once. A rendering recorded again with the same
|
|
6296
|
+
* checksum is the same write and answers the record as it stands; another
|
|
6297
|
+
* checksum is refused with `SUBSCRIPTION_INVOICE_DOCUMENT_CHANGED`
|
|
6298
|
+
* (`moved`), and the first stays: `replaceRendering` is the one write that
|
|
6299
|
+
* puts another in its place.
|
|
6300
|
+
*/
|
|
6301
|
+
recordRendering(invoiceId: string, rendering: NewInvoiceRendering, tx?: TransactionContext): Promise<SubscriptionInvoiceDocumentRecord>;
|
|
6302
|
+
/**
|
|
6303
|
+
* Records a rendering in place of the one recorded with `replaced` as its
|
|
6304
|
+
* checksum, while the invoice is not archived (`SC-AUD-019`): until the
|
|
6305
|
+
* archive holds a file, nothing has been handed out. Answers the record as
|
|
6306
|
+
* it stands now, or `null` where the recorded checksum is another by now or
|
|
6307
|
+
* the invoice is archived — a run that read it before another one changed it.
|
|
6308
|
+
*/
|
|
6309
|
+
replaceRendering(invoiceId: string, rendering: NewInvoiceRendering, replaced: string, tx?: TransactionContext): Promise<SubscriptionInvoiceDocumentRecord | null>;
|
|
6310
|
+
/**
|
|
6311
|
+
* Records that the archive confirmed the document whose checksum is
|
|
6312
|
+
* `checksum`; `false` where it was already recorded, or the recorded
|
|
6313
|
+
* checksum is another.
|
|
6314
|
+
*/
|
|
6315
|
+
markArchived(invoiceId: string, at: Date, checksum: string, tx?: TransactionContext): Promise<boolean>;
|
|
6316
|
+
/**
|
|
6317
|
+
* Claims an archived invoice's mail for the run calling it at `at`: where
|
|
6318
|
+
* it is not delivered and no run holds it, or the run that holds it took it
|
|
6319
|
+
* on before `staleBefore`. `true` where this run holds it now — of two
|
|
6320
|
+
* concurrent calls exactly one does — so that an invoice is mailed once
|
|
6321
|
+
* however many instances run (`SC-PRIC-047`).
|
|
6322
|
+
*/
|
|
6323
|
+
claimDelivery(invoiceId: string, at: Date, staleBefore: Date, tx?: TransactionContext): Promise<boolean>;
|
|
6324
|
+
/**
|
|
6325
|
+
* Records that the invoice was handed to the mail, provided it is still
|
|
6326
|
+
* held by the claim taken at `claimedAt` and not delivered. `false` where it
|
|
6327
|
+
* is not: the claim went stale and another run took the invoice on.
|
|
6328
|
+
*/
|
|
6329
|
+
markDelivered(invoiceId: string, delivery: {
|
|
6330
|
+
claimedAt: Date;
|
|
6331
|
+
at: Date;
|
|
6332
|
+
to: string;
|
|
6333
|
+
}, tx?: TransactionContext): Promise<boolean>;
|
|
6334
|
+
/**
|
|
6335
|
+
* Lets go of the claim taken at `claimedAt`, so the next run tries again.
|
|
6336
|
+
* Does nothing where the invoice is delivered or held by another claim.
|
|
6337
|
+
*/
|
|
6338
|
+
releaseDelivery(invoiceId: string, claimedAt: Date, tx?: TransactionContext): Promise<void>;
|
|
6339
|
+
/** Where the invoice's document stands, or `null` before it was rendered. */
|
|
6340
|
+
findDocument(invoiceId: string, tx?: TransactionContext): Promise<SubscriptionInvoiceDocumentRecord | null>;
|
|
6341
|
+
/**
|
|
6342
|
+
* The invoices whose document the archive has not confirmed yet —
|
|
6343
|
+
* not rendered, or rendered and not archived (`SC-PRIC-033`). By id, at
|
|
6344
|
+
* most `limit`, after `after` where it is given.
|
|
6345
|
+
*/
|
|
6346
|
+
listAwaitingDocument(page: {
|
|
6347
|
+
limit: number;
|
|
6348
|
+
after?: string;
|
|
6349
|
+
}, tx?: TransactionContext): Promise<string[]>;
|
|
6350
|
+
/**
|
|
6351
|
+
* The invoices archived and not yet handed to the mail, page by page as
|
|
6352
|
+
* above — whether or not a run holds them, which `claimDelivery` decides.
|
|
6353
|
+
*/
|
|
6354
|
+
listAwaitingDelivery(page: {
|
|
6355
|
+
limit: number;
|
|
6356
|
+
after?: string;
|
|
6357
|
+
}, tx?: TransactionContext): Promise<string[]>;
|
|
6358
|
+
}
|
|
5568
6359
|
/**
|
|
5569
6360
|
* Display form of a subscription for the tenant self-service UI.
|
|
5570
6361
|
* Richer than `SubscriptionRecord` (which is only the aggregation form); contains
|
|
@@ -5907,6 +6698,14 @@ interface CancelSubscriptionInput {
|
|
|
5907
6698
|
terminateNow: boolean;
|
|
5908
6699
|
minimumTermUntil?: Date;
|
|
5909
6700
|
}
|
|
6701
|
+
/** What `endNow` answers with. */
|
|
6702
|
+
interface EndSubscriptionNowResult {
|
|
6703
|
+
/** False where the cancellation moved since it was read, and nothing was written. */
|
|
6704
|
+
ended: boolean;
|
|
6705
|
+
canceledAt: Date | null;
|
|
6706
|
+
canceledEffectiveAt: Date | null;
|
|
6707
|
+
status: string;
|
|
6708
|
+
}
|
|
5910
6709
|
/** What `cancelSubscription` answers with. */
|
|
5911
6710
|
interface CancelSubscriptionResult {
|
|
5912
6711
|
canceledAt: Date | null;
|
|
@@ -5976,6 +6775,22 @@ interface TenantSubscriptionWritePort {
|
|
|
5976
6775
|
* unchanged, which is the ordinary case.
|
|
5977
6776
|
*/
|
|
5978
6777
|
cancelSubscription(tenantId: string, input: CancelSubscriptionInput): Promise<CancelSubscriptionResult>;
|
|
6778
|
+
/**
|
|
6779
|
+
* Ends at `input.at` a subscription whose cancellation was declared for a
|
|
6780
|
+
* later date, provided its effective date is still
|
|
6781
|
+
* `input.expectedCanceledEffectiveAt`: both cancellation fields become
|
|
6782
|
+
* `input.at` and the status `CANCELED`. Answers `ended: false`, with the
|
|
6783
|
+
* stored fields, where the cancellation moved meanwhile. A conditional
|
|
6784
|
+
* claim, like `cancelSubscription`, so an end written in between is not
|
|
6785
|
+
* written over.
|
|
6786
|
+
*
|
|
6787
|
+
* What a feature withdrawn for an external reason lets a subscriber do,
|
|
6788
|
+
* cancelled or not; a subscription not cancelled is ended through
|
|
6789
|
+
* `cancelSubscription` with `terminateNow`. Optional, so a port written
|
|
6790
|
+
* before it keeps working; without it, a subscription already cancelled
|
|
6791
|
+
* for a later date cannot be ended at once.
|
|
6792
|
+
*/
|
|
6793
|
+
endNow?(tenantId: string, input: EndNowInput): Promise<EndSubscriptionNowResult>;
|
|
5979
6794
|
/**
|
|
5980
6795
|
* Atomic onboarding creation: sets plan + cycle + period window
|
|
5981
6796
|
* AND optionally calls a promo-redeem callback — all in a
|
|
@@ -7104,6 +7919,45 @@ interface VersionRetirementRepository {
|
|
|
7104
7919
|
findById(id: string): Promise<VersionRetirementRecord | null>;
|
|
7105
7920
|
}
|
|
7106
7921
|
|
|
7922
|
+
/**
|
|
7923
|
+
* Keeps every feature withdrawal: which feature, why, from when, the
|
|
7924
|
+
* reductions the operator named, when it was lifted, and when the
|
|
7925
|
+
* subscriptions it reaches were told. What it means for each of them is kept
|
|
7926
|
+
* beside it as a notice of kind `feature-withdrawn`, written in the
|
|
7927
|
+
* transaction that marks it told.
|
|
7928
|
+
*
|
|
7929
|
+
* An adapter translates. It does not decide whether a feature may be
|
|
7930
|
+
* withdrawn; it holds a feature to one withdrawal not yet lifted, so that two
|
|
7931
|
+
* operators announcing at once cannot both succeed, and makes lifting and
|
|
7932
|
+
* marking it told conditional on neither having happened yet.
|
|
7933
|
+
*/
|
|
7934
|
+
interface FeatureWithdrawalRepository {
|
|
7935
|
+
/**
|
|
7936
|
+
* Records a withdrawal, in the caller's transaction where one is given, and
|
|
7937
|
+
* returns it as stored — the id is the adapter's to assign. Returns null
|
|
7938
|
+
* where a withdrawal of the same feature is recorded and not lifted: the
|
|
7939
|
+
* database holds a feature to one, so of two concurrent calls exactly one
|
|
7940
|
+
* lands.
|
|
7941
|
+
*/
|
|
7942
|
+
create(data: NewFeatureWithdrawal, tx?: TransactionContext): Promise<FeatureWithdrawalRecord | null>;
|
|
7943
|
+
/** Every withdrawal, the most recently announced first. */
|
|
7944
|
+
list(): Promise<FeatureWithdrawalRecord[]>;
|
|
7945
|
+
findById(id: string): Promise<FeatureWithdrawalRecord | null>;
|
|
7946
|
+
/**
|
|
7947
|
+
* Records that the withdrawal `id` is lifted, provided it is not lifted
|
|
7948
|
+
* yet, and returns it as stored; null where it was lifted meanwhile or no
|
|
7949
|
+
* withdrawal has that id.
|
|
7950
|
+
*/
|
|
7951
|
+
lift(id: string, lift: FeatureWithdrawalLift, tx?: TransactionContext): Promise<FeatureWithdrawalRecord | null>;
|
|
7952
|
+
/**
|
|
7953
|
+
* Records that the subscriptions the withdrawal `id` reaches were told at
|
|
7954
|
+
* `at`, provided nobody recorded it yet, in the caller's transaction where
|
|
7955
|
+
* one is given. Returns whether this call recorded it: of an announcement
|
|
7956
|
+
* and a run telling the same withdrawal at once, exactly one does.
|
|
7957
|
+
*/
|
|
7958
|
+
markTold(id: string, at: Date, tx?: TransactionContext): Promise<boolean>;
|
|
7959
|
+
}
|
|
7960
|
+
|
|
7107
7961
|
/** Class reference usable as a DI token (e.g. the consumer's `PrismaService`). */
|
|
7108
7962
|
type PersistenceClassRef = abstract new (...args: never[]) => unknown;
|
|
7109
7963
|
/** DI token forms a persistence bundle may reference in `inject`. */
|
|
@@ -7191,6 +8045,10 @@ interface SaaSiCatPersistenceEntitlement {
|
|
|
7191
8045
|
subscriberRepository?: PersistenceProvider<SubscriberRepository>;
|
|
7192
8046
|
/** The charges a subscriber's contracts give rise to (`tenantBilling.chargeJournal`). */
|
|
7193
8047
|
subscriberLedgerRepository?: PersistenceProvider<SubscriberLedgerRepository>;
|
|
8048
|
+
/** The invoices issued from those charges (`tenantBilling.chargeJournal.invoices`). */
|
|
8049
|
+
subscriptionInvoiceRepository?: PersistenceProvider<SubscriptionInvoiceRepository>;
|
|
8050
|
+
/** The invoices' documents, kept in the database (`chargeJournal.invoices.archive`). */
|
|
8051
|
+
subscriptionInvoiceArchive?: PersistenceProvider<InvoiceArchivePort>;
|
|
7194
8052
|
subscriptionBundleRepository?: PersistenceProvider<SubscriptionBundleRepository>;
|
|
7195
8053
|
bundleRepository?: PersistenceProvider<BundleRepository>;
|
|
7196
8054
|
}
|
|
@@ -7234,6 +8092,11 @@ interface SaaSiCatPersistenceTenantBilling {
|
|
|
7234
8092
|
* version is off, and retiring a plan version is not affected.
|
|
7235
8093
|
*/
|
|
7236
8094
|
bundleVersionRetirements?: PersistenceProvider<BundleVersionRetirementRepository>;
|
|
8095
|
+
/**
|
|
8096
|
+
* The record of every feature withdrawal. Optional so an adapter written
|
|
8097
|
+
* before it keeps working; without it, withdrawing a feature is off.
|
|
8098
|
+
*/
|
|
8099
|
+
featureWithdrawals?: PersistenceProvider<FeatureWithdrawalRepository>;
|
|
7237
8100
|
}
|
|
7238
8101
|
/**
|
|
7239
8102
|
* The record of payment gateway callbacks and the payment methods they confirm
|
|
@@ -7677,6 +8540,79 @@ declare const BILLING_ERROR_CODES: {
|
|
|
7677
8540
|
* show it instead of guessing.
|
|
7678
8541
|
*/
|
|
7679
8542
|
readonly BUNDLE_VERSION_OFFER_CHANGED: "BUNDLE_VERSION_OFFER_CHANGED";
|
|
8543
|
+
/**
|
|
8544
|
+
* Withdrawing a feature is not offered: the installation's stores cannot
|
|
8545
|
+
* list everybody a withdrawal would reach.
|
|
8546
|
+
*/
|
|
8547
|
+
readonly FEATURE_WITHDRAWAL_UNAVAILABLE: "FEATURE_WITHDRAWAL_UNAVAILABLE";
|
|
8548
|
+
/** The catalogue knows no feature of that key, so there is nothing to withdraw. Carries `featureKey`. */
|
|
8549
|
+
readonly FEATURE_WITHDRAWAL_FEATURE_UNKNOWN: "FEATURE_WITHDRAWAL_FEATURE_UNKNOWN";
|
|
8550
|
+
/**
|
|
8551
|
+
* The date names a moment before now. A feature is withdrawn from the
|
|
8552
|
+
* moment it is announced or from a later date: the days before were
|
|
8553
|
+
* delivered.
|
|
8554
|
+
*/
|
|
8555
|
+
readonly FEATURE_WITHDRAWAL_DATE_IN_PAST: "FEATURE_WITHDRAWAL_DATE_IN_PAST";
|
|
8556
|
+
/** A withdrawal of the feature is not lifted yet; one at a time. Carries `featureKey`. */
|
|
8557
|
+
readonly FEATURE_WITHDRAWAL_OPEN: "FEATURE_WITHDRAWAL_OPEN";
|
|
8558
|
+
/**
|
|
8559
|
+
* A withdrawal of the feature is lifted only from a date after the one
|
|
8560
|
+
* named, so the two would overlap. Carries `featureKey` and the `date` a
|
|
8561
|
+
* new one may begin on.
|
|
8562
|
+
*/
|
|
8563
|
+
readonly FEATURE_WITHDRAWAL_OVERLAPS: "FEATURE_WITHDRAWAL_OVERLAPS";
|
|
8564
|
+
/**
|
|
8565
|
+
* A reduction names a plan or an add-on, in a rhythm, that no line the
|
|
8566
|
+
* withdrawal reaches is. Carries `kind`, `key` and `billingCycle`.
|
|
8567
|
+
*/
|
|
8568
|
+
readonly FEATURE_WITHDRAWAL_REDUCTION_NOT_REACHED: "FEATURE_WITHDRAWAL_REDUCTION_NOT_REACHED";
|
|
8569
|
+
/** A reduction is named twice. Carries `kind`, `key` and `billingCycle`. */
|
|
8570
|
+
readonly FEATURE_WITHDRAWAL_REDUCTION_NAMED_TWICE: "FEATURE_WITHDRAWAL_REDUCTION_NAMED_TWICE";
|
|
8571
|
+
/**
|
|
8572
|
+
* A reduction is more than the lowest price among the lines it reduces:
|
|
8573
|
+
* a price is reduced to nothing at most. Carries `key`, `billingCycle` and
|
|
8574
|
+
* that `price`.
|
|
8575
|
+
*/
|
|
8576
|
+
readonly FEATURE_WITHDRAWAL_REDUCTION_EXCEEDS_PRICE: "FEATURE_WITHDRAWAL_REDUCTION_EXCEEDS_PRICE";
|
|
8577
|
+
/**
|
|
8578
|
+
* The subscriptions the withdrawal reaches changed since the preview the
|
|
8579
|
+
* operator looked at. Nothing was announced; carries the current `preview`.
|
|
8580
|
+
*/
|
|
8581
|
+
readonly FEATURE_WITHDRAWAL_PREVIEW_CHANGED: "FEATURE_WITHDRAWAL_PREVIEW_CHANGED";
|
|
8582
|
+
/** No withdrawal has that id. Carries `withdrawalId`. */
|
|
8583
|
+
readonly FEATURE_WITHDRAWAL_NOT_FOUND: "FEATURE_WITHDRAWAL_NOT_FOUND";
|
|
8584
|
+
/** The withdrawal was lifted already. Carries the `date` it is lifted from. */
|
|
8585
|
+
readonly FEATURE_WITHDRAWAL_ALREADY_LIFTED: "FEATURE_WITHDRAWAL_ALREADY_LIFTED";
|
|
8586
|
+
/**
|
|
8587
|
+
* Nobody the withdrawal reaches has been told of it yet, and telling them
|
|
8588
|
+
* failed just now: a withdrawal is lifted only once they were. Nothing was
|
|
8589
|
+
* lifted; the next try, or the quarter-hourly run, tells them first.
|
|
8590
|
+
*/
|
|
8591
|
+
readonly FEATURE_WITHDRAWAL_NOT_TOLD_YET: "FEATURE_WITHDRAWAL_NOT_TOLD_YET";
|
|
8592
|
+
/**
|
|
8593
|
+
* The date a withdrawal would be lifted from lies before now: what was
|
|
8594
|
+
* withdrawn until then was withdrawn.
|
|
8595
|
+
*/
|
|
8596
|
+
readonly FEATURE_WITHDRAWAL_LIFT_IN_PAST: "FEATURE_WITHDRAWAL_LIFT_IN_PAST";
|
|
8597
|
+
/**
|
|
8598
|
+
* The withdrawal does not take its feature away now — its date is ahead,
|
|
8599
|
+
* or it was lifted — so nothing ends at once because of it. Carries
|
|
8600
|
+
* `featureKey`.
|
|
8601
|
+
*/
|
|
8602
|
+
readonly FEATURE_WITHDRAWAL_NOT_IN_EFFECT: "FEATURE_WITHDRAWAL_NOT_IN_EFFECT";
|
|
8603
|
+
/**
|
|
8604
|
+
* The withdrawal did not reach the subscription, or the line to end: it
|
|
8605
|
+
* was not running at the announcement, or no longer holds the feature.
|
|
8606
|
+
*/
|
|
8607
|
+
readonly FEATURE_WITHDRAWAL_DOES_NOT_REACH: "FEATURE_WITHDRAWAL_DOES_NOT_REACH";
|
|
8608
|
+
/** What was to be ended at once has ended already. */
|
|
8609
|
+
readonly FEATURE_WITHDRAWAL_ALREADY_ENDED: "FEATURE_WITHDRAWAL_ALREADY_ENDED";
|
|
8610
|
+
/**
|
|
8611
|
+
* A cancellation is declared for a later date, and the installation's
|
|
8612
|
+
* subscription write or booking store cannot bring it forward (`endNow`).
|
|
8613
|
+
* It ends as declared. Carries that `date`.
|
|
8614
|
+
*/
|
|
8615
|
+
readonly FEATURE_WITHDRAWAL_END_NOW_UNSUPPORTED: "FEATURE_WITHDRAWAL_END_NOW_UNSUPPORTED";
|
|
7680
8616
|
/** The subscription has ended; its plan can no longer be changed. */
|
|
7681
8617
|
readonly SUBSCRIPTION_ENDED: "SUBSCRIPTION_ENDED";
|
|
7682
8618
|
/** An active special contract blocks self-service plan changes. */
|
|
@@ -7823,6 +8759,57 @@ declare const CONTRACT_ERROR_CODES: {
|
|
|
7823
8759
|
readonly SUBSCRIPTION_CONTRACT_TAX_RATE_NOT_DECIDED: "SUBSCRIPTION_CONTRACT_TAX_RATE_NOT_DECIDED";
|
|
7824
8760
|
};
|
|
7825
8761
|
type ContractErrorCode = (typeof CONTRACT_ERROR_CODES)[keyof typeof CONTRACT_ERROR_CODES];
|
|
8762
|
+
/** Invoices issued from the charge journal (`SubscriptionInvoiceService`). */
|
|
8763
|
+
declare const INVOICE_ERROR_CODES: {
|
|
8764
|
+
/**
|
|
8765
|
+
* A charge already stands on an invoice: a second run issuing the same
|
|
8766
|
+
* charges lost the race. Nothing is written and no number is drawn.
|
|
8767
|
+
*/
|
|
8768
|
+
readonly SUBSCRIPTION_INVOICE_CHARGE_INVOICED: "SUBSCRIPTION_INVOICE_CHARGE_INVOICED";
|
|
8769
|
+
/**
|
|
8770
|
+
* The invoice lacks content the tax adapter requires of it — `missing`
|
|
8771
|
+
* names the fields, `adapter` the adapter. It draws no number and waits
|
|
8772
|
+
* until what is missing is supplied (`SC-PRIC-027`).
|
|
8773
|
+
*/
|
|
8774
|
+
readonly SUBSCRIPTION_INVOICE_CONTENT_INCOMPLETE: "SUBSCRIPTION_INVOICE_CONTENT_INCOMPLETE";
|
|
8775
|
+
/**
|
|
8776
|
+
* The contract's parties were copied by a migration and the operator has
|
|
8777
|
+
* not confirmed them yet; its charges are not invoiced until then
|
|
8778
|
+
* (`SC-AUD-012`).
|
|
8779
|
+
*/
|
|
8780
|
+
readonly SUBSCRIPTION_INVOICE_PARTIES_UNCONFIRMED: "SUBSCRIPTION_INVOICE_PARTIES_UNCONFIRMED";
|
|
8781
|
+
/**
|
|
8782
|
+
* A file of the invoice's document has another checksum than the one
|
|
8783
|
+
* recorded or archived for it (`invoiceId`, `recorded`, `rendered`), and
|
|
8784
|
+
* the first stays. The run takes the archived file as the one issued, or —
|
|
8785
|
+
* where nothing is archived — records the new rendering in place of the
|
|
8786
|
+
* old (`SC-AUD-019`); the invoice waits only where another run changed the
|
|
8787
|
+
* record or the archive in between, and the next run settles it.
|
|
8788
|
+
*/
|
|
8789
|
+
readonly SUBSCRIPTION_INVOICE_DOCUMENT_CHANGED: "SUBSCRIPTION_INVOICE_DOCUMENT_CHANGED";
|
|
8790
|
+
/**
|
|
8791
|
+
* The tax adapter refuses the rendered document — `missing` names what it
|
|
8792
|
+
* lacks or disagrees with, `adapter` the adapter. The invoice keeps its
|
|
8793
|
+
* number and waits for a document that passes (`SC-PRIC-042`).
|
|
8794
|
+
*/
|
|
8795
|
+
readonly SUBSCRIPTION_INVOICE_DOCUMENT_REFUSED: "SUBSCRIPTION_INVOICE_DOCUMENT_REFUSED";
|
|
8796
|
+
/**
|
|
8797
|
+
* The archived document does not match the checksum recorded when it was
|
|
8798
|
+
* rendered (`invoiceId`). It is not handed out (`SC-AUD-019`).
|
|
8799
|
+
*/
|
|
8800
|
+
readonly SUBSCRIPTION_INVOICE_DOCUMENT_MISMATCH: "SUBSCRIPTION_INVOICE_DOCUMENT_MISMATCH";
|
|
8801
|
+
/** The invoice's document is not archived yet (`invoiceId`); nothing is offered until it is (`SC-AUD-014`). */
|
|
8802
|
+
readonly SUBSCRIPTION_INVOICE_DOCUMENT_NOT_ARCHIVED: "SUBSCRIPTION_INVOICE_DOCUMENT_NOT_ARCHIVED";
|
|
8803
|
+
/** No invoice with this id (`invoiceId`). */
|
|
8804
|
+
readonly SUBSCRIPTION_INVOICE_NOT_FOUND: "SUBSCRIPTION_INVOICE_NOT_FOUND";
|
|
8805
|
+
/**
|
|
8806
|
+
* The subscriber's record holds no invoice email (`subscriberId`), so the
|
|
8807
|
+
* archived invoice cannot be sent (`SC-PRIC-047`); it is sent once one is
|
|
8808
|
+
* entered.
|
|
8809
|
+
*/
|
|
8810
|
+
readonly SUBSCRIPTION_INVOICE_NO_INVOICE_EMAIL: "SUBSCRIPTION_INVOICE_NO_INVOICE_EMAIL";
|
|
8811
|
+
};
|
|
8812
|
+
type InvoiceErrorCode = (typeof INVOICE_ERROR_CODES)[keyof typeof INVOICE_ERROR_CODES];
|
|
7826
8813
|
/** The parties contracts are concluded with (`SubscriberService`), and their absence. */
|
|
7827
8814
|
declare const SUBSCRIBER_ERROR_CODES: {
|
|
7828
8815
|
/**
|
|
@@ -8140,6 +9127,53 @@ declare const PLATFORM_ERROR_CODES: {
|
|
|
8140
9127
|
readonly SUBSCRIBER_BUSINESS_STATUS_REASON_REQUIRED: "SUBSCRIBER_BUSINESS_STATUS_REASON_REQUIRED";
|
|
8141
9128
|
/** A check of the subscriber's VAT identification number was asked for, and it holds none. */
|
|
8142
9129
|
readonly SUBSCRIBER_VAT_ID_MISSING: "SUBSCRIBER_VAT_ID_MISSING";
|
|
9130
|
+
/**
|
|
9131
|
+
* A charge already stands on an invoice: a second run issuing the same
|
|
9132
|
+
* charges lost the race. Nothing is written and no number is drawn.
|
|
9133
|
+
*/
|
|
9134
|
+
readonly SUBSCRIPTION_INVOICE_CHARGE_INVOICED: "SUBSCRIPTION_INVOICE_CHARGE_INVOICED";
|
|
9135
|
+
/**
|
|
9136
|
+
* The invoice lacks content the tax adapter requires of it — `missing`
|
|
9137
|
+
* names the fields, `adapter` the adapter. It draws no number and waits
|
|
9138
|
+
* until what is missing is supplied (`SC-PRIC-027`).
|
|
9139
|
+
*/
|
|
9140
|
+
readonly SUBSCRIPTION_INVOICE_CONTENT_INCOMPLETE: "SUBSCRIPTION_INVOICE_CONTENT_INCOMPLETE";
|
|
9141
|
+
/**
|
|
9142
|
+
* The contract's parties were copied by a migration and the operator has
|
|
9143
|
+
* not confirmed them yet; its charges are not invoiced until then
|
|
9144
|
+
* (`SC-AUD-012`).
|
|
9145
|
+
*/
|
|
9146
|
+
readonly SUBSCRIPTION_INVOICE_PARTIES_UNCONFIRMED: "SUBSCRIPTION_INVOICE_PARTIES_UNCONFIRMED";
|
|
9147
|
+
/**
|
|
9148
|
+
* A file of the invoice's document has another checksum than the one
|
|
9149
|
+
* recorded or archived for it (`invoiceId`, `recorded`, `rendered`), and
|
|
9150
|
+
* the first stays. The run takes the archived file as the one issued, or —
|
|
9151
|
+
* where nothing is archived — records the new rendering in place of the
|
|
9152
|
+
* old (`SC-AUD-019`); the invoice waits only where another run changed the
|
|
9153
|
+
* record or the archive in between, and the next run settles it.
|
|
9154
|
+
*/
|
|
9155
|
+
readonly SUBSCRIPTION_INVOICE_DOCUMENT_CHANGED: "SUBSCRIPTION_INVOICE_DOCUMENT_CHANGED";
|
|
9156
|
+
/**
|
|
9157
|
+
* The tax adapter refuses the rendered document — `missing` names what it
|
|
9158
|
+
* lacks or disagrees with, `adapter` the adapter. The invoice keeps its
|
|
9159
|
+
* number and waits for a document that passes (`SC-PRIC-042`).
|
|
9160
|
+
*/
|
|
9161
|
+
readonly SUBSCRIPTION_INVOICE_DOCUMENT_REFUSED: "SUBSCRIPTION_INVOICE_DOCUMENT_REFUSED";
|
|
9162
|
+
/**
|
|
9163
|
+
* The archived document does not match the checksum recorded when it was
|
|
9164
|
+
* rendered (`invoiceId`). It is not handed out (`SC-AUD-019`).
|
|
9165
|
+
*/
|
|
9166
|
+
readonly SUBSCRIPTION_INVOICE_DOCUMENT_MISMATCH: "SUBSCRIPTION_INVOICE_DOCUMENT_MISMATCH";
|
|
9167
|
+
/** The invoice's document is not archived yet (`invoiceId`); nothing is offered until it is (`SC-AUD-014`). */
|
|
9168
|
+
readonly SUBSCRIPTION_INVOICE_DOCUMENT_NOT_ARCHIVED: "SUBSCRIPTION_INVOICE_DOCUMENT_NOT_ARCHIVED";
|
|
9169
|
+
/** No invoice with this id (`invoiceId`). */
|
|
9170
|
+
readonly SUBSCRIPTION_INVOICE_NOT_FOUND: "SUBSCRIPTION_INVOICE_NOT_FOUND";
|
|
9171
|
+
/**
|
|
9172
|
+
* The subscriber's record holds no invoice email (`subscriberId`), so the
|
|
9173
|
+
* archived invoice cannot be sent (`SC-PRIC-047`); it is sent once one is
|
|
9174
|
+
* entered.
|
|
9175
|
+
*/
|
|
9176
|
+
readonly SUBSCRIPTION_INVOICE_NO_INVOICE_EMAIL: "SUBSCRIPTION_INVOICE_NO_INVOICE_EMAIL";
|
|
8143
9177
|
readonly CHECKOUT_OFFER_LINE_ITEMS_REQUIRED: "CHECKOUT_OFFER_LINE_ITEMS_REQUIRED";
|
|
8144
9178
|
readonly CHECKOUT_OFFER_PLAN_LINE_ITEM_REQUIRED: "CHECKOUT_OFFER_PLAN_LINE_ITEM_REQUIRED";
|
|
8145
9179
|
readonly CHECKOUT_OFFER_BUNDLE_LINE_ITEMS_REQUIRED: "CHECKOUT_OFFER_BUNDLE_LINE_ITEMS_REQUIRED";
|
|
@@ -8447,6 +9481,79 @@ declare const PLATFORM_ERROR_CODES: {
|
|
|
8447
9481
|
* show it instead of guessing.
|
|
8448
9482
|
*/
|
|
8449
9483
|
readonly BUNDLE_VERSION_OFFER_CHANGED: "BUNDLE_VERSION_OFFER_CHANGED";
|
|
9484
|
+
/**
|
|
9485
|
+
* Withdrawing a feature is not offered: the installation's stores cannot
|
|
9486
|
+
* list everybody a withdrawal would reach.
|
|
9487
|
+
*/
|
|
9488
|
+
readonly FEATURE_WITHDRAWAL_UNAVAILABLE: "FEATURE_WITHDRAWAL_UNAVAILABLE";
|
|
9489
|
+
/** The catalogue knows no feature of that key, so there is nothing to withdraw. Carries `featureKey`. */
|
|
9490
|
+
readonly FEATURE_WITHDRAWAL_FEATURE_UNKNOWN: "FEATURE_WITHDRAWAL_FEATURE_UNKNOWN";
|
|
9491
|
+
/**
|
|
9492
|
+
* The date names a moment before now. A feature is withdrawn from the
|
|
9493
|
+
* moment it is announced or from a later date: the days before were
|
|
9494
|
+
* delivered.
|
|
9495
|
+
*/
|
|
9496
|
+
readonly FEATURE_WITHDRAWAL_DATE_IN_PAST: "FEATURE_WITHDRAWAL_DATE_IN_PAST";
|
|
9497
|
+
/** A withdrawal of the feature is not lifted yet; one at a time. Carries `featureKey`. */
|
|
9498
|
+
readonly FEATURE_WITHDRAWAL_OPEN: "FEATURE_WITHDRAWAL_OPEN";
|
|
9499
|
+
/**
|
|
9500
|
+
* A withdrawal of the feature is lifted only from a date after the one
|
|
9501
|
+
* named, so the two would overlap. Carries `featureKey` and the `date` a
|
|
9502
|
+
* new one may begin on.
|
|
9503
|
+
*/
|
|
9504
|
+
readonly FEATURE_WITHDRAWAL_OVERLAPS: "FEATURE_WITHDRAWAL_OVERLAPS";
|
|
9505
|
+
/**
|
|
9506
|
+
* A reduction names a plan or an add-on, in a rhythm, that no line the
|
|
9507
|
+
* withdrawal reaches is. Carries `kind`, `key` and `billingCycle`.
|
|
9508
|
+
*/
|
|
9509
|
+
readonly FEATURE_WITHDRAWAL_REDUCTION_NOT_REACHED: "FEATURE_WITHDRAWAL_REDUCTION_NOT_REACHED";
|
|
9510
|
+
/** A reduction is named twice. Carries `kind`, `key` and `billingCycle`. */
|
|
9511
|
+
readonly FEATURE_WITHDRAWAL_REDUCTION_NAMED_TWICE: "FEATURE_WITHDRAWAL_REDUCTION_NAMED_TWICE";
|
|
9512
|
+
/**
|
|
9513
|
+
* A reduction is more than the lowest price among the lines it reduces:
|
|
9514
|
+
* a price is reduced to nothing at most. Carries `key`, `billingCycle` and
|
|
9515
|
+
* that `price`.
|
|
9516
|
+
*/
|
|
9517
|
+
readonly FEATURE_WITHDRAWAL_REDUCTION_EXCEEDS_PRICE: "FEATURE_WITHDRAWAL_REDUCTION_EXCEEDS_PRICE";
|
|
9518
|
+
/**
|
|
9519
|
+
* The subscriptions the withdrawal reaches changed since the preview the
|
|
9520
|
+
* operator looked at. Nothing was announced; carries the current `preview`.
|
|
9521
|
+
*/
|
|
9522
|
+
readonly FEATURE_WITHDRAWAL_PREVIEW_CHANGED: "FEATURE_WITHDRAWAL_PREVIEW_CHANGED";
|
|
9523
|
+
/** No withdrawal has that id. Carries `withdrawalId`. */
|
|
9524
|
+
readonly FEATURE_WITHDRAWAL_NOT_FOUND: "FEATURE_WITHDRAWAL_NOT_FOUND";
|
|
9525
|
+
/** The withdrawal was lifted already. Carries the `date` it is lifted from. */
|
|
9526
|
+
readonly FEATURE_WITHDRAWAL_ALREADY_LIFTED: "FEATURE_WITHDRAWAL_ALREADY_LIFTED";
|
|
9527
|
+
/**
|
|
9528
|
+
* Nobody the withdrawal reaches has been told of it yet, and telling them
|
|
9529
|
+
* failed just now: a withdrawal is lifted only once they were. Nothing was
|
|
9530
|
+
* lifted; the next try, or the quarter-hourly run, tells them first.
|
|
9531
|
+
*/
|
|
9532
|
+
readonly FEATURE_WITHDRAWAL_NOT_TOLD_YET: "FEATURE_WITHDRAWAL_NOT_TOLD_YET";
|
|
9533
|
+
/**
|
|
9534
|
+
* The date a withdrawal would be lifted from lies before now: what was
|
|
9535
|
+
* withdrawn until then was withdrawn.
|
|
9536
|
+
*/
|
|
9537
|
+
readonly FEATURE_WITHDRAWAL_LIFT_IN_PAST: "FEATURE_WITHDRAWAL_LIFT_IN_PAST";
|
|
9538
|
+
/**
|
|
9539
|
+
* The withdrawal does not take its feature away now — its date is ahead,
|
|
9540
|
+
* or it was lifted — so nothing ends at once because of it. Carries
|
|
9541
|
+
* `featureKey`.
|
|
9542
|
+
*/
|
|
9543
|
+
readonly FEATURE_WITHDRAWAL_NOT_IN_EFFECT: "FEATURE_WITHDRAWAL_NOT_IN_EFFECT";
|
|
9544
|
+
/**
|
|
9545
|
+
* The withdrawal did not reach the subscription, or the line to end: it
|
|
9546
|
+
* was not running at the announcement, or no longer holds the feature.
|
|
9547
|
+
*/
|
|
9548
|
+
readonly FEATURE_WITHDRAWAL_DOES_NOT_REACH: "FEATURE_WITHDRAWAL_DOES_NOT_REACH";
|
|
9549
|
+
/** What was to be ended at once has ended already. */
|
|
9550
|
+
readonly FEATURE_WITHDRAWAL_ALREADY_ENDED: "FEATURE_WITHDRAWAL_ALREADY_ENDED";
|
|
9551
|
+
/**
|
|
9552
|
+
* A cancellation is declared for a later date, and the installation's
|
|
9553
|
+
* subscription write or booking store cannot bring it forward (`endNow`).
|
|
9554
|
+
* It ends as declared. Carries that `date`.
|
|
9555
|
+
*/
|
|
9556
|
+
readonly FEATURE_WITHDRAWAL_END_NOW_UNSUPPORTED: "FEATURE_WITHDRAWAL_END_NOW_UNSUPPORTED";
|
|
8450
9557
|
/** The subscription has ended; its plan can no longer be changed. */
|
|
8451
9558
|
readonly SUBSCRIPTION_ENDED: "SUBSCRIPTION_ENDED";
|
|
8452
9559
|
/** An active special contract blocks self-service plan changes. */
|
|
@@ -8674,7 +9781,7 @@ declare const PLATFORM_ERROR_CODES: {
|
|
|
8674
9781
|
/** Email already taken (mapped from `PlatformUserExistsError`). */
|
|
8675
9782
|
readonly EMAIL_EXISTS: "EMAIL_EXISTS";
|
|
8676
9783
|
};
|
|
8677
|
-
type PlatformErrorCode = SetupErrorCode | AuthErrorCode | PromoErrorCode | CatalogErrorCode | BillingErrorCode | ContractErrorCode | SubscriberErrorCode | RegistrationErrorCode | PaymentErrorCode | SettingsErrorCode | MaintenanceErrorCode | TaxErrorCode;
|
|
9784
|
+
type PlatformErrorCode = SetupErrorCode | AuthErrorCode | PromoErrorCode | CatalogErrorCode | BillingErrorCode | ContractErrorCode | InvoiceErrorCode | SubscriberErrorCode | RegistrationErrorCode | PaymentErrorCode | SettingsErrorCode | MaintenanceErrorCode | TaxErrorCode;
|
|
8678
9785
|
/**
|
|
8679
9786
|
* Shape of a coded error response.
|
|
8680
9787
|
*
|
|
@@ -8759,7 +9866,13 @@ declare const OPTIONAL_CANONICAL_MODELS: {
|
|
|
8759
9866
|
readonly SubscriptionNotice: readonly ["tenantBilling.subscriptionNotices"];
|
|
8760
9867
|
readonly VersionRetirement: readonly ["tenantBilling.versionRetirements"];
|
|
8761
9868
|
readonly BundleVersionRetirement: readonly ["tenantBilling.bundleVersionRetirements"];
|
|
9869
|
+
readonly FeatureWithdrawal: readonly ["tenantBilling.featureWithdrawals"];
|
|
8762
9870
|
readonly SubscriberLedgerEntry: readonly ["entitlement.subscriberLedgerRepository"];
|
|
9871
|
+
readonly SubscriptionInvoice: readonly ["entitlement.subscriptionInvoiceRepository"];
|
|
9872
|
+
readonly SubscriptionInvoiceLine: readonly ["entitlement.subscriptionInvoiceRepository"];
|
|
9873
|
+
readonly SubscriptionInvoiceNumber: readonly ["entitlement.subscriptionInvoiceRepository"];
|
|
9874
|
+
readonly SubscriptionInvoiceDocument: readonly ["entitlement.subscriptionInvoiceRepository"];
|
|
9875
|
+
readonly SubscriptionInvoiceArchive: readonly ["entitlement.subscriptionInvoiceArchive"];
|
|
8763
9876
|
readonly PromoCodeHold: readonly ["promo.holdRepository"];
|
|
8764
9877
|
};
|
|
8765
9878
|
type OptionalCanonicalModel = keyof typeof OPTIONAL_CANONICAL_MODELS;
|
|
@@ -9765,6 +10878,10 @@ type IssuerIdentityChange =
|
|
|
9765
10878
|
*/
|
|
9766
10879
|
declare function classifyIssuerChange(recorded: LegalIdentity | null, issuer: PlanCatalogIssuer | undefined): IssuerIdentityChange;
|
|
9767
10880
|
|
|
10881
|
+
/** Every origin a charge may name, as a record or a line that copies one is checked against. */
|
|
10882
|
+
declare const SUBSCRIBER_CHARGE_ORIGINS: readonly SubscriberChargeOrigin[];
|
|
10883
|
+
/** Every source a charge may name. */
|
|
10884
|
+
declare const SUBSCRIBER_CHARGE_SOURCES: readonly SubscriberChargeSource[];
|
|
9768
10885
|
/**
|
|
9769
10886
|
* A `subscriber_ledger_entries` row as either adapter reads it back. The amount
|
|
9770
10887
|
* is `unknown` because a Prisma row carries a `Decimal` where a Drizzle row
|
|
@@ -9806,6 +10923,252 @@ declare function subscriberChargeColumns(charge: NewSubscriberCharge): Omit<Cano
|
|
|
9806
10923
|
amountNet: string;
|
|
9807
10924
|
};
|
|
9808
10925
|
|
|
10926
|
+
/**
|
|
10927
|
+
* A `subscription_invoices` row as either adapter reads it back. Amounts are
|
|
10928
|
+
* `unknown` because a Prisma row carries a `Decimal` where a Drizzle row carries
|
|
10929
|
+
* a numeric string, and days because one carries a `Date` at midnight UTC where
|
|
10930
|
+
* the other carries the text.
|
|
10931
|
+
*/
|
|
10932
|
+
interface CanonicalSubscriptionInvoiceRow {
|
|
10933
|
+
id: string;
|
|
10934
|
+
number: string;
|
|
10935
|
+
numberPrefix: string;
|
|
10936
|
+
numberYear: number;
|
|
10937
|
+
numberSequence: number;
|
|
10938
|
+
tenantId: string;
|
|
10939
|
+
subscriberId: string;
|
|
10940
|
+
subscriptionId: string;
|
|
10941
|
+
contractId: string;
|
|
10942
|
+
issuedAt: Date;
|
|
10943
|
+
issueDate: unknown;
|
|
10944
|
+
dueDate: unknown;
|
|
10945
|
+
servicePeriodFrom: unknown;
|
|
10946
|
+
servicePeriodUntil: unknown;
|
|
10947
|
+
currency: string;
|
|
10948
|
+
issuerParty: unknown;
|
|
10949
|
+
subscriberParty: unknown;
|
|
10950
|
+
footer: unknown;
|
|
10951
|
+
taxTreatment: unknown;
|
|
10952
|
+
taxes: unknown;
|
|
10953
|
+
totalNet: unknown;
|
|
10954
|
+
totalTax: unknown;
|
|
10955
|
+
totalGross: unknown;
|
|
10956
|
+
createdAt: Date;
|
|
10957
|
+
}
|
|
10958
|
+
/** A `subscription_invoice_lines` row as either adapter reads it back. */
|
|
10959
|
+
interface CanonicalSubscriptionInvoiceLineRow {
|
|
10960
|
+
id: string;
|
|
10961
|
+
invoiceId: string;
|
|
10962
|
+
position: number;
|
|
10963
|
+
chargeId: string;
|
|
10964
|
+
contractLineItemId: string;
|
|
10965
|
+
title: string;
|
|
10966
|
+
origin: string;
|
|
10967
|
+
source: string;
|
|
10968
|
+
periodFrom: unknown;
|
|
10969
|
+
periodUntil: unknown;
|
|
10970
|
+
amountNet: unknown;
|
|
10971
|
+
taxRate: unknown;
|
|
10972
|
+
}
|
|
10973
|
+
/** Reads an invoice row and its lines back as a record, the lines in their order. */
|
|
10974
|
+
declare function toSubscriptionInvoiceRecord(row: CanonicalSubscriptionInvoiceRow, lines: readonly CanonicalSubscriptionInvoiceLineRow[]): SubscriptionInvoiceRecord;
|
|
10975
|
+
/**
|
|
10976
|
+
* The columns an invoice is written with: amounts as decimal strings of two
|
|
10977
|
+
* places, as a charge's are, and days as their text, which each adapter turns
|
|
10978
|
+
* into what its date column takes.
|
|
10979
|
+
*/
|
|
10980
|
+
interface SubscriptionInvoiceColumns {
|
|
10981
|
+
number: string;
|
|
10982
|
+
numberPrefix: string;
|
|
10983
|
+
numberYear: number;
|
|
10984
|
+
numberSequence: number;
|
|
10985
|
+
tenantId: string;
|
|
10986
|
+
subscriberId: string;
|
|
10987
|
+
subscriptionId: string;
|
|
10988
|
+
contractId: string;
|
|
10989
|
+
issuedAt: Date;
|
|
10990
|
+
issueDate: CalendarDay;
|
|
10991
|
+
dueDate: CalendarDay;
|
|
10992
|
+
servicePeriodFrom: CalendarDay;
|
|
10993
|
+
servicePeriodUntil: CalendarDay;
|
|
10994
|
+
currency: string;
|
|
10995
|
+
issuerParty: SubscriptionInvoiceIssuer;
|
|
10996
|
+
subscriberParty: SubscriptionInvoiceSubscriber;
|
|
10997
|
+
footer: string[];
|
|
10998
|
+
taxTreatment: Record<string, unknown>;
|
|
10999
|
+
taxes: TaxAtRate[];
|
|
11000
|
+
totalNet: string;
|
|
11001
|
+
totalTax: string;
|
|
11002
|
+
totalGross: string;
|
|
11003
|
+
}
|
|
11004
|
+
/** The columns a line is written with, in the form `SubscriptionInvoiceColumns` describes. */
|
|
11005
|
+
interface SubscriptionInvoiceLineColumns {
|
|
11006
|
+
invoiceId: string;
|
|
11007
|
+
position: number;
|
|
11008
|
+
chargeId: string;
|
|
11009
|
+
contractLineItemId: string;
|
|
11010
|
+
title: string;
|
|
11011
|
+
origin: string;
|
|
11012
|
+
source: string;
|
|
11013
|
+
periodFrom: CalendarDay;
|
|
11014
|
+
periodUntil: CalendarDay;
|
|
11015
|
+
amountNet: string;
|
|
11016
|
+
taxRate: string;
|
|
11017
|
+
}
|
|
11018
|
+
/** The columns an invoice is written with, given the number the store drew. */
|
|
11019
|
+
declare function subscriptionInvoiceColumns(invoice: NewSubscriptionInvoice, drawn: {
|
|
11020
|
+
number: string;
|
|
11021
|
+
numberSequence: number;
|
|
11022
|
+
}): SubscriptionInvoiceColumns;
|
|
11023
|
+
/** The columns a line is written with. */
|
|
11024
|
+
declare function subscriptionInvoiceLineColumns(line: NewSubscriptionInvoiceLine, invoiceId: string): SubscriptionInvoiceLineColumns;
|
|
11025
|
+
/** A day as the `Date` at midnight UTC a Prisma `@db.Date` column takes. */
|
|
11026
|
+
declare function utcMidnightOf(day: CalendarDay): Date;
|
|
11027
|
+
|
|
11028
|
+
/**
|
|
11029
|
+
* A charge that already stands on an invoice: what the unique `chargeId` of
|
|
11030
|
+
* the invoice lines answers when two runs issue the same charges at once. The
|
|
11031
|
+
* invoice is not written and its number not drawn.
|
|
11032
|
+
*/
|
|
11033
|
+
declare function subscriptionInvoiceChargeInvoiced(chargeId: string): PersistenceRefusal;
|
|
11034
|
+
/**
|
|
11035
|
+
* A rendering of an invoice's document whose checksum is not the one recorded
|
|
11036
|
+
* or archived for it, refused: the first stays. Only the run replaces a
|
|
11037
|
+
* recorded rendering, and only while nothing is archived (`SC-AUD-019`).
|
|
11038
|
+
*/
|
|
11039
|
+
declare function subscriptionInvoiceDocumentChanged(invoiceId: string, recorded: string, rendered: string): PersistenceRefusal;
|
|
11040
|
+
|
|
11041
|
+
/** The charges one invoice issues: booked at the same moment under the same contract. */
|
|
11042
|
+
interface InvoiceGroup {
|
|
11043
|
+
contractId: string;
|
|
11044
|
+
bookedAt: Date;
|
|
11045
|
+
charges: SubscriberChargeRecord[];
|
|
11046
|
+
}
|
|
11047
|
+
/**
|
|
11048
|
+
* A subscription's charges left to invoice, as the invoices that issue them.
|
|
11049
|
+
*
|
|
11050
|
+
* The charges a billing period opens with are booked together and issued
|
|
11051
|
+
* together; a charge that arises later in the period is booked when it arises
|
|
11052
|
+
* and issued on an invoice of its own (`SC-PRIC-022`). A contract is the
|
|
11053
|
+
* agreement an invoice asks payment under, so charges of two contracts are
|
|
11054
|
+
* never on one invoice. The oldest come first, so numbers follow the charges.
|
|
11055
|
+
* A group whose charges are all zero issues no invoice (`SC-PRIC-048`) and is
|
|
11056
|
+
* left out; a charge of zero beside one that is not stays on its invoice.
|
|
11057
|
+
*/
|
|
11058
|
+
declare function invoiceGroupsOf(charges: readonly SubscriberChargeRecord[]): InvoiceGroup[];
|
|
11059
|
+
/** What an invoice is drawn up from. */
|
|
11060
|
+
interface InvoiceDraftInput {
|
|
11061
|
+
group: InvoiceGroup;
|
|
11062
|
+
/** The contract the group's charges belong to: where each line takes its title and place. */
|
|
11063
|
+
contractLines: readonly Pick<ContractLineItemRecord, 'id' | 'titleSnapshot'>[];
|
|
11064
|
+
tenantId: string;
|
|
11065
|
+
subscriberId: string;
|
|
11066
|
+
subscriber: SubscriptionInvoiceSubscriber;
|
|
11067
|
+
issuer: SubscriptionInvoiceIssuer;
|
|
11068
|
+
/** The footer lines `config/saas.yaml` names now (`SC-PRIC-077`). */
|
|
11069
|
+
footer: readonly string[];
|
|
11070
|
+
/** The treatment the tax adapter decides for the subscriber now (`SC-PRIC-043`). */
|
|
11071
|
+
treatment: TaxTreatment;
|
|
11072
|
+
/** The adapter's rule for the tax of an invoice (`SC-PRIC-041`). */
|
|
11073
|
+
tax: (lines: readonly InvoiceTaxLine[]) => TaxPerRate;
|
|
11074
|
+
issuedAt: Date;
|
|
11075
|
+
/** The installation's time zone, which every day the invoice states is read in (`SC-PRIC-045`). */
|
|
11076
|
+
timeZone: string;
|
|
11077
|
+
numberPrefix: string;
|
|
11078
|
+
/** Days from the issue date to the due date (`SC-PRIC-046`). */
|
|
11079
|
+
paymentTermDays: number;
|
|
11080
|
+
}
|
|
11081
|
+
/**
|
|
11082
|
+
* The invoice `input.group` makes. Its lines follow the contract's lines, so
|
|
11083
|
+
* the invoice reads in the order the contract does, each naming its charge and
|
|
11084
|
+
* its contract line (`SC-AUD-013`) and taking the contract line's title. Every
|
|
11085
|
+
* line carries the treatment's rate, and the tax is the adapter's, computed
|
|
11086
|
+
* once per rate over the lines' net amounts.
|
|
11087
|
+
*
|
|
11088
|
+
* Throws where the charges contradict each other — a currency or a contract
|
|
11089
|
+
* line the group cannot have — which no invoice can be drawn up from.
|
|
11090
|
+
*/
|
|
11091
|
+
declare function draftSubscriptionInvoice(input: InvoiceDraftInput): NewSubscriptionInvoice;
|
|
11092
|
+
/** What the tax adapter checks of an invoice before its number is drawn (`SC-PRIC-027`). */
|
|
11093
|
+
declare function invoiceContentDraftOf(invoice: NewSubscriptionInvoice): InvoiceContentDraft;
|
|
11094
|
+
|
|
11095
|
+
/** A recorded settings change, as far as the issuer's history needs it. */
|
|
11096
|
+
type IssuerHistoryStep = Pick<SettingsChangeRecord, 'previous' | 'current'>;
|
|
11097
|
+
/**
|
|
11098
|
+
* The issuer an invoice of a contract names.
|
|
11099
|
+
*
|
|
11100
|
+
* `copy` is the issuer the contract copied when it was concluded; `configured`
|
|
11101
|
+
* the issuer `config/saas.yaml` names on the issue date, as a contract would
|
|
11102
|
+
* copy it now (`contractPartiesOf`), or `null` where it names none; `history`
|
|
11103
|
+
* the recorded settings changes, the oldest first.
|
|
11104
|
+
*/
|
|
11105
|
+
declare function invoiceIssuerOf(copy: ContractIssuerParty, configured: ContractIssuerParty | null, history: readonly IssuerHistoryStep[]): SubscriptionInvoiceIssuer;
|
|
11106
|
+
/**
|
|
11107
|
+
* The footer lines an invoice carries (`SC-PRIC-077`): those `config/saas.yaml`
|
|
11108
|
+
* names, where the invoice names the issuer the file names; none where it names
|
|
11109
|
+
* the contract's copy of another entity, whose register and account the lines
|
|
11110
|
+
* are not.
|
|
11111
|
+
*/
|
|
11112
|
+
declare function invoiceFooterOf(issuer: SubscriptionInvoiceIssuer, configured: ContractIssuerParty | null, footer: readonly string[]): string[];
|
|
11113
|
+
|
|
11114
|
+
/** A `subscription_invoice_documents` row as either adapter reads it back. */
|
|
11115
|
+
interface CanonicalSubscriptionInvoiceDocumentRow {
|
|
11116
|
+
invoiceId: string;
|
|
11117
|
+
checksum: string;
|
|
11118
|
+
mediaType: string;
|
|
11119
|
+
fileName: string;
|
|
11120
|
+
size: unknown;
|
|
11121
|
+
renderedAt: Date;
|
|
11122
|
+
archivedAt: Date | null;
|
|
11123
|
+
deliveryClaimedAt: Date | null;
|
|
11124
|
+
deliveredAt: Date | null;
|
|
11125
|
+
deliveredTo: string | null;
|
|
11126
|
+
}
|
|
11127
|
+
/** A `subscription_invoice_archive` row as either adapter reads it back. */
|
|
11128
|
+
interface CanonicalSubscriptionInvoiceArchiveRow {
|
|
11129
|
+
invoiceId: string;
|
|
11130
|
+
checksum: string;
|
|
11131
|
+
mediaType: string;
|
|
11132
|
+
fileName: string;
|
|
11133
|
+
content: Uint8Array;
|
|
11134
|
+
archivedAt: Date;
|
|
11135
|
+
}
|
|
11136
|
+
/** Whether `value` is a checksum as the platform records one. */
|
|
11137
|
+
declare function isInvoiceDocumentChecksum(value: unknown): value is string;
|
|
11138
|
+
declare function toSubscriptionInvoiceDocumentRecord(row: CanonicalSubscriptionInvoiceDocumentRow): SubscriptionInvoiceDocumentRecord;
|
|
11139
|
+
declare function toArchivedInvoiceDocument(row: CanonicalSubscriptionInvoiceArchiveRow): ArchivedInvoiceDocument;
|
|
11140
|
+
/**
|
|
11141
|
+
* The triggers of `subscription_invoice_archive` that keep a document as it
|
|
11142
|
+
* was issued (`1.0-an-invoice-document-is-archived.postgres.sql`): one refuses
|
|
11143
|
+
* every update and delete of a row, the other every truncate of the table.
|
|
11144
|
+
*/
|
|
11145
|
+
declare const INVOICE_ARCHIVE_TRIGGERS: readonly ["subscription_invoice_archive_is_kept", "subscription_invoice_archive_is_not_emptied"];
|
|
11146
|
+
/**
|
|
11147
|
+
* Why the database archive would let a document be changed, given the
|
|
11148
|
+
* triggers that fire on its table, or `null` where both of its own do. Shared
|
|
11149
|
+
* by both adapters, which read the enabled triggers from the catalogue.
|
|
11150
|
+
*
|
|
11151
|
+
* A database created from the fragments by `db push` alone, or a migration run
|
|
11152
|
+
* before the table existed, has none: the triggers are SQL the Prisma DSL
|
|
11153
|
+
* cannot express.
|
|
11154
|
+
*/
|
|
11155
|
+
declare function invoiceArchiveProtectionProblem(enabledTriggers: readonly string[]): string | null;
|
|
11156
|
+
|
|
11157
|
+
/** The VAT category of EN 16931 (UNTDID 5305) a line and a breakdown name. */
|
|
11158
|
+
type VatCategory = 'S' | 'E' | 'AE' | 'O';
|
|
11159
|
+
/** The category EN 16931 names for a treatment an adapter decides. */
|
|
11160
|
+
declare function vatCategoryOf(kind: TaxTreatmentKind): VatCategory;
|
|
11161
|
+
/** Whether `text` can stand in an XML document as it is. */
|
|
11162
|
+
declare function holdsOnlyXmlCharacters(text: string): boolean;
|
|
11163
|
+
/**
|
|
11164
|
+
* `text` as an e-invoice's XML states it, which is what every XML parser reads
|
|
11165
|
+
* back from it: a character XML cannot hold becomes `?`, as the page shows a
|
|
11166
|
+
* character its font has no glyph for (`SC-PRIC-078`), and a carriage return
|
|
11167
|
+
* is the line feed XML 1.0 hands over in its place (§ 2.11). The renderer
|
|
11168
|
+
* writes this, and the adapter's check compares the record through it.
|
|
11169
|
+
*/
|
|
11170
|
+
declare function asXmlReadsIt(text: string): string;
|
|
11171
|
+
|
|
9809
11172
|
/** A `subscribers` row as either adapter reads it back. */
|
|
9810
11173
|
interface CanonicalSubscriberRow {
|
|
9811
11174
|
id: string;
|
|
@@ -10219,4 +11582,4 @@ declare function resolveErrorMessage(body: ResolvableErrorBody, overrides?: Part
|
|
|
10219
11582
|
|
|
10220
11583
|
declare const ERROR_MESSAGES_DE: Record<PlatformErrorCode, string>;
|
|
10221
11584
|
|
|
10222
|
-
export { ACTIVE_SUBSCRIPTION_CONTRACT_STATUSES, AUTH_ERROR_CODES, type ActionKey, type ActivationOrchestrator, type ActivePlanVersionWhere, type ActivePlanVersionWhereWithEndsAt, type ActiveVersionWhere, type ActiveVersionWhereWithEndsAt, type ActorTag, type AdminAccountEntry, type AdminAccountHolder, type AdminActor, type AdminAuditListFilter, type AdminManifest, type AdminResourcesPort, type AdminSubscriberAccount, type AdminSubscriberAttention, type AdminSubscriberCorrected, type AdminSubscriberHistoryEntry, type AdminSubscriptionListRow, type AdminTenantDetail, type AdminTenantListFilter, type AdminTenantListRow, type AdminTenantStateResult, type AdminTenantSubscriber, type AdminUserListFilter, type AdminUserListRow, type AdminVatIdCheckOutcome, type AppliedSettingsPort, type AppliedSettingsRecord, type AppliedSettingsValues, type ApplyOnboardingSelectionInput, type ApplyOnboardingSelectionResult, type ApprovedCatalogKeys, type AuditActionDef, type AuditActor, type AuditEntry, type AuditPort, type AuditQuery, type AuditQueryPort, type AuditStatsPort, type AuditStatsSnapshot, type AuthErrorCode, BILLING_ERROR_CODES, BUNDLE_PRICE_LOOKUP_LIMIT, BUNDLE_VERSION_RETIREMENT_CAPABILITY, type BillingCycle, type BillingErrorCode, type BundleAvailabilityState, type BundleCompatibility, type BundleFeatureShape, type BundleListFilter, type BundlePricingOverride, type BundleRepository, type BundleRetirementAnnounced, type BundleRetirementPreview, type BundleRetirementReachedRow, type BundleRetirementSkipReason, type BundleRetirementSkippedRow, type BundleRetirementSwitchResult, type BundleRetirementSwitchTerms, type BundleRow, type BundleVersionFields, type BundleVersionMutationResult, type BundleVersionOfferView, type BundleVersionOfferedNotice, type BundleVersionRetiredNotice, type BundleVersionRetirementRecord, type BundleVersionRetirementReminder, type BundleVersionRetirementRepository, type BundleVersionRetirementView, type BundleVersionRow, type BundleVersionSide, type BundleVersionSwitchResult, CATALOGUE_KEYS, CATALOG_ERROR_CODES, CONTRACT_ERROR_CODES, CUSTOM_LIMITS_KEYS, type CancelSubscriptionBundleData, type CancelSubscriptionInput, type CancelSubscriptionResult, type CancellationNoticePeriods, type CanonicalBundleVersionRetirementRow, type CanonicalContractLineItemRow, type CanonicalContractRow, type CanonicalMaintenanceWindowRow, type CanonicalPlanRow, type CanonicalPlanVersionRow, type CanonicalRunningContractRow, type CanonicalSubscriberChargeRow, type CanonicalSubscriberCorrectionRow, type CanonicalSubscriberPaymentMethodRow, type CanonicalSubscriberRow, type CanonicalSubscriberTaxOriginChangeRow, type CanonicalSubscriberVatIdCheckRow, type CanonicalSubscriptionBundleRow, type CanonicalSubscriptionNoticeRow, type CanonicalVersionRetirementRow, type CapabilityCatalogEntryRow, type CapabilityCodeStatus, type CapabilityKey, type CapabilityKind, type CatalogEntryFilter, type CatalogEntryI18n, type CatalogEntryI18nFields, type CatalogEntryRepository, type CatalogErrorCode, type CatalogVersionKind, 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 ConcurrencyGate, 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 CustomLimits, 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 HeldVatId, type ImmediatePlanChangeInput, type InvoiceLineItemSnapshot, type IssuerCorrectionFault, type IssuerIdentityChange, type KpiCardDef, type KpiDisplayHint, LEGAL_IDENTITY_FIELDS, type LegalIdentity, type LegalIdentityField, MAINTENANCE_CAPABILITY, MAINTENANCE_ERROR_CODES, MAINTENANCE_MESSAGE_MAX_LENGTH, MAINTENANCE_STATE_MAX_AGE_SECONDS, MARKETING_PRIORITY_MAX, MARKETING_PRIORITY_MIN, type MaintenanceErrorCode, type MaintenanceLockView, type MaintenanceNotificationPort, type MaintenanceOverview, type MaintenanceStatusView, type MaintenanceUnlockView, type MaintenanceWindowChanges, type MaintenanceWindowEvent, type MaintenanceWindowPort, type MaintenanceWindowRecord, type MaintenanceWindowStage, type MaintenanceWindowStatus, type MaintenanceWindowView, type ManifestAccessPort, type ManifestContribution, type MarketingProjectionFilter, type MarketingProjectionRepository, type MarketingProjectionRow, type MarketingSettingsRepository, type MarketingSettingsRow, type MarketingTargetType, type MarketingTopFeature, type MaskedPaymentMethod, type MfaPort, NO_SCHEDULED_CHANGE, type NewBundleVersionRetirement, type NewContractLineItemData, type NewMaintenanceWindow, type NewSettingsChange, type NewSubscriberCharge, type NewSubscriberDetails, type NewSubscriptionContractData, type NewVersionRetirement, type NotToldReasons, type NoticeToRecord, OPTIONAL_CANONICAL_MODELS, OTP_RATE_LIMIT_MAX_SENDS, OTP_RATE_LIMIT_WINDOW_MINUTES, OTP_TTL_MINUTES, OTP_VERIFY_MAX_ATTEMPTS, type OnboardingPromoRedemption, type OnboardingSelectionRequest, type OnboardingSelectionResponse, type OptionalBundleMember, type OptionalCanonicalModel, type OrderlyRetirementSettings, 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, PersistenceRefusal, type PersistenceRefusalReason, 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 PlanCatalogTax, type PlanCatalogTenantBilling, type PlanDef, type PlanId, type PlanListFilter, type PlanRepository, type PlanRow, type PlanVersion, type PlanVersionFields, type PlanVersionMutationResult, type PlanVersionRecord, type PlanVersionRepository, type PlanVersionRow, type PlatformErrorBody, type PlatformErrorCode, type PlatformJobActor, 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, RETIREMENT_REMINDER_LEAD_DAYS, type ReadCustomLimits, type ReassignTenantAdminCliResult, type RecommendablePlan, type RecordSubscriberPaymentMethodData, type RecordSubscriberPaymentMethodOutcome, type RecordSubscriberPaymentMethodResult, type RecordedVatIdCheck, 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 RetiredBundleVersionRef, type RetiredVersionRef, type RetirementAnnounced, type RetirementBlocker, type RetirementMoveRun, type RetirementPreview, type RetirementPricedSide, type RetirementProgress, type RetirementReachedRow, type RetirementSide, type RetirementSkipReason, type RetirementSkippedRow, type RetirementSwitchResult, type RetirementSwitchTerms, type ReviewCatalogEntryData, type RlsBypassPort, type RunningContractIssuer, type RunningContractIssuers, SETTINGS_ERROR_CODES, SETUP_ERROR_CODES, SUBSCRIBER_ACCOUNT_CAPABILITY, SUBSCRIBER_ATTENTION_CAPABILITY, SUBSCRIBER_ATTENTION_PAGE_SIZE, SUBSCRIBER_CORRECTION_CAPABILITY, SUBSCRIBER_ERROR_CODES, SUBSCRIBER_INVOICE_ADDRESS_FIELDS, SUBSCRIBER_STANDING_CAPABILITY, SUBSCRIBER_TAX_ORIGIN_FIELDS, type SaaSiCatPersistenceAdapter, type SaaSiCatPersistenceAdminResources, type SaaSiCatPersistenceCatalog, type SaaSiCatPersistenceCore, type SaaSiCatPersistenceEntitlement, type SaaSiCatPersistencePayments, type SaaSiCatPersistencePromo, type SaaSiCatPersistenceTenantBilling, type SaveRegistrationConfigInput, type SaveRegistrationConfigResult, type ScheduledChangeColumns, type ScheduledPlanChangeInput, type SecretSealer, 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 SubscriberBusinessStatusData, type SubscriberBusinessStatusResult, type SubscriberCharge, type SubscriberChargeOrigin, type SubscriberChargeRecord, type SubscriberChargeSource, type SubscriberContact, type SubscriberContactChange, type SubscriberCorrectionData, type SubscriberCorrectionRecord, type SubscriberCorrectionResult, type SubscriberDetails, type SubscriberErrorCode, type SubscriberIdentityCorrection, type SubscriberIdentityDelta, type SubscriberIdentityValues, type SubscriberInvoiceAddressField, type SubscriberLedgerRepository, type SubscriberPaymentMethodRecord, type SubscriberPaymentMethodReference, type SubscriberPaymentMethodRepository, type SubscriberPaymentMethodSetupData, type SubscriberPaymentMethodSetupMatch, type SubscriberPaymentMethodStatus, type SubscriberReadiness, type SubscriberRecord, type SubscriberRepository, type SubscriberTaxOrigin, type SubscriberTaxOriginChangeRecord, type SubscriberTaxOriginField, type SubscriberTaxOriginValues, type SubscriberTaxStatus, type SubscriberVatIdCheckRecord, type SubscriberVatIdCheckResult, type SubscriberWithCurrentCheck, type Subscription, type SubscriptionBundleRecord, type SubscriptionBundleRepository, type SubscriptionBundleView, type SubscriptionContractFilter, type SubscriptionContractInvoiceSnapshot, type SubscriptionContractParties, type SubscriptionContractPriceSnapshot, type SubscriptionContractRecord, type SubscriptionContractRepository, type SubscriptionContractStatus, type SubscriptionNotice, type SubscriptionNoticeDelivery, type SubscriptionNoticeKey, type SubscriptionNoticeKind, type SubscriptionNoticePort, type SubscriptionNoticeRecord, type SubscriptionNoticeRepository, type SubscriptionRecord, type SubscriptionRepository, type SubscriptionStatsPort, type SubscriptionStatsSnapshot, type SubscriptionStatus, type SubscriptionUsagePort, type SubscriptionUsageRecord, type SuperAdminProvisioningPort, type SupersedeSubscriptionContractData, type SyncDiscoveryResult, TAX_ERROR_CODES, TAX_TREATMENT_KINDS, type TaxAdapter, type TaxAdapterFactory, type TaxAdapterIdentity, type TaxDecision, type TaxDecisionRequest, type TaxErrorCode, type TaxIssuer, type TaxOriginWrite, type TaxTreatment, type TaxTreatmentKind, type TenantActionDef, type TenantColumnDef, type TenantDto, type TenantListFilter, type TenantPort, type TenantSubscriptionUsage, 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, VERSION_RETIREMENT_CAPABILITY, type VatIdCheck, type VatIdCheckOutcome, type VerifyRegistrationOtpResult, type VersionChange, type VersionChangeDirection, type VersionEditability, type VersionEditableReason, type VersionOffer, type VersionOfferClass, type VersionOfferFields, type VersionOfferSide, type VersionOfferView, type VersionOfferedNotice, type VersionRetiredNotice, type VersionRetirementRecord, type VersionRetirementReminder, type VersionRetirementRepository, type VersionRetirementView, type VersionSale, type VersionSaleDates, type VersionSaleKind, type VersionSwitchResult, type VersionWindow, type VersionedEntityBase, applyPromo, assertPersistenceCapabilities, buildActivePlanVersionWhere, buildActiveVersionWhere, buildFeatureRequiresIndex, bundleDraftDefaults, bundleKeyTaken, bundleStemDefaults, canonicalJson, canonicalVatId, catalogDraftExists, catalogVersionAlreadyPublished, catalogVersionGone, classifyBundleVersionDiff, classifyIssuerChange, classifyPlanDiff, classifyVersionOffer, collectUnsatisfiedRequires, computeIncludedVat, concurrencyGate, concurrencyGateOf, contractPartiesOf, coverageExcludingSelf, customLimitsReader, definedFields, diffSettings, formatCustomerNumber, formatErrorMessage, grossFromNet, identityCorrectionDelta, isBundleRedundant, isForeignPaymentMethodReferenceError, isMaintenanceAnnouncementLapsed, isMaintenanceOverrun, isPaymentCallbackRejectedError, isPersistenceRefusal, isPlatformUserExistsError, isVersionActiveAt, isVersionEditable, issuerIdentityOf, keepOneRecommended, keepsVatIdCheck, maintenanceRetryAfterSeconds, maintenanceStatusOf, maintenanceWindowStatusOf, maintenanceWindowViewOf, marketingProjectionTaken, membersLeftOut, missingRequiresFor, movedIdentityFields, netFromGross, noActivePlanVersion, parseZonedInstant, percentOf, pickActivePromo, planCatalogSettingsOf, planKeyTaken, planNotInCatalog, previousUtcDay, promoCodeTaken, promoStatus, promotionOnPrice, prorate, readCustomLimits, readQuotaRecord, readQuotaValue, recordedIssuerIdentity, refuseForeignPaymentMethodReference, resolveBundleAvailability, resolveErrorMessage, retirementCostsTheSubscription, retirementReminderDueAt, retirementReminderIsDue, retirementSwitchTerms, roundToCents, sameLegalIdentity, scheduledChangeAfterWrite, selectChargeableBundles, settingsSubtreeOf, startOfUtcDay, subscriberChargeColumns, subscriberFromRegistration, subscriberPaymentMethodColumns, subscriptionBundleAlreadyCancelled, subscriptionBundleGone, subscriptionContractGone, subscriptionGone, sumToCents, taxOriginOf, taxOriginWrite, taxTreatmentToJson, toBundleStemRow, toBundleVersionRetirementRecord, toCents, toContractLineItemRecord, toDecimalString, toMaintenanceWindowRecord, toPlanRow, toPlanVersionRow, toRunningContractIssuer, toSubscriberChargeRecord, toSubscriberCorrectionRecord, toSubscriberPaymentMethodRecord, toSubscriberRecord, toSubscriberTaxOriginChangeRecord, toSubscriberVatIdCheckRecord, toSubscriptionBundleRecord, toSubscriptionContractRecord, toSubscriptionNoticeRecord, toTaxOriginValues, toTaxTreatment, toVersionRetirementRecord, vatIdCheckFromStore, versionOnSale, versionOnSaleOrNext, versionSale };
|
|
11585
|
+
export { ACTIVE_SUBSCRIPTION_CONTRACT_STATUSES, AUTH_ERROR_CODES, type ActionKey, type ActivationOrchestrator, type ActivePlanVersionWhere, type ActivePlanVersionWhereWithEndsAt, type ActiveVersionWhere, type ActiveVersionWhereWithEndsAt, type ActorTag, type AdminAccountEntry, type AdminAccountHolder, type AdminActor, type AdminAuditListFilter, type AdminManifest, type AdminResourcesPort, type AdminSubscriberAccount, type AdminSubscriberAttention, type AdminSubscriberCorrected, type AdminSubscriberHistoryEntry, type AdminSubscriptionListRow, type AdminTenantDetail, type AdminTenantListFilter, type AdminTenantListRow, type AdminTenantStateResult, type AdminTenantSubscriber, type AdminUserListFilter, type AdminUserListRow, type AdminVatIdCheckOutcome, type AppliedSettingsPort, type AppliedSettingsRecord, type AppliedSettingsValues, type ApplyOnboardingSelectionInput, type ApplyOnboardingSelectionResult, type ApprovedCatalogKeys, type ArchivedInvoiceDocument, type AuditActionDef, type AuditActor, type AuditEntry, type AuditPort, type AuditQuery, type AuditQueryPort, type AuditStatsPort, type AuditStatsSnapshot, type AuthErrorCode, BILLING_ERROR_CODES, BUNDLE_PRICE_LOOKUP_LIMIT, BUNDLE_VERSION_RETIREMENT_CAPABILITY, type BillingCycle, type BillingErrorCode, type BundleAvailabilityState, type BundleCompatibility, type BundleFeatureShape, type BundleListFilter, type BundlePricingOverride, type BundleRepository, type BundleRetirementAnnounced, type BundleRetirementPreview, type BundleRetirementReachedRow, type BundleRetirementSkipReason, type BundleRetirementSkippedRow, type BundleRetirementSwitchResult, type BundleRetirementSwitchTerms, type BundleRow, type BundleVersionFields, type BundleVersionMutationResult, type BundleVersionOfferView, type BundleVersionOfferedNotice, type BundleVersionRetiredNotice, type BundleVersionRetirementRecord, type BundleVersionRetirementReminder, type BundleVersionRetirementRepository, type BundleVersionRetirementView, type BundleVersionRow, type BundleVersionSide, type BundleVersionSwitchResult, CATALOGUE_KEYS, CATALOG_ERROR_CODES, CONTRACT_ERROR_CODES, CUSTOM_LIMITS_KEYS, type CalendarDay, type CancelSubscriptionBundleData, type CancelSubscriptionInput, type CancelSubscriptionResult, type CancellationNoticePeriods, type CanonicalBundleVersionRetirementRow, type CanonicalContractLineItemRow, type CanonicalContractRow, type CanonicalFeatureWithdrawalRow, type CanonicalMaintenanceWindowRow, type CanonicalPlanRow, type CanonicalPlanVersionRow, type CanonicalRunningContractRow, type CanonicalSubscriberChargeRow, type CanonicalSubscriberCorrectionRow, type CanonicalSubscriberPaymentMethodRow, type CanonicalSubscriberRow, type CanonicalSubscriberTaxOriginChangeRow, type CanonicalSubscriberVatIdCheckRow, type CanonicalSubscriptionBundleRow, type CanonicalSubscriptionInvoiceArchiveRow, type CanonicalSubscriptionInvoiceDocumentRow, type CanonicalSubscriptionInvoiceLineRow, type CanonicalSubscriptionInvoiceRow, type CanonicalSubscriptionNoticeRow, type CanonicalVersionRetirementRow, type CapabilityCatalogEntryRow, type CapabilityCodeStatus, type CapabilityKey, type CapabilityKind, type CatalogEntryFilter, type CatalogEntryI18n, type CatalogEntryI18nFields, type CatalogEntryRepository, type CatalogErrorCode, type CatalogVersionKind, 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 ConcurrencyGate, 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 CustomLimits, 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 EndAtOncePreview, type EndNowInput, type EndSubscriptionNowResult, type EndedAtOnce, type EndedAtOnceNotice, type ErrorMessageParams, FEATURE_NOT_LICENSED, FEATURE_WITHDRAWAL_CAPABILITY, FEATURE_WITHDRAWAL_REASON_MAX_LENGTH, type FeatureCatalogEntryRow, type FeatureDef, type FeatureKey, type FeatureNotLicensedBody, type FeatureRequiresIndex, type FeatureTier, type FeatureUiMeta, type FeatureUiRegistry, type FeatureWithdrawalAnnounced, type FeatureWithdrawalBlocker, type FeatureWithdrawalLift, type FeatureWithdrawalLifted, type FeatureWithdrawalLiftedNotice, type FeatureWithdrawalLine, type FeatureWithdrawalLineKind, type FeatureWithdrawalMark, type FeatureWithdrawalNoticeLine, type FeatureWithdrawalPreview, type FeatureWithdrawalReachedRow, type FeatureWithdrawalRecord, type FeatureWithdrawalReduction, type FeatureWithdrawalRepository, type FeatureWithdrawalRow, type FeatureWithdrawalSkippedRow, type FeatureWithdrawalTarget, type FeatureWithdrawalView, type FeatureWithdrawnNotice, type FinalActivationResult, type FirstTimeCustomerCheck, ForeignPaymentMethodReferenceError, type HeldVatId, INVOICE_ARCHIVE_TRIGGERS, INVOICE_DOCUMENT_CAPABILITY, INVOICE_ERROR_CODES, INVOICE_SEQUENCE_DIGITS, type ImmediatePlanChangeInput, type InvoiceArchivePort, type InvoiceContentDraft, type InvoiceDocument, type InvoiceDocumentToArchive, type InvoiceDraftInput, type InvoiceErrorCode, type InvoiceGroup, type InvoiceLineItemSnapshot, type InvoiceMail, type InvoiceMailPort, type InvoiceRenderer, type InvoiceTaxLine, type IssuerCorrectionFault, type IssuerHistoryStep, type IssuerIdentityChange, type KpiCardDef, type KpiDisplayHint, LEGAL_IDENTITY_FIELDS, type LegalIdentity, type LegalIdentityField, MAINTENANCE_CAPABILITY, MAINTENANCE_ERROR_CODES, MAINTENANCE_MESSAGE_MAX_LENGTH, MAINTENANCE_STATE_MAX_AGE_SECONDS, MARKETING_PRIORITY_MAX, MARKETING_PRIORITY_MIN, type MaintenanceErrorCode, type MaintenanceLockView, type MaintenanceNotificationPort, type MaintenanceOverview, type MaintenanceStatusView, type MaintenanceUnlockView, type MaintenanceWindowChanges, type MaintenanceWindowEvent, type MaintenanceWindowPort, type MaintenanceWindowRecord, type MaintenanceWindowStage, type MaintenanceWindowStatus, type MaintenanceWindowView, type ManifestAccessPort, type ManifestContribution, type MarketingProjectionFilter, type MarketingProjectionRepository, type MarketingProjectionRow, type MarketingSettingsRepository, type MarketingSettingsRow, type MarketingTargetType, type MarketingTopFeature, type MaskedPaymentMethod, type MfaPort, NO_SCHEDULED_CHANGE, type NewBundleVersionRetirement, type NewContractLineItemData, type NewFeatureWithdrawal, type NewInvoiceRendering, type NewMaintenanceWindow, type NewSettingsChange, type NewSubscriberCharge, type NewSubscriberDetails, type NewSubscriptionContractData, type NewSubscriptionInvoice, type NewSubscriptionInvoiceLine, type NewVersionRetirement, type NotToldReasons, type NoticeToRecord, OPTIONAL_CANONICAL_MODELS, OTP_RATE_LIMIT_MAX_SENDS, OTP_RATE_LIMIT_WINDOW_MINUTES, OTP_TTL_MINUTES, OTP_VERIFY_MAX_ATTEMPTS, type OnboardingPromoRedemption, type OnboardingSelectionRequest, type OnboardingSelectionResponse, type OptionalBundleMember, type OptionalCanonicalModel, type OrderlyRetirementSettings, 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, PersistenceRefusal, type PersistenceRefusalReason, type PlanCatalog, type PlanCatalogApp, type PlanCatalogImportReport, type PlanCatalogImportSink, type PlanCatalogInvoicing, type PlanCatalogIssuer, type PlanCatalogIssuerCorrection, type PlanCatalogLookup, type PlanCatalogMarketing, type PlanCatalogNotifications, type PlanCatalogPaymentAccount, type PlanCatalogPayments, type PlanCatalogReadSink, type PlanCatalogReadSnapshot, type PlanCatalogSettings, type PlanCatalogSubscribers, type PlanCatalogTax, type PlanCatalogTenantBilling, type PlanDef, type PlanId, type PlanListFilter, type PlanRepository, type PlanRow, type PlanVersion, type PlanVersionFields, type PlanVersionMutationResult, type PlanVersionRecord, type PlanVersionRepository, type PlanVersionRow, type PlatformErrorBody, type PlatformErrorCode, type PlatformJobActor, 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, RETIREMENT_REMINDER_LEAD_DAYS, type ReadCustomLimits, type ReassignTenantAdminCliResult, type RecommendablePlan, type RecordSubscriberPaymentMethodData, type RecordSubscriberPaymentMethodOutcome, type RecordSubscriberPaymentMethodResult, type RecordedVatIdCheck, 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 RetiredBundleVersionRef, type RetiredVersionRef, type RetirementAnnounced, type RetirementBlocker, type RetirementMoveRun, type RetirementPreview, type RetirementPricedSide, type RetirementProgress, type RetirementReachedRow, type RetirementSide, type RetirementSkipReason, type RetirementSkippedRow, type RetirementSwitchResult, type RetirementSwitchTerms, type ReviewCatalogEntryData, type RlsBypassPort, type RunningContractIssuer, type RunningContractIssuers, SETTINGS_ERROR_CODES, SETUP_ERROR_CODES, SUBSCRIBER_ACCOUNT_CAPABILITY, SUBSCRIBER_ATTENTION_CAPABILITY, SUBSCRIBER_ATTENTION_PAGE_SIZE, SUBSCRIBER_CHARGE_ORIGINS, SUBSCRIBER_CHARGE_SOURCES, SUBSCRIBER_CORRECTION_CAPABILITY, SUBSCRIBER_ERROR_CODES, SUBSCRIBER_INVOICE_ADDRESS_FIELDS, SUBSCRIBER_STANDING_CAPABILITY, SUBSCRIBER_TAX_ORIGIN_FIELDS, type SaaSiCatPersistenceAdapter, type SaaSiCatPersistenceAdminResources, type SaaSiCatPersistenceCatalog, type SaaSiCatPersistenceCore, type SaaSiCatPersistenceEntitlement, type SaaSiCatPersistencePayments, type SaaSiCatPersistencePromo, type SaaSiCatPersistenceTenantBilling, type SaveRegistrationConfigInput, type SaveRegistrationConfigResult, type ScheduledChangeColumns, type ScheduledPlanChangeInput, type SecretSealer, 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 SubscriberBusinessStatusData, type SubscriberBusinessStatusResult, type SubscriberCharge, type SubscriberChargeOrigin, type SubscriberChargeRecord, type SubscriberChargeSource, type SubscriberContact, type SubscriberContactChange, type SubscriberCorrectionData, type SubscriberCorrectionRecord, type SubscriberCorrectionResult, type SubscriberDetails, type SubscriberErrorCode, type SubscriberIdentityCorrection, type SubscriberIdentityDelta, type SubscriberIdentityValues, type SubscriberInvoiceAddressField, type SubscriberLedgerRepository, type SubscriberPaymentMethodRecord, type SubscriberPaymentMethodReference, type SubscriberPaymentMethodRepository, type SubscriberPaymentMethodSetupData, type SubscriberPaymentMethodSetupMatch, type SubscriberPaymentMethodStatus, type SubscriberReadiness, type SubscriberRecord, type SubscriberRepository, type SubscriberTaxOrigin, type SubscriberTaxOriginChangeRecord, type SubscriberTaxOriginField, type SubscriberTaxOriginValues, type SubscriberTaxStatus, type SubscriberVatIdCheckRecord, type SubscriberVatIdCheckResult, type SubscriberWithCurrentCheck, type Subscription, type SubscriptionBundleRecord, type SubscriptionBundleRepository, type SubscriptionBundleView, type SubscriptionContractFilter, type SubscriptionContractInvoiceSnapshot, type SubscriptionContractParties, type SubscriptionContractPriceSnapshot, type SubscriptionContractRecord, type SubscriptionContractRepository, type SubscriptionContractStatus, type SubscriptionInvoiceColumns, type SubscriptionInvoiceDocumentRecord, type SubscriptionInvoiceIssuer, type SubscriptionInvoiceLineColumns, type SubscriptionInvoiceLineRecord, type SubscriptionInvoiceRecord, type SubscriptionInvoiceRepository, type SubscriptionInvoiceSubscriber, type SubscriptionNotice, type SubscriptionNoticeDelivery, type SubscriptionNoticeKey, type SubscriptionNoticeKind, type SubscriptionNoticePort, type SubscriptionNoticeRecord, type SubscriptionNoticeRepository, type SubscriptionRecord, type SubscriptionRepository, type SubscriptionStatsPort, type SubscriptionStatsSnapshot, type SubscriptionStatus, type SubscriptionUsagePort, type SubscriptionUsageRecord, type SuperAdminProvisioningPort, type SupersedeSubscriptionContractData, type SyncDiscoveryResult, TAX_ERROR_CODES, TAX_TREATMENT_KINDS, type TaxAdapter, type TaxAdapterFactory, type TaxAdapterIdentity, type TaxAtRate, type TaxDecision, type TaxDecisionRequest, type TaxErrorCode, type TaxIssuer, type TaxOriginWrite, type TaxPerRate, type TaxTreatment, type TaxTreatmentKind, type TenantActionDef, type TenantColumnDef, type TenantDto, type TenantFeatureWithdrawal, type TenantFeatureWithdrawalLine, type TenantListFilter, type TenantPort, type TenantSubscriptionUsage, 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, VERSION_RETIREMENT_CAPABILITY, type VatCategory, type VatIdCheck, type VatIdCheckOutcome, type VerifyRegistrationOtpResult, type VersionChange, type VersionChangeDirection, type VersionEditability, type VersionEditableReason, type VersionOffer, type VersionOfferClass, type VersionOfferFields, type VersionOfferSide, type VersionOfferView, type VersionOfferedNotice, type VersionRetiredNotice, type VersionRetirementRecord, type VersionRetirementReminder, type VersionRetirementRepository, type VersionRetirementView, type VersionSale, type VersionSaleDates, type VersionSaleKind, type VersionSwitchResult, type VersionWindow, type VersionedEntityBase, type WithdrawnFeature, addDaysToDay, applyPromo, asXmlReadsIt, assertPersistenceCapabilities, buildActivePlanVersionWhere, buildActiveVersionWhere, buildFeatureRequiresIndex, bundleDraftDefaults, bundleKeyTaken, bundleStemDefaults, canonicalJson, canonicalVatId, catalogDraftExists, catalogVersionAlreadyPublished, catalogVersionGone, classifyBundleVersionDiff, classifyIssuerChange, classifyPlanDiff, classifyVersionOffer, collectUnsatisfiedRequires, computeIncludedVat, concurrencyGate, concurrencyGateOf, contractPartiesOf, coverageExcludingSelf, customLimitsReader, dayInZone, definedFields, diffSettings, draftSubscriptionInvoice, endedAtOnceSubjectOf, featureWithdrawalRowOf, featuresWithdrawnAt, formatCustomerNumber, formatErrorMessage, formatInvoiceNumber, grossFromNet, holdsOnlyXmlCharacters, identityCorrectionDelta, invoiceArchiveProtectionProblem, invoiceContentDraftOf, invoiceFooterOf, invoiceGroupsOf, invoiceIssuerOf, isBundleRedundant, isFeatureWithdrawnAt, isForeignPaymentMethodReferenceError, isInvoiceDocumentChecksum, isMaintenanceAnnouncementLapsed, isMaintenanceOverrun, isPaymentCallbackRejectedError, isPersistenceRefusal, isPlatformUserExistsError, isVersionActiveAt, isVersionEditable, issuerIdentityOf, keepOneRecommended, keepsVatIdCheck, lastDayInZone, maintenanceRetryAfterSeconds, maintenanceStatusOf, maintenanceWindowStatusOf, maintenanceWindowViewOf, marketingProjectionTaken, membersLeftOut, missingRequiresFor, movedIdentityFields, netFromGross, nextWithdrawalChange, noActivePlanVersion, parseZonedInstant, percentOf, pickActivePromo, planCatalogSettingsOf, planKeyTaken, planNotInCatalog, previousUtcDay, promoCodeTaken, promoStatus, promotionOnPrice, prorate, readCustomLimits, readQuotaRecord, readQuotaValue, recordedIssuerIdentity, refuseForeignPaymentMethodReference, resolveBundleAvailability, resolveErrorMessage, retirementCostsTheSubscription, retirementReminderDueAt, retirementReminderIsDue, retirementSwitchTerms, roundToCents, sameLegalIdentity, scheduledChangeAfterWrite, selectChargeableBundles, settingsSubtreeOf, startOfUtcDay, subscriberChargeColumns, subscriberFromRegistration, subscriberPaymentMethodColumns, subscriptionBundleAlreadyCancelled, subscriptionBundleGone, subscriptionContractGone, subscriptionGone, subscriptionInvoiceChargeInvoiced, subscriptionInvoiceColumns, subscriptionInvoiceDocumentChanged, subscriptionInvoiceLineColumns, sumToCents, taxOriginOf, taxOriginWrite, taxPerRate, taxTreatmentToJson, toArchivedInvoiceDocument, toBundleStemRow, toBundleVersionRetirementRecord, toCents, toContractLineItemRecord, toDecimalString, toFeatureWithdrawalRecord, toMaintenanceWindowRecord, toPlanRow, toPlanVersionRow, toRunningContractIssuer, toSubscriberChargeRecord, toSubscriberCorrectionRecord, toSubscriberPaymentMethodRecord, toSubscriberRecord, toSubscriberTaxOriginChangeRecord, toSubscriberVatIdCheckRecord, toSubscriptionBundleRecord, toSubscriptionContractRecord, toSubscriptionInvoiceDocumentRecord, toSubscriptionInvoiceRecord, toSubscriptionNoticeRecord, toTaxOriginValues, toTaxTreatment, toVersionRetirementRecord, utcMidnightOf, vatCategoryOf, vatIdCheckFromStore, versionOnSale, versionOnSaleOrNext, versionSale, withdrawnFeaturesOf, yearOfDay };
|