@saasicat/nest 1.0.0-rc.2 → 1.0.0-rc.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (154) hide show
  1. package/README.md +44 -8
  2. package/dist/.build-stamp +1 -1
  3. package/dist/_entries.cjs +10214 -4796
  4. package/dist/admin/index.d.cts +5 -4
  5. package/dist/admin/index.d.ts +5 -4
  6. package/dist/admin/index.js +13 -9
  7. package/dist/{admin-resources.module-CpvzcfCc.d.cts → admin-resources.module-B4XNvdH-.d.cts} +1 -2
  8. package/dist/{admin-resources.module-DF5_Q7RD.d.ts → admin-resources.module-CWqdI9BV.d.ts} +1 -2
  9. package/dist/{admin-stats.service-TYiSUwIR.d.ts → admin-stats.service-CsLNt19Z.d.ts} +11 -7
  10. package/dist/{admin-stats.service-DfKupywR.d.cts → admin-stats.service-DrZrU8IJ.d.cts} +11 -7
  11. package/dist/{aggregation-B3CD0v_d.d.cts → aggregation-ChpZDh0g.d.ts} +39 -6
  12. package/dist/{aggregation-BFzW07DE.d.ts → aggregation-OpnhwzF5.d.cts} +39 -6
  13. package/dist/billing/index.d.cts +448 -108
  14. package/dist/billing/index.d.ts +448 -108
  15. package/dist/billing/index.js +108 -41
  16. package/dist/catalog/index.d.cts +74 -45
  17. package/dist/catalog/index.d.ts +74 -45
  18. package/dist/catalog/index.js +21 -13
  19. package/dist/catalog.module-C9O7BxRq.d.ts +180 -0
  20. package/dist/catalog.module-T-I5Ricz.d.cts +180 -0
  21. package/dist/checkout-offer/index.d.cts +17 -22
  22. package/dist/checkout-offer/index.d.ts +17 -22
  23. package/dist/checkout-offer/index.js +21 -7
  24. package/dist/checkout-offer.module-DFhGy6JO.d.cts +58 -0
  25. package/dist/checkout-offer.module-x7SP_dX4.d.ts +58 -0
  26. package/dist/checkout-offer.service-BeHgYikI.d.ts +242 -0
  27. package/dist/checkout-offer.service-CCVxG9b2.d.cts +242 -0
  28. package/dist/chunk-34XVPR6P.js +222 -0
  29. package/dist/{chunk-AOQJEYOL.js → chunk-3QVGA6JX.js} +3 -1
  30. package/dist/chunk-3RLWML2S.js +896 -0
  31. package/dist/{chunk-TXC3LHHB.js → chunk-4SDSYV4A.js} +21 -13
  32. package/dist/chunk-55QEDAMX.js +946 -0
  33. package/dist/chunk-5CKC7O52.js +140 -0
  34. package/dist/chunk-6PJE7EWO.js +185 -0
  35. package/dist/chunk-7NJKVC5X.js +353 -0
  36. package/dist/{chunk-RUNZ3X4C.js → chunk-AOS2JPDD.js} +1263 -185
  37. package/dist/{chunk-WOVQPXV4.js → chunk-CQ2ZZMTD.js} +702 -725
  38. package/dist/{chunk-NA6O63B7.js → chunk-F5X66HF5.js} +5 -5
  39. package/dist/chunk-FEQZCWUL.js +174 -0
  40. package/dist/{chunk-VIJ5NJWC.js → chunk-G6EZWECL.js} +107 -31
  41. package/dist/chunk-G7RQO2XO.js +0 -0
  42. package/dist/{chunk-N3L3AICU.js → chunk-GPQWGA6B.js} +5 -6
  43. package/dist/chunk-GZTL64QK.js +7 -0
  44. package/dist/{chunk-SABTXESR.js → chunk-J7NJRK3K.js} +17 -1
  45. package/dist/{chunk-SEPN52AD.js → chunk-JBCC6C3M.js} +566 -307
  46. package/dist/{chunk-I7GTA3RX.js → chunk-JQRA724W.js} +1 -1
  47. package/dist/{chunk-WXYJHZCN.js → chunk-JVAEKTJ4.js} +2 -14
  48. package/dist/chunk-KPEMTBOP.js +26 -0
  49. package/dist/chunk-LF6J4YYN.js +301 -0
  50. package/dist/{chunk-LTT736P3.js → chunk-LLYVYRGJ.js} +228 -387
  51. package/dist/{chunk-6Z7JR4EW.js → chunk-M47BNEY2.js} +1897 -633
  52. package/dist/{chunk-KFT5AIIH.js → chunk-NDLC5GYK.js} +206 -24
  53. package/dist/{chunk-O2J2HDXA.js → chunk-OOTEXP47.js} +3 -8
  54. package/dist/chunk-QPVDCKYS.js +702 -0
  55. package/dist/{chunk-NHVDCYK5.js → chunk-R5YCJBHY.js} +71 -106
  56. package/dist/{chunk-XBYAFEOR.js → chunk-S33SO5XX.js} +1 -1
  57. package/dist/chunk-SZ7RFPXA.js +10 -0
  58. package/dist/chunk-TBBZWZQT.js +98 -0
  59. package/dist/chunk-TOEFN7DN.js +295 -0
  60. package/dist/{chunk-7ZEGFL42.js → chunk-WHJSYKNC.js} +6 -6
  61. package/dist/chunk-WOEJ6K7M.js +55 -0
  62. package/dist/{chunk-AU3OOREM.js → chunk-XSSWYPP5.js} +16 -3
  63. package/dist/contract-line-item-money-B0Z3Ogur.d.cts +43 -0
  64. package/dist/contract-line-item-money-B0Z3Ogur.d.ts +43 -0
  65. package/dist/discovery/index.d.cts +2 -2
  66. package/dist/discovery/index.d.ts +2 -2
  67. package/dist/discovery/index.js +6 -6
  68. package/dist/{discovery.scanner-9cMqF95o.d.cts → discovery.scanner-DXKc6JkV.d.cts} +1 -1
  69. package/dist/{discovery.scanner-9cMqF95o.d.ts → discovery.scanner-DXKc6JkV.d.ts} +1 -1
  70. package/dist/{enforce-quota.interceptor-Df0e3OWe.d.cts → enforce-quota.interceptor-BFyVdWe8.d.cts} +6 -6
  71. package/dist/{enforce-quota.interceptor-DW3etVyI.d.ts → enforce-quota.interceptor-GaBXboGx.d.ts} +6 -6
  72. package/dist/entitlement/index.d.cts +27 -4
  73. package/dist/entitlement/index.d.ts +27 -4
  74. package/dist/entitlement/index.js +13 -8
  75. package/dist/index.d.cts +209 -28
  76. package/dist/index.d.ts +209 -28
  77. package/dist/index.js +285 -163
  78. package/dist/issuer-identity.check-CBO0vcsq.d.cts +197 -0
  79. package/dist/issuer-identity.check-Cz9CEMkZ.d.ts +197 -0
  80. package/dist/{module-options-COSEb0VW.d.ts → module-options-DmQ3G4sZ.d.ts} +135 -41
  81. package/dist/{module-options-BG3MzQva.d.cts → module-options-qAOwinHR.d.cts} +135 -41
  82. package/dist/payment-callback.service-CR84Xw1Z.d.cts +125 -0
  83. package/dist/payment-callback.service-CR84Xw1Z.d.ts +125 -0
  84. package/dist/payments/index.cjs +4 -0
  85. package/dist/payments/index.d.cts +187 -0
  86. package/dist/payments/index.d.ts +187 -0
  87. package/dist/payments/index.js +141 -0
  88. package/dist/payments.module-BdUq9ot_.d.cts +57 -0
  89. package/dist/payments.module-CQGv_VG7.d.ts +57 -0
  90. package/dist/plan-catalog-source-DWe-BGY1.d.cts +21 -0
  91. package/dist/plan-catalog-source-DWe-BGY1.d.ts +21 -0
  92. package/dist/{plan-resolution-Cgo_TR1H.d.cts → plan-resolution-CwUy_OqC.d.cts} +14 -0
  93. package/dist/{plan-resolution-Cgo_TR1H.d.ts → plan-resolution-CwUy_OqC.d.ts} +14 -0
  94. package/dist/{plan-versions.service-DChhbK6h.d.ts → plan-versions.service-C0N-Em2W.d.ts} +38 -64
  95. package/dist/{plan-versions.service-TPEtbN0r.d.cts → plan-versions.service-DARLh-qI.d.cts} +38 -64
  96. package/dist/platform/index.d.cts +52 -23
  97. package/dist/platform/index.d.ts +52 -23
  98. package/dist/platform/index.js +57 -36
  99. package/dist/promo/index.d.cts +23 -8
  100. package/dist/promo/index.d.ts +23 -8
  101. package/dist/promo/index.js +15 -7
  102. package/dist/{promo.module-DtvIycpt.d.cts → promo.module-CKkECmU8.d.cts} +9 -3
  103. package/dist/{promo.module-Z8h1PNX-.d.ts → promo.module-DuIJdK3U.d.ts} +9 -3
  104. package/dist/promo.service-BYBu6dy3.d.cts +215 -0
  105. package/dist/promo.service-CFjfF0Xm.d.ts +215 -0
  106. package/dist/registration/index.d.cts +104 -47
  107. package/dist/registration/index.d.ts +104 -47
  108. package/dist/registration/index.js +15 -9
  109. package/dist/subscriber/index.cjs +4 -0
  110. package/dist/subscriber/index.d.cts +28 -0
  111. package/dist/subscriber/index.d.ts +28 -0
  112. package/dist/subscriber/index.js +16 -0
  113. package/dist/subscriber.service-5W6Gi-1B.d.cts +68 -0
  114. package/dist/subscriber.service-5W6Gi-1B.d.ts +68 -0
  115. package/dist/subscription-contract/index.d.cts +4 -2
  116. package/dist/subscription-contract/index.d.ts +4 -2
  117. package/dist/subscription-contract/index.js +13 -5
  118. package/dist/{subscription-contract.module-fDFdQ0jm.d.ts → subscription-contract.module-BfIRpc1o.d.ts} +8 -2
  119. package/dist/{subscription-contract.module-CEK8HS5-.d.cts → subscription-contract.module-DTMuUJYd.d.cts} +8 -2
  120. package/dist/{subscription-contract.service-hD87MKyg.d.cts → subscription-contract.service-CPZrTM9C.d.ts} +32 -3
  121. package/dist/{subscription-contract.service-hD87MKyg.d.ts → subscription-contract.service-CfNApLuP.d.cts} +32 -3
  122. package/dist/tenant-billing.controller-BLqbsONe.d.ts +812 -0
  123. package/dist/tenant-billing.controller-DKbAqTbM.d.cts +812 -0
  124. package/dist/tenant-billing.module-ClbjzocC.d.cts +364 -0
  125. package/dist/tenant-billing.module-DohgJJ2m.d.ts +364 -0
  126. package/dist/tenant-billing.tokens-G-1xOlMr.d.cts +129 -0
  127. package/dist/tenant-billing.tokens-G-1xOlMr.d.ts +129 -0
  128. package/dist/testing/index.d.cts +44 -17
  129. package/dist/testing/index.d.ts +44 -17
  130. package/dist/testing/index.js +189 -40
  131. package/package.json +24 -4
  132. package/dist/catalog.module-BDDO6iwq.d.cts +0 -103
  133. package/dist/catalog.module-BTnMsE6u.d.ts +0 -103
  134. package/dist/checkout-offer.module-CMtiQJTT.d.ts +0 -39
  135. package/dist/checkout-offer.module-CVpWrzbe.d.cts +0 -39
  136. package/dist/checkout-offer.service-BLOv2HOo.d.cts +0 -49
  137. package/dist/checkout-offer.service-BLOv2HOo.d.ts +0 -49
  138. package/dist/chunk-57V6ZTI6.js +0 -22
  139. package/dist/chunk-BSK6YBLI.js +0 -87
  140. package/dist/chunk-DQKCK7DX.js +0 -217
  141. package/dist/chunk-VXEYLNIB.js +0 -632
  142. package/dist/chunk-WUDYIPYH.js +0 -715
  143. package/dist/define-saasicat-DROBe-b1.d.ts +0 -69
  144. package/dist/define-saasicat-vGBCkFys.d.cts +0 -69
  145. package/dist/promo.service-BJbKAmw3.d.cts +0 -112
  146. package/dist/promo.service-BJbKAmw3.d.ts +0 -112
  147. package/dist/tenant-billing.controller-BQ67mlmI.d.ts +0 -438
  148. package/dist/tenant-billing.controller-DS8kB8a7.d.cts +0 -438
  149. package/dist/tenant-billing.module-BznC3XtW.d.cts +0 -299
  150. package/dist/tenant-billing.module-wUbsQSFG.d.ts +0 -299
  151. /package/dist/{chunk-2FR6ZL7R.js → chunk-BHZOH2DY.js} +0 -0
  152. /package/dist/{chunk-2SLTRKXC.js → chunk-DFOW3JVO.js} +0 -0
  153. /package/dist/{chunk-DBZGV3HC.js → chunk-DU56UKEH.js} +0 -0
  154. /package/dist/{chunk-OYNHOY45.js → chunk-GAUEVIAE.js} +0 -0
