@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,8 +1,14 @@
1
- import { PendingRegistrationRepository, RegistrationOtpDelivery, UserAccountLookup, SlugAvailabilityCheck, PasswordHasher, PlanCatalogLookup, PaymentProvider, PaymentEventLog, ActivationOrchestrator, RegistrationAuditLogger, RegistrationResumeTokenSigner, RegistrationResumeDelivery, RegistrationConfiguratorLookup, RegistrationPromoPreview, PublicSignupPlan, SelectPlanInput, RegistrationAuditContext, SelectPlanResult, StartCheckoutInput, StartCheckoutResult, HandlePaymentEventInput, HandlePaymentEventResult, CleanupResult, StartRegistrationInput, StartRegistrationResult, VerifyRegistrationOtpResult, ResumeRegistrationInput, ResumeRegistrationResult, ConfiguratorCatalog, SaveRegistrationConfigInput, SaveRegistrationConfigResult, ConfiguratorPriceBreakdown, RegistrationConfigSelection } from '@saasicat/core';
1
+ import { PendingRegistrationRepository, ActivationOrchestrator, RegistrationAuditLogger, SubscriberPaymentMethodRepository, PendingRegistration, RegistrationBillingDetails, PaymentGatewayCallback, RegistrationOtpDelivery, UserAccountLookup, SlugAvailabilityCheck, PasswordHasher, PlanCatalogLookup, RegistrationResumeTokenSigner, RegistrationResumeDelivery, RegistrationConfiguratorLookup, RegistrationPromoPreview, PublicSignupPlan, SelectPlanInput, RegistrationAuditContext, SelectPlanResult, StartCheckoutInput, StartCheckoutResult, CleanupResult, StartRegistrationInput, StartRegistrationResult, VerifyRegistrationOtpResult, ResumeRegistrationInput, ResumeRegistrationResult, ConfiguratorCatalog, SaveRegistrationConfigInput, SaveRegistrationConfigResult, ConfiguratorPriceBreakdown, RegistrationConfigSelection } from '@saasicat/core';
2
2
  export { PasswordHasher } from '@saasicat/core';
3
- import { CanActivate, ExecutionContext, Type, DynamicModule, ForwardReference, Provider } from '@nestjs/common';
3
+ import { b as CheckoutOfferService } from '../checkout-offer.service-CCVxG9b2.cjs';
4
+ import { OnModuleInit, OnApplicationBootstrap, CanActivate, ExecutionContext, Type, DynamicModule, ForwardReference, Provider } from '@nestjs/common';
5
+ import { P as PaymentGatewayRegistry, a as PaymentCallbackService } from '../payment-callback.service-CR84Xw1Z.cjs';
4
6
  import { P as ProviderSpec } from '../di-CcNeq9v-.cjs';
5
7
  export { CronExpression } from '@nestjs/schedule';
8
+ import '../subscription-contract.service-CfNApLuP.cjs';
9
+ import '../subscriber.service-5W6Gi-1B.cjs';
10
+ import '../promo.service-BYBu6dy3.cjs';
11
+ import '../plan-catalog-source-DWe-BGY1.cjs';
6
12
 
7
13
  /** 6-digit numeric OTP code, uniformly distributed from 100000..999999. */
8
14
  declare function generateOtpCode(): string;
@@ -27,8 +33,6 @@ declare const USER_ACCOUNT_LOOKUP_TOKEN: unique symbol;
27
33
  declare const SLUG_AVAILABILITY_CHECK_TOKEN: unique symbol;
28
34
  declare const PASSWORD_HASHER_TOKEN: unique symbol;
29
35
  declare const PLAN_CATALOG_LOOKUP_TOKEN: unique symbol;
30
- declare const PAYMENT_PROVIDER_TOKEN: unique symbol;
31
- declare const PAYMENT_EVENT_LOG_TOKEN: unique symbol;
32
36
  declare const ACTIVATION_ORCHESTRATOR_TOKEN: unique symbol;
33
37
  declare const REGISTRATION_AUDIT_LOGGER_TOKEN: unique symbol;
34
38
  declare const REGISTRATION_RESUME_TOKEN_SIGNER_TOKEN: unique symbol;
@@ -39,6 +43,65 @@ declare const REGISTRATION_PROMO_PREVIEW_TOKEN: unique symbol;
39
43
  /** Optionally injectable configuration — falls back to default TTLs from @saasicat/core. */
40
44
  declare const REGISTRATION_CONFIG_TOKEN: unique symbol;
41
45
 
