@saasicat/nest 0.4.0 → 0.6.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 (58) hide show
  1. package/dist/admin/index.cjs +3 -8
  2. package/dist/admin/index.d.cts +5 -33
  3. package/dist/admin/index.d.ts +5 -33
  4. package/dist/admin/index.js +2 -2
  5. package/dist/{admin-manifest.config-DxTfZ8-L.d.cts → admin-manifest.config-DyrQNT7M.d.cts} +1 -1
  6. package/dist/{admin-manifest.config-DxTfZ8-L.d.ts → admin-manifest.config-DyrQNT7M.d.ts} +1 -1
  7. package/dist/admin-manifest.service-Cp6uwvmt.d.cts +33 -0
  8. package/dist/admin-manifest.service-UGgzR1x-.d.ts +33 -0
  9. package/dist/{aggregation-DGCyoN5d.d.ts → aggregation-BibpEO0t.d.ts} +6 -59
  10. package/dist/{aggregation-Bt1i_whS.d.cts → aggregation-CfI0bOsQ.d.cts} +6 -59
  11. package/dist/billing/index.cjs +18 -106
  12. package/dist/billing/index.d.cts +8 -30
  13. package/dist/billing/index.d.ts +8 -30
  14. package/dist/billing/index.js +12 -14
  15. package/dist/catalog/index.cjs +1160 -1985
  16. package/dist/catalog/index.d.cts +9 -124
  17. package/dist/catalog/index.d.ts +9 -124
  18. package/dist/catalog/index.js +5 -27
  19. package/dist/checkout-offer/index.js +2 -2
  20. package/dist/{chunk-2VNZYRDV.js → chunk-52UTQRD3.js} +1 -1
  21. package/dist/{chunk-FN65XZKH.js → chunk-5DDCSGZC.js} +1110 -1923
  22. package/dist/{chunk-VHEHZMHB.js → chunk-BTL66TR6.js} +22 -75
  23. package/dist/{chunk-XSGU2Y2O.js → chunk-CK54YKVK.js} +2 -33
  24. package/dist/{chunk-SG34XT7J.js → chunk-FSGBRFLX.js} +18 -10
  25. package/dist/{chunk-SYEVGPFC.js → chunk-K3OPNVFR.js} +1 -1
  26. package/dist/{chunk-XCZ3TTFK.js → chunk-N3WANKSA.js} +0 -2
  27. package/dist/{chunk-K42EQPBB.js → chunk-ND7OOKOG.js} +18 -51
  28. package/dist/{chunk-MV6LW5UB.js → chunk-R2QOSVAA.js} +2 -2
  29. package/dist/{chunk-YNEW3L63.js → chunk-SD3TT2BR.js} +1 -1
  30. package/dist/{chunk-P6MYZMXQ.js → chunk-U6HT27J7.js} +3 -8
  31. package/dist/{chunk-7MLGHWKO.js → chunk-WKVBNTYC.js} +2 -0
  32. package/dist/{chunk-ZL4LLE2Z.js → chunk-ZLUGQE5D.js} +1 -1
  33. package/dist/discovery/index.js +4 -4
  34. package/dist/{enforce-quota.interceptor-3HmbeHTM.d.ts → enforce-quota.interceptor-Dj1Kusr5.d.ts} +9 -4
  35. package/dist/{enforce-quota.interceptor-HmdZFg41.d.cts → enforce-quota.interceptor-cv7r80VM.d.cts} +9 -4
  36. package/dist/entitlement/index.cjs +13 -46
  37. package/dist/entitlement/index.d.cts +4 -3
  38. package/dist/entitlement/index.d.ts +4 -3
  39. package/dist/entitlement/index.js +7 -9
  40. package/dist/index.cjs +1348 -2300
  41. package/dist/index.d.cts +8 -7
  42. package/dist/index.d.ts +8 -7
  43. package/dist/index.js +85 -113
  44. package/dist/platform/index.cjs +28 -54
  45. package/dist/platform/index.d.cts +4 -3
  46. package/dist/platform/index.d.ts +4 -3
  47. package/dist/platform/index.js +10 -7
  48. package/dist/promo/index.cjs +2 -2
  49. package/dist/promo/index.js +3 -3
  50. package/dist/registration/index.cjs +2 -34
  51. package/dist/registration/index.d.cts +3 -21
  52. package/dist/registration/index.d.ts +3 -21
  53. package/dist/registration/index.js +1 -3
  54. package/dist/testing/index.cjs +26 -255
  55. package/dist/testing/index.d.cts +5 -37
  56. package/dist/testing/index.d.ts +5 -37
  57. package/dist/testing/index.js +7 -207
  58. package/package.json +3 -3
@@ -2,8 +2,8 @@ import {
2
2
  SubscriptionContractService
3
3
  } from "./chunk-2PNX2QL2.js";
4
4
  import {
5
- REQUIRE_FEATURE_KEY
6
- } from "./chunk-Q53N43LQ.js";
5
+ PromoCodesService
6
+ } from "./chunk-ZLUGQE5D.js";
7
7
  import {
8
8
  AUDIT_CONTEXT_RESOLVER_TOKEN,
9
9
  PENDING_PLAN_QUERY_PORT_TOKEN,
@@ -16,6 +16,9 @@ import {
16
16
  USER_EMAIL_RESOLVER_TOKEN,
17
17
  USER_ID_RESOLVER_TOKEN
18
18
  } from "./chunk-WPUVJRIN.js";
19
+ import {
20
+ REQUIRE_FEATURE_KEY
21
+ } from "./chunk-Q53N43LQ.js";
19
22
  import {
20
23
  AdminAuditService
21
24
  } from "./chunk-E56W4U2P.js";
@@ -25,24 +28,24 @@ import {
25
28
  SUBSCRIPTION_BUNDLE_REPOSITORY_TOKEN,
26
29
  isLimitExceededError,
27
30
  toEffectiveLimitsSnapshot
28
- } from "./chunk-K42EQPBB.js";
31
+ } from "./chunk-ND7OOKOG.js";
29
32
  import {
30
33
  SUBSCRIPTION_CONTRACT_REPOSITORY_TOKEN
31
34
  } from "./chunk-NYLON2VC.js";
