@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,89 +1,10 @@
1
- import { CheckoutOfferRepository, BundleRepository, PlanRepository, CatalogEntryRepository, CheckoutOfferFilter, CheckoutOfferRow, CreateCheckoutOfferData, UpdateCheckoutOfferData, CheckoutOfferPriceBreakdown, CheckoutOfferLineItem, CheckoutOfferPromotionSnapshot, CheckoutOfferPromoCodeSnapshot } from '@saasicat/types';
2
- import { Type, CanActivate, DynamicModule, ForwardReference, Provider } from '@nestjs/common';
3
- import { P as ProviderSpec } from '../di-CcNeq9v-.cjs';
4
-
5
- declare class CheckoutOfferService {
6
- private readonly repo;
7
- private readonly bundles;
8
- private readonly plans;
9
- private readonly catalogEntries;
10
- constructor(repo: CheckoutOfferRepository, bundles?: BundleRepository | null, plans?: PlanRepository | null, catalogEntries?: CatalogEntryRepository | null);
11
- list(filter: CheckoutOfferFilter): Promise<CheckoutOfferRow[]>;
12
- getById(id: string): Promise<CheckoutOfferRow>;
13
- create(data: CreateCheckoutOfferData): Promise<CheckoutOfferRow>;
14
- /** Customization in onboarding — only while the offer is `open`. */
15
- update(id: string, data: UpdateCheckoutOfferData): Promise<CheckoutOfferRow>;
16
- /**
17
- * Freezes the offer (`status = 'consumed'`). Returns the final
18
- * snapshot — the caller (registration/billing) writes it
19
- * as `Subscription.packageSnapshot`.
20
- */
21
- consume(id: string): Promise<CheckoutOfferRow>;
22
- /**
23
- * #35 P6 — server-side requires validation: the dependencies of all
24
- * features (plan ∪ selected bundles) must be covered within the
25
- * selection, otherwise an offer would be created whose features cannot
26
- * work at the tenant (an app-specific validateModuleDependencies check is
27
- * thereby replaced on the platform side). The requires source are the
28
- * curated FeatureCatalogEntries; without CatalogEntryRepository it is
29
- * skipped (graceful — no requires data available).
30
- */
31
- private assertFeatureRequiresSatisfied;
32
- /**
33
- * Plan features preferably from the server SSOT (PlanRepository); fallback
34
- * is the frozen featuresSnapshot of the plan LineItem (adapter without
35
- * PlanRepository wiring).
36
- */
37
- private resolvePlanFeatures;
38
- /** Bundle features from the BundleVersions; fallback featuresSnapshot. */
39
- private resolveBundleFeatures;
40
- private assertBundleVersionsStillBookable;
41
- private normalizeCreateData;
42
- private normalizeUpdateData;
43
- private resolveLineItems;
44
- private defaultPlanLineItem;
45
- private assertOpen;
46
- private isExpired;
47
- private dateIsAfterNow;
48
- private isValidUntilExpired;
49
- }
1
+ export { C as CheckoutOfferControllerConfig, a as CheckoutOfferModule, b as CheckoutOfferModuleOptions, c as CheckoutOfferService } from '../checkout-offer.module-ZYF5IsDY.cjs';
2
+ import { Type, CanActivate } from '@nestjs/common';
3
+ import { CheckoutOfferPriceBreakdown, CheckoutOfferLineItem, CheckoutOfferPromotionSnapshot, CheckoutOfferPromoCodeSnapshot } from '@saasicat/types';
4
+ import '../di-CcNeq9v-.cjs';
50
5
 
51
6
  declare function buildCheckoutOfferController(guards: Array<Type<CanActivate>>): Type;
52
7
 
53
- interface CheckoutOfferControllerConfig {
54
- /** Class-level guards; `[]` for auth-free public endpoints. */
55
- guards: Array<Type<CanActivate>>;
56
- }
57
- interface CheckoutOfferModuleOptions {
58
- checkoutOfferRepository: ProviderSpec<CheckoutOfferRepository>;
59
- /**
60
- * Optional for V3 revalidation on consume: if set, the service checks
61
- * whether referenced bundle versions are still bookable. Also provides
62
- * the bundle features for the requires validation (#35 P6).
63
- */
64
- bundleRepository?: ProviderSpec<BundleRepository>;
65
- /**
66
- * Optional for the requires validation (#35 P6): plan features of the
67
- * chosen plan version. Without wiring, falls back to the featuresSnapshot
68
- * of the plan line item.
69
- */
70
- planRepository?: ProviderSpec<PlanRepository>;
71
- /**
72
- * Optional for the requires validation (#35 P6): requires source =
73
- * curated FeatureCatalogEntries. Without wiring, the validation is
74
- * skipped (graceful).
75
- */
76
- catalogEntryRepository?: ProviderSpec<CatalogEntryRepository>;
77
- /** Controller mount for `/public/checkout-offer`. Omitted = service only. */
78
- controller?: CheckoutOfferControllerConfig;
79
- imports?: Array<Type<unknown> | DynamicModule | Promise<DynamicModule> | ForwardReference>;
80
- extraProviders?: Provider[];
81
- global?: boolean;
82
- }
83
- declare class CheckoutOfferModule {
84
- static forRoot(options: CheckoutOfferModuleOptions): DynamicModule;
85
- }
86
-
87
8
  /** Repository for `checkout_offers`. */