46
+ interface RegistrationSetupUrls {
47
+ successUrl: string;
48
+ cancelUrl: string;
49
+ }
50
+ interface RegistrationSetupStarted {
51
+ updated: PendingRegistration;
52
+ sessionRef: string;
53
+ redirectUrl: string;
54
+ /** The last moment a confirmation of this session can arrive, as the gateway reports it. */
55
+ confirmableUntil: Date | null;
56
+ /** A confirmation the gateway already holds, for `confirm`. */
57
+ immediate: {
58
+ account: string;
59
+ callback: PaymentGatewayCallback;
60
+ } | null;
61
+ }
62
+ /**
63
+ * Step 4 of a sign-up: the billing address and the payment method, and the
64
+ * activation once the gateway confirmed it.
65
+ *
66
+ * The confirmation arrives as a gateway callback, claimed on a transaction the
67
+ * platform opens. The application's `ActivationOrchestrator` writes the user,
68
+ * the tenant, the subscriber and the subscription on that transaction, and the
69
+ * payment method is recorded for the subscriber on it too — all of it, the
70
+ * claim included, or none of it.
71
+ */
72
+ declare class RegistrationPaymentService implements OnModuleInit, OnApplicationBootstrap {
73
+ private readonly repo;
74
+ private readonly orchestrator;
75
+ private readonly audit;
76
+ private readonly registry;
77
+ private readonly callbacks;
78
+ private readonly methods;
79
+ private readonly logger;
80
+ constructor(repo: PendingRegistrationRepository, orchestrator: ActivationOrchestrator, audit: RegistrationAuditLogger, registry?: PaymentGatewayRegistry | null, callbacks?: PaymentCallbackService | null, methods?: SubscriberPaymentMethodRepository | null);
81
+ onModuleInit(): void;
82
+ onApplicationBootstrap(): Promise<void>;
83
+ /**
84
+ * Records the billing details and opens the gateway's form. Returns the
85
+ * record as it now stands, where to send the person, and what `confirm`
86
+ * hands on when the gateway confirmed on the spot. The checkout expires
87
+ * `PENDING_CHECKOUT_TTL_DAYS` after `startedAt`.
88
+ */
89
+ startSetup(pending: PendingRegistration, billingDetails: RegistrationBillingDetails, urls: RegistrationSetupUrls, startedAt: Date): Promise<RegistrationSetupStarted>;
90
+ /** Handles a confirmation the gateway gave when the setup started, like any callback. */
91
+ confirm(started: RegistrationSetupStarted): Promise<void>;
92
+ private activate;
93
+ private noteFailure;
94
+ /**
95
+ * The sign-up a setup event is about, found by the session its account
96
+ * opened. `null` — and nothing done — when there is none waiting: it was
97
+ * activated already, or expired and was cleaned up, or the event names a
98
+ * different sign-up than the session belongs to.
99
+ */
100
+ private pendingFor;
101
+ private payments;
102
+ private record;
103
+ }
104
+
42
105
  /**
43
106
  * Orchestrates step 1 (capture registration data) and step 2 (OTP verification)
44
107
  * of the multi-step registration flow.
@@ -61,36 +124,32 @@ declare class PendingRegistrationService {
61
124
  private readonly slugCheck;
62
125
  private readonly passwordHasher;
63
126
  private readonly planCatalog;
64
- private readonly paymentProvider;
65
- private readonly paymentEventLog;
66
- private readonly activationOrchestrator;
127
+ private readonly payments;
67
128
  private readonly audit;
68
129
  private readonly resumeTokenSigner?;
69
130
  private readonly resumeDelivery?;
70
131
  private readonly resumeBaseUrl?;
71
132
  private readonly configuratorLookup?;
72
133
  private readonly promoPreview?;
134
+ private readonly checkoutOffers?;
73
135
  private readonly logger;
74
- constructor(repo: PendingRegistrationRepository, otpDelivery: RegistrationOtpDelivery, userLookup: UserAccountLookup, slugCheck: SlugAvailabilityCheck, passwordHasher: PasswordHasher, planCatalog: PlanCatalogLookup, paymentProvider: PaymentProvider, paymentEventLog: PaymentEventLog, activationOrchestrator: ActivationOrchestrator, audit: RegistrationAuditLogger, resumeTokenSigner?: RegistrationResumeTokenSigner | undefined, resumeDelivery?: RegistrationResumeDelivery | undefined, resumeBaseUrl?: string | undefined, configuratorLookup?: RegistrationConfiguratorLookup | undefined, promoPreview?: RegistrationPromoPreview | undefined);
136
+ constructor(repo: PendingRegistrationRepository, otpDelivery: RegistrationOtpDelivery, userLookup: UserAccountLookup, slugCheck: SlugAvailabilityCheck, passwordHasher: PasswordHasher, planCatalog: PlanCatalogLookup, payments: RegistrationPaymentService, audit: RegistrationAuditLogger, resumeTokenSigner?: RegistrationResumeTokenSigner | undefined, resumeDelivery?: RegistrationResumeDelivery | undefined, resumeBaseUrl?: string | undefined, configuratorLookup?: RegistrationConfiguratorLookup | undefined, promoPreview?: RegistrationPromoPreview | undefined, checkoutOffers?: CheckoutOfferService | undefined);
75
137
  private record;
76
138
  /** Public signup plan list for step 3 (frontend `usePublicPlans()`). */
77
139
  listPublicPlans(): Promise<PublicSignupPlan[]>;
78
140
  selectPlan(input: SelectPlanInput, context?: RegistrationAuditContext): Promise<SelectPlanResult>;
79
141
  startCheckout(input: StartCheckoutInput, context?: RegistrationAuditContext): Promise<StartCheckoutResult>;
80
142
  /**
81
- * Processes a payment webhook idempotently:
82
- * 1. `tryClaim` pins the event ID via a @unique INSERT. Duplicates are
83
- * dropped silently (`ALREADY_PROCESSED`).
84
- * 2. On status `SUCCEEDED` the PendingRegistration is resolved from the
85
- * checkout session and the ActivationOrchestrator triggers the final
86
- * user+tenant+subscription creation in a single transaction.
87
- * 3. After activation the PendingRegistration is deleted.
88
- *
89
- * On errors in step 2/3 the EventLog entry remains — provider retries then
90
- * run into ALREADY_PROCESSED. Operational repair is done manually (status
91
- * inspection + cleanup).
143
+ * Gives back the slot a failed start took: its form did not open, or its
144
+ * slot could not be moved to the form's end. The failure is the answer the
145
+ * caller gets; a slot that cannot be given back here lapses with its short
146
+ * hold, so this failure is logged rather than put in the way of that answer.
147
+ */
148
+ private giveBackHoldOf;
149
+ /**
150
+ * Holds the promo code of the offer the sign-up concludes until `until`.
92
151
  */
