@saasicat/nest 0.6.0 → 0.7.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.
@@ -3923,7 +3923,6 @@ var TenantBillingController = class _TenantBillingController {
3923
3923
  periodEnd: period?.end ?? null,
3924
3924
  nextStatus: wasTrial ? null : "ACTIVE"
3925
3925
  });
3926
- await this.tryFreezeOnPlanChange(tenantId, dto.plan, dto.billingCycle, wasTrial);
3927
3926
  if (dto.promoCode) {
3928
3927
  if (!this.promoCodes) {
3929
3928
  warnings.push("Promo-Code wurde gesendet, aber PromoCodesModule ist nicht geladen \u2014 der Code wurde NICHT eingel\xF6st.");
@@ -3945,6 +3944,7 @@ var TenantBillingController = class _TenantBillingController {
3945
3944
  }
3946
3945
  }
3947
3946
  }
3947
+ await this.tryFreezeOnPlanChange(tenantId, dto.plan, dto.billingCycle, wasTrial);
3948
3948
  this.entitlements.invalidateTenant(tenantId);
3949
3949
  await this.auditLog(req, userId, "Subscription", tenantId, "COMPLETE_ONBOARDING_SUBSCRIPTION", {
3950
3950
  plan: planResult.plan,
@@ -56,9 +56,9 @@ import {
56
56
  periodEndWithMinLead,
57
57
  resolveBundleCancelEffectiveAt,
58
58
  resolveBundlePriceNet
59
- } from "../chunk-BTL66TR6.js";
60
- import "../chunk-2PNX2QL2.js";
59
+ } from "../chunk-6LP7CDS2.js";
61
60
  import "../chunk-ZLUGQE5D.js";
61
+ import "../chunk-2PNX2QL2.js";
62
62
  import {
63
63
  AUDIT_CONTEXT_RESOLVER_TOKEN,
64
64
  PENDING_PLAN_QUERY_PORT_TOKEN,
@@ -83,8 +83,7 @@ import "../chunk-E56W4U2P.js";
83
83
  import {
84
84
  SUBSCRIPTION_BUNDLE_CONFIG_TOKEN,
85
85
  SUBSCRIPTION_BUNDLE_REPOSITORY_TOKEN
86
- } from "../chunk-ND7OOKOG.js";
87
- import "../chunk-NYLON2VC.js";
86
+ } from "../chunk-RZU4HIAN.js";
88
87
  import {
89
88
  PLAN_CATALOG_READ_SINK_TOKEN,
90
89
  PLAN_CATALOG_TOKEN,
@@ -100,6 +99,7 @@ import {
100
99
  isFeatureInPlan,
101
100
  isFeaturePlannedOnly
102
101
  } from "../chunk-R2QOSVAA.js";
102
+ import "../chunk-NYLON2VC.js";
103
103
  import "../chunk-WKVBNTYC.js";
104
104
  import "../chunk-N3WANKSA.js";
105
105
  import "../chunk-SABTXESR.js";
@@ -1,9 +1,9 @@
1
- import {
2
- SubscriptionContractService
3
- } from "./chunk-2PNX2QL2.js";
4
1
  import {
5
2
  PromoCodesService
6
3
  } from "./chunk-ZLUGQE5D.js";
4
+ import {
5
+ SubscriptionContractService
6
+ } from "./chunk-2PNX2QL2.js";
7
7
  import {
8
8
  AUDIT_CONTEXT_RESOLVER_TOKEN,
9
9
  PENDING_PLAN_QUERY_PORT_TOKEN,
@@ -28,16 +28,16 @@ import {
28
28
  SUBSCRIPTION_BUNDLE_REPOSITORY_TOKEN,
29
29
  isLimitExceededError,
30
30
  toEffectiveLimitsSnapshot
31
- } from "./chunk-ND7OOKOG.js";
32
- import {
33
- SUBSCRIPTION_CONTRACT_REPOSITORY_TOKEN
34
- } from "./chunk-NYLON2VC.js";
31
+ } from "./chunk-RZU4HIAN.js";
35
32
  import {
36
33
  PLAN_CATALOG_TOKEN,
37
34
  findPlan,
38
35
  getMarketedPlans,
39
36
  getPlanPriceNet
40
37
  } from "./chunk-R2QOSVAA.js";
38
+ import {
39
+ SUBSCRIPTION_CONTRACT_REPOSITORY_TOKEN
40
+ } from "./chunk-NYLON2VC.js";
41
41
  import {
42
42
  ENTITLEMENT_SERVICE_TOKEN
43
43
  } from "./chunk-WKVBNTYC.js";
@@ -2143,7 +2143,6 @@ var TenantBillingController = class _TenantBillingController {
2143
2143
  periodEnd: period?.end ?? null,
2144
2144
  nextStatus: wasTrial ? null : "ACTIVE"
2145
2145
  });
2146
- await this.tryFreezeOnPlanChange(tenantId, dto.plan, dto.billingCycle, wasTrial);
2147
2146
  if (dto.promoCode) {
2148
2147
  if (!this.promoCodes) {
2149
2148
  warnings.push("Promo-Code wurde gesendet, aber PromoCodesModule ist nicht geladen \u2014 der Code wurde NICHT eingel\xF6st.");
@@ -2165,6 +2164,7 @@ var TenantBillingController = class _TenantBillingController {
2165
2164
  }
2166
2165
  }
2167
2166
  }
2167
+ await this.tryFreezeOnPlanChange(tenantId, dto.plan, dto.billingCycle, wasTrial);
2168
2168
  this.entitlements.invalidateTenant(tenantId);
2169
2169
  await this.auditLog(req, userId, "Subscription", tenantId, "COMPLETE_ONBOARDING_SUBSCRIPTION", {
2170
2170
  plan: planResult.plan,
@@ -11,7 +11,7 @@ import {
11
11
  import {
12
12
  EntitlementModule,
13
13
  LimitExceededError
14
- } from "./chunk-ND7OOKOG.js";
14
+ } from "./chunk-RZU4HIAN.js";
15
15
  import {
16
16
  PLAN_CATALOG_TOKEN,
17
17
  PlanCatalogModule
@@ -17,9 +17,9 @@ import {
17
17
  isLimitExceededError,
18
18
  resolveEntitlementPlan,
19
19
  toEffectiveLimitsSnapshot
20
- } from "../chunk-ND7OOKOG.js";
21
- import "../chunk-NYLON2VC.js";
20
+ } from "../chunk-RZU4HIAN.js";
22
21
  import "../chunk-R2QOSVAA.js";
22
+ import "../chunk-NYLON2VC.js";
23
23
  import {
24
24
  ENTITLEMENT_RESOLUTION_CONFIG_TOKEN,
25
25
  ENTITLEMENT_SERVICE_TOKEN,
package/dist/index.cjs CHANGED
@@ -4449,7 +4449,6 @@ var TenantBillingController = class _TenantBillingController {
4449
4449
  periodEnd: period?.end ?? null,
4450
4450
  nextStatus: wasTrial ? null : "ACTIVE"
4451
4451
  });
4452
- await this.tryFreezeOnPlanChange(tenantId, dto.plan, dto.billingCycle, wasTrial);
4453
4452
  if (dto.promoCode) {
4454
4453
  if (!this.promoCodes) {
4455
4454
  warnings.push("Promo-Code wurde gesendet, aber PromoCodesModule ist nicht geladen \u2014 der Code wurde NICHT eingel\xF6st.");
@@ -4471,6 +4470,7 @@ var TenantBillingController = class _TenantBillingController {
4471
4470
  }
4472
4471
  }
4473
4472
  }
4473
+ await this.tryFreezeOnPlanChange(tenantId, dto.plan, dto.billingCycle, wasTrial);
4474
4474
  this.entitlements.invalidateTenant(tenantId);
4475
4475
  await this.auditLog(req, userId, "Subscription", tenantId, "COMPLETE_ONBOARDING_SUBSCRIPTION", {
4476
4476
  plan: planResult.plan,
package/dist/index.js CHANGED
@@ -1,3 +1,12 @@
1
+ import {
2
+ PreviewPromoCodeDto,
3
+ PromoCodeExpirer,
4
+ PromoCodePublicController,
5
+ PromoCodeRateLimitGuard,
6
+ PromoCodesModule,
7
+ hashIp,
8
+ ipFingerprint
9
+ } from "./chunk-52UTQRD3.js";
1
10
  import {
2
11
  ACTIVATION_ORCHESTRATOR_TOKEN,
3
12
  BaseIpRateLimitGuard,
@@ -37,15 +46,6 @@ import {
37
46
  slugify,
38
47
  verifyOtpCode
39
48
  } from "./chunk-CK54YKVK.js";
40
- import {
41
- PreviewPromoCodeDto,
42
- PromoCodeExpirer,
43
- PromoCodePublicController,
44
- PromoCodeRateLimitGuard,
45
- PromoCodesModule,
46
- hashIp,
47
- ipFingerprint
48
- } from "./chunk-52UTQRD3.js";
49
49
  import {
50
50
  ADMIN_STATS_AUDIT_WINDOW_DAYS_TOKEN,
51
51
  AUDIT_STATS_PORT_TOKEN,
@@ -113,14 +113,7 @@ import {
113
113
  periodEndWithMinLead,
114
114
  resolveBundleCancelEffectiveAt,
115
115
  resolveBundlePriceNet
116
- } from "./chunk-BTL66TR6.js";
117
- import {
118
- SubscriptionContractModule,
119
- SubscriptionContractService,
120
- contractLineItemToInvoiceLineItem,
121
- sortContractLineItemsForInvoice,
122
- subscriptionContractToInvoiceSnapshot
123
- } from "./chunk-2PNX2QL2.js";
116
+ } from "./chunk-6LP7CDS2.js";
124
117
  import {
125
118
  PROMO_CODE_REDEMPTION_REPOSITORY_TOKEN,
126
119
  PROMO_CODE_REPOSITORY_TOKEN,
@@ -137,6 +130,13 @@ import {
137
130
  computeDiscountedGross,
138
131
  computeRegularStartsAt
139
132
  } from "./chunk-ZLUGQE5D.js";
133
+ import {
134
+ SubscriptionContractModule,
135
+ SubscriptionContractService,
136
+ contractLineItemToInvoiceLineItem,
137
+ sortContractLineItemsForInvoice,
138
+ subscriptionContractToInvoiceSnapshot
139
+ } from "./chunk-2PNX2QL2.js";
140
140
  import {
141
141
  ADVISORY_STRICT_MODE_CODES,
142
142
  BundlesService,
@@ -283,10 +283,7 @@ import {
283
283
  isLimitExceededError,
284
284
  resolveEntitlementPlan,
285
285
  toEffectiveLimitsSnapshot
286
- } from "./chunk-ND7OOKOG.js";
287
- import {
288
- SUBSCRIPTION_CONTRACT_REPOSITORY_TOKEN
289
- } from "./chunk-NYLON2VC.js";
286
+ } from "./chunk-RZU4HIAN.js";
290
287
  import {
291
288
  PLAN_CATALOG_READ_SINK_TOKEN,
292
289
  PLAN_CATALOG_TOKEN,
@@ -305,6 +302,9 @@ import {
305
302
  isFeaturePlannedOnly,
306
303
  round2
307
304
  } from "./chunk-R2QOSVAA.js";
305
+ import {
306
+ SUBSCRIPTION_CONTRACT_REPOSITORY_TOKEN
307
+ } from "./chunk-NYLON2VC.js";
308
308
  import {
309
309
  ENTITLEMENT_RESOLUTION_CONFIG_TOKEN,
310
310
  ENTITLEMENT_SERVICE_TOKEN,
@@ -9,7 +9,7 @@ import {
9
9
  StaticPlanResolver,
10
10
  TenantManifestService,
11
11
  buildTenantManifestController
12
- } from "../chunk-FSGBRFLX.js";
12
+ } from "../chunk-A2QBXDJC.js";
13
13
  import {
14
14
  AdminManifestService
15
15
  } from "../chunk-U6HT27J7.js";
@@ -17,9 +17,9 @@ import "../chunk-Q53N43LQ.js";
17
17
  import "../chunk-E56W4U2P.js";
18
18
  import "../chunk-AJ3EPELS.js";
19
19
  import "../chunk-M6CZQYPY.js";
20
- import "../chunk-ND7OOKOG.js";
21
- import "../chunk-NYLON2VC.js";
20
+ import "../chunk-RZU4HIAN.js";
22
21
  import "../chunk-R2QOSVAA.js";
22
+ import "../chunk-NYLON2VC.js";
23
23
  import "../chunk-WKVBNTYC.js";
24
24
  import "../chunk-N3WANKSA.js";
25
25
  import "../chunk-SABTXESR.js";
@@ -5,15 +5,15 @@ import {
5
5
  StaticEntitlementService,
6
6
  StaticFeatureGuard,
7
7
  StaticPlanResolver
8
- } from "../chunk-FSGBRFLX.js";
8
+ } from "../chunk-A2QBXDJC.js";
9
9
  import "../chunk-U6HT27J7.js";
10
10
  import "../chunk-Q53N43LQ.js";
11
11
  import "../chunk-E56W4U2P.js";
12
12
  import "../chunk-AJ3EPELS.js";
13
13
  import "../chunk-M6CZQYPY.js";
14
- import "../chunk-ND7OOKOG.js";
15
- import "../chunk-NYLON2VC.js";
14
+ import "../chunk-RZU4HIAN.js";
16
15
  import "../chunk-R2QOSVAA.js";
16
+ import "../chunk-NYLON2VC.js";
17
17
  import "../chunk-WKVBNTYC.js";
18
18
  import "../chunk-N3WANKSA.js";
19
19
  import "../chunk-SABTXESR.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@saasicat/nest",
3
- "version": "0.6.0",
3
+ "version": "0.7.0",
4
4
  "description": "NestJS implementation of the SaaS platform: billing, promo codes, admin backend, audit, MFA, adapter ports.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -137,8 +137,8 @@
137
137
  "js-yaml": "^4.1.0",
138
138
  "otplib": "^13.4.1",
139
139
  "qrcode": "^1.5.4",
140
- "@saasicat/spec": "^0.6.0",
141
- "@saasicat/types": "^0.6.0"
140
+ "@saasicat/spec": "^0.7.0",
141
+ "@saasicat/types": "^0.7.0"
142
142
  },
143
143
  "peerDependencies": {
144
144
  "@nestjs/common": "^11.0.0",
@@ -1,10 +1,10 @@
1
- import {
2
- SUBSCRIPTION_CONTRACT_REPOSITORY_TOKEN
3
- } from "./chunk-NYLON2VC.js";
4
1
  import {
5
2
  PLAN_CATALOG_TOKEN,
6
3
  isFeaturePlannedOnly
7
4
  } from "./chunk-R2QOSVAA.js";
5
+ import {
6
+ SUBSCRIPTION_CONTRACT_REPOSITORY_TOKEN
7
+ } from "./chunk-NYLON2VC.js";
8
8
  import {
9
9
  ENTITLEMENT_RESOLUTION_CONFIG_TOKEN,
10
10
  ENTITLEMENT_SERVICE_TOKEN,