@@ -1,6 +1,6 @@
1
- import { BundleRepository, DiscoverySnapshot, SubscriptionRepository, PlanRepository, CatalogEntryRepository, BundleRow, BundleVersionRow, CreateBundleData, UpdateBundleData, CreateBundleVersionDraftData, BundleVersionMutationResult, UpdateBundleVersionDraftData, PublishBundleVersionData, MarketingProjectionRepository, MarketingProjectionFilter, MarketingProjectionRow, CreateMarketingProjectionData, UpdateMarketingProjectionData, FeatureUiRegistry, CapabilityCatalogEntryRow, FeatureCatalogEntryRow, QuotaCatalogEntryRow, ReviewCatalogEntryData, CatalogEntryI18n, UpdateCatalogEntryBaseData, SyncDiscoveryResult, PromotionRepository, PromotionRow, CreatePromotionData, UpdatePromotionData, MarketingSettingsRepository, MarketingSettingsRow, UpdateMarketingSettingsData, PublicMarketingCatalogResponse, PlanRow, CreatePlanData, UpdatePlanData, PlanVersionRow, CreatePlanVersionDraftData, PlanVersionMutationResult, UpdatePlanVersionDraftData, PublishPlanVersionData } from '@saasicat/core';
1
+ import { BundleRepository, DiscoverySnapshot, SubscriptionRepository, PlanRepository, CatalogEntryRepository, BundleRow, BundleVersionRow, CreateBundleData, UpdateBundleData, CreateBundleVersionDraftData, BundleVersionMutationResult, UpdateBundleVersionDraftData, PublishBundleVersionData, MarketingProjectionRepository, MarketingProjectionFilter, MarketingProjectionRow, CreateMarketingProjectionData, UpdateMarketingProjectionData, FeatureUiRegistry, CapabilityCatalogEntryRow, FeatureCatalogEntryRow, QuotaCatalogEntryRow, ReviewCatalogEntryData, CatalogEntryI18n, UpdateCatalogEntryBaseData, SyncDiscoveryResult, PromotionRepository, PromotionRow, CreatePromotionData, UpdatePromotionData, MarketingSettingsRepository, MarketingSettingsRow, UpdateMarketingSettingsData, PlanRow, CreatePlanData, UpdatePlanData, PlanVersionRow, CreatePlanVersionDraftData, PlanVersionMutationResult, UpdatePlanVersionDraftData, PublishPlanVersionData } from '@saasicat/core';
2
2
  import { OnApplicationBootstrap } from '@nestjs/common';
3
- import { c as DiscoveryScanner } from './discovery.scanner-9cMqF95o.cjs';
3
+ import { a as DiscoveryScanner } from './discovery.scanner-DXKc6JkV.cjs';
4
4
 