93
- handlePaymentEvent(input: HandlePaymentEventInput, context?: RegistrationAuditContext): Promise<HandlePaymentEventResult>;
152
+ private holdPromoCodeOf;
94
153
  /**
95
154
  * Deletes all PendingRegistration records with `expiresAt < now`.
96
155
  * Full deletion (no anonymization path) is the simpler option: the schema
@@ -234,8 +293,6 @@ interface RegistrationModuleOptions {
234
293
  slugAvailabilityCheck: ProviderSpec<SlugAvailabilityCheck>;
235
294
  passwordHasher: ProviderSpec<PasswordHasher>;
236
295
  planCatalogLookup: ProviderSpec<PlanCatalogLookup>;
237
- paymentProvider: ProviderSpec<PaymentProvider>;
238
- paymentEventLog: ProviderSpec<PaymentEventLog>;
239
296
  activationOrchestrator: ProviderSpec<ActivationOrchestrator>;
240
297
  auditLogger: ProviderSpec<RegistrationAuditLogger>;
241
298
  /**
@@ -326,35 +383,32 @@ declare class SelectRegistrationPlanDto {
326
383
  planId: string;
327
384
  }
328
385
 
386
+ /** The billing address and tax identifiers step 4 asks for, which the subscriber is created with. */
387
+ declare class RegistrationBillingDetailsDto {
388
+ addressLine1: string;
389
+ addressLine2?: string | null;
390
+ postalCode: string;
391
+ city: string;
392
+ /** ISO 3166-1 alpha-2, e.g. `DE`. */
393
+ country: string;
394
+ vatId?: string | null;
395
+ taxNumber?: string | null;
396
+ }
329
397
  /**
330
- * Input for step 4 (start checkout) — `POST /auth/register/start-checkout`.
331
- * The frontend passes the PendingRegistration ID and the redirect URLs
332
- * (success / cancel) that the payment provider redirects to after the payment
333
- * action.
398
+ * Input for step 4 — `POST /auth/register/start-checkout`: the billing details,
399
+ * and where the payment gateway's form sends the person once the payment method
400
+ * is set up, or when they leave it.
334
401
  */
335
402
  declare class StartRegistrationCheckoutDto {
336
403
  pendingRegistrationId: string;
404
+ billingDetails: RegistrationBillingDetailsDto;
337
405
  successUrl: string;
338
406
  cancelUrl: string;
339
- }
340
-
341
- /**
342
- * Webhook contract for `POST /webhooks/payment`.
343
- *
344
- * Provider-agnostic: the Stripe adapter (phase 2.4) maps Stripe's
345
- * `checkout.session.completed` → `{ eventId, sessionId, status: 'SUCCEEDED' }`,
346
- * `payment_intent.payment_failed` → `{ status: 'FAILED' }`, etc.
347
- *
348
- * In production the signature verification (Stripe `Stripe-Signature`
349
- * header) should run BEFORE the DTO validation — see StripeWebhookGuard in
350
- * the app module.
351
- */
352
- declare class PaymentWebhookDto {
353
- eventId: string;
354
- sessionId?: string;
355
- provider: string;
356
- status: 'SUCCEEDED' | 'FAILED';
357
- payload?: Record<string, unknown>;
407
+ /**
408
+ * The checkout offer the sign-up concludes; its promo code is held until a
409
+ * confirmation of the payment form can no longer arrive.
410
+ */
411
+ checkoutOfferId?: string | null;
358
412
  }
359
413
 
360
414
  /**
@@ -401,7 +455,10 @@ declare class PreviewRegistrationPromoDto {
401
455
  }
402
456
 
403
457
  interface PromoEvaluation {
404
- /** Discount in EUR on the subtotal (gross or net depending on catalog convention; here on net). */
458
+ /**
459
+ * The discount in gross, as the promo preview reckons it against the gross
460
+ * subtotal. `computeBreakdown` converts it to net before taking it off.
461
+ */
405
462
  discountAmount: number;
406
463
  /** Percentage for UI display. */
407
464
  percent: number;
@@ -420,4 +477,4 @@ declare function resolveModel(catalog: ConfiguratorCatalog, modelId: string): {
420
477
  yearlyNet: number;
421
478
  };
422
479
 
