@saasicat/nest 0.8.0 → 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (95) hide show
  1. package/dist/_entries.cjs +17678 -0
  2. package/dist/admin/index.cjs +4 -1274
  3. package/dist/admin/index.d.cts +10 -171
  4. package/dist/admin/index.d.ts +10 -171
  5. package/dist/admin/index.js +13 -4
  6. package/dist/admin-resources.module-BZN_yBFj.d.cts +40 -0
  7. package/dist/admin-resources.module-Cms8MY6h.d.ts +40 -0
  8. package/dist/admin-stats.module-15ac5KY3.d.ts +201 -0
  9. package/dist/admin-stats.module-v4SVvWzj.d.cts +201 -0
  10. package/dist/billing/index.cjs +4 -5128
  11. package/dist/billing/index.d.cts +8 -719
  12. package/dist/billing/index.d.ts +8 -719
  13. package/dist/billing/index.js +7 -10
  14. package/dist/catalog/index.cjs +4 -5624
  15. package/dist/catalog/index.d.cts +7 -427
  16. package/dist/catalog/index.d.ts +7 -427
  17. package/dist/catalog/index.js +14 -12
  18. package/dist/catalog.module-BKObceo0.d.ts +103 -0
  19. package/dist/catalog.module-Dw2Hrbyu.d.cts +103 -0
  20. package/dist/checkout-offer/index.cjs +4 -807
  21. package/dist/checkout-offer/index.d.cts +5 -84
  22. package/dist/checkout-offer/index.d.ts +5 -84
  23. package/dist/checkout-offer/index.js +3 -2
  24. package/dist/checkout-offer.module-Y0hDOVrq.d.ts +85 -0
  25. package/dist/checkout-offer.module-ZYF5IsDY.d.cts +85 -0
  26. package/dist/{chunk-5DDCSGZC.js → chunk-33TP26MR.js} +144 -356
  27. package/dist/{chunk-CK54YKVK.js → chunk-75JABGZK.js} +16 -16
  28. package/dist/{chunk-HRU3CP57.js → chunk-BOADBIGB.js} +1 -1
  29. package/dist/{chunk-ZLUGQE5D.js → chunk-E7AJ42AB.js} +8 -8
  30. package/dist/{chunk-6LP7CDS2.js → chunk-F3VV6EXG.js} +18 -13
  31. package/dist/{chunk-PLDHI6NA.js → chunk-FVT7KTUI.js} +258 -3
  32. package/dist/{chunk-RZU4HIAN.js → chunk-GBDUH6DO.js} +26 -23
  33. package/dist/{chunk-K3OPNVFR.js → chunk-HBFU5AN3.js} +5 -9
  34. package/dist/chunk-HWGIMNWR.js +0 -0
  35. package/dist/chunk-IRWZC3GC.js +755 -0
  36. package/dist/chunk-L4KTQ6CL.js +20 -0
  37. package/dist/{chunk-T5SXXAKG.js → chunk-LZHLGUQI.js} +1 -1
  38. package/dist/{chunk-YHHE4KDA.js → chunk-PUXLPUVH.js} +351 -21
  39. package/dist/chunk-TXDH4FUA.js +211 -0
  40. package/dist/chunk-UF53DWWR.js +0 -0
  41. package/dist/{chunk-AJ3EPELS.js → chunk-V34AA7C7.js} +1 -1
  42. package/dist/chunk-WJ6BMDL3.js +313 -0
  43. package/dist/{chunk-M6CZQYPY.js → chunk-Z3FWN3HJ.js} +2 -2
  44. package/dist/discovery/index.cjs +4 -588
  45. package/dist/discovery/index.js +3 -3
  46. package/dist/{enforce-quota.interceptor-cv7r80VM.d.cts → enforce-quota.interceptor-BhkX5nq2.d.cts} +127 -12
  47. package/dist/{enforce-quota.interceptor-Dj1Kusr5.d.ts → enforce-quota.interceptor-CcqZc0Yu.d.ts} +127 -12
  48. package/dist/entitlement/index.cjs +4 -780
  49. package/dist/entitlement/index.d.cts +3 -1
  50. package/dist/entitlement/index.d.ts +3 -1
  51. package/dist/entitlement/index.js +2 -3
  52. package/dist/index.cjs +4 -14975
  53. package/dist/index.d.cts +22 -54
  54. package/dist/index.d.ts +22 -54
  55. package/dist/index.js +88 -369
  56. package/dist/module-CSN8j8Tp.d.cts +39 -0
  57. package/dist/module-DgYJur6f.d.ts +39 -0
  58. package/dist/plan-versions.service-BB36Q1bg.d.ts +329 -0
  59. package/dist/plan-versions.service-CUR2Whyr.d.cts +329 -0
  60. package/dist/platform/index.cjs +4 -2779
  61. package/dist/platform/index.d.cts +50 -8
  62. package/dist/platform/index.d.ts +50 -8
  63. package/dist/platform/index.js +116 -12
  64. package/dist/promo/index.cjs +4 -995
  65. package/dist/promo/index.d.cts +48 -46
  66. package/dist/promo/index.d.ts +48 -46
  67. package/dist/promo/index.js +10 -2
  68. package/dist/rate-limit.guard-dntqAlfZ.d.cts +19 -0
  69. package/dist/rate-limit.guard-dntqAlfZ.d.ts +19 -0
  70. package/dist/registration/index.cjs +4 -1655
  71. package/dist/registration/index.js +1 -1
  72. package/dist/setup.service-BPwJ7My_.d.cts +45 -0
  73. package/dist/setup.service-D2mrdDDB.d.ts +45 -0
  74. package/dist/subscription-bundle-preview.service-BkJXHAeP.d.cts +438 -0
  75. package/dist/subscription-bundle-preview.service-DBbrE_cw.d.ts +438 -0
  76. package/dist/subscription-bundles.module-BQmoozm5.d.ts +291 -0
  77. package/dist/subscription-bundles.module-DCpV-Pb5.d.cts +291 -0
  78. package/dist/subscription-contract/index.cjs +4 -471
  79. package/dist/subscription-contract/index.d.cts +5 -13
  80. package/dist/subscription-contract/index.d.ts +5 -13
  81. package/dist/subscription-contract.module-CG9fPKAr.d.cts +14 -0
  82. package/dist/subscription-contract.module-CVebZzHR.d.ts +14 -0
  83. package/dist/testing/index.cjs +4 -3756
  84. package/dist/testing/index.d.cts +9 -4
  85. package/dist/testing/index.d.ts +9 -4
  86. package/dist/testing/index.js +13 -7
  87. package/package.json +5 -5
  88. package/dist/admin-manifest.config-DyrQNT7M.d.cts +0 -10
  89. package/dist/admin-manifest.config-DyrQNT7M.d.ts +0 -10
  90. package/dist/admin-manifest.service-Cp6uwvmt.d.cts +0 -33
  91. package/dist/admin-manifest.service-UGgzR1x-.d.ts +0 -33
  92. package/dist/chunk-52UTQRD3.js +0 -326
  93. package/dist/chunk-N3WANKSA.js +0 -20
  94. package/dist/chunk-Q53N43LQ.js +0 -13
  95. /package/dist/{chunk-2FR6ZL7R.js → chunk-DBZGV3HC.js} +0 -0