5
5
  /**
6
6
  * Configuration for the mutating operations.
@@ -36,7 +36,7 @@ declare class BundlesService {
36
36
  private mode;
37
37
  private readonly marketedOnly;
38
38
  constructor(repo: BundleRepository, snapshot?: DiscoverySnapshot | null, config?: CatalogServiceConfig, subscriptions?: SubscriptionRepository | null, planRepo?: PlanRepository | null, scanner?: DiscoveryScanner | null, catalogEntries?: CatalogEntryRepository | null);
39
- listBundles(projectKey: string): Promise<BundleRow[]>;
39
+ listBundles(): Promise<BundleRow[]>;
40
40
  getBundle(bundleId: string): Promise<{
41
41
  bundle: BundleRow;
42
42
  versions: BundleVersionRow[];
@@ -90,6 +90,26 @@ declare class BundlesService {
90
90
  */
91
91
  publishBundleVersion(versionId: string, publishMeta: PublishBundleVersionData): Promise<BundleVersionMutationResult>;
92
92
  private runStrictCheck;
93
+ /**
94
+ * Refuses a version that a plan it is offered to could not actually buy.
95
+ *
96
+ * "Some price resolves" is not the same as "this plan, in the rhythm it is
97
+ * sold in, resolves one". A bundle priced monthly only, offered to a plan
98
+ * that is sold yearly, passes the first test and fails the second — and the
99
+ * failure surfaces at a tenant's checkout rather than at the operator's
100
+ * desk, which is the wrong end of the mistake.
101
+ *
102
+ * The expectation comes from the catalog, not from a list: the plans are
103
+ * whichever the compatibility declares (empty = every plan), and the cycles
104
+ * are whichever each plan version carries a price for. Add a third cycle to
105
+ * the catalog one day and this asks about it without being told.
106
+ *
107
+ * Skipped where no plan repository is bound — a consumer without one has no
108
+ * catalog to derive from, and guessing would refuse valid bundles.
109
+ */
110
+ private refuseUnsellableToACompatiblePlan;
111
+ /** The live version of a plan, or null where the port cannot answer. */
112
+ private liveVersionOf;
93
113
  private gateOrPass;
94
114
  private assertBundleVersionWindowUpdate;
95
115
  private findPreviousBundleVersion;
@@ -123,25 +143,25 @@ declare class CatalogEntriesService implements OnApplicationBootstrap {
123
143
  * `POST /admin/catalog/discovery/sync` remains as a fallback.
124
144
  */
125
145
  onApplicationBootstrap(): Promise<void>;
126
- listCapabilities(projectKey: string, codeStatus?: string): Promise<CapabilityCatalogEntryRow[]>;
127
- listFeatures(projectKey: string, discoveryStatus?: string): Promise<FeatureCatalogEntryRow[]>;
128
- listQuotas(projectKey: string, discoveryStatus?: string): Promise<QuotaCatalogEntryRow[]>;
146
+ listCapabilities(codeStatus?: string): Promise<CapabilityCatalogEntryRow[]>;
147
+ listFeatures(discoveryStatus?: string): Promise<FeatureCatalogEntryRow[]>;
148
+ listQuotas(discoveryStatus?: string): Promise<QuotaCatalogEntryRow[]>;
129
149
  /**
130
150
  * Approval transition of a feature (#20). Validates the state machine;
131
151
  * `approved` persists the approval signature from the current
132
152
  * snapshot, `pending` (revoke/reactivate) deletes it, `outdated`/
133
153
  * `obsolete` keep the last approval as history.
134
154
  */
135
- reviewFeature(projectKey: string, featureKey: string, data: ReviewCatalogEntryData, reviewedBy: string | null): Promise<FeatureCatalogEntryRow>;
155
+ reviewFeature(featureKey: string, data: ReviewCatalogEntryData, reviewedBy: string | null): Promise<FeatureCatalogEntryRow>;
136
156
  /** Approval transition of a quota — same state machine as features (#20). */
137
- reviewQuota(projectKey: string, quotaKey: string, data: ReviewCatalogEntryData, reviewedBy: string | null): Promise<QuotaCatalogEntryRow>;
157
+ reviewQuota(quotaKey: string, data: ReviewCatalogEntryData, reviewedBy: string | null): Promise<QuotaCatalogEntryRow>;
138
158
  private resolveReviewUpdate;
139
- setFeatureI18n(projectKey: string, featureKey: string, i18n: CatalogEntryI18n): Promise<FeatureCatalogEntryRow>;
140
- setQuotaI18n(projectKey: string, quotaKey: string, i18n: CatalogEntryI18n): Promise<QuotaCatalogEntryRow>;
159
+ setFeatureI18n(featureKey: string, i18n: CatalogEntryI18n): Promise<FeatureCatalogEntryRow>;
160
+ setQuotaI18n(quotaKey: string, i18n: CatalogEntryI18n): Promise<QuotaCatalogEntryRow>;
141
161
  /** Sets the editable default-locale label/description of a feature. */
142
- setFeatureBase(projectKey: string, featureKey: string, data: UpdateCatalogEntryBaseData): Promise<FeatureCatalogEntryRow>;
162
+ setFeatureBase(featureKey: string, data: UpdateCatalogEntryBaseData): Promise<FeatureCatalogEntryRow>;
143
163
  /** Sets the editable default-locale label/description of a quota. */
144
- setQuotaBase(projectKey: string, quotaKey: string, data: UpdateCatalogEntryBaseData): Promise<QuotaCatalogEntryRow>;
164
+ setQuotaBase(quotaKey: string, data: UpdateCatalogEntryBaseData): Promise<QuotaCatalogEntryRow>;
145
165
  /**
146
166
  * Synchronizes the catalog entries from a discovery snapshot.
147
167
  * Idempotent — can run against the same snapshot any number of times.
@@ -161,7 +181,7 @@ declare class CatalogEntriesService implements OnApplicationBootstrap {
161
181
  declare class PromotionsService {
162
182
  private readonly repo;
163
183
  constructor(repo: PromotionRepository);
164
- list(projectKey: string): Promise<PromotionRow[]>;
184
+ list(): Promise<PromotionRow[]>;
165
185
  getById(id: string): Promise<PromotionRow>;
166
186
  create(data: CreatePromotionData): Promise<PromotionRow>;
167
187
  update(id: string, data: UpdatePromotionData): Promise<PromotionRow>;
@@ -172,54 +192,8 @@ declare class MarketingSettingsService {
172
192
  private readonly repo;
173
193
  constructor(repo: MarketingSettingsRepository);
174
194
  /** Returns the stored config or `null` (in which case the full pool applies). */
175
- get(projectKey: string): Promise<MarketingSettingsRow | null>;
176
- upsert(projectKey: string, data: UpdateMarketingSettingsData): Promise<MarketingSettingsRow>;
177
- }
178
-
179
- declare class PublicMarketingCatalogService {
180
- private readonly planRepo;
181
- private readonly marketingRepo;
182
- private readonly promotionRepo;
183
- private readonly catalogEntryRepo;
184
- private readonly bundleRepo;
185
- constructor(planRepo: PlanRepository, marketingRepo: MarketingProjectionRepository, promotionRepo: PromotionRepository, catalogEntryRepo?: CatalogEntryRepository | null, bundleRepo?: BundleRepository | null);
186
- getCatalog(projectKey: string, locale: string, currency: string, vatRate: number, asOf?: Date): Promise<PublicMarketingCatalogResponse>;
187
- /**
188
- * Loads all published-and-live bundle versions for a project and
189
- * filters on `marketed === true`. Without a registered
190
- * `BundleRepository` (apps without the SuperAdmin bundle editor) the
191
- * list is empty — the public catalog stays plan-only.
192
- */
193
- private loadMarketedBundles;
194
- /**
195
- * Maps BundleVersionRow → PublicMarketingBundle. Locale resolution
196
- * runs via `MarketingProjectionRepository.findByTarget('BUNDLE',
197
- * bundleVersionId, locale)` — on a miss it falls back to
198
- * `DEFAULT_LOCALE`. If the fallback is missing too, label/description
199
- * come directly from the bundle root (denormalized in `BundleVersionRow`).
200
- *
201
- * If the marketing projection is `visible === false`, the bundle is
202
- * hidden from the public response (preparation phase).
203
- */
204
- private toPublicBundle;
205
- /**
206
- * Labels for bundle features ∪ their requires (#48): `comparison.features`
207
- * only covers the plan-feature union — bundle-only features would
208
- * otherwise get no label in the public payload. Curated keys only;
209
- * without a CatalogEntryRepository the map stays empty (frontends fall
210
- * back to the key).
211
- */
212
- private resolveBundleFeatureLabels;
213
- /** Loads the translated feature/quota labels (+ sortOrder) for a locale. */
214
- private loadLabelMeta;
215
- /**
216
- * Resolves the displayed label of a top feature: the `label` override
217
- * wins; otherwise the translated label of the referenced `key`.
218
- */
219
- private resolveTopFeature;
220
- /** Row definitions of the comparison matrix (feature/quota union + labels). */
221
- private buildComparison;
222
- private resolvePromo;
195
+ get(): Promise<MarketingSettingsRow | null>;
196
+ upsert(data: UpdateMarketingSettingsData): Promise<MarketingSettingsRow>;
223
197
  }