423
- export { ACTIVATION_ORCHESTRATOR_TOKEN, BaseIpRateLimitGuard, ContinueRegistrationDto, PASSWORD_HASHER_TOKEN, PAYMENT_EVENT_LOG_TOKEN, PAYMENT_PROVIDER_TOKEN, PENDING_REGISTRATION_REPOSITORY_TOKEN, PLAN_CATALOG_LOOKUP_TOKEN, PaymentWebhookDto, PendingRegistrationService, PreviewRegistrationPromoDto, type PromoEvaluation, REGISTRATION_AUDIT_LOGGER_TOKEN, REGISTRATION_CONFIGURATOR_LOOKUP_TOKEN, REGISTRATION_CONFIG_TOKEN, REGISTRATION_OTP_DELIVERY_TOKEN, REGISTRATION_PROMO_PREVIEW_TOKEN, REGISTRATION_RESUME_BASE_URL_TOKEN, REGISTRATION_RESUME_DELIVERY_TOKEN, REGISTRATION_RESUME_TOKEN_SIGNER_TOKEN, RegisterStartDto, RegistrationCleanupCron, RegistrationModule, type RegistrationModuleOptions, ResendRegistrationOtpDto, SLUG_AVAILABILITY_CHECK_TOKEN, SaveRegistrationConfigDto, SaveRegistrationConfigSelectionDto, SelectRegistrationPlanDto, StartRegistrationCheckoutDto, USER_ACCOUNT_LOOKUP_TOKEN, VerifyRegistrationOtpDto, computeBreakdown, generateOtpCode, hashOtpCode, resolveModel, slugify, verifyOtpCode };
480
+ export { ACTIVATION_ORCHESTRATOR_TOKEN, BaseIpRateLimitGuard, ContinueRegistrationDto, PASSWORD_HASHER_TOKEN, PENDING_REGISTRATION_REPOSITORY_TOKEN, PLAN_CATALOG_LOOKUP_TOKEN, PendingRegistrationService, PreviewRegistrationPromoDto, type PromoEvaluation, REGISTRATION_AUDIT_LOGGER_TOKEN, REGISTRATION_CONFIGURATOR_LOOKUP_TOKEN, REGISTRATION_CONFIG_TOKEN, REGISTRATION_OTP_DELIVERY_TOKEN, REGISTRATION_PROMO_PREVIEW_TOKEN, REGISTRATION_RESUME_BASE_URL_TOKEN, REGISTRATION_RESUME_DELIVERY_TOKEN, REGISTRATION_RESUME_TOKEN_SIGNER_TOKEN, RegisterStartDto, RegistrationBillingDetailsDto, RegistrationCleanupCron, RegistrationModule, type RegistrationModuleOptions, ResendRegistrationOtpDto, SLUG_AVAILABILITY_CHECK_TOKEN, SaveRegistrationConfigDto, SaveRegistrationConfigSelectionDto, SelectRegistrationPlanDto, StartRegistrationCheckoutDto, USER_ACCOUNT_LOOKUP_TOKEN, VerifyRegistrationOtpDto, computeBreakdown, generateOtpCode, hashOtpCode, resolveModel, slugify, verifyOtpCode };
@@ -1,8 +1,14 @@
1
- import { PendingRegistrationRepository, RegistrationOtpDelivery, UserAccountLookup, SlugAvailabilityCheck, PasswordHasher, PlanCatalogLookup, PaymentProvider, PaymentEventLog, ActivationOrchestrator, RegistrationAuditLogger, RegistrationResumeTokenSigner, RegistrationResumeDelivery, RegistrationConfiguratorLookup, RegistrationPromoPreview, PublicSignupPlan, SelectPlanInput, RegistrationAuditContext, SelectPlanResult, StartCheckoutInput, StartCheckoutResult, HandlePaymentEventInput, HandlePaymentEventResult, CleanupResult, StartRegistrationInput, StartRegistrationResult, VerifyRegistrationOtpResult, ResumeRegistrationInput, ResumeRegistrationResult, ConfiguratorCatalog, SaveRegistrationConfigInput, SaveRegistrationConfigResult, ConfiguratorPriceBreakdown, RegistrationConfigSelection } from '@saasicat/core';
1
+ import { PendingRegistrationRepository, ActivationOrchestrator, RegistrationAuditLogger, SubscriberPaymentMethodRepository, PendingRegistration, RegistrationBillingDetails, PaymentGatewayCallback, RegistrationOtpDelivery, UserAccountLookup, SlugAvailabilityCheck, PasswordHasher, PlanCatalogLookup, RegistrationResumeTokenSigner, RegistrationResumeDelivery, RegistrationConfiguratorLookup, RegistrationPromoPreview, PublicSignupPlan, SelectPlanInput, RegistrationAuditContext, SelectPlanResult, StartCheckoutInput, StartCheckoutResult, CleanupResult, StartRegistrationInput, StartRegistrationResult, VerifyRegistrationOtpResult, ResumeRegistrationInput, ResumeRegistrationResult, ConfiguratorCatalog, SaveRegistrationConfigInput, SaveRegistrationConfigResult, ConfiguratorPriceBreakdown, RegistrationConfigSelection } from '@saasicat/core';
2
2
  export { PasswordHasher } from '@saasicat/core';
3
- import { CanActivate, ExecutionContext, Type, DynamicModule, ForwardReference, Provider } from '@nestjs/common';
3
+ import { b as CheckoutOfferService } from '../checkout-offer.service-BeHgYikI.js';
4
+ import { OnModuleInit, OnApplicationBootstrap, CanActivate, ExecutionContext, Type, DynamicModule, ForwardReference, Provider } from '@nestjs/common';
5
+ import { P as PaymentGatewayRegistry, a as PaymentCallbackService } from '../payment-callback.service-CR84Xw1Z.js';
4
6
  import { P as ProviderSpec } from '../di-CcNeq9v-.js';
5
7
  export { CronExpression } from '@nestjs/schedule';
8
+ import '../subscription-contract.service-CPZrTM9C.js';
9
+ import '../subscriber.service-5W6Gi-1B.js';
10
+ import '../promo.service-CFjfF0Xm.js';
11
+ import '../plan-catalog-source-DWe-BGY1.js';
6
12
 
7
13
  /** 6-digit numeric OTP code, uniformly distributed from 100000..999999. */
8
14
  declare function generateOtpCode(): string;
@@ -27,8 +33,6 @@ declare const USER_ACCOUNT_LOOKUP_TOKEN: unique symbol;
27
33
  declare const SLUG_AVAILABILITY_CHECK_TOKEN: unique symbol;
28
34
  declare const PASSWORD_HASHER_TOKEN: unique symbol;
29
35
  declare const PLAN_CATALOG_LOOKUP_TOKEN: unique symbol;
30
- declare const PAYMENT_PROVIDER_TOKEN: unique symbol;
31
- declare const PAYMENT_EVENT_LOG_TOKEN: unique symbol;
32
36
  declare const ACTIVATION_ORCHESTRATOR_TOKEN: unique symbol;