@@ -1,15 +1,18 @@
1
- import { BillingCycle, FeatureKey, UpsellOfferResolver, BundleRepository, CatalogEntryRepository, UpsellOffer, PlanCatalog, PlanCatalogReadSink, PlanCatalogReadSnapshot, PlanCatalogImportSink, PlanCatalogImportReport, PlanId, PlanDef, QuotaKey, MarketingTopFeature, FeatureUiRegistry, MarketingProjectionRepository, SubscriptionUsagePort, UsageSnapshotPort, NewContractLineItemData, TenantSubscriptionWritePort, SubscriptionBundleRepository, SubscriptionBundleView, SubscriptionBundleRecord, SubscriptionUsageRecord, OnboardingSelectionResponse, SubscriptionContractRepository, ConfiguratorSourcesLookup, ConfiguratorMarketingProvider, ConfiguratorCatalog, PlanRepository, BundleVersionRow } from '@saasicat/types';
1
+ import { BillingCycle, FeatureKey, UpsellOfferResolver, BundleRepository, CatalogEntryRepository, UpsellOffer, PlanCatalog, PlanCatalogReadSink, PlanCatalogReadSnapshot, PlanCatalogImportSink, PlanCatalogImportReport, PlanId, PlanDef, QuotaKey, MarketingTopFeature, FeatureUiRegistry, MarketingProjectionRepository, ConfiguratorSourcesLookup, ConfiguratorMarketingProvider, ConfiguratorCatalog } from '@saasicat/types';
2
2
  export { BundleVersionFields, ChangeDirection, DiffResult, PlanVersionFields, VersionChange, VersionChangeDirection, classifyBundleVersionDiff, classifyPlanDiff } from '@saasicat/types';
3
3
  import * as _nestjs_common from '@nestjs/common';
4
4
  import { CanActivate, ExecutionContext, ArgumentsHost, Type, DynamicModule, ForwardReference, Provider } from '@nestjs/common';
5
5
  export { Type as NestType } from '@nestjs/common';
6
6
  import { Reflector, BaseExceptionFilter } from '@nestjs/core';
7
- import { c as EntitlementService, a as EffectiveLimitsSnapshot, t as toEffectiveLimitsSnapshot } from '../aggregation-CfI0bOsQ.cjs';
7
+ import { c as EntitlementService } from '../aggregation-CfI0bOsQ.cjs';
8
8
  import { P as ProviderSpec } from '../di-CcNeq9v-.cjs';
9
+ import { f as ContractFreezePort, g as ContractFreezeSourcePort } from '../subscription-bundles.module-DCpV-Pb5.cjs';
10
+ export { A as AUDIT_CONTEXT_RESOLVER_TOKEN, a as AuditContextResolver, b as AuthGuardList, C as CONTRACT_FREEZE_PORT_TOKEN, c as CONTRACT_FREEZE_PROJECT_KEY_TOKEN, d as CONTRACT_FREEZE_SOURCE_PORT_TOKEN, e as ContractFreezeBundleSnapshot, D as DuePendingPlanChange, P as PENDING_PLAN_QUERY_PORT_TOKEN, h as PendingPlanQueryPort, S as SELF_SERVICE_BLOCKED_BUNDLES_TOKEN, i as SELF_SERVICE_BLOCKED_PLANS_TOKEN, j as SUBSCRIPTION_USAGE_PORT_TOKEN, k as SUBSCRIPTION_WRITE_PORT_TOKEN, l as SelfServiceBlockedBundles, m as SelfServiceBlockedPlans, n as SubscriptionBundleControllerOptions, o as SubscriptionBundleModule, p as SubscriptionBundleModuleOptions, T as TENANT_AUTH_GUARDS_TOKEN, q as TENANT_ID_RESOLVER_TOKEN, r as TRIAL_PROJECTION_PORT_TOKEN, s as TenantBillingModule, t as TenantBillingModuleOptions, u as TenantIdResolver, v as TrialProjectionInput, w as TrialProjectionPort, U as USAGE_SNAPSHOT_PORT_TOKEN, x as USER_EMAIL_RESOLVER_TOKEN, y as USER_ID_RESOLVER_TOKEN, z as UserEmailResolver, B as UserIdResolver } from '../subscription-bundles.module-DCpV-Pb5.cjs';
11
+ export { A as AddBundleToSubscriptionInput, B as BundlePreviewSnapshot, C as CancelBundleFromSubscriptionInput, a as CancelSubscriptionDto, b as ChangePlanDto, c as CompleteOnboardingSubscriptionDto, d as ComposedTenantAuthGuard, L as LimitsCheckRow, P as PendingPlanMaterializationService, e as PlanChangeContext, f as PlanChangePreviewDto, g as PlanChangePreviewIssue, h as PlanChangePreviewService, i as PlanChangeType, j as PlanSnapshotDto, k as PreviewPlanChangeDto, l as ProrationDto, m as ProrationInput, R as RedundantFeatureHint, S as SubscriptionBundleAddPreviewDto, n as SubscriptionBundleCancelPreviewDto, o as SubscriptionBundleConfig, p as SubscriptionBundlePreviewContext, q as SubscriptionBundlePreviewIssue, r as SubscriptionBundlePreviewService, s as SubscriptionBundlesService, T as TenantAdminGuard, t as TenantBillingController, U as UsageResponse, u as addMonths, v as computeProration, w as resolveBundleCancelEffectiveAt, x as resolveBundlePriceNet } from '../subscription-bundle-preview.service-BkJXHAeP.cjs';
9
12
  import { S as SubscriptionContractService } from '../subscription-contract.service--cm47ZJJ.cjs';
10
- import { f as PromoCodesService } from '../service-DX8KbGXl.cjs';
11
- import { A as AdminAuditService } from '../admin-audit.service-9IqXMlZm.cjs';
12
13
  import '../plan-resolution-CFCoUkrE.cjs';
14
+ import '../service-DX8KbGXl.cjs';
15
+ import '../admin-audit.service-9IqXMlZm.cjs';
13
16
 