224
198
 
225
199
  declare class PlansService {
@@ -233,8 +207,8 @@ declare class PlansService {
233
207
  * `SubscriptionRepository` is registered or it does not implement
234
208
  * `countActiveByPlanKey`.
235
209
  */
236
- getTenantCounts(projectKey: string): Promise<Record<string, number>>;
237
- listPlans(projectKey: string, opts?: {
210
+ getTenantCounts(): Promise<Record<string, number>>;
211
+ listPlans(opts?: {
238
212
  onlyPublished?: boolean;
239
213
  }): Promise<PlanRow[]>;
240
214
  getPlan(planId: string): Promise<PlanRow>;
@@ -326,4 +300,4 @@ declare class PlanVersionsService {
326
300
  private gateOrPass;
327
301
  }
328
302
 
329
- export { BundlesService as B, CatalogEntriesService as C, MarketingProjectionsService as M, PlanVersionsService as P, type CatalogServiceConfig as a, MarketingSettingsService as b, PlansService as c, PromotionsService as d, PublicMarketingCatalogService as e };
303
+ export { BundlesService as B, CatalogEntriesService as C, MarketingProjectionsService as M, PlanVersionsService as P, type CatalogServiceConfig as a, MarketingSettingsService as b, PlansService as c, PromotionsService as d };
@@ -1,31 +1,36 @@
1
- export { a as SAASICAT_PUBLIC_ROUTE_KEY, d as SaaSiCatModule, e as SaaSiCatPublicRoute, S as SetupService, g as defineSaaSiCat, i as isSaaSiCatPublicRoute } from '../define-saasicat-vGBCkFys.cjs';
1
+ export { I as IssuerIdentityCheck, a as IssuerIdentityInspector, b as IssuerIdentityVerdict, c as SAASICAT_PUBLIC_ROUTE_KEY, f as SaaSiCatModule, g as SaaSiCatPublicRoute, S as SetupService, i as defineSaaSiCat, j as isSaaSiCatPublicRoute } from '../issuer-identity.check-CBO0vcsq.cjs';
2
2
  import { CanActivate, DynamicModule, OnApplicationBootstrap } from '@nestjs/common';
3
- import { SaaSiCatPersistenceAdapter, SubscriptionUsagePort, SubscriptionRepository, UsageSnapshotPort, QuotaProvider } from '@saasicat/core';
3
+ import { SaaSiCatPersistenceAdapter, SubscriptionUsagePort, PlanCatalog, SubscriptionRepository, UsageSnapshotPort, QuotaProvider } from '@saasicat/core';
4
4
  import { P as ProviderSpec } from '../di-CcNeq9v-.cjs';
5
- import { b as DiscoveryAppInfo } from '../discovery.scanner-9cMqF95o.cjs';
6
- export { c as DiscoveryScanner } from '../discovery.scanner-9cMqF95o.cjs';
7
- import { e as SaaSiCatModuleOptions, S as SaaSiCatAdapters, o as PlanResolverPort } from '../module-options-BG3MzQva.cjs';
8
- export { P as PLAN_RESOLVER_PORT_TOKEN, a as SaaSiCatAdminResourcesOptions, b as SaaSiCatAdminStatsOptions, c as SaaSiCatCatalogOptions, d as SaaSiCatCheckoutOfferOptions, f as SaaSiCatPromoCodesOptions, g as SaaSiCatSetupOptions, h as SaaSiCatSubscriptionBundlesOptions, i as SaaSiCatSubscriptionContractOptions, j as SaaSiCatTenantAuthGuards, k as SaaSiCatTenantBillingOptions, l as SetupModule, m as SetupModuleOptions, n as StaticPlanResolver, T as TenantManifestControllerOptions, p as buildTenantManifestController } from '../module-options-BG3MzQva.cjs';
9
- import { S as StaticEntitlementService } from '../enforce-quota.interceptor-Df0e3OWe.cjs';
10
- export { E as EnforceQuotaInterceptor, Q as QUOTA_PROVIDERS_TOKEN, b as STATIC_FEATURE_GUARD_CONFIG_TOKEN, c as StaticEntitlementSnapshot, a as StaticFeatureGuard, d as StaticFeatureGuardConfig } from '../enforce-quota.interceptor-Df0e3OWe.cjs';
5
+ import { D as DiscoveryAppInfo } from '../discovery.scanner-DXKc6JkV.cjs';
6
+ export { a as DiscoveryScanner } from '../discovery.scanner-DXKc6JkV.cjs';
7
+ import { c as SaaSiCatModuleOptions, S as SaaSiCatAdapters, b as PlanResolverPort } from '../module-options-qAOwinHR.cjs';
8
+ export { D as DB_CATALOG_MEMBERS, p as DbCatalogOptions, P as PLAN_RESOLVER_PORT_TOKEN, d as SaaSiCatAdminResourcesOptions, e as SaaSiCatAdminStatsOptions, f as SaaSiCatCatalogOptions, g as SaaSiCatCheckoutOfferOptions, h as SaaSiCatPromoCodesOptions, i as SaaSiCatSetupOptions, j as SaaSiCatSubscriptionBundlesOptions, k as SaaSiCatSubscriptionContractOptions, l as SaaSiCatTenantAuthGuards, m as SaaSiCatTenantBillingOptions, n as SetupModule, o as SetupModuleOptions, a as StaticPlanResolver, T as TenantManifestControllerOptions, q as buildTenantManifestController } from '../module-options-qAOwinHR.cjs';
9
+ import { S as StaticEntitlementService } from '../enforce-quota.interceptor-BFyVdWe8.cjs';
10
+ export { E as EnforceQuotaInterceptor, Q as QUOTA_PROVIDERS_TOKEN, b as STATIC_FEATURE_GUARD_CONFIG_TOKEN, c as StaticEntitlementSnapshot, a as StaticFeatureGuard, d as StaticFeatureGuardConfig } from '../enforce-quota.interceptor-BFyVdWe8.cjs';
11
11
  import { DiscoveryService, MetadataScanner } from '@nestjs/core';
12
- export { A as AdminBypassRlsInterceptor, a as AdminManifestModule, b as AdminManifestModuleOptions, c as AdminManifestService, d as AdminModule, e as AdminModuleOptions, f as AdminStatsService, M as MfaGuard, h as MfaService, S as SuperAdminGuard } from '../admin-stats.service-DfKupywR.cjs';
12
+ export { A as AdminBypassRlsInterceptor, a as AdminManifestModule, b as AdminManifestModuleOptions, c as AdminManifestService, d as AdminModule, e as AdminModuleOptions, f as AdminStatsService, h as MfaGuard, M as MfaService, S as SuperAdminGuard } from '../admin-stats.service-DrZrU8IJ.cjs';
13
13
  export { A as AdminAuditService } from '../admin-audit.service-4P3Djdxk.cjs';
14
- export { e as AdminResourcesService, f as AdminStatsModule, g as AdminStatsModuleOptions } from '../admin-resources.module-CpvzcfCc.cjs';
15
- export { c as EntitlementService } from '../aggregation-B3CD0v_d.cjs';
16
- export { d as ComposedTenantAuthGuard, P as PendingPlanMaterializationService, h as PlanChangePreviewService, r as SubscriptionBundlePreviewService, s as SubscriptionBundlesService, T as TenantAdminGuard, t as TenantBillingController } from '../tenant-billing.controller-DS8kB8a7.cjs';
17
- export { B as BundlesService, C as CatalogEntriesService, M as MarketingProjectionsService, b as MarketingSettingsService, P as PlanVersionsService, c as PlansService, d as PromotionsService, e as PublicMarketingCatalogService } from '../plan-versions.service-TPEtbN0r.cjs';
14
+ export { f as AdminResourcesService, g as AdminStatsModule, a as AdminStatsModuleOptions } from '../admin-resources.module-B4XNvdH-.cjs';
15
+ export { c as EntitlementService } from '../aggregation-OpnhwzF5.cjs';
16
+ export { g as ComposedTenantAuthGuard, P as PendingPlanMaterializationService, l as PlanChangePreviewService, w as SubscriptionBundlePreviewService, x as SubscriptionBundlesService, T as TenantAdminGuard, y as TenantBillingController } from '../tenant-billing.controller-DKbAqTbM.cjs';
17
+ export { B as BundlesService, C as CatalogEntriesService, M as MarketingProjectionsService, b as MarketingSettingsService, P as PlanVersionsService, c as PlansService, d as PromotionsService } from '../plan-versions.service-DARLh-qI.cjs';
18
+ export { c as PublicMarketingCatalogService } from '../catalog.module-T-I5Ricz.cjs';
18
19
  export { P as PromoCodeRateLimitGuard } from '../rate-limit.guard-dntqAlfZ.cjs';
19
- export { i as PromoCodesService } from '../promo.service-BJbKAmw3.cjs';
20
- export { a as CheckoutOfferModule, b as CheckoutOfferModuleOptions } from '../checkout-offer.module-CVpWrzbe.cjs';
21
- export { C as CheckoutOfferService } from '../checkout-offer.service-BLOv2HOo.cjs';
22
- export { S as SubscriptionContractModule, a as SubscriptionContractModuleOptions } from '../subscription-contract.module-CEK8HS5-.cjs';
23
- export { S as SubscriptionContractService } from '../subscription-contract.service-hD87MKyg.cjs';
24
- import '../tenant-billing.module-BznC3XtW.cjs';
25
- import '../catalog.module-BDDO6iwq.cjs';
26
- import '../plan-resolution-Cgo_TR1H.cjs';
27
- import '../promo.module-DtvIycpt.cjs';
20
+ export { a as PromoCodesService } from '../promo.service-BYBu6dy3.cjs';
21
+ export { c as CheckoutOfferModule, C as CheckoutOfferModuleOptions } from '../checkout-offer.module-DFhGy6JO.cjs';
22
+ export { C as CheckoutOfferPricing, b as CheckoutOfferService } from '../checkout-offer.service-CCVxG9b2.cjs';
23
+ export { a as SubscriptionContractModule, S as SubscriptionContractModuleOptions } from '../subscription-contract.module-DTMuUJYd.cjs';
24
+ export { S as SubscriptionContractService } from '../subscription-contract.service-CfNApLuP.cjs';
25
+ import '../tenant-billing.module-ClbjzocC.cjs';
26
+ import '../tenant-billing.tokens-G-1xOlMr.cjs';
27
+ import '../contract-line-item-money-B0Z3Ogur.cjs';
28
+ import '../plan-resolution-CwUy_OqC.cjs';
29
+ import '../promo.module-CKkECmU8.cjs';
30
+ import '../payments.module-BdUq9ot_.cjs';
28
31
  import 'rxjs';
32
+ import '../plan-catalog-source-DWe-BGY1.cjs';
33
+ import '../subscriber.service-5W6Gi-1B.cjs';
29
34
 
30
35
  /**
31
36
  * What `tenantBilling` resolved and its two dependants need.
@@ -90,6 +95,20 @@ interface PlatformConfiguration {
90
95
  readonly options: SaaSiCatModuleOptions;
91
96
  /** After the bundle slices and the explicit entries have been merged. */
92
97
  readonly adapters: SaaSiCatAdapters;
98
+ /**
99
+ * The catalogue as resolved before the database is asked: `planCatalog`
100
+ * as given, or the file `dbCatalog` names, loaded. Absent where nothing
101
+ * usable was configured — which is for the rules to say.
102
+ */
103
+ readonly catalog?: PlanCatalog;
104
+ /**
105
+ * Why the file `dbCatalog` named did not load, where it did not.
106
+ *
107
+ * A finding rather than a throw from inside the loader: the platform is
108
+ * the caller on this path, so an unreadable file would otherwise end the
109
+ * boot before any other rule had spoken.
110
+ */
111
+ readonly catalogFailure?: Error;
93
112
  }
94
113
  interface PlatformRule {
95
114
  /** Stable id — `<area>.<what-it-requires>`. Appears in the boot error. */
@@ -178,11 +197,21 @@ declare function assertConfiguration(configuration: PlatformConfiguration, rules
178
197
  * Standard `tenantId → planId` resolver backed by the canonical subscription
179
198
  * repository. This removes the identical resolver class most applications
180
199
  * previously had to write themselves.
200
+ *
201
+ * It answers for the DEFAULT enforcement stack — `StaticFeatureGuard` and
202
+ * `EnforceQuotaInterceptor` — which reaches its plan through here rather than
203
+ * through `EntitlementService`. Two paths, one rule, and the rule has to be
204
+ * written in both: an app that never registers tenant billing enforces
205
+ * entitlements entirely through this one.
181
206
  */
182
207
  declare class SubscriptionPlanResolver implements PlanResolverPort {
183
208
  private readonly subscriptions;
184
209
  private readonly activeStatuses;
185
- constructor(subscriptions: SubscriptionRepository, activeStatuses?: ReadonlySet<string>);
210
+ /** The plan a subscription falls back to once its cancellation lands. */
211
+ private readonly canceledEntitlementPlan;
212
+ constructor(subscriptions: SubscriptionRepository, activeStatuses?: ReadonlySet<string>,
213
+ /** The plan a subscription falls back to once its cancellation lands. */
214
+ canceledEntitlementPlan?: string | null);
186
215
  getPlanIdForTenant(tenantId: string): Promise<string | null>;
187
216
  }
188
217
 
@@ -1,31 +1,36 @@
1
- export { a as SAASICAT_PUBLIC_ROUTE_KEY, d as SaaSiCatModule, e as SaaSiCatPublicRoute, S as SetupService, g as defineSaaSiCat, i as isSaaSiCatPublicRoute } from '../define-saasicat-DROBe-b1.js';
1
+ export { I as IssuerIdentityCheck, a as IssuerIdentityInspector, b as IssuerIdentityVerdict, c as SAASICAT_PUBLIC_ROUTE_KEY, f as SaaSiCatModule, g as SaaSiCatPublicRoute, S as SetupService, i as defineSaaSiCat, j as isSaaSiCatPublicRoute } from '../issuer-identity.check-Cz9CEMkZ.js';
2
2
  import { CanActivate, DynamicModule, OnApplicationBootstrap } from '@nestjs/common';
3
- import { SaaSiCatPersistenceAdapter, SubscriptionUsagePort, SubscriptionRepository, UsageSnapshotPort, QuotaProvider } from '@saasicat/core';
3
+ import { SaaSiCatPersistenceAdapter, SubscriptionUsagePort, PlanCatalog, SubscriptionRepository, UsageSnapshotPort, QuotaProvider } from '@saasicat/core';
4
4
  import { P as ProviderSpec } from '../di-CcNeq9v-.js';
5
- import { b as DiscoveryAppInfo } from '../discovery.scanner-9cMqF95o.js';
6
- export { c as DiscoveryScanner } from '../discovery.scanner-9cMqF95o.js';
7
- import { e as SaaSiCatModuleOptions, S as SaaSiCatAdapters, o as PlanResolverPort } from '../module-options-COSEb0VW.js';
8
- export { P as PLAN_RESOLVER_PORT_TOKEN, a as SaaSiCatAdminResourcesOptions, b as SaaSiCatAdminStatsOptions, c as SaaSiCatCatalogOptions, d as SaaSiCatCheckoutOfferOptions, f as SaaSiCatPromoCodesOptions, g as SaaSiCatSetupOptions, h as SaaSiCatSubscriptionBundlesOptions, i as SaaSiCatSubscriptionContractOptions, j as SaaSiCatTenantAuthGuards, k as SaaSiCatTenantBillingOptions, l as SetupModule, m as SetupModuleOptions, n as StaticPlanResolver, T as TenantManifestControllerOptions, p as buildTenantManifestController } from '../module-options-COSEb0VW.js';
9
- import { S as StaticEntitlementService } from '../enforce-quota.interceptor-DW3etVyI.js';
10
- export { E as EnforceQuotaInterceptor, Q as QUOTA_PROVIDERS_TOKEN, b as STATIC_FEATURE_GUARD_CONFIG_TOKEN, c as StaticEntitlementSnapshot, a as StaticFeatureGuard, d as StaticFeatureGuardConfig } from '../enforce-quota.interceptor-DW3etVyI.js';
5
+ import { D as DiscoveryAppInfo } from '../discovery.scanner-DXKc6JkV.js';
6
+ export { a as DiscoveryScanner } from '../discovery.scanner-DXKc6JkV.js';
7
+ import { c as SaaSiCatModuleOptions, S as SaaSiCatAdapters, b as PlanResolverPort } from '../module-options-DmQ3G4sZ.js';
8
+ export { D as DB_CATALOG_MEMBERS, p as DbCatalogOptions, P as PLAN_RESOLVER_PORT_TOKEN, d as SaaSiCatAdminResourcesOptions, e as SaaSiCatAdminStatsOptions, f as SaaSiCatCatalogOptions, g as SaaSiCatCheckoutOfferOptions, h as SaaSiCatPromoCodesOptions, i as SaaSiCatSetupOptions, j as SaaSiCatSubscriptionBundlesOptions, k as SaaSiCatSubscriptionContractOptions, l as SaaSiCatTenantAuthGuards, m as SaaSiCatTenantBillingOptions, n as SetupModule, o as SetupModuleOptions, a as StaticPlanResolver, T as TenantManifestControllerOptions, q as buildTenantManifestController } from '../module-options-DmQ3G4sZ.js';
9
+ import { S as StaticEntitlementService } from '../enforce-quota.interceptor-GaBXboGx.js';
10
+ export { E as EnforceQuotaInterceptor, Q as QUOTA_PROVIDERS_TOKEN, b as STATIC_FEATURE_GUARD_CONFIG_TOKEN, c as StaticEntitlementSnapshot, a as StaticFeatureGuard, d as StaticFeatureGuardConfig } from '../enforce-quota.interceptor-GaBXboGx.js';
11
11
  import { DiscoveryService, MetadataScanner } from '@nestjs/core';
12
- export { A as AdminBypassRlsInterceptor, a as AdminManifestModule, b as AdminManifestModuleOptions, c as AdminManifestService, d as AdminModule, e as AdminModuleOptions, f as AdminStatsService, M as MfaGuard, h as MfaService, S as SuperAdminGuard } from '../admin-stats.service-TYiSUwIR.js';
12
+ export { A as AdminBypassRlsInterceptor, a as AdminManifestModule, b as AdminManifestModuleOptions, c as AdminManifestService, d as AdminModule, e as AdminModuleOptions, f as AdminStatsService, h as MfaGuard, M as MfaService, S as SuperAdminGuard } from '../admin-stats.service-CsLNt19Z.js';
13
13
  export { A as AdminAuditService } from '../admin-audit.service-4P3Djdxk.js';
14
- export { e as AdminResourcesService, f as AdminStatsModule, g as AdminStatsModuleOptions } from '../admin-resources.module-DF5_Q7RD.js';
15
- export { c as EntitlementService } from '../aggregation-BFzW07DE.js';
16
- export { d as ComposedTenantAuthGuard, P as PendingPlanMaterializationService, h as PlanChangePreviewService, r as SubscriptionBundlePreviewService, s as SubscriptionBundlesService, T as TenantAdminGuard, t as TenantBillingController } from '../tenant-billing.controller-BQ67mlmI.js';
17
- export { B as BundlesService, C as CatalogEntriesService, M as MarketingProjectionsService, b as MarketingSettingsService, P as PlanVersionsService, c as PlansService, d as PromotionsService, e as PublicMarketingCatalogService } from '../plan-versions.service-DChhbK6h.js';
14
+ export { f as AdminResourcesService, g as AdminStatsModule, a as AdminStatsModuleOptions } from '../admin-resources.module-CWqdI9BV.js';
15
+ export { c as EntitlementService } from '../aggregation-ChpZDh0g.js';
16
+ export { g as ComposedTenantAuthGuard, P as PendingPlanMaterializationService, l as PlanChangePreviewService, w as SubscriptionBundlePreviewService, x as SubscriptionBundlesService, T as TenantAdminGuard, y as TenantBillingController } from '../tenant-billing.controller-BLqbsONe.js';
17
+ export { B as BundlesService, C as CatalogEntriesService, M as MarketingProjectionsService, b as MarketingSettingsService, P as PlanVersionsService, c as PlansService, d as PromotionsService } from '../plan-versions.service-C0N-Em2W.js';
18
+ export { c as PublicMarketingCatalogService } from '../catalog.module-C9O7BxRq.js';
18
19
  export { P as PromoCodeRateLimitGuard } from '../rate-limit.guard-dntqAlfZ.js';
19
- export { i as PromoCodesService } from '../promo.service-BJbKAmw3.js';
20
- export { a as CheckoutOfferModule, b as CheckoutOfferModuleOptions } from '../checkout-offer.module-CMtiQJTT.js';
21
- export { C as CheckoutOfferService } from '../checkout-offer.service-BLOv2HOo.js';
22
- export { S as SubscriptionContractModule, a as SubscriptionContractModuleOptions } from '../subscription-contract.module-fDFdQ0jm.js';
23
- export { S as SubscriptionContractService } from '../subscription-contract.service-hD87MKyg.js';
24
- import '../tenant-billing.module-wUbsQSFG.js';
25
- import '../catalog.module-BTnMsE6u.js';
26
- import '../plan-resolution-Cgo_TR1H.js';
27
- import '../promo.module-Z8h1PNX-.js';
20
+ export { a as PromoCodesService } from '../promo.service-CFjfF0Xm.js';
21
+ export { c as CheckoutOfferModule, C as CheckoutOfferModuleOptions } from '../checkout-offer.module-x7SP_dX4.js';
22
+ export { C as CheckoutOfferPricing, b as CheckoutOfferService } from '../checkout-offer.service-BeHgYikI.js';
23
+ export { a as SubscriptionContractModule, S as SubscriptionContractModuleOptions } from '../subscription-contract.module-BfIRpc1o.js';
24
+ export { S as SubscriptionContractService } from '../subscription-contract.service-CPZrTM9C.js';
25
+ import '../tenant-billing.module-DohgJJ2m.js';
26
+ import '../tenant-billing.tokens-G-1xOlMr.js';
27
+ import '../contract-line-item-money-B0Z3Ogur.js';
28
+ import '../plan-resolution-CwUy_OqC.js';
29
+ import '../promo.module-DuIJdK3U.js';
30
+ import '../payments.module-CQGv_VG7.js';
28
31
  import 'rxjs';
32
+ import '../plan-catalog-source-DWe-BGY1.js';
33
+ import '../subscriber.service-5W6Gi-1B.js';
29
34
 
30
35
  /**
31
36
  * What `tenantBilling` resolved and its two dependants need.
@@ -90,6 +95,20 @@ interface PlatformConfiguration {
90
95
  readonly options: SaaSiCatModuleOptions;
91
96
  /** After the bundle slices and the explicit entries have been merged. */
92
97
  readonly adapters: SaaSiCatAdapters;
98
+ /**
99
+ * The catalogue as resolved before the database is asked: `planCatalog`
100
+ * as given, or the file `dbCatalog` names, loaded. Absent where nothing
101
+ * usable was configured — which is for the rules to say.
102
+ */
103
+ readonly catalog?: PlanCatalog;
104
+ /**
105
+ * Why the file `dbCatalog` named did not load, where it did not.
106
+ *
107
+ * A finding rather than a throw from inside the loader: the platform is
108
+ * the caller on this path, so an unreadable file would otherwise end the
109
+ * boot before any other rule had spoken.
110
+ */
111
+ readonly catalogFailure?: Error;
93
112
  }
94
113
  interface PlatformRule {
95
114
  /** Stable id — `<area>.<what-it-requires>`. Appears in the boot error. */
@@ -178,11 +197,21 @@ declare function assertConfiguration(configuration: PlatformConfiguration, rules
178
197
  * Standard `tenantId → planId` resolver backed by the canonical subscription
179
198
  * repository. This removes the identical resolver class most applications
180
199
  * previously had to write themselves.
200
+ *
201
+ * It answers for the DEFAULT enforcement stack — `StaticFeatureGuard` and
202
+ * `EnforceQuotaInterceptor` — which reaches its plan through here rather than
203
+ * through `EntitlementService`. Two paths, one rule, and the rule has to be
204
+ * written in both: an app that never registers tenant billing enforces
205
+ * entitlements entirely through this one.
181
206
  */
182
207
  declare class SubscriptionPlanResolver implements PlanResolverPort {
183
208
  private readonly subscriptions;
184
209
  private readonly activeStatuses;
185
- constructor(subscriptions: SubscriptionRepository, activeStatuses?: ReadonlySet<string>);
210
+ /** The plan a subscription falls back to once its cancellation lands. */
211
+ private readonly canceledEntitlementPlan;
212
+ constructor(subscriptions: SubscriptionRepository, activeStatuses?: ReadonlySet<string>,
213
+ /** The plan a subscription falls back to once its cancellation lands. */
214
+ canceledEntitlementPlan?: string | null);
186
215
  getPlanIdForTenant(tenantId: string): Promise<string | null>;
187
216
  }
188
217
 
@@ -1,11 +1,14 @@
1
1
  import {
2
2
  defineSaaSiCat
3
- } from "../chunk-OYNHOY45.js";
3
+ } from "../chunk-GAUEVIAE.js";
4
4
  import {
5
+ DB_CATALOG_MEMBERS,
5
6
  ENFORCEMENT_CHAIN_STATE_TOKEN,
6
7
  EnforceQuotaInterceptor,
7
8
  EnforcementChainCheck,
8
9
  FEATURE_COMPOSERS,
10
+ IssuerIdentityCheck,
11
+ IssuerIdentityInspector,
9
12
  MOUNTED_BUT_NOT_EXPORTED,
10
13
  PLAN_RESOLVER_PORT_TOKEN,
11
14
  PLATFORM_RULES,
@@ -28,13 +31,13 @@ import {
28
31
  docsUrlFor,
29
32
  findViolations,
30
33
  headingSlug
31
- } from "../chunk-RUNZ3X4C.js";
34
+ } from "../chunk-AOS2JPDD.js";
32
35
  import {
33
36
  PromoCodeRateLimitGuard
34
- } from "../chunk-TXC3LHHB.js";
37
+ } from "../chunk-4SDSYV4A.js";
35
38
  import {
36
39
  SubscriptionContractModule
37
- } from "../chunk-AU3OOREM.js";
40
+ } from "../chunk-XSSWYPP5.js";
38
41
  import {
39
42
  AdminBypassRlsInterceptor,
40
43
  AdminManifestModule,
@@ -43,25 +46,16 @@ import {
43
46
  AdminResourcesService,
44
47
  AdminStatsModule,
45
48
  AdminStatsService,
46
- MfaGuard,
47
- MfaService,
48
49
  SuperAdminGuard
49
- } from "../chunk-LTT736P3.js";
50
+ } from "../chunk-LLYVYRGJ.js";
50
51
  import {
51
- ComposedTenantAuthGuard,
52
52
  PendingPlanMaterializationService,
53
53
  PlanChangePreviewService,
54
54
  SubscriptionBundlePreviewService,
55
55
  SubscriptionBundlesService,
56
56
  TenantAdminGuard,
57
57
  TenantBillingController
58
- } from "../chunk-6Z7JR4EW.js";
59
- import {
60
- PromoCodesService
61
- } from "../chunk-VXEYLNIB.js";
62
- import {
63
- SubscriptionContractService
64
- } from "../chunk-KFT5AIIH.js";
58
+ } from "../chunk-M47BNEY2.js";
65
59
  import {
66
60
  BundlesService,
67
61
  CatalogEntriesService,
@@ -71,36 +65,59 @@ import {
71
65
  PlansService,
72
66
  PromotionsService,
73
67
  PublicMarketingCatalogService
74
- } from "../chunk-WOVQPXV4.js";
75
- import "../chunk-N3L3AICU.js";
68
+ } from "../chunk-CQ2ZZMTD.js";
69
+ import "../chunk-GZTL64QK.js";
70
+ import {
71
+ MfaGuard,
72
+ MfaService
73
+ } from "../chunk-34XVPR6P.js";
76
74
  import {
77
75
  AdminAuditService
78
- } from "../chunk-O2J2HDXA.js";
76
+ } from "../chunk-OOTEXP47.js";
79
77
  import {
80
- CheckoutOfferModule,
78
+ CheckoutOfferModule
79
+ } from "../chunk-TOEFN7DN.js";
80
+ import {
81
+ CheckoutOfferPricing,
81
82
  CheckoutOfferService
82
- } from "../chunk-WUDYIPYH.js";
83
- import "../chunk-BSK6YBLI.js";
83
+ } from "../chunk-55QEDAMX.js";
84
84
  import {
85
- SAASICAT_PUBLIC_ROUTE_KEY,
86
- SaaSiCatPublicRoute,
87
- isSaaSiCatPublicRoute
88
- } from "../chunk-YSC46BGM.js";
89
- import "../chunk-7ZEGFL42.js";
85
+ PromoCodesService
86
+ } from "../chunk-3RLWML2S.js";
90
87
  import {
91
- EntitlementService
92
- } from "../chunk-VIJ5NJWC.js";
93
- import "../chunk-DQKCK7DX.js";
94
- import "../chunk-VBRYPU7V.js";
95
- import "../chunk-57V6ZTI6.js";
96
- import "../chunk-OUDSQ3PU.js";
97
- import "../chunk-AOQJEYOL.js";
98
- import "../chunk-SABTXESR.js";
99
- import "../chunk-XBYAFEOR.js";
88
+ SubscriptionContractService
89
+ } from "../chunk-NDLC5GYK.js";
90
+ import "../chunk-KPEMTBOP.js";
91
+ import "../chunk-S33SO5XX.js";
100
92
  import {
101
93
  DiscoveryScanner
102
- } from "../chunk-WXYJHZCN.js";
94
+ } from "../chunk-JVAEKTJ4.js";
95
+ import "../chunk-WHJSYKNC.js";
96
+ import {
97
+ EntitlementService
98
+ } from "../chunk-G6EZWECL.js";
99
+ import "../chunk-OUDSQ3PU.js";
100
+ import "../chunk-TBBZWZQT.js";
101
+ import "../chunk-VBRYPU7V.js";
102
+ import "../chunk-6PJE7EWO.js";
103
+ import "../chunk-3QVGA6JX.js";
103
104
  import "../chunk-QUZU2M33.js";