32
- import {
33
- BUNDLE_REPOSITORY_TOKEN,
34
- CATALOG_ENTRY_REPOSITORY_TOKEN,
35
- PLAN_REPOSITORY_TOKEN
36
- } from "./chunk-XCZ3TTFK.js";
37
- import {
38
- PromoCodesService
39
- } from "./chunk-ZL4LLE2Z.js";
40
35
  import {
41
36
  PLAN_CATALOG_TOKEN,
42
37
  findPlan,
43
38
  getMarketedPlans,
44
39
  getPlanPriceNet
45
- } from "./chunk-MV6LW5UB.js";
40
+ } from "./chunk-R2QOSVAA.js";
41
+ import {
42
+ ENTITLEMENT_SERVICE_TOKEN
43
+ } from "./chunk-WKVBNTYC.js";
44
+ import {
45
+ BUNDLE_REPOSITORY_TOKEN,
46
+ CATALOG_ENTRY_REPOSITORY_TOKEN,
47
+ PLAN_REPOSITORY_TOKEN
48
+ } from "./chunk-N3WANKSA.js";
46
49
  import {
47
50
  asProvider
48
51
  } from "./chunk-SABTXESR.js";
@@ -273,7 +276,7 @@ var FeatureGuard = class _FeatureGuard {
273
276
  FeatureGuard = _ts_decorate([
274
277
  Injectable(),
275
278
  _ts_param(0, Inject(Reflector)),
276
- _ts_param(1, Inject(EntitlementService)),
279
+ _ts_param(1, Inject(ENTITLEMENT_SERVICE_TOKEN)),
277
280
  _ts_param(2, Optional()),
278
281
  _ts_param(2, Inject(FEATURE_GUARD_CONFIG_TOKEN)),
279
282
  _ts_param(3, Optional()),
@@ -294,7 +297,6 @@ import { buildFeatureRequiresIndex, collectUnsatisfiedRequires } from "@saasicat
294
297
  // src/billing/public-catalog.tokens.ts
295
298
  var PUBLIC_CATALOG_PROJECT_KEY_TOKEN = /* @__PURE__ */ Symbol("PUBLIC_CATALOG_PROJECT_KEY");
296
299
  var PUBLIC_CATALOG_BUNDLE_REPOSITORY_TOKEN = /* @__PURE__ */ Symbol("PUBLIC_CATALOG_BUNDLE_REPOSITORY");
297
- var PUBLIC_CATALOG_BUSINESS_TYPE_REPOSITORY_TOKEN = /* @__PURE__ */ Symbol("PUBLIC_CATALOG_BUSINESS_TYPE_REPOSITORY");
298
300
  var PUBLIC_CATALOG_MARKETING_REPOSITORY_TOKEN = /* @__PURE__ */ Symbol("PUBLIC_CATALOG_MARKETING_REPOSITORY");
299
301
  var PUBLIC_CATALOG_CATALOG_ENTRY_REPOSITORY_TOKEN = /* @__PURE__ */ Symbol("PUBLIC_CATALOG_CATALOG_ENTRY_REPOSITORY");
300
302
 
@@ -782,15 +784,13 @@ var PublicCatalogController = class {
782
784
  projectKey;
783
785
  marketingRepo;
784
786
  bundleRepo;
785
- businessTypeRepo;
786
787
  catalogEntryRepo;
787
- constructor(planCatalog, featureRegistry, projectKey = null, marketingRepo = null, bundleRepo = null, businessTypeRepo = null, catalogEntryRepo = null) {
788
+ constructor(planCatalog, featureRegistry, projectKey = null, marketingRepo = null, bundleRepo = null, catalogEntryRepo = null) {
788
789
  this.planCatalog = planCatalog;
789
790
  this.featureRegistry = featureRegistry;
790
791
  this.projectKey = projectKey;
791
792
  this.marketingRepo = marketingRepo;
792
793
  this.bundleRepo = bundleRepo;
793
- this.businessTypeRepo = businessTypeRepo;
794
794
  this.catalogEntryRepo = catalogEntryRepo;
795
795
  }
796
796
  async listPlans(lang, localeParam = "de") {
@@ -882,41 +882,6 @@ var PublicCatalogController = class {
882
882
  return /* @__PURE__ */ new Map();
883
883
  }
884
884
  }
885
- /**
886
- * SPEC_V2 §11.1 M6 Pack 2c — public catalog endpoint for BusinessTypes
887
- * (stem list with live versions + bundle composition + marketing).
888
- */
889
- async listBusinessTypes(lang, localeParam = "de") {
890
- const locale = lang || localeParam;
891
- if (!this.businessTypeRepo || !this.bundleRepo || !this.projectKey) return [];
892
- const stems = await this.businessTypeRepo.list({
893
- projectKey: this.projectKey
894
- });
895
- const out = [];
896
- for (const stem of stems) {
897
- const versions = await this.businessTypeRepo.listVersions(stem.id);
898
- const live = versions.find((v) => v.publishedAt !== null && v.supersededAt === null);
899
- if (!live) continue;
900
- const bundleKeys = [];
901
- for (const ref of live.bundles) {
902
- const bv = await this.bundleRepo.findVersionById(ref.bundleVersionId);
903
- if (bv) bundleKeys.push(bv.bundleKey);
904
- }
905
- const marketing = await this.lookupMarketing("BUSINESS_TYPE", live.id, locale);
906
- out.push({
907
- businessTypeVersionId: live.id,
908
- businessTypeKey: stem.businessTypeKey,
909
- label: stem.label,
910
- description: stem.description ?? null,
911
- monthlyNet: live.monthlyNet,
912
- yearlyNet: live.yearlyNet,
913
- bundleKeys,
914
- quotaOverrides: live.quotaOverrides,
915
- marketing
916
- });
917
- }
918
- return out;
919
- }
920
885
  async lookupMarketing(targetType, targetVersionId, locale) {
921
886
  if (!this.marketingRepo || !this.projectKey) return void 0;
922
887
  const rows = await this.marketingRepo.list({
@@ -985,17 +950,6 @@ _ts_decorate7([
985
950
  ]),
986
951
  _ts_metadata5("design:returntype", Promise)
987
952
  ], PublicCatalogController.prototype, "listBundles", null);
988
- _ts_decorate7([
989
- Get("business-types"),
990
- _ts_param5(0, Query("lang")),
991
- _ts_param5(1, Query("locale")),
992
- _ts_metadata5("design:type", Function),
993
- _ts_metadata5("design:paramtypes", [
994
- String,
995
- void 0
996
- ]),
997
- _ts_metadata5("design:returntype", Promise)
998
- ], PublicCatalogController.prototype, "listBusinessTypes", null);
999
953
  PublicCatalogController = _ts_decorate7([
1000
954
  Controller2("billing"),
1001
955
  _ts_param5(0, Inject5(PLAN_CATALOG_TOKEN)),
@@ -1007,9 +961,7 @@ PublicCatalogController = _ts_decorate7([
1007
961
  _ts_param5(4, Optional3()),
1008
962
  _ts_param5(4, Inject5(PUBLIC_CATALOG_BUNDLE_REPOSITORY_TOKEN)),
1009
963
  _ts_param5(5, Optional3()),
1010
- _ts_param5(5, Inject5(PUBLIC_CATALOG_BUSINESS_TYPE_REPOSITORY_TOKEN)),
1011
- _ts_param5(6, Optional3()),
1012
- _ts_param5(6, Inject5(PUBLIC_CATALOG_CATALOG_ENTRY_REPOSITORY_TOKEN)),
964
+ _ts_param5(5, Inject5(PUBLIC_CATALOG_CATALOG_ENTRY_REPOSITORY_TOKEN)),
1013
965
  _ts_metadata5("design:type", Function),
1014
966
  _ts_metadata5("design:paramtypes", [
1015
967
  typeof PlanCatalog === "undefined" ? Object : PlanCatalog,
@@ -1017,7 +969,6 @@ PublicCatalogController = _ts_decorate7([
1017
969
  Object,
1018
970
  Object,
1019
971
  Object,
1020
- Object,
1021
972
  Object
1022
973
  ])
1023
974
  ], PublicCatalogController);
@@ -1052,9 +1003,6 @@ var PublicCatalogModule = class _PublicCatalogModule {
1052
1003
  if (options.bundleRepository) {
1053
1004
  providers.push(asProvider(PUBLIC_CATALOG_BUNDLE_REPOSITORY_TOKEN, options.bundleRepository));
1054
1005
  }
1055
- if (options.businessTypeRepository) {
1056
- providers.push(asProvider(PUBLIC_CATALOG_BUSINESS_TYPE_REPOSITORY_TOKEN, options.businessTypeRepository));
1057
- }
1058
1006
  if (options.marketingRepository) {
1059
1007
  providers.push(asProvider(PUBLIC_CATALOG_MARKETING_REPOSITORY_TOKEN, options.marketingRepository));
1060
1008
  }
@@ -1394,7 +1342,7 @@ var PlanChangePreviewService = class {
1394
1342
  PlanChangePreviewService = _ts_decorate11([
1395
1343
  Injectable6(),
1396
1344
  _ts_param7(0, Inject7(PLAN_CATALOG_TOKEN)),
1397
- _ts_param7(1, Inject7(EntitlementService)),
1345
+ _ts_param7(1, Inject7(ENTITLEMENT_SERVICE_TOKEN)),
1398
1346
  _ts_param7(2, Inject7(SUBSCRIPTION_USAGE_PORT_TOKEN)),
1399
1347
  _ts_param7(3, Inject7(USAGE_SNAPSHOT_PORT_TOKEN)),
1400
1348
  _ts_param7(4, Optional5()),
@@ -1622,7 +1570,7 @@ var SubscriptionContractFreezeService = class {
1622
1570
  SubscriptionContractFreezeService = _ts_decorate13([
1623
1571
  Injectable8(),
1624
1572
  _ts_param9(0, Inject9(PLAN_CATALOG_TOKEN)),
1625
- _ts_param9(1, Inject9(EntitlementService)),
1573
+ _ts_param9(1, Inject9(ENTITLEMENT_SERVICE_TOKEN)),
1626
1574
  _ts_param9(2, Inject9(SubscriptionContractService)),
1627
1575
  _ts_param9(3, Inject9(CONTRACT_FREEZE_PROJECT_KEY_TOKEN)),
1628
1576
  _ts_param9(4, Inject9(CONTRACT_FREEZE_SOURCE_PORT_TOKEN)),
@@ -2476,7 +2424,7 @@ _ts_decorate17([
2476
2424
  TenantBillingController = _ts_decorate17([
2477
2425
  Controller3("billing"),
2478
2426
  UseGuards2(ComposedTenantAuthGuard),
2479
- _ts_param11(0, Inject11(EntitlementService)),
2427
+ _ts_param11(0, Inject11(ENTITLEMENT_SERVICE_TOKEN)),
2480
2428
  _ts_param11(1, Inject11(PlanChangePreviewService)),
2481
2429
  _ts_param11(2, Inject11(SUBSCRIPTION_USAGE_PORT_TOKEN)),
2482
2430
  _ts_param11(3, Inject11(USAGE_SNAPSHOT_PORT_TOKEN)),
@@ -2922,7 +2870,7 @@ SubscriptionBundlePreviewService = _ts_decorate20([
2922
2870
  ])
2923
2871
  ], SubscriptionBundlePreviewService);
2924
2872
  function resolveBundlePriceNet(bundleVersion, planKey, billingCycle) {
2925
- const override = (bundleVersion.pricingOverrides ?? []).find((o) => o.planId === planKey && !o.businessTypeKey);
2873
+ const override = (bundleVersion.pricingOverrides ?? []).find((o) => o.planId === planKey);
2926
2874
  const yearly = billingCycle === "YEARLY";
2927
2875
  const raw = yearly ? override?.yearlyNet !== void 0 ? override.yearlyNet : bundleVersion.yearlyNet : override?.monthlyNet !== void 0 ? override.monthlyNet : bundleVersion.monthlyNet;
2928
2876
  if (raw === null || raw === void 0) return null;
@@ -3328,7 +3276,6 @@ export {
3328
3276
  FeatureGuard,
3329
3277
  PUBLIC_CATALOG_PROJECT_KEY_TOKEN,
3330
3278
  PUBLIC_CATALOG_BUNDLE_REPOSITORY_TOKEN,
3331
- PUBLIC_CATALOG_BUSINESS_TYPE_REPOSITORY_TOKEN,
3332
3279
  PUBLIC_CATALOG_MARKETING_REPOSITORY_TOKEN,
3333
3280
  CatalogBundleUpsellResolver,
3334
3281
  LimitExceededFilter,
@@ -50,7 +50,6 @@ var REGISTRATION_RESUME_DELIVERY_TOKEN = /* @__PURE__ */ Symbol("REGISTRATION_RE
50
50
  var REGISTRATION_RESUME_BASE_URL_TOKEN = /* @__PURE__ */ Symbol("REGISTRATION_RESUME_BASE_URL");
51
51
  var REGISTRATION_CONFIGURATOR_LOOKUP_TOKEN = /* @__PURE__ */ Symbol("REGISTRATION_CONFIGURATOR_LOOKUP");
52
52
  var REGISTRATION_PROMO_PREVIEW_TOKEN = /* @__PURE__ */ Symbol("REGISTRATION_PROMO_PREVIEW");
53
- var REGISTRATION_BUSINESS_TYPE_LOOKUP_TOKEN = /* @__PURE__ */ Symbol("REGISTRATION_BUSINESS_TYPE_LOOKUP");
54
53
  var REGISTRATION_CONFIG_TOKEN = /* @__PURE__ */ Symbol("REGISTRATION_CONFIG");
55
54
 
56
55
  // src/registration/pending-registration.service.ts
@@ -146,9 +145,8 @@ var PendingRegistrationService = class _PendingRegistrationService {
146
145
  resumeBaseUrl;
147
146
  configuratorLookup;
148
147
  promoPreview;
149
- businessTypeLookup;
150
148
  logger = new Logger(_PendingRegistrationService.name);
151
- constructor(repo, otpDelivery, userLookup, slugCheck, passwordHasher, planCatalog, paymentProvider, paymentEventLog, activationOrchestrator, audit, resumeTokenSigner, resumeDelivery, resumeBaseUrl, configuratorLookup, promoPreview, businessTypeLookup) {
149
+ constructor(repo, otpDelivery, userLookup, slugCheck, passwordHasher, planCatalog, paymentProvider, paymentEventLog, activationOrchestrator, audit, resumeTokenSigner, resumeDelivery, resumeBaseUrl, configuratorLookup, promoPreview) {
152
150
  this.repo = repo;
153
151
  this.otpDelivery = otpDelivery;
154
152
  this.userLookup = userLookup;
@@ -164,7 +162,6 @@ var PendingRegistrationService = class _PendingRegistrationService {
164
162
  this.resumeBaseUrl = resumeBaseUrl;
165
163
  this.configuratorLookup = configuratorLookup;
166
164
  this.promoPreview = promoPreview;
167
- this.businessTypeLookup = businessTypeLookup;
168
165
  }
169
166
  async record(eventType, pendingRegistrationId, context, metadata) {
170
167
  try {
@@ -716,14 +713,6 @@ var PendingRegistrationService = class _PendingRegistrationService {
716
713
  code: "MODEL_NOT_AVAILABLE"
717
714
  });
718
715
  }
719
- if (input.selection.businessTypeVersionId && this.businessTypeLookup) {
720
- const view = await this.businessTypeLookup.findPublishedVersion(input.selection.businessTypeVersionId);
721
- if (!view) {
722
- throw new BadRequestException({
723
- code: "BUSINESS_TYPE_NOT_AVAILABLE"
724
- });
725
- }
726
- }
727
716
  let promoEval;
728
717
  if (input.selection.appliedPromoCode && this.promoPreview) {
729
718
  const dryRun = computeBreakdown(catalog, {
@@ -890,8 +879,6 @@ PendingRegistrationService = _ts_decorate([
890
879
  _ts_param(13, Inject(REGISTRATION_CONFIGURATOR_LOOKUP_TOKEN)),
891
880
  _ts_param(14, Optional()),
892
881
  _ts_param(14, Inject(REGISTRATION_PROMO_PREVIEW_TOKEN)),
893
- _ts_param(15, Optional()),
894
- _ts_param(15, Inject(REGISTRATION_BUSINESS_TYPE_LOOKUP_TOKEN)),
895
882
  _ts_metadata("design:type", Function),
896
883
  _ts_metadata("design:paramtypes", [
897
884
  typeof PendingRegistrationRepository === "undefined" ? Object : PendingRegistrationRepository,
@@ -908,8 +895,7 @@ PendingRegistrationService = _ts_decorate([
908
895
  typeof RegistrationResumeDelivery === "undefined" ? Object : RegistrationResumeDelivery,
909
896
  String,
910
897
  typeof RegistrationConfiguratorLookup === "undefined" ? Object : RegistrationConfiguratorLookup,
911
- typeof RegistrationPromoPreview === "undefined" ? Object : RegistrationPromoPreview,
912
- typeof RegistrationBusinessTypeLookup === "undefined" ? Object : RegistrationBusinessTypeLookup
898
+ typeof RegistrationPromoPreview === "undefined" ? Object : RegistrationPromoPreview
913
899
  ])
914
900
  ], PendingRegistrationService);
915
901
  function normalizeEmail(value) {
@@ -1124,9 +1110,6 @@ var RegistrationModule = class _RegistrationModule {
1124
1110
  if (options.promoPreview) {
1125
1111
  providers.push(asProvider(REGISTRATION_PROMO_PREVIEW_TOKEN, options.promoPreview));
1126
1112
  }
1127
- if (options.businessTypeLookup) {
1128
- providers.push(asProvider(REGISTRATION_BUSINESS_TYPE_LOOKUP_TOKEN, options.businessTypeLookup));
1129
- }
1130
1113
  const includeCleanupCron = options.includeCleanupCron ?? true;
1131
1114
  if (includeCleanupCron) {
1132
1115
  providers.push(RegistrationCleanupCron);
@@ -1470,13 +1453,6 @@ var SaveRegistrationConfigSelectionDto = class {
1470
1453
  modelId;
1471
1454
  billingCycle;
1472
1455
  appliedPromoCode;
1473
- /**
1474
- * SPEC_V2 §11.1 M5.3 — optional business-type choice. UUID of a
1475
- * **published** BusinessTypeVersion. The service validates existence +
1476
- * live status against `RegistrationBusinessTypeLookup`. `null` = no
1477
- * choice (legacy Plan-only path).
1478
- */
1479
- businessTypeVersionId;
1480
1456
  /**
1481
1457
  * METAMODELL §17a — Bundle consistency. ID of the `CheckoutOffer` that was
1482
1458
  * created on the pricing page (`<app>/register?offer=<id>`). Passed
@@ -1505,12 +1481,6 @@ _ts_decorate12([
1505
1481
  MaxLength6(60),
1506
1482
  _ts_metadata11("design:type", Object)
1507
1483
  ], SaveRegistrationConfigSelectionDto.prototype, "appliedPromoCode", void 0);
1508
- _ts_decorate12([
1509
- IsOptional3(),
1510
- ValidateIf((_o, value) => value !== null),
1511
- IsUUID(),
1512
- _ts_metadata11("design:type", Object)
1513
- ], SaveRegistrationConfigSelectionDto.prototype, "businessTypeVersionId", void 0);
1514
1484
  _ts_decorate12([
1515
1485
  IsOptional3(),
1516
1486
  ValidateIf((_o, value) => value !== null),
@@ -1589,7 +1559,6 @@ export {
1589
1559
  REGISTRATION_RESUME_BASE_URL_TOKEN,
1590
1560
  REGISTRATION_CONFIGURATOR_LOOKUP_TOKEN,
1591
1561
  REGISTRATION_PROMO_PREVIEW_TOKEN,
1592
- REGISTRATION_BUSINESS_TYPE_LOOKUP_TOKEN,
1593
1562
  REGISTRATION_CONFIG_TOKEN,
1594
1563
  computeBreakdown,
1595
1564
  resolveModel,
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  AdminManifestModule,
3
3
  AdminModule
4
- } from "./chunk-P6MYZMXQ.js";
4
+ } from "./chunk-U6HT27J7.js";
5
5
  import {
6
6
  REQUIRE_FEATURE_KEY
7
7
  } from "./chunk-Q53N43LQ.js";
@@ -11,17 +11,17 @@ import {
11
11
  import {
12
12
  EntitlementModule,
13
13
  LimitExceededError
14
- } from "./chunk-K42EQPBB.js";
15
- import {
16
- ENFORCE_QUOTA_KEY
17
- } from "./chunk-L4SUWH5B.js";
14
+ } from "./chunk-ND7OOKOG.js";
18
15
  import {
19
16
  PLAN_CATALOG_TOKEN,
20
17
  PlanCatalogModule
21
- } from "./chunk-MV6LW5UB.js";
18
+ } from "./chunk-R2QOSVAA.js";
22
19
  import {
23
20
  asProvider
24
21
  } from "./chunk-SABTXESR.js";
22
+ import {
23
+ ENFORCE_QUOTA_KEY
24
+ } from "./chunk-L4SUWH5B.js";
25
25
  import {
26
26
  __name
27
27
  } from "./chunk-SHUYVCID.js";
@@ -470,6 +470,9 @@ var SaasPlatformModule = class _SaasPlatformModule {
470
470
  if (missingCore.length) {
471
471
  throw new Error(`SaasPlatformModule.forRoot: adapters missing (provide them via \`adapters\` or a \`persistence\` bundle): ${missingCore.join(", ")}`);
472
472
  }
473
+ const mfaPort = adapters.mfa;
474
+ const auditPort = adapters.audit;
475
+ const rlsBypassPort = adapters.rlsBypass;
473
476
  if (!options.planCatalog && (!adapters.planCatalogReadSink || !options.dbCatalog)) {
474
477
  throw new Error("SaasPlatformModule.forRoot: either set `planCatalog` (quickstart YAML path) or, for DB hydration, BOTH a planCatalogReadSink (`adapters`/`persistence`) AND `dbCatalog` ({ projectKey, currency, vatRate }).");
475
478
  }
@@ -515,15 +518,20 @@ var SaasPlatformModule = class _SaasPlatformModule {
515
518
  snapshotPath: options.discoverySnapshotPath === void 0 ? "var/discovery-snapshot.json" : options.discoverySnapshotPath
516
519
  }),
517
520
  AdminModule.forRoot({
518
- mfaPort: adapters.mfa,
519
- auditPort: adapters.audit,
520
- rlsBypassPort: adapters.rlsBypass,
521
+ mfaPort,
522
+ auditPort,
523
+ rlsBypassPort,
521
524
  global: true
522
525
  }),
523
526
  AdminManifestModule.forRoot({
524
527
  config: options.adminManifestConfig ?? buildMinimalManifestConfig(),
525
528
  guards: options.controller.guards,
526
- reloadGuards: options.reloadGuards
529
+ reloadGuards: options.reloadGuards,
530
+ // Global like AdminModule above: apps register their manifest
531
+ // contribution by injecting AdminManifestService into one of
532
+ // their own modules (handbook §6.6). Re-exporting the module
533
+ // from here does not make that injection resolvable.
534
+ global: true
527
535
  })
528
536
  ];
529
537
  if (options.entitlement) {
@@ -5,7 +5,7 @@ import {
5
5
  BUNDLE_REPOSITORY_TOKEN,
6
6
  CATALOG_ENTRY_REPOSITORY_TOKEN,
7
7
  PLAN_REPOSITORY_TOKEN
8
- } from "./chunk-XCZ3TTFK.js";
8
+ } from "./chunk-N3WANKSA.js";
9
9
  import {
10
10
  asProvider
11
11
  } from "./chunk-SABTXESR.js";
@@ -1,7 +1,6 @@
1
1
  // src/catalog/tokens.ts
2
2
  var PLAN_REPOSITORY_TOKEN = /* @__PURE__ */ Symbol("PLAN_REPOSITORY");
3
3
  var BUNDLE_REPOSITORY_TOKEN = /* @__PURE__ */ Symbol("BUNDLE_REPOSITORY");
4
- var BUSINESS_TYPE_REPOSITORY_TOKEN = /* @__PURE__ */ Symbol("BUSINESS_TYPE_REPOSITORY");
5
4
  var MARKETING_PROJECTION_REPOSITORY_TOKEN = /* @__PURE__ */ Symbol("MARKETING_PROJECTION_REPOSITORY");
6
5
  var CATALOG_ENTRY_REPOSITORY_TOKEN = /* @__PURE__ */ Symbol("CATALOG_ENTRY_REPOSITORY");
7
6
  var PROMOTION_REPOSITORY_TOKEN = /* @__PURE__ */ Symbol("PROMOTION_REPOSITORY");
@@ -12,7 +11,6 @@ var FEATURE_UI_REGISTRY_TOKEN = /* @__PURE__ */ Symbol("FEATURE_UI_REGISTRY");
12
11
  export {
13
12
  PLAN_REPOSITORY_TOKEN,
14
13
  BUNDLE_REPOSITORY_TOKEN,
15
- BUSINESS_TYPE_REPOSITORY_TOKEN,
16
14
  MARKETING_PROJECTION_REPOSITORY_TOKEN,
17
15
  CATALOG_ENTRY_REPOSITORY_TOKEN,
18
16
  PROMOTION_REPOSITORY_TOKEN,
@@ -1,25 +1,26 @@
1
1
  import {
2
2
  SUBSCRIPTION_CONTRACT_REPOSITORY_TOKEN
3
3
  } from "./chunk-NYLON2VC.js";
4
+ import {
5
+ PLAN_CATALOG_TOKEN,
6
+ isFeaturePlannedOnly
7
+ } from "./chunk-R2QOSVAA.js";
4
8
  import {
5
9
  ENTITLEMENT_RESOLUTION_CONFIG_TOKEN,
10
+ ENTITLEMENT_SERVICE_TOKEN,
6
11
  PLAN_VERSION_REPOSITORY_TOKEN,
7
12
  SUBSCRIPTION_REPOSITORY_TOKEN,
8
13
  TRANSACTION_RUNNER_TOKEN
9
- } from "./chunk-7MLGHWKO.js";
14
+ } from "./chunk-WKVBNTYC.js";
10
15
  import {
11
16
  BUNDLE_REPOSITORY_TOKEN
12
- } from "./chunk-XCZ3TTFK.js";
13
- import {
14
- DISCOVERY_SNAPSHOT_TOKEN
15
- } from "./chunk-L4SUWH5B.js";
16
- import {
17
- PLAN_CATALOG_TOKEN,
18
- isFeaturePlannedOnly
19
- } from "./chunk-MV6LW5UB.js";
17
+ } from "./chunk-N3WANKSA.js";
20
18
  import {
21
19
  asProvider
22
20
  } from "./chunk-SABTXESR.js";
21
+ import {
22
+ DISCOVERY_SNAPSHOT_TOKEN
23
+ } from "./chunk-L4SUWH5B.js";
23
24
  import {
24
25
  __name
25
26
  } from "./chunk-SHUYVCID.js";
@@ -29,25 +30,6 @@ var SUBSCRIPTION_BUNDLE_REPOSITORY_TOKEN = /* @__PURE__ */ Symbol.for("saas-plat
29
30
  var SUBSCRIPTION_BUNDLE_CONFIG_TOKEN = /* @__PURE__ */ Symbol.for("saas-platform/SubscriptionBundleConfig");
30
31
 
31
32
  // src/entitlement/aggregation.ts
32
- function aggregateBusinessTypeQuotas(snapshot) {
33
- const sums = {};
34
- for (const bundle of snapshot.bundles) {
35
- for (const [key, value] of Object.entries(bundle.quotas)) {
36
- if (sums[key] === -1 || value === -1) {
37
- sums[key] = -1;
38
- } else {
39
- sums[key] = (sums[key] ?? 0) + value;
40
- }
41
- }
42
- }
43
- for (const [key, value] of Object.entries(snapshot.quotaOverrides)) {
44
- if (value !== void 0) {
45
- sums[key] = value;
46
- }
47
- }
48
- return sums;
49
- }
50
- __name(aggregateBusinessTypeQuotas, "aggregateBusinessTypeQuotas");
51
33
  function filterActiveSubscriptionBundles(bundles, now) {
52
34
  return bundles.filter((b) => b.canceledEffectiveAt === null || b.canceledEffectiveAt > now);
53
35
  }
@@ -98,16 +80,6 @@ function aggregateContractLineItemEntitlements(lineItems, fallbackPlan = "UNKNOW
98
80
  };
99
81
  }
100
82
  __name(aggregateContractLineItemEntitlements, "aggregateContractLineItemEntitlements");
101
- function collectBusinessTypeFeatures(snapshot) {
102
- const set = /* @__PURE__ */ new Set();
103
- for (const bundle of snapshot.bundles) {
104
- for (const f of bundle.features) {
105
- set.add(f);
106
- }
107
- }
108
- return Array.from(set);
109
- }
110
- __name(collectBusinessTypeFeatures, "collectBusinessTypeFeatures");
111
83
  function filterPlannedOnlyFeatures(features, catalog) {
112
84
  const out = /* @__PURE__ */ new Set();
113
85
  for (const f of features) {
@@ -140,8 +112,6 @@ function applyCustomLimits(base, custom) {
140
112
  }
141
113
  __name(applyCustomLimits, "applyCustomLimits");
142
114
  function aggregateLimits(input, catalog, now) {
143
- const businessTypeQuotas = input.businessTypeVersion ? aggregateBusinessTypeQuotas(input.businessTypeVersion) : {};
144
- const businessTypeFeatures = input.businessTypeVersion ? collectBusinessTypeFeatures(input.businessTypeVersion) : [];
145
115
  const activeBundles = filterActiveSubscriptionBundles(input.subscriptionBundles ?? [], now);
146
116
  const subBundleQuotas = aggregateSubscriptionBundleQuotas(activeBundles);
147
117
  const subBundleFeatures = collectSubscriptionBundleFeatures(activeBundles);
@@ -149,13 +119,6 @@ function aggregateLimits(input, catalog, now) {
149
119
  for (const [k, v] of Object.entries(input.planVersion.quotas)) {
150
120
  quotas[k] = v;
151
121
  }
152
- for (const [k, v] of Object.entries(businessTypeQuotas)) {
153
- if (quotas[k] === -1 || v === -1) {
154
- quotas[k] = -1;
155
- } else {
156
- quotas[k] = (quotas[k] ?? 0) + v;
157
- }
158
- }
159
122
  for (const [k, v] of Object.entries(subBundleQuotas)) {
160
123
  if (quotas[k] === -1 || v === -1) {
161
124
  quotas[k] = -1;
@@ -165,7 +128,6 @@ function aggregateLimits(input, catalog, now) {
165
128
  }
166
129
  const features = /* @__PURE__ */ new Set([
167
130
  ...input.planVersion.features,
168
- ...businessTypeFeatures,
169
131
  ...subBundleFeatures
170
132
  ]);
171
133
  const withCustom = applyCustomLimits({
@@ -564,7 +526,13 @@ var EntitlementModule = class _EntitlementModule {
564
526
  asProvider(SUBSCRIPTION_REPOSITORY_TOKEN, options.subscriptionRepository),
565
527
  asProvider(PLAN_VERSION_REPOSITORY_TOKEN, options.planVersionRepository),
566
528
  asProvider(TRANSACTION_RUNNER_TOKEN, options.transactionRunner),
567
- EntitlementService
529
+ EntitlementService,
530
+ // Cross-bundle-stable alias so consumers in other subpath bundles
531
+ // (billing/TenantBillingModule) can inject the same instance.
532
+ {
533
+ provide: ENTITLEMENT_SERVICE_TOKEN,
534
+ useExisting: EntitlementService
535
+ }
568
536
  ];
569
537
  if (options.resolutionConfig) {
570
538
  providers.push({
@@ -587,6 +555,7 @@ var EntitlementModule = class _EntitlementModule {
587
555
  providers,
588
556
  exports: [
589
557
  EntitlementService,
558
+ ENTITLEMENT_SERVICE_TOKEN,
590
559
  SUBSCRIPTION_REPOSITORY_TOKEN
591
560
  ]
592
561
  };
@@ -599,12 +568,10 @@ EntitlementModule = _ts_decorate2([
599
568
  export {
600
569
  SUBSCRIPTION_BUNDLE_REPOSITORY_TOKEN,
601
570
  SUBSCRIPTION_BUNDLE_CONFIG_TOKEN,
602
- aggregateBusinessTypeQuotas,
603
571
  filterActiveSubscriptionBundles,
604
572
  aggregateSubscriptionBundleQuotas,
605
573
  collectSubscriptionBundleFeatures,
606
574
  aggregateContractLineItemEntitlements,
607
- collectBusinessTypeFeatures,
608
575
  filterPlannedOnlyFeatures,
609
576
  applyCustomLimits,
610
577
  aggregateLimits,
@@ -83,8 +83,8 @@ function _ts_decorate(decorators, target, key, desc) {
83
83
  return c > 3 && r && Object.defineProperty(target, key, r), r;
84
84
  }
85
85
  __name(_ts_decorate, "_ts_decorate");
86
- var PLAN_CATALOG_TOKEN = /* @__PURE__ */ Symbol("PLAN_CATALOG");
87
- var PLAN_CATALOG_READ_SINK_TOKEN = /* @__PURE__ */ Symbol("PLAN_CATALOG_READ_SINK");
86
+ var PLAN_CATALOG_TOKEN = /* @__PURE__ */ Symbol.for("saasicat/nest/PLAN_CATALOG");
87
+ var PLAN_CATALOG_READ_SINK_TOKEN = /* @__PURE__ */ Symbol.for("saasicat/nest/PLAN_CATALOG_READ_SINK");
88
88
  var PlanCatalogModule = class _PlanCatalogModule {
89
89
  static {
90
90
  __name(this, "PlanCatalogModule");
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  SuperAdminGuard
3
- } from "./chunk-P6MYZMXQ.js";
3
+ } from "./chunk-U6HT27J7.js";
4
4
  import {
5
5
  asProvider
6
6
  } from "./chunk-SABTXESR.js";
@@ -27,7 +27,8 @@ var SuperAdminGuard = class {
27
27
  canActivate(context) {
28
28
  const request = context.switchToHttp().getRequest();
29
29
  if (!request.user) throw new ForbiddenException("Nicht authentifiziert");
30
- if (request.user.role !== "SUPER_ADMIN") {
30
+ const role = request.user.platformRole ?? request.user.role;
31
+ if (role !== "SUPER_ADMIN") {
31
32
  throw new ForbiddenException("Nur SUPER_ADMIN-Rolle erlaubt");
32
33
  }
33
34
  return true;
@@ -535,7 +536,7 @@ var PLATFORM_CORE_MANIFEST_CONTRIBUTION = {
535
536
  // section, see `DEFAULT_NAV_SECTIONS` in the nav-builder). The order per
536
537
  // section is deliberately curated:
537
538
  // Overview: dashboard
538
- // Product catalog: discovery → bundles → businessTypes → plans →
539
+ // Product catalog: discovery → bundles → plans →
539
540
  // planVersions → marketingCatalog → promoCodes
540
541
  // (promoCodes is appended by the app contributions
541
542
  // and therefore lands at the end of the section)
@@ -560,12 +561,6 @@ var PLATFORM_CORE_MANIFEST_CONTRIBUTION = {
560
561
  enabled: true,
561
562
  requiredCapability: "bundles.read"
562
563
  },
563
- // SPEC_V2 §11.1 M3 — BusinessType editor in SuperAdmin.
564
- // Apps with domain verticals set `businessTypes.read = true`.
565
- businessTypes: {
566
- enabled: true,
567
- requiredCapability: "businessTypes.read"
568
- },
569
564
  plans: {
570
565
  enabled: true,
571
566
  requiredCapability: "plans.read"
@@ -1,10 +1,12 @@
1
1
  // src/entitlement/tokens.ts
2
+ var ENTITLEMENT_SERVICE_TOKEN = /* @__PURE__ */ Symbol.for("saas-platform/EntitlementService");
2
3
  var SUBSCRIPTION_REPOSITORY_TOKEN = /* @__PURE__ */ Symbol.for("saas-platform/SubscriptionRepository");
3
4
  var PLAN_VERSION_REPOSITORY_TOKEN = /* @__PURE__ */ Symbol.for("saas-platform/PlanVersionRepository");
4
5
  var TRANSACTION_RUNNER_TOKEN = /* @__PURE__ */ Symbol.for("saas-platform/TransactionRunner");
5
6
  var ENTITLEMENT_RESOLUTION_CONFIG_TOKEN = /* @__PURE__ */ Symbol.for("saas-platform/EntitlementResolutionConfig");
6
7
 
7
8
  export {
9
+ ENTITLEMENT_SERVICE_TOKEN,
8
10
  SUBSCRIPTION_REPOSITORY_TOKEN,
9
11
  PLAN_VERSION_REPOSITORY_TOKEN,
10
12
  TRANSACTION_RUNNER_TOKEN,
@@ -3,7 +3,7 @@ import {
3
3
  computeIncludedVat,
4
4
  getPlanPriceGross,
5
5
  round2
6
- } from "./chunk-MV6LW5UB.js";
6
+ } from "./chunk-R2QOSVAA.js";
7
7
  import {
8
8
  __name
9
9
  } from "./chunk-SHUYVCID.js";
@@ -5,14 +5,14 @@ import {
5
5
  RequiresCapability,
6
6
  runHeadlessDiscoveryScan
7
7
  } from "../chunk-HRU3CP57.js";
8
- import {
9
- DiscoveryModule,
10
- buildDiscoveryController
11
- } from "../chunk-AJ3EPELS.js";
12
8
  import {
13
9
  DiscoverySnapshotNotFoundError,
14
10
  loadDiscoverySnapshotFromFile
15
11
  } from "../chunk-ABB2CRAS.js";
12
+ import {
13
+ DiscoveryModule,
14
+ buildDiscoveryController
15
+ } from "../chunk-AJ3EPELS.js";
16
16
  import {
17
17
  DISCOVERY_APP_INFO_TOKEN,
18
18
  DISCOVERY_SNAPSHOT_PATH_TOKEN,