88
9
  declare const CHECKOUT_OFFER_REPOSITORY_TOKEN: unique symbol;
89
10
 
@@ -117,4 +38,4 @@ declare class UpdateCheckoutOfferDto {
117
38
  validUntil?: string | null;
118
39
  }
119
40
 
120
- export { CHECKOUT_OFFER_REPOSITORY_TOKEN, type CheckoutOfferControllerConfig, CheckoutOfferModule, type CheckoutOfferModuleOptions, CheckoutOfferService, CreateCheckoutOfferDto, UpdateCheckoutOfferDto, buildCheckoutOfferController };
41
+ export { CHECKOUT_OFFER_REPOSITORY_TOKEN, CreateCheckoutOfferDto, UpdateCheckoutOfferDto, buildCheckoutOfferController };
@@ -1,89 +1,10 @@
1
- import { CheckoutOfferRepository, BundleRepository, PlanRepository, CatalogEntryRepository, CheckoutOfferFilter, CheckoutOfferRow, CreateCheckoutOfferData, UpdateCheckoutOfferData, CheckoutOfferPriceBreakdown, CheckoutOfferLineItem, CheckoutOfferPromotionSnapshot, CheckoutOfferPromoCodeSnapshot } from '@saasicat/types';
2
- import { Type, CanActivate, DynamicModule, ForwardReference, Provider } from '@nestjs/common';
3
- import { P as ProviderSpec } from '../di-CcNeq9v-.js';
4
-
5
- declare class CheckoutOfferService {
6
- private readonly repo;
7
- private readonly bundles;
8
- private readonly plans;
9
- private readonly catalogEntries;
10
- constructor(repo: CheckoutOfferRepository, bundles?: BundleRepository | null, plans?: PlanRepository | null, catalogEntries?: CatalogEntryRepository | null);
11
- list(filter: CheckoutOfferFilter): Promise<CheckoutOfferRow[]>;
12
- getById(id: string): Promise<CheckoutOfferRow>;
13
- create(data: CreateCheckoutOfferData): Promise<CheckoutOfferRow>;
14
- /** Customization in onboarding — only while the offer is `open`. */
15
- update(id: string, data: UpdateCheckoutOfferData): Promise<CheckoutOfferRow>;
16
- /**
17
- * Freezes the offer (`status = 'consumed'`). Returns the final
18
- * snapshot — the caller (registration/billing) writes it
19
- * as `Subscription.packageSnapshot`.
20
- */
21
- consume(id: string): Promise<CheckoutOfferRow>;
22
- /**
23
- * #35 P6 — server-side requires validation: the dependencies of all
24
- * features (plan ∪ selected bundles) must be covered within the
25
- * selection, otherwise an offer would be created whose features cannot
26
- * work at the tenant (an app-specific validateModuleDependencies check is
27
- * thereby replaced on the platform side). The requires source are the
28
- * curated FeatureCatalogEntries; without CatalogEntryRepository it is
29
- * skipped (graceful — no requires data available).
30
- */
31
- private assertFeatureRequiresSatisfied;
32
- /**
33
- * Plan features preferably from the server SSOT (PlanRepository); fallback
34
- * is the frozen featuresSnapshot of the plan LineItem (adapter without
35
- * PlanRepository wiring).
36
- */
37
- private resolvePlanFeatures;
38
- /** Bundle features from the BundleVersions; fallback featuresSnapshot. */
39
- private resolveBundleFeatures;
40
- private assertBundleVersionsStillBookable;
41
- private normalizeCreateData;
42
- private normalizeUpdateData;
43
- private resolveLineItems;
44
- private defaultPlanLineItem;
45
- private assertOpen;
46
- private isExpired;
47
- private dateIsAfterNow;
48
- private isValidUntilExpired;
49
- }
1
+ export { C as CheckoutOfferControllerConfig, a as CheckoutOfferModule, b as CheckoutOfferModuleOptions, c as CheckoutOfferService } from '../checkout-offer.module-Y0hDOVrq.js';
2
+ import { Type, CanActivate } from '@nestjs/common';
3
+ import { CheckoutOfferPriceBreakdown, CheckoutOfferLineItem, CheckoutOfferPromotionSnapshot, CheckoutOfferPromoCodeSnapshot } from '@saasicat/types';
4
+ import '../di-CcNeq9v-.js';
50
5
 