33
37
  declare const REGISTRATION_AUDIT_LOGGER_TOKEN: unique symbol;
34
38
  declare const REGISTRATION_RESUME_TOKEN_SIGNER_TOKEN: unique symbol;
@@ -39,6 +43,65 @@ declare const REGISTRATION_PROMO_PREVIEW_TOKEN: unique symbol;
39
43
  /** Optionally injectable configuration — falls back to default TTLs from @saasicat/core. */
40
44
  declare const REGISTRATION_CONFIG_TOKEN: unique symbol;
41
45
 
46
+ interface RegistrationSetupUrls {
47
+ successUrl: string;
48
+ cancelUrl: string;
49
+ }
50
+ interface RegistrationSetupStarted {
51
+ updated: PendingRegistration;
52
+ sessionRef: string;
53
+ redirectUrl: string;
54
+ /** The last moment a confirmation of this session can arrive, as the gateway reports it. */
55
+ confirmableUntil: Date | null;
56
+ /** A confirmation the gateway already holds, for `confirm`. */
57
+ immediate: {
58
+ account: string;
59
+ callback: PaymentGatewayCallback;
60
+ } | null;
61
+ }
62
+ /**
63
+ * Step 4 of a sign-up: the billing address and the payment method, and the
64
+ * activation once the gateway confirmed it.
65
+ *
66
+ * The confirmation arrives as a gateway callback, claimed on a transaction the
67
+ * platform opens. The application's `ActivationOrchestrator` writes the user,
68
+ * the tenant, the subscriber and the subscription on that transaction, and the
69
+ * payment method is recorded for the subscriber on it too — all of it, the
70
+ * claim included, or none of it.
71
+ */
72
+ declare class RegistrationPaymentService implements OnModuleInit, OnApplicationBootstrap {
73
+ private readonly repo;
74
+ private readonly orchestrator;
75
+ private readonly audit;
76
+ private readonly registry;
77
+ private readonly callbacks;
78
+ private readonly methods;
79
+ private readonly logger;
80
+ constructor(repo: PendingRegistrationRepository, orchestrator: ActivationOrchestrator, audit: RegistrationAuditLogger, registry?: PaymentGatewayRegistry | null, callbacks?: PaymentCallbackService | null, methods?: SubscriberPaymentMethodRepository | null);
81
+ onModuleInit(): void;
82
+ onApplicationBootstrap(): Promise<void>;
83
+ /**
84
+ * Records the billing details and opens the gateway's form. Returns the
85
+ * record as it now stands, where to send the person, and what `confirm`
86
+ * hands on when the gateway confirmed on the spot. The checkout expires
87
+ * `PENDING_CHECKOUT_TTL_DAYS` after `startedAt`.
88
+ */
89
+ startSetup(pending: PendingRegistration, billingDetails: RegistrationBillingDetails, urls: RegistrationSetupUrls, startedAt: Date): Promise<RegistrationSetupStarted>;
90
+ /** Handles a confirmation the gateway gave when the setup started, like any callback. */
91
+ confirm(started: RegistrationSetupStarted): Promise<void>;
92
+ private activate;
93
+ private noteFailure;
94
+ /**
95
+ * The sign-up a setup event is about, found by the session its account
96
+ * opened. `null` — and nothing done — when there is none waiting: it was
97
+ * activated already, or expired and was cleaned up, or the event names a
98
+ * different sign-up than the session belongs to.
99
+ */
100
+ private pendingFor;
101
+ private payments;
102
+ private record;
103
+ }
104
+
42
105
  /**
43
106
  * Orchestrates step 1 (capture registration data) and step 2 (OTP verification)
44
107
  * of the multi-step registration flow.
@@ -61,36 +124,32 @@ declare class PendingRegistrationService {
61
124
  private readonly slugCheck;
62
125
  private readonly passwordHasher;
63
126
  private readonly planCatalog;
64
- private readonly paymentProvider;
65
- private readonly paymentEventLog;
66
- private readonly activationOrchestrator;
127
+ private readonly payments;
67
128
  private readonly audit;
68
129
  private readonly resumeTokenSigner?;
69
130
  private readonly resumeDelivery?;
70
131
  private readonly resumeBaseUrl?;
71
132
  private readonly configuratorLookup?;
72
133
  private readonly promoPreview?;
134
+ private readonly checkoutOffers?;
73
135
  private readonly logger;
74
- constructor(repo: PendingRegistrationRepository, otpDelivery: RegistrationOtpDelivery, userLookup: UserAccountLookup, slugCheck: SlugAvailabilityCheck, passwordHasher: PasswordHasher, planCatalog: PlanCatalogLookup, paymentProvider: PaymentProvider, paymentEventLog: PaymentEventLog, activationOrchestrator: ActivationOrchestrator, audit: RegistrationAuditLogger, resumeTokenSigner?: RegistrationResumeTokenSigner | undefined, resumeDelivery?: RegistrationResumeDelivery | undefined, resumeBaseUrl?: string | undefined, configuratorLookup?: RegistrationConfiguratorLookup | undefined, promoPreview?: RegistrationPromoPreview | undefined);
136
+ constructor(repo: PendingRegistrationRepository, otpDelivery: RegistrationOtpDelivery, userLookup: UserAccountLookup, slugCheck: SlugAvailabilityCheck, passwordHasher: PasswordHasher, planCatalog: PlanCatalogLookup, payments: RegistrationPaymentService, audit: RegistrationAuditLogger, resumeTokenSigner?: RegistrationResumeTokenSigner | undefined, resumeDelivery?: RegistrationResumeDelivery | undefined, resumeBaseUrl?: string | undefined, configuratorLookup?: RegistrationConfiguratorLookup | undefined, promoPreview?: RegistrationPromoPreview | undefined, checkoutOffers?: CheckoutOfferService | undefined);
75
137
  private record;
76
138
  /** Public signup plan list for step 3 (frontend `usePublicPlans()`). */