14
17
  /**
15
18
  * Finds the next period boundary that lies strictly **after** `after`.
@@ -548,280 +551,6 @@ declare const PUBLIC_CATALOG_PROJECT_KEY_TOKEN: unique symbol;
548
551
  declare const PUBLIC_CATALOG_BUNDLE_REPOSITORY_TOKEN: unique symbol;
549
552
  declare const PUBLIC_CATALOG_MARKETING_REPOSITORY_TOKEN: unique symbol;
550
553
 
551
- /**
552
- * List of all auth guards the platform controller should iterate in order
553
- * (analogous to `@UseGuards(JwtAuthGuard, TenantGuard, RolesGuard)`).
554
- * Provided via `forRoot.authGuards` — can be an array of existing instances
555
- * or a factory provider.
556
- */
557
- declare const TENANT_AUTH_GUARDS_TOKEN: unique symbol;
558
- /**
559
- * Resolver function `(req) => string` that extracts the `tenantId` from the
560
- * request. Default: `req.user.tenantId`.
561
- */
562
- declare const TENANT_ID_RESOLVER_TOKEN: unique symbol;
563
- /**
564
- * Resolver function `(req) => string` that extracts the `userId` from the
565
- * request. Default: `req.user.sub ?? req.user.id`.
566
- */
567
- declare const USER_ID_RESOLVER_TOKEN: unique symbol;
568
- /**
569
- * Resolver function `(req) => string` that extracts the user email from the
570
- * request. Optional — used by the audit-log path to build the AdminActor
571
- * (`{userId, email, source: 'web', context}`). Default: `req.user.email`.
572
- * If the consumer's JWT does not carry an email, the resolver can return
573
- * `null` — the audit-log path then falls back to `'unknown'`.
574
- */
575
- declare const USER_EMAIL_RESOLVER_TOKEN: unique symbol;
576
- /**
577
- * Resolver function `(req) => string` that extracts an audit context from the
578
- * request (e.g. session ID, trace ID). Default: `req.headers['x-session-id']`
579
- * or `'tenant-self-service'`.
580
- */
581
- declare const AUDIT_CONTEXT_RESOLVER_TOKEN: unique symbol;
582
- /** Adapter token: consumer's `SubscriptionUsagePort` implementation. */
583
- declare const SUBSCRIPTION_USAGE_PORT_TOKEN: unique symbol;
584
- /** Adapter token: consumer's `UsageSnapshotPort` implementation. */
585
- declare const USAGE_SNAPSHOT_PORT_TOKEN: unique symbol;
586
- /** Adapter token: consumer's `TenantSubscriptionWritePort` implementation. */
587
- declare const SUBSCRIPTION_WRITE_PORT_TOKEN: unique symbol;
588
- type TenantIdResolver = (req: unknown) => string | null | undefined;
589
- type UserIdResolver = (req: unknown) => string | null | undefined;
590
- type UserEmailResolver = (req: unknown) => string | null | undefined;
591
- type AuditContextResolver = (req: unknown) => string | null | undefined;
592
- type AuthGuardList = ReadonlyArray<CanActivate>;
593
- /**
594
- * Optional adapter token: projects the new trial end of a change
595
- * (app-specific trial logic, e.g. carry-over of the remaining time). Without a
596
- * port, `PlanChangePreviewDto.projectedTrialEndsAt` stays `null` and the wizard
597
- * falls back to the current trial end.
598
- */
599
- declare const TRIAL_PROJECTION_PORT_TOKEN: unique symbol;
600
- interface TrialProjectionInput {
601
- /** Current plan key of the subscription. */
602
- currentPlan: string;
603
- /** Target plan key of the change. */
604
- targetPlan: string;
605
- /** Current trial end (null = no trial). */
606
- currentTrialEndsAt: Date | null;
607
- /** Subscription status (e.g. 'TRIAL'/'ACTIVE'). */
608
- status: string;
609
- now: Date;
610
- }
611
- interface TrialProjectionPort {
612
- /**
613
- * Projected new trial end after the change. `null` if nothing changes or
614
- * the target package does not support a trial.
615
- */
616
- projectTrialEndsAt(input: TrialProjectionInput): Promise<Date | null>;
617
- }
618
- /**
619
- * Optional adapter token: provides due scheduled plan changes for the
620
- * `PendingPlanMaterializationService`. Without a port, the service is not
621
- * registered (materialization is opt-in).
622
- */
623
- declare const PENDING_PLAN_QUERY_PORT_TOKEN: unique symbol;
624
- /** A due scheduled plan change — minimal for materialization. */
625
- interface DuePendingPlanChange {
626
- tenantId: string;
627
- /** Target plan key of the scheduled change (`pendingPlan`). */
628
- pendingPlan: string;
629
- /** Target cycle (`pendingBillingCycle`); `null` → default MONTHLY. */
630
- pendingBillingCycle: string | null;
631
- }
632
- interface PendingPlanQueryPort {
633
- /**
634
- * Returns all subscriptions with a due scheduled plan change:
635
- * `pendingPlan != null AND pendingEffectiveAt <= now AND status != 'TRIAL'`.
636
- * TRIAL is excluded — there the trial lifecycle drives the transition.
637
- */
638
- findDuePendingPlanChanges(now: Date): Promise<DuePendingPlanChange[]>;
639
- }
640
-
641
- declare class ComposedTenantAuthGuard implements CanActivate {
642
- private readonly guards;
643
- constructor(guards?: AuthGuardList | null);
644
- canActivate(context: ExecutionContext): Promise<boolean>;
645
- }
646
-
647
- declare class TenantAdminGuard implements CanActivate {
648
- canActivate(context: ExecutionContext): boolean;
649
- }
650
-
651
- interface SelfServiceBlockedPlans {
652
- asTarget?: string[];
653
- asSource?: string[];
654
- }
655
- declare const SELF_SERVICE_BLOCKED_PLANS_TOKEN: unique symbol;
656
- /**
657
- * Bundle counterpart (#37): `bundleKeys` lists bundles that are not
658
- * bookable via self-service (only via sales/special contract).
659
- * Applies in `SubscriptionBundlesService.addBundleToSubscription`
660
- * (enforcement, 422) and in the bundle preview (blocker indication).
661
- */
662
- interface SelfServiceBlockedBundles {
663
- bundleKeys?: string[];
664
- }
665
- declare const SELF_SERVICE_BLOCKED_BUNDLES_TOKEN: unique symbol;
666
-
667
- interface ProrationDto {
668
- daysRemainingInPeriod: number;
669
- daysInPeriod: number;
670
- periodStart: Date;
671
- periodEnd: Date;
672
- currentPriceNet: number;
673
- targetPriceNet: number;
674
- /** Prorated surcharge/credit until end of period. Negative = credit. */
675
- prorataDeltaNet: number;
676
- }
677
- interface ProrationInput {
678
- periodStart: Date;
679
- periodEnd: Date;
680
- now: Date;
681
- /** Previous period price (bundle add: 0 — something is only added). */
682
- currentPriceNet: number;
683
- targetPriceNet: number;
684
- }
685
- declare function computeProration(input: ProrationInput): ProrationDto;
686
-
687
- type PlanChangeType = 'UPGRADE' | 'DOWNGRADE' | 'CYCLE_CHANGE' | 'NOOP';
688
- interface PlanSnapshotDto {
689
- id: string;
690
- name: string;
691
- monthlyNet: number | null;
692
- yearlyNet: number | null;
693
- quotas: Record<string, number>;
694
- features: string[];
695
- }
696
- interface LimitsCheckRow {
697
- used: number;
698
- currentMax: number;
699
- targetMax: number;
700
- exceeded: boolean;
701
- }
702
- interface PlanChangePreviewIssue {
703
- code: string;
704
- message: string;
705
- }
706
- interface PlanChangePreviewDto {
707
- changeType: PlanChangeType;
708
- current: {
709
- plan: PlanSnapshotDto;
710
- billingCycle: string;
711
- };
712
- target: {
713
- plan: PlanSnapshotDto;
714
- billingCycle: string;
715
- };
716
- /** For upgrade/NOOP: immediately (null). Otherwise period end. */
717
- effectiveAt: Date | null;
718
- isImmediate: boolean;
719
- /**
720
- * Projected new trial end after the change (app trial logic, e.g.
721
- * carry-over of the remaining time). `null` if no TrialProjectionPort is
722
- * configured, the subscription is not in a trial, or nothing changes.
723
- * The wizard uses this to show "regulär ab Ende der Testphase".
724
- */
725
- projectedTrialEndsAt: Date | null;
726
- proration: ProrationDto | null;
727
- /** Map quotaKey → LimitsCheckRow across all quota dimensions from the current limit, target plan and usage. */
728
- limitsCheck: Record<string, LimitsCheckRow>;
729
- featuresLost: string[];
730
- featuresGained: string[];
731
- /** Hard prevention reasons — e.g. usage > target limit. */
732
- blockers: PlanChangePreviewIssue[];
733
- /** Non-blocking hints — e.g. feature loss. */
734
- warnings: PlanChangePreviewIssue[];
735
- }
736
- interface PlanChangeContext {
737
- /** Current period start time from the subscription, if present. */
738
- currentPeriodStart: Date | null;
739
- /** Current period end from the subscription, if present. */
740
- currentPeriodEnd: Date | null;
741
- /** TRIAL end, if status === 'TRIAL'. */
742
- trialEndsAt: Date | null;
743
- /** Subscription status (TRIAL/ACTIVE/...). */
744
- status: string;
745
- /** Current cycle of the subscription (for cycle-change classification). */
746
- currentBillingCycle: string;
747
- /** Current plan of the subscription. */
748
- currentPlan: string;
749
- /** Subscription start, if present (for the periodEndAfter fallback). */
750
- startedAt: Date | null;
751
- }
752
- declare class PlanChangePreviewService {
753
- private readonly catalog;
754
- private readonly entitlements;
755
- private readonly subscriptions;
756
- private readonly usageSnapshot;
757
- private readonly blockedPlans;
758
- private readonly trialProjection;
759
- constructor(catalog: PlanCatalog, entitlements: EntitlementService, subscriptions: SubscriptionUsagePort, usageSnapshot: UsageSnapshotPort, blockedPlans?: SelfServiceBlockedPlans | null, trialProjection?: TrialProjectionPort | null);
760
- preview(tenantId: string, targetPlan: string, targetCycle: string, now?: Date): Promise<PlanChangePreviewDto>;
761
- /** Like `preview`, but only the blocker list — for a server-side
762
- * pre-check before the `changePlan` mutation (defense-in-depth). */
763
- assertChangeAllowed(tenantId: string, targetPlan: string, targetCycle: string, now?: Date): Promise<PlanChangePreviewIssue[]>;
764
- private classify;
765
- /** Catalog order = rank. Non-marketed plans go to the end. */
766
- private planRank;
767
- private resolveEffectiveAt;
768
- private computeProration;
769
- }
770
-
771
- /**
772
- * Optional hook token: the platform `changePlan` path + the
773
- * `PendingPlanMaterializationService` call the freeze after the plan mutation
774
- * (analogous to `TrialProjectionPort`). Without a port nothing is frozen — the
775
- * entitlements then stay catalog-/version-pinned as before.
776
- */
777
- declare const CONTRACT_FREEZE_PORT_TOKEN: unique symbol;
778
- /** Adapter token: consumer-specific bundle/version data access. */
779
- declare const CONTRACT_FREEZE_SOURCE_PORT_TOKEN: unique symbol;
780
- /** Config token: the consumer's `projectKey` for the contract. */
781
- declare const CONTRACT_FREEZE_PROJECT_KEY_TOKEN: unique symbol;
782
- interface ContractFreezePort {
783
- /**
784
- * Freezes the agreed service at `effectiveFrom` as the new active
785
- * `SubscriptionContract` (supersedes the previous one). Non-fatal for the
786
- * caller — the plan change is already persisted.
787
- */
788
- freezeOnPlanChange(tenantId: string, newPlan: string, billingCycle: BillingCycle, effectiveFrom: Date): Promise<void>;
789
- }
790
- /** Frozen bundle line items + their version ids (trace). */
791
- interface ContractFreezeBundleSnapshot {
792
- lineItems: NewContractLineItemData[];
793
- bundleVersionIds: string[];
794
- }
795
- /**
796
- * Consumer-specific data access for the freeze: live PlanVersion id
797
- * (trace) + booked bundles as contract line items. The generic freeze
798
- * logic (plan line item from the catalog, snapshot, contract assembly) lives in
799
- * the platform `SubscriptionContractFreezeService`.
800
- */
801
- interface ContractFreezeSourcePort {
802
- /** Live (published, non-superseded) PlanVersion id of the target plan, or null. */
803
- findLivePlanVersionId(planId: string): Promise<string | null>;
804
- /**
805
- * The tenant's active (non-terminated) bundle bookings as line items.
806
- * `vatRate` is passed through so the gross price is computed consistently
807
- * with the catalog VAT. Apps without a bundle schema return empty lists.
808
- */
809
- loadBookedBundles(tenantId: string, cycle: 'monthly' | 'yearly', vatRate: number): Promise<ContractFreezeBundleSnapshot>;
810
- }
811
-
812
- declare class PendingPlanMaterializationService {
813
- private readonly query;
814
- private readonly subscriptionWrite;
815
- private readonly entitlements;
816
- private readonly contractFreeze;
817
- private readonly logger;
818
- constructor(query: PendingPlanQueryPort, subscriptionWrite: TenantSubscriptionWritePort, entitlements: EntitlementService, contractFreeze?: ContractFreezePort | null);
819
- materializeDuePlanChanges(now?: Date): Promise<{
820
- applied: number;
821
- }>;
822
- private tryFreeze;
823
- }
824
-
825
554
  declare class SubscriptionContractFreezeService implements ContractFreezePort {
826
555
  private readonly catalog;
827
556
  private readonly entitlements;
@@ -834,292 +563,6 @@ declare class SubscriptionContractFreezeService implements ContractFreezePort {
834
563
 
835
564
  declare function computeCarriedTrialEndsAt(currentTrialDays: number, newTrialDays: number, currentTrialEndsAt: Date, now: Date): Date;
836
565
 
837
- declare class PreviewPlanChangeDto {
838
- plan: string;
839
- billingCycle: string;
840
- }
841
- declare class ChangePlanDto extends PreviewPlanChangeDto {
842
- /** Immediate change (true) vs. change at period end (false/undefined). */
843
- effectiveImmediately?: boolean;
844
- }
845
- declare class CancelSubscriptionDto {
846
- /** true = cancel immediately (status CANCELED). false/undefined = at period end. */
847
- immediately?: boolean;
848
- }
849
-
850
- declare class CompleteOnboardingSubscriptionDto {
851
- plan: string;
852
- billingCycle: string;
853
- promoCode?: string;
854
- /**
855
- * Optional — UUIDs of the BundleVersions that should be booked
856
- * together with the plan (P11.7.3). Per bundle, the platform
857
- * default minimum term (12 months) is set. Bundles are added
858
- * best-effort **after** the plan change — an error on an individual
859
- * bundle (e.g. incompatible with the chosen plan) lands as a
860
- * warning in the response, without rolling back the plan change.
861
- */
862
- bundleVersionIds?: string[];
863
- }
864
-
865
- interface SubscriptionBundleConfig {
866
- /** Default minimum term in months on `add`. Default = 12. */
867
- defaultMinimumTermMonths?: number;
868
- }
869
- interface AddBundleToSubscriptionInput {
870
- subscriptionId: string;
871
- bundleVersionId: string;
872
- /** PlanKey of the current subscription for the plan-compatibility check. */
873
- currentPlanKey: string;
874
- /** Default = now (service time). */
875
- startedAt?: Date;
876
- /**
877
- * Override for the minimum term (months). Default = config or
878
- * 12. `0` explicitly means "no minimum term"
879
- * (`minimumTermEndsAt = null`).
880
- */
881
- minimumTermMonths?: number;
882
- }
883
- interface CancelBundleFromSubscriptionInput {
884
- subscriptionBundleId: string;
885
- /** Default = now. */
886
- canceledAt?: Date;
887
- /**
888
- * Period end of the subscription from which the cancellation could take effect.
889
- * Effective date = `max(currentPeriodEnd, minimumTermEndsAt)`.
890
- * If not set, `canceledAt` is interpreted as the period end
891
- * (= immediate effect, provided the minimum term has already expired).
892
- */
893
- currentPeriodEnd?: Date;
894
- }
895
- declare class SubscriptionBundlesService {
896
- private readonly repo;
897
- private readonly bundles;
898
- private readonly blockedBundles;
899
- private readonly defaultMinTermMonths;
900
- constructor(repo: SubscriptionBundleRepository, bundles: BundleRepository, config?: SubscriptionBundleConfig, blockedBundles?: SelfServiceBlockedBundles | null);
901
- /** All bundle bookings of a subscription (for the "My Bundles" page). */
902
- listForSubscription(subscriptionId: string): Promise<SubscriptionBundleView[]>;
903
- addBundleToSubscription(input: AddBundleToSubscriptionInput): Promise<SubscriptionBundleRecord>;
904
- cancelBundleFromSubscription(input: CancelBundleFromSubscriptionInput): Promise<SubscriptionBundleRecord>;
905
- /**
906
- * "Undo cancellation" — only as long as the cancellation is not yet effective
907
- * (the bundle runs until `canceledEffectiveAt`). After that, re-booking is the way.
908
- */
909
- reactivateBundle(subscriptionBundleId: string): Promise<SubscriptionBundleRecord>;
910
- }
911
- /**
912
- * Effective date of a bundle cancellation:
913
- * `max(currentPeriodEnd, minimumTermEndsAt)` — missing values fall back to
914
- * `canceledAt` (= immediate effect). Shared between the
915
- * cancellation mutation and the preview (#37).
916
- */
917
- declare function resolveBundleCancelEffectiveAt(input: {
918
- canceledAt: Date;
919
- currentPeriodEnd: Date | null;
920
- minimumTermEndsAt: Date | null;
921
- }): Date;
922
- /**
923
- * Adds `months` to `date` and keeps the UTC day. Edge case
924
- * 31.01 + 1 month → 28/29.02 (JS Date does this automatically by
925
- * setMonth normalizing the day).
926
- */
927
- declare function addMonths(date: Date, months: number): Date;
928
-
929
- interface RequestLike {
930
- user?: {
931
- tenantId?: string;
932
- sub?: string;
933
- id?: string;
934
- };
935
- }
936
- interface UsageResponse {
937
- plan: string;
938
- effectivePlan: string;
939
- billingCycle: string;
940
- status: string;
941
- isPilot: boolean;
942
- pilotEndsAt: Date | null;
943
- trialEndsAt: Date | null;
944
- startedAt: Date | null;
945
- currentPeriodStart: Date | null;
946
- currentPeriodEnd: Date | null;
947
- pendingPlan: string | null;
948
- pendingBillingCycle: string | null;
949
- pendingEffectiveAt: Date | null;
950
- planVersion: SubscriptionUsageRecord['planVersion'];
951
- pendingPlanVersion: SubscriptionUsageRecord['pendingPlanVersion'];
952
- pendingPlanVersionEffectiveAt: Date | null;
953
- pendingPlanVersionAccepted: boolean;
954
- pendingPlanVersionAcceptedAt: Date | null;
955
- limits: ReturnType<typeof toEffectiveLimitsSnapshot>;
956
- usage: Record<string, number>;
957
- /**
958
- * P11.4 (METAMODELL §17a): Frozen package snapshot from the
959
- * `CheckoutOffer` that was activated during onboarding. Read-only
960
- * for the tenant self-service UI. `null` for subscriptions without
961
- * a CheckoutOffer origin.
962
- */
963
- packageSnapshot: unknown | null;
964
- /** P11.4: Optional reference to the originating CheckoutOffer. */
965
- checkoutOfferId: string | null;
966
- }
967
- declare class TenantBillingController {
968
- private readonly entitlements;
969
- private readonly planPreview;
970
- private readonly subscriptionUsage;
971
- private readonly usageSnapshot;
972
- private readonly subscriptionWrite;
973
- private readonly tenantIdResolver;
974
- private readonly userIdResolver;
975
- private readonly blockedPlans;
976
- private readonly promoCodes;
977
- private readonly auditService;
978
- private readonly userEmailResolver;
979
- private readonly auditContextResolver;
980
- private readonly subscriptionBundles;
981
- private readonly contractFreeze;
982
- private readonly trialProjection;
983
- constructor(entitlements: EntitlementService, planPreview: PlanChangePreviewService, subscriptionUsage: SubscriptionUsagePort, usageSnapshot: UsageSnapshotPort, subscriptionWrite: TenantSubscriptionWritePort, tenantIdResolver?: TenantIdResolver | null, userIdResolver?: UserIdResolver | null, blockedPlans?: SelfServiceBlockedPlans | null, promoCodes?: PromoCodesService | null, auditService?: AdminAuditService | null, userEmailResolver?: UserEmailResolver | null, auditContextResolver?: AuditContextResolver | null, subscriptionBundles?: SubscriptionBundlesService | null, contractFreeze?: ContractFreezePort | null, trialProjection?: TrialProjectionPort | null);
984
- private readonly logger;
985
- getEntitlement(req: RequestLike): Promise<EffectiveLimitsSnapshot>;
986
- getUsage(req: RequestLike): Promise<UsageResponse>;
987
- previewPlanChange(req: RequestLike, dto: PreviewPlanChangeDto): Promise<PlanChangePreviewDto>;
988
- changePlan(req: RequestLike, dto: ChangePlanDto): Promise<{
989
- plan: string;
990
- billingCycle: string;
991
- immediate: boolean;
992
- pendingPlan?: undefined;
993
- pendingBillingCycle?: undefined;
994
- pendingEffectiveAt?: undefined;
995
- } | {
996
- plan: string;
997
- billingCycle: string;
998
- pendingPlan: string;
999
- pendingBillingCycle: string;
1000
- pendingEffectiveAt: Date;
1001
- immediate: boolean;
1002
- }>;
1003
- completeOnboardingSubscription(req: RequestLike, dto: CompleteOnboardingSubscriptionDto): Promise<OnboardingSelectionResponse>;
1004
- acceptPendingPlanVersion(req: RequestLike): Promise<{
1005
- accepted: boolean;
1006
- acceptedAt: Date | null;
1007
- effectiveAt: Date | null;
1008
- idempotent: boolean;
1009
- }>;
1010
- cancelSubscription(req: RequestLike, dto: CancelSubscriptionDto): Promise<{
1011
- canceledAt: Date | null;
1012
- status: string;
1013
- immediate: boolean;
1014
- }>;
1015
- private requireTenantId;
1016
- private requireUserId;
1017
- private buildActor;
1018
- private resolveUserEmail;
1019
- private toResponseRedemption;
1020
- private collectPromoSkipReasons;
1021
- /**
1022
- * #18: contract freeze after the plan change — non-fatal, only outside of
1023
- * the trial (during a trial the trial entitlements apply, not the booked plan;
1024
- * the freeze happens on the transition to ACTIVE, i.e. on materialization).
1025
- * Without a configured `contractFreeze` hook the call is a no-op.
1026
- */
1027
- private tryFreezeOnPlanChange;
1028
- /**
1029
- * Audit-log helper — writes best-effort, does not block the response path.
1030
- * If `AdminAuditService` is not injected (e.g. a minimal deploy without
1031
- * AdminModule), the call is silently discarded.
1032
- */
1033
- private auditLog;
1034
- }
1035
-
1036
- interface TenantBillingModuleOptions {
1037
- /**
1038
- * App guards in the order in which they should be executed
1039
- * (e.g. `[JwtAuthGuard, TenantGuard]`). The platform combines them via
1040
- * `ComposedTenantAuthGuard`. At least one guard is mandatory —
1041
- * missing configuration leads to 403 (safe default).
1042
- *
1043
- * Variant 1: array of guard instances (e.g. via factory provider).
1044
- * Variant 2: Pick<FactoryProvider, 'useFactory' | 'inject'> — apps
1045
- * pass their guard classes through via `inject` and the factory builds
1046
- * the array.
1047
- */
1048
- authGuards: ProviderSpec<ReadonlyArray<CanActivate>>;
1049
- /** Adapter to the subscription display form (`GET /billing/usage`). */
1050
- subscriptionUsagePort: ProviderSpec<SubscriptionUsagePort>;
1051
- /** Adapter to usage counters of all `quotaKeys`. */
1052
- usageSnapshotPort: ProviderSpec<UsageSnapshotPort>;
1053
- /** Adapter for plan/add-on mutations (phase C). */
1054
- subscriptionWritePort: ProviderSpec<TenantSubscriptionWritePort>;
1055
- /**
1056
- * Optional adapter that provides the projected new trial end of a change
1057
- * (app trial logic, e.g. carry-over). Without a port,
1058
- * `PlanChangePreviewDto.projectedTrialEndsAt` stays `null`.
1059
- */
1060
- trialProjectionPort?: ProviderSpec<TrialProjectionPort>;
1061
- /**
1062
- * Optional adapter that provides due scheduled plan changes (#19). If it is
1063
- * passed, the module registers the `PendingPlanMaterializationService`
1064
- * (exported) — the consumer triggers it via its own cron. Without a
1065
- * port, the materialization stays disabled (lazy resolution as before).
1066
- */
1067
- pendingPlanQueryPort?: ProviderSpec<PendingPlanQueryPort>;
1068
- /**
1069
- * Optional contract freeze hook (#18). If it is configured, the
1070
- * platform `changePlan` path (non-TRIAL) AND the materialization freeze
1071
- * the agreed service after the plan mutation as a `SubscriptionContract`
1072
- * (analogous to `trialProjectionPort`). Consumer-specific are only `projectKey`
1073
- * + bundle/version data access (`sourcePort`); the contract logic is
1074
- * generic. `subscriptionContractRepository` is the same repo that also goes
1075
- * to `EntitlementModule.forRoot` — the freeze needs it in its own scope.
1076
- */
1077
- contractFreeze?: {
1078
- projectKey: string;
1079
- sourcePort: ProviderSpec<ContractFreezeSourcePort>;
1080
- subscriptionContractRepository: ProviderSpec<SubscriptionContractRepository>;
1081
- };
1082
- /**
1083
- * Plans that are not accepted as target/source via self-service
1084
- * (typically ENTERPRISE → special contract). `null`/undefined = no blocks.
1085
- */
1086
- selfServiceBlockedPlans?: SelfServiceBlockedPlans;
1087
- /** Optional tenant ID resolver. Default: `req.user.tenantId`. */
1088
- tenantIdResolver?: TenantIdResolver;
1089
- /** Optional user ID resolver. Default: `req.user.sub ?? req.user.id`. */
1090
- userIdResolver?: UserIdResolver;
1091
- /**
1092
- * Optional email resolver for the audit log path. Default: `req.user.email`.
1093
- * If the consumer JWT does not include the email, the resolver can
1094
- * return `null` — the audit log then uses `'unknown'`.
1095
- */
1096
- userEmailResolver?: UserEmailResolver;
1097
- /**
1098
- * Optional audit context resolver (session ID / trace ID). Default:
1099
- * `req.headers['x-session-id']` or `'tenant-self-service'`.
1100
- */
1101
- auditContextResolver?: AuditContextResolver;
1102
- /**
1103
- * Modules whose providers must be visible within this module.
1104
- * Typical use case: the app's own `AuthModule`, so that the `JwtAuthGuard`
1105
- * is injectable in the `authGuards` factory. Without this entry NestJS throws
1106
- * `UnknownDependenciesException` for JwtAuthGuard.
1107
- */
1108
- imports?: Array<Type<unknown> | DynamicModule | Promise<DynamicModule> | ForwardReference>;
1109
- /**
1110
- * Additional providers that are registered in the DynamicModule itself —
1111
- * typically: the adapter classes referenced in `inject:[Adapter]` lists
1112
- * (e.g. `PrismaSubscriptionUsagePort`). NestJS 11.1.19
1113
- * resolves factory inject tokens only in the DynamicModule's own scope.
1114
- */
1115
- extraProviders?: Provider[];
1116
- /** Register the module globally — default `false`. */
1117
- global?: boolean;
1118
- }
1119
- declare class TenantBillingModule {
1120
- static forRoot(options: TenantBillingModuleOptions): DynamicModule;
1121
- }
1122
-
1123
566
  /**
1124
567
  * Builds the `ConfiguratorCatalog` (for onboarding step 3) from the
1125
568
  * live `plan_versions` (SuperAdmin defines plans + prices) plus the
@@ -1140,160 +583,6 @@ declare const SUBSCRIPTION_BUNDLE_REPOSITORY_TOKEN: unique symbol;
1140
583
  /** Optional config token; default = 12 months minimum term. */
1141
584
  declare const SUBSCRIPTION_BUNDLE_CONFIG_TOKEN: unique symbol;
1142
585
 
1143
- interface SubscriptionBundlePreviewIssue {
1144
- code: string;
1145
- message: string;
1146
- }
1147
- /** Subscription context — the controller reads it from the SubscriptionUsagePort. */
1148
- interface SubscriptionBundlePreviewContext {
1149
- subscriptionId: string;
1150
- /** PlanKey of the current subscription (plan compatibility + redundancy source). */
1151
- currentPlanKey: string;
1152
- /** 'MONTHLY' | 'YEARLY' (port convention). */
1153
- billingCycle: string;
1154
- /** Subscription status (TRIAL/ACTIVE/...). No proration during TRIAL. */
1155
- status: string;
1156
- startedAt: Date | null;
1157
- currentPeriodStart: Date | null;
1158
- currentPeriodEnd: Date | null;
1159
- }
1160
- interface BundlePreviewSnapshot {
1161
- bundleKey: string;
1162
- label: string;
1163
- bundleVersionId: string;
1164
- features: string[];
1165
- quotas: Record<string, number>;
1166
- }
1167
- /** AK-13: feature is already paid for elsewhere — double-payment hint. */
1168
- interface RedundantFeatureHint {
1169
- featureKey: string;
1170
- coveredBy: 'PLAN' | 'BUNDLE';
1171
- /** planKey or bundleKey of the covering source. */
1172
- coveredByKey: string;
1173
- }
1174
- interface SubscriptionBundleAddPreviewDto {
1175
- action: 'add';
1176
- bundle: BundlePreviewSnapshot;
1177
- billingCycle: string;
1178
- /**
1179
- * Prorated amount until period end. `null` during TRIAL (no paid
1180
- * period yet) or without a list price for the cycle.
1181
- */
1182
- proration: ProrationDto | null;
1183
- /** List price per follow-up period in the current cycle; null = no price maintained. */
1184
- nextPeriodPriceNet: number | null;
1185
- minimumTermMonths: number;
1186
- /** Projected minimum-term end from `now`; null = no minimum term. */
1187
- minimumTermEndsAt: Date | null;
1188
- redundantFeatures: RedundantFeatureHint[];
1189
- /**
1190
- * requires-features (#35) that neither the plan nor active bundles nor the
1191
- * bundle itself cover. Non-empty ⇒ blocker
1192
- * BUNDLE_FEATURE_DEPENDENCY_UNSATISFIED.
1193
- */
1194
- missingRequires: string[];
1195
- blockers: SubscriptionBundlePreviewIssue[];
1196
- warnings: SubscriptionBundlePreviewIssue[];
1197
- }
1198
- interface SubscriptionBundleCancelPreviewDto {
1199
- action: 'cancel';
1200
- subscriptionBundleId: string;
1201
- bundle: BundlePreviewSnapshot;
1202
- billingCycle: string;
1203
- /** Effective date = max(currentPeriodEnd, minimumTermEndsAt). */
1204
- effectiveAt: Date;
1205
- /** Savings per period from the effective date; null = no price maintained. */
1206
- nextPeriodSavingsNet: number | null;
1207
- blockers: SubscriptionBundlePreviewIssue[];
1208
- warnings: SubscriptionBundlePreviewIssue[];
1209
- }
1210
- declare class SubscriptionBundlePreviewService {
1211
- private readonly subscriptionBundles;
1212
- private readonly bundles;
1213
- private readonly plans;
1214
- private readonly catalogEntries;
1215
- private readonly blockedBundles;
1216
- private readonly defaultMinTermMonths;
1217
- constructor(subscriptionBundles: SubscriptionBundleRepository, bundles: BundleRepository, plans?: PlanRepository | null, catalogEntries?: CatalogEntryRepository | null, blockedBundles?: SelfServiceBlockedBundles | null, config?: SubscriptionBundleConfig);
1218
- previewAdd(ctx: SubscriptionBundlePreviewContext, input: {
1219
- bundleVersionId: string;
1220
- minimumTermMonths?: number;
1221
- }, now?: Date): Promise<SubscriptionBundleAddPreviewDto>;
1222
- previewCancel(ctx: SubscriptionBundlePreviewContext, input: {
1223
- subscriptionBundleId: string;
1224
- }, now?: Date): Promise<SubscriptionBundleCancelPreviewDto>;
1225
- /** Bookability checks — same codes as `addBundleToSubscription` (422 path). */
1226
- private collectBookabilityBlockers;
1227
- /** Versions of the active bundle bookings (for redundancy + requires coverage). */
1228
- private loadActiveBundleVersions;
1229
- /** Features of the currently live PlanVersion state; empty without PlanRepository. */
1230
- private resolvePlanFeatures;
1231
- private collectRedundantFeatures;
1232
- /**
1233
- * requires of the new bundle that neither the bundle itself nor plan ∪
1234
- * active bundles cover (#35). Empty without CatalogEntryRepository.
1235
- */
1236
- private collectMissingRequires;
1237
- /** `projectKey` lives on the bundle stem, not on the version. */
1238
- private resolveProjectKey;
1239
- }
1240
- /**
1241
- * List price (net) for the billing cycle including plan-specific
1242
- * pricing override (BundlePricingOverride with `planId`). null = no price
1243
- * maintained for the cycle.
1244
- */
1245
- declare function resolveBundlePriceNet(bundleVersion: BundleVersionRow, planKey: string, billingCycle: string): number | null;
1246
-
1247
- interface SubscriptionBundleControllerOptions {
1248
- extraGuards?: Array<Type<CanActivate>>;
1249
- /**
1250
- * Auth guard list analogous to `TenantBillingModule.forRoot.authGuards`.
1251
- * Without this list, `ComposedTenantAuthGuard` blocks fail-closed.
1252
- */
1253
- authGuards?: ProviderSpec<ReadonlyArray<CanActivate>>;
1254
- /**
1255
- * Usage port for subscription lookup and current plan compatibility.
1256
- * If not set, an imported module must export the token.
1257
- */
1258
- subscriptionUsagePort?: ProviderSpec<SubscriptionUsagePort>;
1259
- /** Optional tenant-ID resolver. Default: `req.user.tenantId`. */
1260
- tenantIdResolver?: TenantIdResolver;
1261
- }
1262
- interface SubscriptionBundleModuleOptions {
1263
- subscriptionBundleRepository: ProviderSpec<SubscriptionBundleRepository>;
1264
- /**
1265
- * Optional — if omitted, `BUNDLE_REPOSITORY_TOKEN` is expected via
1266
- * default inject from the DI scope (typically via an imported
1267
- * `CatalogModule`).
1268
- */
1269
- bundleRepository?: ProviderSpec<BundleRepository>;
1270
- /** Default minimum term (months). Default = 12. */
1271
- defaultMinimumTermMonths?: number;
1272
- /**
1273
- * Self-service policy (#37): bundles that are only bookable via sales.
1274
- * Applies in `addBundleToSubscription` (422 BUNDLE_NOT_SELF_SERVICE)
1275
- * and in the preview (blocker).
1276
- */
1277
- selfServiceBlockedBundles?: SelfServiceBlockedBundles;
1278
- /**
1279
- * If set: the tenant self-service controller is mounted at
1280
- * `/billing/subscription-bundles` (GET/POST/DELETE). The
1281
- * `extraGuards` are applied in addition to the platform default
1282
- * `ComposedTenantAuthGuard` (role/MFA guards).
1283
- *
1284
- * Prerequisite: the consumer has already registered `TenantBillingModule`
1285
- * — the controller needs `SUBSCRIPTION_USAGE_PORT_TOKEN`
1286
- * + `TENANT_ID_RESOLVER_TOKEN` in the same DI scope.
1287
- */
1288
- controller?: SubscriptionBundleControllerOptions;
1289
- imports?: Array<Type<unknown> | DynamicModule | Promise<DynamicModule> | ForwardReference>;
1290
- extraProviders?: Provider[];
1291
- global?: boolean;
1292
- }
1293
- declare class SubscriptionBundleModule {
1294
- static forRoot(options: SubscriptionBundleModuleOptions): DynamicModule;
1295
- }
1296
-
1297
586
  /**
1298
587
  * Factory analogous to `buildBundlesController` etc. — the consumer can pass
1299
588
  * additional guards (e.g. RoleGuard) in addition to the platform default
@@ -1301,4 +590,4 @@ declare class SubscriptionBundleModule {
1301
590
  */
1302
591
  declare function buildTenantSubscriptionBundlesController(extraGuards?: Array<Type<CanActivate>>): Type;
1303
592
 
1304
- export { AUDIT_CONTEXT_RESOLVER_TOKEN, type AddBundleToSubscriptionInput, type AjvErrorLike, type AuditContextResolver, type AuthGuardList, type BundlePreviewSnapshot, CONTRACT_FREEZE_PORT_TOKEN, CONTRACT_FREEZE_PROJECT_KEY_TOKEN, CONTRACT_FREEZE_SOURCE_PORT_TOKEN, type CancelBundleFromSubscriptionInput, CancelSubscriptionDto, CatalogBundleUpsellResolver, ChangePlanDto, CompleteOnboardingSubscriptionDto, ComposedTenantAuthGuard, ConfiguratorCatalogBuilder, type ContractFreezeBundleSnapshot, type ContractFreezePort, type ContractFreezeSourcePort, type DuePendingPlanChange, FEATURE_GUARD_CONFIG_TOKEN, FEATURE_UI_REGISTRY_TOKEN, FeatureGuard, type FeatureGuardConfig, LimitExceededFilter, type LimitsCheckRow, type LoadPlanCatalogOptions, type MarketingFields, type NextPeriodWindow, PENDING_PLAN_QUERY_PORT_TOKEN, PLAN_CATALOG_IMPORT_SINK_TOKEN, PLAN_CATALOG_READ_SINK_TOKEN, PLAN_CATALOG_TOKEN, PUBLIC_CATALOG_BUNDLE_REPOSITORY_TOKEN, PUBLIC_CATALOG_MARKETING_REPOSITORY_TOKEN, PUBLIC_CATALOG_PROJECT_KEY_TOKEN, PendingPlanMaterializationService, type PendingPlanQueryPort, type PeriodRollInput, type PlanCatalogBuildSettings, PlanCatalogImportDto, type PlanCatalogImporterControllerConfig, PlanCatalogImporterModule, type PlanCatalogImporterModuleOptions, PlanCatalogImporterService, PlanCatalogModule, type PlanCatalogModuleOptions, PlanCatalogValidationError, type PlanChangeContext, type PlanChangePreviewDto, type PlanChangePreviewIssue, PlanChangePreviewService, type PlanChangeType, type PlanResponseEntry, type PlanSnapshotDto, PreviewPlanChangeDto, type ProrationDto, type ProrationInput, type PublicBundleEntry, PublicCatalogController, PublicCatalogModule, type PublicCatalogModuleOptions, PublishValidationError, type PublishablePlanVersion, REQUIRE_FEATURE_KEY, type RedundantFeatureHint, type RenewalDecision, type RenewalSubInput, RequireFeature, SELF_SERVICE_BLOCKED_BUNDLES_TOKEN, SELF_SERVICE_BLOCKED_PLANS_TOKEN, SUBSCRIPTION_BUNDLE_CONFIG_TOKEN, SUBSCRIPTION_BUNDLE_REPOSITORY_TOKEN, SUBSCRIPTION_USAGE_PORT_TOKEN, SUBSCRIPTION_WRITE_PORT_TOKEN, type SelfServiceBlockedBundles, type SelfServiceBlockedPlans, type SubscriptionBundleAddPreviewDto, type SubscriptionBundleCancelPreviewDto, type SubscriptionBundleConfig, type SubscriptionBundleControllerOptions, SubscriptionBundleModule, type SubscriptionBundleModuleOptions, type SubscriptionBundlePreviewContext, type SubscriptionBundlePreviewIssue, SubscriptionBundlePreviewService, SubscriptionBundlesService, SubscriptionContractFreezeService, TENANT_AUTH_GUARDS_TOKEN, TENANT_ID_RESOLVER_TOKEN, TRIAL_PROJECTION_PORT_TOKEN, TenantAdminGuard, TenantBillingController, TenantBillingModule, type TenantBillingModuleOptions, type TenantIdResolver, type TrialProjectionInput, type TrialProjectionPort, UPSELL_OFFER_CURRENCY_TOKEN, UPSELL_OFFER_RESOLVER_TOKEN, USAGE_SNAPSHOT_PORT_TOKEN, USER_EMAIL_RESOLVER_TOKEN, USER_ID_RESOLVER_TOKEN, type UsageResponse, type UserEmailResolver, type UserIdResolver, addMonths, assertBaseVersionFresh, assertChangeNote, assertDraftPublishable, assertOptimisticLockHeld, buildPlanCatalogFromSnapshot, buildPlanCatalogImporterController, buildTenantSubscriptionBundlesController, clearPendingPlanVersionFields, computeCarriedTrialEndsAt, computeNextPeriod, computeProration, decideRenewal, findPlan, getActiveFeatureKeys, getMarketedPlans, getPlanOrThrow, getPlanPriceGross, getPlanPriceNet, getPlanQuota, initialPeriodWindow, isFeatureInPlan, isFeaturePlannedOnly, loadPlanCatalogFromFile, loadPlanCatalogFromString, periodEndAfter, periodEndWithMinLead, resolveBundleCancelEffectiveAt, resolveBundlePriceNet };
593
+ export { type AjvErrorLike, CatalogBundleUpsellResolver, ConfiguratorCatalogBuilder, ContractFreezePort, ContractFreezeSourcePort, FEATURE_GUARD_CONFIG_TOKEN, FEATURE_UI_REGISTRY_TOKEN, FeatureGuard, type FeatureGuardConfig, LimitExceededFilter, type LoadPlanCatalogOptions, type MarketingFields, type NextPeriodWindow, PLAN_CATALOG_IMPORT_SINK_TOKEN, PLAN_CATALOG_READ_SINK_TOKEN, PLAN_CATALOG_TOKEN, PUBLIC_CATALOG_BUNDLE_REPOSITORY_TOKEN, PUBLIC_CATALOG_MARKETING_REPOSITORY_TOKEN, PUBLIC_CATALOG_PROJECT_KEY_TOKEN, type PeriodRollInput, type PlanCatalogBuildSettings, PlanCatalogImportDto, type PlanCatalogImporterControllerConfig, PlanCatalogImporterModule, type PlanCatalogImporterModuleOptions, PlanCatalogImporterService, PlanCatalogModule, type PlanCatalogModuleOptions, PlanCatalogValidationError, type PlanResponseEntry, type PublicBundleEntry, PublicCatalogController, PublicCatalogModule, type PublicCatalogModuleOptions, PublishValidationError, type PublishablePlanVersion, REQUIRE_FEATURE_KEY, type RenewalDecision, type RenewalSubInput, RequireFeature, SUBSCRIPTION_BUNDLE_CONFIG_TOKEN, SUBSCRIPTION_BUNDLE_REPOSITORY_TOKEN, SubscriptionContractFreezeService, UPSELL_OFFER_CURRENCY_TOKEN, UPSELL_OFFER_RESOLVER_TOKEN, assertBaseVersionFresh, assertChangeNote, assertDraftPublishable, assertOptimisticLockHeld, buildPlanCatalogFromSnapshot, buildPlanCatalogImporterController, buildTenantSubscriptionBundlesController, clearPendingPlanVersionFields, computeCarriedTrialEndsAt, computeNextPeriod, decideRenewal, findPlan, getActiveFeatureKeys, getMarketedPlans, getPlanOrThrow, getPlanPriceGross, getPlanPriceNet, getPlanQuota, initialPeriodWindow, isFeatureInPlan, isFeaturePlannedOnly, loadPlanCatalogFromFile, loadPlanCatalogFromString, periodEndAfter, periodEndWithMinLead };