51
6
  declare function buildCheckoutOfferController(guards: Array<Type<CanActivate>>): Type;
52
7
 
53
- interface CheckoutOfferControllerConfig {
54
- /** Class-level guards; `[]` for auth-free public endpoints. */
55
- guards: Array<Type<CanActivate>>;
56
- }
57
- interface CheckoutOfferModuleOptions {
58
- checkoutOfferRepository: ProviderSpec<CheckoutOfferRepository>;
59
- /**
60
- * Optional for V3 revalidation on consume: if set, the service checks
61
- * whether referenced bundle versions are still bookable. Also provides
62
- * the bundle features for the requires validation (#35 P6).
63
- */
64
- bundleRepository?: ProviderSpec<BundleRepository>;
65
- /**
66
- * Optional for the requires validation (#35 P6): plan features of the
67
- * chosen plan version. Without wiring, falls back to the featuresSnapshot
68
- * of the plan line item.
69
- */
70
- planRepository?: ProviderSpec<PlanRepository>;
71
- /**
72
- * Optional for the requires validation (#35 P6): requires source =
73
- * curated FeatureCatalogEntries. Without wiring, the validation is
74
- * skipped (graceful).
75
- */
76
- catalogEntryRepository?: ProviderSpec<CatalogEntryRepository>;
77
- /** Controller mount for `/public/checkout-offer`. Omitted = service only. */
78
- controller?: CheckoutOfferControllerConfig;
79
- imports?: Array<Type<unknown> | DynamicModule | Promise<DynamicModule> | ForwardReference>;
80
- extraProviders?: Provider[];
81
- global?: boolean;
82
- }
83
- declare class CheckoutOfferModule {
84
- static forRoot(options: CheckoutOfferModuleOptions): DynamicModule;
85
- }
86
-
87
8
  /** Repository for `checkout_offers`. */
88
9
  declare const CHECKOUT_OFFER_REPOSITORY_TOKEN: unique symbol;
89
10
 
@@ -117,4 +38,4 @@ declare class UpdateCheckoutOfferDto {
117
38
  validUntil?: string | null;
118
39
  }
119
40
 
120
- export { CHECKOUT_OFFER_REPOSITORY_TOKEN, type CheckoutOfferControllerConfig, CheckoutOfferModule, type CheckoutOfferModuleOptions, CheckoutOfferService, CreateCheckoutOfferDto, UpdateCheckoutOfferDto, buildCheckoutOfferController };
41
+ export { CHECKOUT_OFFER_REPOSITORY_TOKEN, CreateCheckoutOfferDto, UpdateCheckoutOfferDto, buildCheckoutOfferController };
@@ -1,3 +1,4 @@
1
+ import "../chunk-DBZGV3HC.js";
1
2
  import {
2
3
  CHECKOUT_OFFER_REPOSITORY_TOKEN,
3
4
  CheckoutOfferModule,
@@ -5,9 +6,9 @@ import {
5
6
  CreateCheckoutOfferDto,
6
7
  UpdateCheckoutOfferDto,
7
8
  buildCheckoutOfferController
8
- } from "../chunk-K3OPNVFR.js";
9
+ } from "../chunk-HBFU5AN3.js";
9
10
  import "../chunk-MDIZUVIK.js";
10
- import "../chunk-N3WANKSA.js";
11
+ import "../chunk-L4KTQ6CL.js";
11
12
  import "../chunk-SABTXESR.js";
12
13
  import "../chunk-SHUYVCID.js";