105
+ import "../chunk-QPVDCKYS.js";
106
+ import "../chunk-7NJKVC5X.js";
107
+ import {
108
+ ComposedTenantAuthGuard
109
+ } from "../chunk-5CKC7O52.js";
110
+ import "../chunk-GPQWGA6B.js";
111
+ import "../chunk-SZ7RFPXA.js";
112
+ import "../chunk-WOEJ6K7M.js";
113
+ import "../chunk-LF6J4YYN.js";
114
+ import {
115
+ SAASICAT_PUBLIC_ROUTE_KEY,
116
+ SaaSiCatPublicRoute,
117
+ isSaaSiCatPublicRoute
118
+ } from "../chunk-YSC46BGM.js";
119
+ import "../chunk-FEQZCWUL.js";
120
+ import "../chunk-J7NJRK3K.js";
104
121
  import "../chunk-SHUYVCID.js";
105
122
  export {
106
123
  AdminAuditService,
@@ -114,14 +131,18 @@ export {
114
131
  BundlesService,
115
132
  CatalogEntriesService,
116
133
  CheckoutOfferModule,
134
+ CheckoutOfferPricing,
117
135
  CheckoutOfferService,
118
136
  ComposedTenantAuthGuard,
137
+ DB_CATALOG_MEMBERS,
119
138
  DiscoveryScanner,
120
139
  ENFORCEMENT_CHAIN_STATE_TOKEN,
121
140
  EnforceQuotaInterceptor,
122
141
  EnforcementChainCheck,
123
142
  EntitlementService,
124
143
  FEATURE_COMPOSERS,
144
+ IssuerIdentityCheck,
145
+ IssuerIdentityInspector,
125
146
  MOUNTED_BUT_NOT_EXPORTED,
126
147
  MarketingProjectionsService,
127
148
  MarketingSettingsService,
@@ -1,9 +1,10 @@
1
- import { PromoCodeValueType, PromoCodeDurationType, BillingCycle, PromoCodeRepository, PromoCodeRedemptionRepository } from '@saasicat/core';
2
- import { i as PromoCodesService, f as PreviewResult } from '../promo.service-BJbKAmw3.cjs';
3
- export { C as CODE_MAX_LENGTH, a as CODE_MIN_LENGTH, b as CODE_PATTERN, c as PreviewInput, d as PreviewInvalid, e as PreviewReason, g as PreviewValid, h as PromoCodeStats, P as PromoServiceConfig, R as RedeemInput } from '../promo.service-BJbKAmw3.cjs';
1
+ import { PromoCodeValueType, PromoCodeDurationType, BillingCycle, PromoCodeRepository, PromoCodeRedemptionRepository, PromoCodeHoldRepository } from '@saasicat/core';
2
+ import { a as PromoCodesService, i as PreviewResult } from '../promo.service-BYBu6dy3.cjs';
3
+ export { C as CODE_MAX_LENGTH, b as CODE_MIN_LENGTH, c as CODE_PATTERN, d as CheckoutHoldInput, e as PreviewInput, f as PreviewInvalid, g as PreviewOptions, h as PreviewReason, j as PreviewValid, k as PromoCodeStats, P as PromoServiceConfig, R as RedeemInput } from '../promo.service-BYBu6dy3.cjs';
4
4
  export { P as PromoCodeRateLimitGuard, h as hashIp, i as ipFingerprint } from '../rate-limit.guard-dntqAlfZ.cjs';
5
- export { P as PromoCodesModule, a as PromoCodesModuleOptions } from '../promo.module-DtvIycpt.cjs';
5
+ export { a as PromoCodesModule, P as PromoCodesModuleOptions } from '../promo.module-CKkECmU8.cjs';
6
6
  import { Type, CanActivate } from '@nestjs/common';
7
+ import '../plan-catalog-source-DWe-BGY1.cjs';
7
8
  import '../di-CcNeq9v-.cjs';
8
9
 
9
10
  /** Structural view of a PromoCode for the calculator functions.
@@ -80,20 +81,34 @@ interface PromoLabelOptions {
80
81
  declare function buildLabel(code: Pick<PromoCodeForCalc, 'valueType' | 'value' | 'durationType' | 'durationValue'>, cycle: BillingCycle, options?: PromoLabelOptions): string;
81
82
 
82
83
  declare function round2(n: number): number;
83
- /** Gross = net * (1 + vatRate/100). */
84
+ /**
85
+ * Whether a tax rate is one SaaSiCat accepts. Every tax rate in SaaSiCat is a
86
+ * percentage — 19 means 19 % — wherever it is stated: the settings, the
87
+ * catalogue, an offer, a contract, a contract line.
88
+ *
89
+ * A percentage lies from 0 to 100, and none lies strictly between 0 and 1:
90
+ * that is the shape of a fraction such as 0.19, and a fraction is refused
91
+ * rather than taken for a fraction of a per cent.
92
+ */
93
+ declare function isTaxRatePercent(rate: number): boolean;
94
+ /** Gross = net * (1 + vatRate/100), with `vatRate` a percentage. */
84
95
  declare function grossFromNet(net: number, vatRate: number): number;
85
- /** VAT included in the gross amount: gross * (vatRate / (100 + vatRate)). */
96
+ /** Net = gross * 100 / (100 + vatRate), with `vatRate` a percentage. */
97
+ declare function netFromGross(gross: number, vatRate: number): number;
98
+ /** VAT included in the gross amount: gross * vatRate / (100 + vatRate). */
86
99
  declare function computeIncludedVat(grossAmount: number, vatRate: number): number;
87
100
 
88
101
  declare class PromoCodeExpirer {
89
102
  private readonly promoRepo;
90
103
  private readonly redemptionRepo;
104
+ private readonly holds;
91
105
  private readonly logger;
92
- constructor(promoRepo: PromoCodeRepository, redemptionRepo: PromoCodeRedemptionRepository);
106
+ constructor(promoRepo: PromoCodeRepository, redemptionRepo: PromoCodeRedemptionRepository, holds?: PromoCodeHoldRepository | null);
93
107
  expirePromoCodes(): Promise<void>;
94
108
  }
95
109
 
96
110
  declare const PROMO_CODE_REPOSITORY_TOKEN: unique symbol;
111
+ declare const PROMO_CODE_HOLD_REPOSITORY_TOKEN: unique symbol;
97
112
  declare const PROMO_CODE_REDEMPTION_REPOSITORY_TOKEN: unique symbol;
98
113
  declare const PROMO_CODE_VALIDATION_LOG_REPOSITORY_TOKEN: unique symbol;
99
114
  declare const PROMO_FIRST_TIME_CUSTOMER_CHECK_TOKEN: unique symbol;
@@ -166,4 +181,4 @@ declare class UpdatePromoCodeDto {
166
181
  revenueDeductionAccount?: string | null;
167
182
  }
168
183
 
169
- export { CreatePromoCodeDto, PROMO_CODE_REDEMPTION_REPOSITORY_TOKEN, PROMO_CODE_REPOSITORY_TOKEN, PROMO_CODE_VALIDATION_LOG_REPOSITORY_TOKEN, PROMO_FIRST_TIME_CUSTOMER_CHECK_TOKEN, PROMO_REVENUE_DEDUCTION_AGGREGATOR_TOKEN, PROMO_SERVICE_CONFIG_TOKEN, PROMO_SUBSCRIPTION_LOOKUP_TOKEN, PROMO_TRANSACTION_RUNNER_TOKEN, PreviewPromoCodeDto, PreviewResult, PromoCodeExpirer, type PromoCodeForCalc, PromoCodePublicController, PromoCodesService, type PromoLabelOptions, UpdatePromoCodeDto, addCycles, buildLabel, buildPromoCodeAdminController, computeDiscountGross, computeDiscountedGross, computeIncludedVat, computeRegularStartsAt, grossFromNet, round2 };
184
+ export { CreatePromoCodeDto, PROMO_CODE_HOLD_REPOSITORY_TOKEN, PROMO_CODE_REDEMPTION_REPOSITORY_TOKEN, PROMO_CODE_REPOSITORY_TOKEN, PROMO_CODE_VALIDATION_LOG_REPOSITORY_TOKEN, PROMO_FIRST_TIME_CUSTOMER_CHECK_TOKEN, PROMO_REVENUE_DEDUCTION_AGGREGATOR_TOKEN, PROMO_SERVICE_CONFIG_TOKEN, PROMO_SUBSCRIPTION_LOOKUP_TOKEN, PROMO_TRANSACTION_RUNNER_TOKEN, PreviewPromoCodeDto, PreviewResult, PromoCodeExpirer, type PromoCodeForCalc, PromoCodePublicController, PromoCodesService, type PromoLabelOptions, UpdatePromoCodeDto, addCycles, buildLabel, buildPromoCodeAdminController, computeDiscountGross, computeDiscountedGross, computeIncludedVat, computeRegularStartsAt, grossFromNet, isTaxRatePercent, netFromGross, round2 };