77
139
  listPublicPlans(): Promise<PublicSignupPlan[]>;
78
140
  selectPlan(input: SelectPlanInput, context?: RegistrationAuditContext): Promise<SelectPlanResult>;
79
141
  startCheckout(input: StartCheckoutInput, context?: RegistrationAuditContext): Promise<StartCheckoutResult>;
80
142
  /**
81
- * Processes a payment webhook idempotently:
82
- * 1. `tryClaim` pins the event ID via a @unique INSERT. Duplicates are
83
- * dropped silently (`ALREADY_PROCESSED`).
84
- * 2. On status `SUCCEEDED` the PendingRegistration is resolved from the
85
- * checkout session and the ActivationOrchestrator triggers the final
86
- * user+tenant+subscription creation in a single transaction.
87
- * 3. After activation the PendingRegistration is deleted.
88
- *
89
- * On errors in step 2/3 the EventLog entry remains — provider retries then
90
- * run into ALREADY_PROCESSED. Operational repair is done manually (status
91
- * inspection + cleanup).
143
+ * Gives back the slot a failed start took: its form did not open, or its
144
+ * slot could not be moved to the form's end. The failure is the answer the
145
+ * caller gets; a slot that cannot be given back here lapses with its short
146
+ * hold, so this failure is logged rather than put in the way of that answer.
147
+ */
148
+ private giveBackHoldOf;
149
+ /**
150
+ * Holds the promo code of the offer the sign-up concludes until `until`.
92
151
  */
93
- handlePaymentEvent(input: HandlePaymentEventInput, context?: RegistrationAuditContext): Promise<HandlePaymentEventResult>;
152
+ private holdPromoCodeOf;
94
153
  /**
95
154
  * Deletes all PendingRegistration records with `expiresAt < now`.
96
155
  * Full deletion (no anonymization path) is the simpler option: the schema
@@ -234,8 +293,6 @@ interface RegistrationModuleOptions {
234
293
  slugAvailabilityCheck: ProviderSpec<SlugAvailabilityCheck>;
235
294
  passwordHasher: ProviderSpec<PasswordHasher>;
236
295
  planCatalogLookup: ProviderSpec<PlanCatalogLookup>;
237
- paymentProvider: ProviderSpec<PaymentProvider>;
238
- paymentEventLog: ProviderSpec<PaymentEventLog>;
239
296
  activationOrchestrator: ProviderSpec<ActivationOrchestrator>;
240
297
  auditLogger: ProviderSpec<RegistrationAuditLogger>;
241
298
  /**
@@ -326,35 +383,32 @@ declare class SelectRegistrationPlanDto {
326
383
  planId: string;
327
384
  }
328
385
 
386
+ /** The billing address and tax identifiers step 4 asks for, which the subscriber is created with. */
387
+ declare class RegistrationBillingDetailsDto {
388
+ addressLine1: string;
389
+ addressLine2?: string | null;
390
+ postalCode: string;
391
+ city: string;
392
+ /** ISO 3166-1 alpha-2, e.g. `DE`. */
393
+ country: string;
394
+ vatId?: string | null;
395
+ taxNumber?: string | null;
396
+ }
329
397
  /**
330
- * Input for step 4 (start checkout) — `POST /auth/register/start-checkout`.
331
- * The frontend passes the PendingRegistration ID and the redirect URLs
332
- * (success / cancel) that the payment provider redirects to after the payment
333
- * action.
398
+ * Input for step 4 — `POST /auth/register/start-checkout`: the billing details,
399
+ * and where the payment gateway's form sends the person once the payment method
400
+ * is set up, or when they leave it.
334
401
  */
335
402
  declare class StartRegistrationCheckoutDto {
336
403
  pendingRegistrationId: string;
404
+ billingDetails: RegistrationBillingDetailsDto;
337
405
  successUrl: string;
338
406
  cancelUrl: string;
339
- }
340
-
341
- /**
342
- * Webhook contract for `POST /webhooks/payment`.
343
- *
344
- * Provider-agnostic: the Stripe adapter (phase 2.4) maps Stripe's
345
- * `checkout.session.completed` → `{ eventId, sessionId, status: 'SUCCEEDED' }`,
346
- * `payment_intent.payment_failed` → `{ status: 'FAILED' }`, etc.
347
- *
348
- * In production the signature verification (Stripe `Stripe-Signature`
349
- * header) should run BEFORE the DTO validation — see StripeWebhookGuard in
350
- * the app module.
351
- */
352
- declare class PaymentWebhookDto {
353
- eventId: string;
354
- sessionId?: string;
355
- provider: string;
356
- status: 'SUCCEEDED' | 'FAILED';
357
- payload?: Record<string, unknown>;
407
+ /**
408
+ * The checkout offer the sign-up concludes; its promo code is held until a
409
+ * confirmation of the payment form can no longer arrive.
410
+ */
411
+ checkoutOfferId?: string | null;
358
412
  }
359
413
 
360
414
  /**
@@ -401,7 +455,10 @@ declare class PreviewRegistrationPromoDto {
401
455
  }
402
456
 
403
457
  interface PromoEvaluation {
404
- /** Discount in EUR on the subtotal (gross or net depending on catalog convention; here on net). */
458
+ /**
459
+ * The discount in gross, as the promo preview reckons it against the gross
460
+ * subtotal. `computeBreakdown` converts it to net before taking it off.
461
+ */
405
462
  discountAmount: number;