13
14
  export {
@@ -0,0 +1,85 @@
1
+ import { CheckoutOfferRepository, BundleRepository, PlanRepository, CatalogEntryRepository, CheckoutOfferFilter, CheckoutOfferRow, CreateCheckoutOfferData, UpdateCheckoutOfferData } from '@saasicat/types';
2
+ import { Type, CanActivate, DynamicModule, ForwardReference, Provider } from '@nestjs/common';
3
+ import { P as ProviderSpec } from './di-CcNeq9v-.js';
4
+
5
+ declare class CheckoutOfferService {
6
+ private readonly repo;
7
+ private readonly bundles;
8
+ private readonly plans;
9
+ private readonly catalogEntries;
10
+ constructor(repo: CheckoutOfferRepository, bundles?: BundleRepository | null, plans?: PlanRepository | null, catalogEntries?: CatalogEntryRepository | null);
11
+ list(filter: CheckoutOfferFilter): Promise<CheckoutOfferRow[]>;
12
+ getById(id: string): Promise<CheckoutOfferRow>;
13
+ create(data: CreateCheckoutOfferData): Promise<CheckoutOfferRow>;
14
+ /** Customization in onboarding — only while the offer is `open`. */
15
+ update(id: string, data: UpdateCheckoutOfferData): Promise<CheckoutOfferRow>;
16
+ /**
17
+ * Freezes the offer (`status = 'consumed'`). Returns the final
18
+ * snapshot — the caller (registration/billing) writes it
19
+ * as `Subscription.packageSnapshot`.
20
+ */
21
+ consume(id: string): Promise<CheckoutOfferRow>;
22
+ /**
23
+ * #35 P6 — server-side requires validation: the dependencies of all
24
+ * features (plan ∪ selected bundles) must be covered within the
25
+ * selection, otherwise an offer would be created whose features cannot
26
+ * work at the tenant (an app-specific validateModuleDependencies check is
27
+ * thereby replaced on the platform side). The requires source are the
28
+ * curated FeatureCatalogEntries; without CatalogEntryRepository it is
29
+ * skipped (graceful — no requires data available).
30
+ */
31
+ private assertFeatureRequiresSatisfied;
32
+ /**
33
+ * Plan features preferably from the server SSOT (PlanRepository); fallback
34
+ * is the frozen featuresSnapshot of the plan LineItem (adapter without
35
+ * PlanRepository wiring).
36
+ */
37
+ private resolvePlanFeatures;
38
+ /** Bundle features from the BundleVersions; fallback featuresSnapshot. */
39
+ private resolveBundleFeatures;
40
+ private assertBundleVersionsStillBookable;
41
+ private normalizeCreateData;
42
+ private normalizeUpdateData;
43
+ private resolveLineItems;
44
+ private defaultPlanLineItem;
45
+ private assertOpen;
46
+ private isExpired;
47
+ private dateIsAfterNow;
48
+ private isValidUntilExpired;
49
+ }
50
+
51
+ interface CheckoutOfferControllerConfig {
52
+ /** Class-level guards; `[]` for auth-free public endpoints. */
53
+ guards: Array<Type<CanActivate>>;
54
+ }
55
+ interface CheckoutOfferModuleOptions {
56
+ checkoutOfferRepository: ProviderSpec<CheckoutOfferRepository>;
57
+ /**
58
+ * Optional for V3 revalidation on consume: if set, the service checks
59
+ * whether referenced bundle versions are still bookable. Also provides
60
+ * the bundle features for the requires validation (#35 P6).
61
+ */
62
+ bundleRepository?: ProviderSpec<BundleRepository>;
63
+ /**
64
+ * Optional for the requires validation (#35 P6): plan features of the
65
+ * chosen plan version. Without wiring, falls back to the featuresSnapshot
66
+ * of the plan line item.
67
+ */
68
+ planRepository?: ProviderSpec<PlanRepository>;
69
+ /**
70
+ * Optional for the requires validation (#35 P6): requires source =
71
+ * curated FeatureCatalogEntries. Without wiring, the validation is
72
+ * skipped (graceful).
73
+ */
74
+ catalogEntryRepository?: ProviderSpec<CatalogEntryRepository>;
75
+ /** Controller mount for `/public/checkout-offer`. Omitted = service only. */
76
+ controller?: CheckoutOfferControllerConfig;
77
+ imports?: Array<Type<unknown> | DynamicModule | Promise<DynamicModule> | ForwardReference>;
78
+ extraProviders?: Provider[];
79
+ global?: boolean;
80
+ }
81
+ declare class CheckoutOfferModule {
82
+ static forRoot(options: CheckoutOfferModuleOptions): DynamicModule;
83
+ }
84
+
85
+ export { type CheckoutOfferControllerConfig as C, CheckoutOfferModule as a, type CheckoutOfferModuleOptions as b, CheckoutOfferService as c };
@@ -0,0 +1,85 @@
1
+ import { CheckoutOfferRepository, BundleRepository, PlanRepository, CatalogEntryRepository, CheckoutOfferFilter, CheckoutOfferRow, CreateCheckoutOfferData, UpdateCheckoutOfferData } from '@saasicat/types';
2
+ import { Type, CanActivate, DynamicModule, ForwardReference, Provider } from '@nestjs/common';
3
+ import { P as ProviderSpec } from './di-CcNeq9v-.cjs';
4
+
5
+ declare class CheckoutOfferService {
6
+ private readonly repo;
7
+ private readonly bundles;
8
+ private readonly plans;
9
+ private readonly catalogEntries;
10
+ constructor(repo: CheckoutOfferRepository, bundles?: BundleRepository | null, plans?: PlanRepository | null, catalogEntries?: CatalogEntryRepository | null);
11
+ list(filter: CheckoutOfferFilter): Promise<CheckoutOfferRow[]>;
12
+ getById(id: string): Promise<CheckoutOfferRow>;
13
+ create(data: CreateCheckoutOfferData): Promise<CheckoutOfferRow>;
14
+ /** Customization in onboarding — only while the offer is `open`. */
15
+ update(id: string, data: UpdateCheckoutOfferData): Promise<CheckoutOfferRow>;
16
+ /**
17
+ * Freezes the offer (`status = 'consumed'`). Returns the final
18
+ * snapshot — the caller (registration/billing) writes it
19
+ * as `Subscription.packageSnapshot`.
20
+ */
21
+ consume(id: string): Promise<CheckoutOfferRow>;
22
+ /**
23
+ * #35 P6 — server-side requires validation: the dependencies of all
24
+ * features (plan ∪ selected bundles) must be covered within the
25
+ * selection, otherwise an offer would be created whose features cannot
26
+ * work at the tenant (an app-specific validateModuleDependencies check is
27
+ * thereby replaced on the platform side). The requires source are the
28
+ * curated FeatureCatalogEntries; without CatalogEntryRepository it is
29
+ * skipped (graceful — no requires data available).
30
+ */
31
+ private assertFeatureRequiresSatisfied;
32
+ /**
33
+ * Plan features preferably from the server SSOT (PlanRepository); fallback
34
+ * is the frozen featuresSnapshot of the plan LineItem (adapter without
35
+ * PlanRepository wiring).
36
+ */
37
+ private resolvePlanFeatures;
38
+ /** Bundle features from the BundleVersions; fallback featuresSnapshot. */
39
+ private resolveBundleFeatures;
40
+ private assertBundleVersionsStillBookable;
41
+ private normalizeCreateData;
42
+ private normalizeUpdateData;
43
+ private resolveLineItems;
44
+ private defaultPlanLineItem;
45
+ private assertOpen;
46
+ private isExpired;
47
+ private dateIsAfterNow;
48
+ private isValidUntilExpired;
49
+ }
50
+
51
+ interface CheckoutOfferControllerConfig {
52
+ /** Class-level guards; `[]` for auth-free public endpoints. */
53
+ guards: Array<Type<CanActivate>>;
54
+ }
55
+ interface CheckoutOfferModuleOptions {
56
+ checkoutOfferRepository: ProviderSpec<CheckoutOfferRepository>;
57
+ /**
58
+ * Optional for V3 revalidation on consume: if set, the service checks
59
+ * whether referenced bundle versions are still bookable. Also provides
60
+ * the bundle features for the requires validation (#35 P6).
61
+ */
62
+ bundleRepository?: ProviderSpec<BundleRepository>;
63
+ /**
64
+ * Optional for the requires validation (#35 P6): plan features of the
65
+ * chosen plan version. Without wiring, falls back to the featuresSnapshot
66
+ * of the plan line item.
67
+ */
68
+ planRepository?: ProviderSpec<PlanRepository>;
69
+ /**
70
+ * Optional for the requires validation (#35 P6): requires source =
71
+ * curated FeatureCatalogEntries. Without wiring, the validation is
72
+ * skipped (graceful).
73
+ */
74
+ catalogEntryRepository?: ProviderSpec<CatalogEntryRepository>;
75
+ /** Controller mount for `/public/checkout-offer`. Omitted = service only. */
76
+ controller?: CheckoutOfferControllerConfig;
77
+ imports?: Array<Type<unknown> | DynamicModule | Promise<DynamicModule> | ForwardReference>;
78
+ extraProviders?: Provider[];
79
+ global?: boolean;
80
+ }
81
+ declare class CheckoutOfferModule {
82
+ static forRoot(options: CheckoutOfferModuleOptions): DynamicModule;
83
+ }
84
+
85
+ export { type CheckoutOfferControllerConfig as C, CheckoutOfferModule as a, type CheckoutOfferModuleOptions as b, CheckoutOfferService as c };