406
463
  /** Percentage for UI display. */
407
464
  percent: number;
@@ -420,4 +477,4 @@ declare function resolveModel(catalog: ConfiguratorCatalog, modelId: string): {
420
477
  yearlyNet: number;
421
478
  };
422
479
 
423
- export { ACTIVATION_ORCHESTRATOR_TOKEN, BaseIpRateLimitGuard, ContinueRegistrationDto, PASSWORD_HASHER_TOKEN, PAYMENT_EVENT_LOG_TOKEN, PAYMENT_PROVIDER_TOKEN, PENDING_REGISTRATION_REPOSITORY_TOKEN, PLAN_CATALOG_LOOKUP_TOKEN, PaymentWebhookDto, PendingRegistrationService, PreviewRegistrationPromoDto, type PromoEvaluation, REGISTRATION_AUDIT_LOGGER_TOKEN, REGISTRATION_CONFIGURATOR_LOOKUP_TOKEN, REGISTRATION_CONFIG_TOKEN, REGISTRATION_OTP_DELIVERY_TOKEN, REGISTRATION_PROMO_PREVIEW_TOKEN, REGISTRATION_RESUME_BASE_URL_TOKEN, REGISTRATION_RESUME_DELIVERY_TOKEN, REGISTRATION_RESUME_TOKEN_SIGNER_TOKEN, RegisterStartDto, RegistrationCleanupCron, RegistrationModule, type RegistrationModuleOptions, ResendRegistrationOtpDto, SLUG_AVAILABILITY_CHECK_TOKEN, SaveRegistrationConfigDto, SaveRegistrationConfigSelectionDto, SelectRegistrationPlanDto, StartRegistrationCheckoutDto, USER_ACCOUNT_LOOKUP_TOKEN, VerifyRegistrationOtpDto, computeBreakdown, generateOtpCode, hashOtpCode, resolveModel, slugify, verifyOtpCode };
480
+ export { ACTIVATION_ORCHESTRATOR_TOKEN, BaseIpRateLimitGuard, ContinueRegistrationDto, PASSWORD_HASHER_TOKEN, PENDING_REGISTRATION_REPOSITORY_TOKEN, PLAN_CATALOG_LOOKUP_TOKEN, PendingRegistrationService, PreviewRegistrationPromoDto, type PromoEvaluation, REGISTRATION_AUDIT_LOGGER_TOKEN, REGISTRATION_CONFIGURATOR_LOOKUP_TOKEN, REGISTRATION_CONFIG_TOKEN, REGISTRATION_OTP_DELIVERY_TOKEN, REGISTRATION_PROMO_PREVIEW_TOKEN, REGISTRATION_RESUME_BASE_URL_TOKEN, REGISTRATION_RESUME_DELIVERY_TOKEN, REGISTRATION_RESUME_TOKEN_SIGNER_TOKEN, RegisterStartDto, RegistrationBillingDetailsDto, RegistrationCleanupCron, RegistrationModule, type RegistrationModuleOptions, ResendRegistrationOtpDto, SLUG_AVAILABILITY_CHECK_TOKEN, SaveRegistrationConfigDto, SaveRegistrationConfigSelectionDto, SelectRegistrationPlanDto, StartRegistrationCheckoutDto, USER_ACCOUNT_LOOKUP_TOKEN, VerifyRegistrationOtpDto, computeBreakdown, generateOtpCode, hashOtpCode, resolveModel, slugify, verifyOtpCode };
@@ -4,11 +4,8 @@ import {
4
4
  ContinueRegistrationDto,
5
5
  CronExpression,
6
6
  PASSWORD_HASHER_TOKEN,
7
- PAYMENT_EVENT_LOG_TOKEN,
8
- PAYMENT_PROVIDER_TOKEN,
9
7
  PENDING_REGISTRATION_REPOSITORY_TOKEN,
10
8
  PLAN_CATALOG_LOOKUP_TOKEN,
11
- PaymentWebhookDto,
12
9
  PendingRegistrationService,
13
10
  PreviewRegistrationPromoDto,
14
11
  REGISTRATION_AUDIT_LOGGER_TOKEN,
@@ -20,6 +17,7 @@ import {
20
17
  REGISTRATION_RESUME_DELIVERY_TOKEN,
21
18
  REGISTRATION_RESUME_TOKEN_SIGNER_TOKEN,
22
19
  RegisterStartDto,
20
+ RegistrationBillingDetailsDto,
23
21
  RegistrationCleanupCron,
24
22
  RegistrationModule,
25
23
  ResendRegistrationOtpDto,
@@ -36,9 +34,19 @@ import {
36
34
  resolveModel,
37
35
  slugify,
38
36
  verifyOtpCode
39
- } from "../chunk-SEPN52AD.js";
40
- import "../chunk-57V6ZTI6.js";
41
- import "../chunk-SABTXESR.js";
37
+ } from "../chunk-JBCC6C3M.js";
38
+ import "../chunk-55QEDAMX.js";
39
+ import "../chunk-3RLWML2S.js";
40
+ import "../chunk-NDLC5GYK.js";
41
+ import "../chunk-KPEMTBOP.js";
42
+ import "../chunk-TBBZWZQT.js";
43
+ import "../chunk-VBRYPU7V.js";
44
+ import "../chunk-6PJE7EWO.js";
45
+ import "../chunk-3QVGA6JX.js";
46
+ import "../chunk-7NJKVC5X.js";
47
+ import "../chunk-LF6J4YYN.js";
48
+ import "../chunk-FEQZCWUL.js";
49
+ import "../chunk-J7NJRK3K.js";
42
50
  import "../chunk-SHUYVCID.js";
43
51
  export {
44
52
  ACTIVATION_ORCHESTRATOR_TOKEN,
@@ -46,11 +54,8 @@ export {
46
54
  ContinueRegistrationDto,
47
55
  CronExpression,
48
56
  PASSWORD_HASHER_TOKEN,
49
- PAYMENT_EVENT_LOG_TOKEN,
50
- PAYMENT_PROVIDER_TOKEN,
51
57
  PENDING_REGISTRATION_REPOSITORY_TOKEN,
52
58
  PLAN_CATALOG_LOOKUP_TOKEN,
53
- PaymentWebhookDto,
54
59
  PendingRegistrationService,
55
60
  PreviewRegistrationPromoDto,
56
61
  REGISTRATION_AUDIT_LOGGER_TOKEN,
@@ -62,6 +67,7 @@ export {
62
67
  REGISTRATION_RESUME_DELIVERY_TOKEN,
63
68
  REGISTRATION_RESUME_TOKEN_SIGNER_TOKEN,
64
69
  RegisterStartDto,
70
+ RegistrationBillingDetailsDto,
65
71
  RegistrationCleanupCron,
66
72
  RegistrationModule,
67
73
  ResendRegistrationOtpDto,
@@ -0,0 +1,4 @@
1
+ 'use strict';
2
+ // Generated by scripts/build-cjs-stubs.mjs — do not edit.
3
+ // Thin re-export so every entry shares one set of class objects.
4
+ module.exports = require('../_entries.cjs').subscriberNs;
@@ -0,0 +1,28 @@
1
+ export { S as SubscriberService } from '../subscriber.service-5W6Gi-1B.cjs';
2
+ import { Type, DynamicModule, ForwardReference, Provider } from '@nestjs/common';
3
+ import { SubscriberRepository } from '@saasicat/core';
4
+ import { P as ProviderSpec } from '../di-CcNeq9v-.cjs';
5
+
6
+ interface SubscriberModuleOptions {
7
+ subscriberRepository: ProviderSpec<SubscriberRepository>;
8
+ /** Modules that provide dependencies used by the repository factory. */
9
+ imports?: Array<Type<unknown> | DynamicModule | Promise<DynamicModule> | ForwardReference>;
10
+ extraProviders?: Provider[];
11
+ global?: boolean;
12
+ }
13
+ /**
14
+ * `SubscriberService` on its own. `SubscriptionContractModule` provides it as
15
+ * well, because a contract cannot be written without it; this module is for an
16
+ * application that creates tenants in a module of its own.
17
+ *
18
+ * Reads the customer number prefix from `PLAN_CATALOG_SETTINGS_TOKEN`, which
19
+ * `SaaSiCatModule.forRoot` provides globally.
20
+ */
21
+ declare class SubscriberModule {
22
+ static forRoot(options: SubscriberModuleOptions): DynamicModule;
23
+ }
24
+
25
+ /** Repository for `subscribers`, their tenant links and their corrections. */
26
+ declare const SUBSCRIBER_REPOSITORY_TOKEN: unique symbol;
27
+
28
+ export { SUBSCRIBER_REPOSITORY_TOKEN, SubscriberModule, type SubscriberModuleOptions };
@@ -0,0 +1,28 @@
1
+ export { S as SubscriberService } from '../subscriber.service-5W6Gi-1B.js';
2
+ import { Type, DynamicModule, ForwardReference, Provider } from '@nestjs/common';
3
+ import { SubscriberRepository } from '@saasicat/core';
4
+ import { P as ProviderSpec } from '../di-CcNeq9v-.js';
5
+
6
+ interface SubscriberModuleOptions {
7
+ subscriberRepository: ProviderSpec<SubscriberRepository>;
8
+ /** Modules that provide dependencies used by the repository factory. */
9
+ imports?: Array<Type<unknown> | DynamicModule | Promise<DynamicModule> | ForwardReference>;
10
+ extraProviders?: Provider[];
11
+ global?: boolean;
12
+ }
13
+ /**
14
+ * `SubscriberService` on its own. `SubscriptionContractModule` provides it as
15
+ * well, because a contract cannot be written without it; this module is for an
16
+ * application that creates tenants in a module of its own.
17
+ *
18
+ * Reads the customer number prefix from `PLAN_CATALOG_SETTINGS_TOKEN`, which
19
+ * `SaaSiCatModule.forRoot` provides globally.
20
+ */
21
+ declare class SubscriberModule {
22
+ static forRoot(options: SubscriberModuleOptions): DynamicModule;
23
+ }
24
+
25
+ /** Repository for `subscribers`, their tenant links and their corrections. */
26
+ declare const SUBSCRIBER_REPOSITORY_TOKEN: unique symbol;
27
+
28
+ export { SUBSCRIBER_REPOSITORY_TOKEN, SubscriberModule, type SubscriberModuleOptions };
@@ -0,0 +1,16 @@
1
+ import "../chunk-DU56UKEH.js";
2
+ import {
3
+ SubscriberModule
4
+ } from "../chunk-WOEJ6K7M.js";
5
+ import {
6
+ SUBSCRIBER_REPOSITORY_TOKEN,
7
+ SubscriberService
8
+ } from "../chunk-LF6J4YYN.js";
9
+ import "../chunk-FEQZCWUL.js";
10
+ import "../chunk-J7NJRK3K.js";
11
+ import "../chunk-SHUYVCID.js";
12
+ export {
13
+ SUBSCRIBER_REPOSITORY_TOKEN,
14
+ SubscriberModule,
15
+ SubscriberService
16
+ };