@forklaunch/implementation-billing-base 0.3.4 → 0.3.7

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.
@@ -1,704 +1,249 @@
1
1
  import { InstanceTypeRecord, IdDto, IdsDto } from '@forklaunch/common';
2
2
  import { TtlCache } from '@forklaunch/core/cache';
3
- import {
4
- OpenTelemetryCollector,
5
- MetricsDefinition,
6
- TelemetryOptions
7
- } from '@forklaunch/core/http';
8
- import {
9
- BillingPortalService,
10
- CheckoutSessionService,
11
- PaymentLinkService,
12
- PlanService,
13
- SubscriptionService
14
- } from '@forklaunch/interfaces-billing/interfaces';
15
- import {
16
- BillingPortalDto,
17
- CreateBillingPortalDto,
18
- UpdateBillingPortalDto,
19
- CheckoutSessionDto,
20
- CreateCheckoutSessionDto,
21
- UpdateCheckoutSessionDto,
22
- PaymentLinkDto,
23
- CreatePaymentLinkDto,
24
- UpdatePaymentLinkDto,
25
- PlanDto,
26
- CreatePlanDto,
27
- UpdatePlanDto,
28
- SubscriptionDto,
29
- CreateSubscriptionDto,
30
- UpdateSubscriptionDto
31
- } from '@forklaunch/interfaces-billing/types';
32
- import {
33
- ResponseMapperConstructor,
34
- RequestMapperConstructor,
35
- InternalMapper
36
- } from '@forklaunch/internal';
3
+ import { OpenTelemetryCollector, MetricsDefinition, TelemetryOptions } from '@forklaunch/core/http';
4
+ import { BillingPortalService, CheckoutSessionService, PaymentLinkService, PlanService, SubscriptionService } from '@forklaunch/interfaces-billing/interfaces';
5
+ import { BillingPortalDto, CreateBillingPortalDto, UpdateBillingPortalDto, CheckoutSessionDto, CreateCheckoutSessionDto, UpdateCheckoutSessionDto, PaymentLinkDto, CreatePaymentLinkDto, UpdatePaymentLinkDto, PlanDto, CreatePlanDto, UpdatePlanDto, SubscriptionDto, CreateSubscriptionDto, UpdateSubscriptionDto } from '@forklaunch/interfaces-billing/types';
6
+ import { ResponseMapperConstructor, RequestMapperConstructor, InternalMapper } from '@forklaunch/internal';
37
7
  import { AnySchemaValidator } from '@forklaunch/validator';
38
8
  import { EntityManager } from '@mikro-orm/core';
39
9
 
40
10
  type BaseBillingDtos = {
41
- BillingPortalMapper: BillingPortalDto;
42
- CreateBillingPortalMapper: CreateBillingPortalDto;
43
- UpdateBillingPortalMapper: UpdateBillingPortalDto;
11
+ BillingPortalMapper: BillingPortalDto;
12
+ CreateBillingPortalMapper: CreateBillingPortalDto;
13
+ UpdateBillingPortalMapper: UpdateBillingPortalDto;
44
14
  };
45
15
  type BaseCheckoutSessionDtos<PaymentMethodEnum, CurrencyEnum, StatusEnum> = {
46
- CheckoutSessionMapper: CheckoutSessionDto<
47
- PaymentMethodEnum,
48
- CurrencyEnum,
49
- StatusEnum
50
- >;
51
- CreateCheckoutSessionMapper: CreateCheckoutSessionDto<
52
- PaymentMethodEnum,
53
- CurrencyEnum,
54
- StatusEnum
55
- >;
56
- UpdateCheckoutSessionMapper: UpdateCheckoutSessionDto<
57
- PaymentMethodEnum,
58
- CurrencyEnum,
59
- StatusEnum
60
- >;
16
+ CheckoutSessionMapper: CheckoutSessionDto<PaymentMethodEnum, CurrencyEnum, StatusEnum>;
17
+ CreateCheckoutSessionMapper: CreateCheckoutSessionDto<PaymentMethodEnum, CurrencyEnum, StatusEnum>;
18
+ UpdateCheckoutSessionMapper: UpdateCheckoutSessionDto<PaymentMethodEnum, CurrencyEnum, StatusEnum>;
61
19
  };
62
20
  type BasePaymentLinkDtos<PaymentMethodEnum, CurrencyEnum, StatusEnum> = {
63
- PaymentLinkMapper: PaymentLinkDto<
64
- PaymentMethodEnum,
65
- CurrencyEnum,
66
- StatusEnum
67
- >;
68
- CreatePaymentLinkMapper: CreatePaymentLinkDto<
69
- PaymentMethodEnum,
70
- CurrencyEnum,
71
- StatusEnum
72
- >;
73
- UpdatePaymentLinkMapper: UpdatePaymentLinkDto<
74
- PaymentMethodEnum,
75
- CurrencyEnum,
76
- StatusEnum
77
- >;
21
+ PaymentLinkMapper: PaymentLinkDto<PaymentMethodEnum, CurrencyEnum, StatusEnum>;
22
+ CreatePaymentLinkMapper: CreatePaymentLinkDto<PaymentMethodEnum, CurrencyEnum, StatusEnum>;
23
+ UpdatePaymentLinkMapper: UpdatePaymentLinkDto<PaymentMethodEnum, CurrencyEnum, StatusEnum>;
78
24
  };
79
25
  type BasePlanDtos<PlanCadenceEnum, CurrencyEnum, BillingProviderEnum> = {
80
- PlanMapper: PlanDto<PlanCadenceEnum, CurrencyEnum, BillingProviderEnum>;
81
- CreatePlanMapper: CreatePlanDto<
82
- PlanCadenceEnum,
83
- CurrencyEnum,
84
- BillingProviderEnum
85
- >;
86
- UpdatePlanMapper: UpdatePlanDto<
87
- PlanCadenceEnum,
88
- CurrencyEnum,
89
- BillingProviderEnum
90
- >;
26
+ PlanMapper: PlanDto<PlanCadenceEnum, CurrencyEnum, BillingProviderEnum>;
27
+ CreatePlanMapper: CreatePlanDto<PlanCadenceEnum, CurrencyEnum, BillingProviderEnum>;
28
+ UpdatePlanMapper: UpdatePlanDto<PlanCadenceEnum, CurrencyEnum, BillingProviderEnum>;
91
29
  };
92
30
  type BaseSubscriptionDtos<PartyType, BillingProviderType> = {
93
- SubscriptionMapper: SubscriptionDto<PartyType, BillingProviderType>;
94
- CreateSubscriptionMapper: CreateSubscriptionDto<
95
- PartyType,
96
- BillingProviderType
97
- >;
98
- UpdateSubscriptionMapper: UpdateSubscriptionDto<
99
- PartyType,
100
- BillingProviderType
101
- >;
31
+ SubscriptionMapper: SubscriptionDto<PartyType, BillingProviderType>;
32
+ CreateSubscriptionMapper: CreateSubscriptionDto<PartyType, BillingProviderType>;
33
+ UpdateSubscriptionMapper: UpdateSubscriptionDto<PartyType, BillingProviderType>;
102
34
  };
103
35
 
104
36
  type BaseBillingEntities = {
105
- BillingPortalMapper: BillingPortalDto;
106
- CreateBillingPortalMapper: BillingPortalDto;
107
- UpdateBillingPortalMapper: BillingPortalDto;
37
+ BillingPortalMapper: BillingPortalDto;
38
+ CreateBillingPortalMapper: BillingPortalDto;
39
+ UpdateBillingPortalMapper: BillingPortalDto;
40
+ };
41
+ type BaseCheckoutSessionEntities<PaymentMethodEnum, CurrencyEnum, StatusEnum> = {
42
+ CheckoutSessionMapper: CheckoutSessionDto<PaymentMethodEnum, CurrencyEnum, StatusEnum>;
43
+ CreateCheckoutSessionMapper: CheckoutSessionDto<PaymentMethodEnum, CurrencyEnum, StatusEnum>;
44
+ UpdateCheckoutSessionMapper: CheckoutSessionDto<PaymentMethodEnum, CurrencyEnum, StatusEnum>;
108
45
  };
109
- type BaseCheckoutSessionEntities<PaymentMethodEnum, CurrencyEnum, StatusEnum> =
110
- {
111
- CheckoutSessionMapper: CheckoutSessionDto<
112
- PaymentMethodEnum,
113
- CurrencyEnum,
114
- StatusEnum
115
- >;
116
- CreateCheckoutSessionMapper: CheckoutSessionDto<
117
- PaymentMethodEnum,
118
- CurrencyEnum,
119
- StatusEnum
120
- >;
121
- UpdateCheckoutSessionMapper: CheckoutSessionDto<
122
- PaymentMethodEnum,
123
- CurrencyEnum,
124
- StatusEnum
125
- >;
126
- };
127
46
  type BasePaymentLinkEntities<PaymentMethodEnum, CurrencyEnum, StatusEnum> = {
128
- PaymentLinkMapper: PaymentLinkDto<
129
- PaymentMethodEnum,
130
- CurrencyEnum,
131
- StatusEnum
132
- >;
133
- CreatePaymentLinkMapper: PaymentLinkDto<
134
- PaymentMethodEnum,
135
- CurrencyEnum,
136
- StatusEnum
137
- >;
138
- UpdatePaymentLinkMapper: PaymentLinkDto<
139
- PaymentMethodEnum,
140
- CurrencyEnum,
141
- StatusEnum
142
- >;
47
+ PaymentLinkMapper: PaymentLinkDto<PaymentMethodEnum, CurrencyEnum, StatusEnum>;
48
+ CreatePaymentLinkMapper: PaymentLinkDto<PaymentMethodEnum, CurrencyEnum, StatusEnum>;
49
+ UpdatePaymentLinkMapper: PaymentLinkDto<PaymentMethodEnum, CurrencyEnum, StatusEnum>;
143
50
  };
144
51
  type BasePlanEntities<PlanCadenceEnum, CurrencyEnum, BillingProviderEnum> = {
145
- PlanMapper: PlanDto<PlanCadenceEnum, CurrencyEnum, BillingProviderEnum>;
146
- CreatePlanMapper: PlanDto<PlanCadenceEnum, CurrencyEnum, BillingProviderEnum>;
147
- UpdatePlanMapper: PlanDto<PlanCadenceEnum, CurrencyEnum, BillingProviderEnum>;
52
+ PlanMapper: PlanDto<PlanCadenceEnum, CurrencyEnum, BillingProviderEnum>;
53
+ CreatePlanMapper: PlanDto<PlanCadenceEnum, CurrencyEnum, BillingProviderEnum>;
54
+ UpdatePlanMapper: PlanDto<PlanCadenceEnum, CurrencyEnum, BillingProviderEnum>;
148
55
  };
149
56
  type BaseSubscriptionEntities<PartyType, BillingProviderType> = {
150
- SubscriptionMapper: SubscriptionDto<PartyType, BillingProviderType>;
151
- CreateSubscriptionMapper: SubscriptionDto<PartyType, BillingProviderType>;
152
- UpdateSubscriptionMapper: SubscriptionDto<PartyType, BillingProviderType>;
57
+ SubscriptionMapper: SubscriptionDto<PartyType, BillingProviderType>;
58
+ CreateSubscriptionMapper: SubscriptionDto<PartyType, BillingProviderType>;
59
+ UpdateSubscriptionMapper: SubscriptionDto<PartyType, BillingProviderType>;
153
60
  };
154
61
 
155
- declare class BaseBillingPortalService<
156
- SchemaValidator extends AnySchemaValidator,
157
- Entities extends BaseBillingEntities,
158
- Dto extends BaseBillingDtos = BaseBillingDtos
159
- > implements BillingPortalService
160
- {
161
- protected em: EntityManager;
162
- protected cache: TtlCache;
163
- protected openTelemetryCollector: OpenTelemetryCollector<MetricsDefinition>;
164
- protected schemaValidator: SchemaValidator;
165
- protected mappers: {
166
- BillingPortalMapper: ResponseMapperConstructor<
167
- SchemaValidator,
168
- Dto['BillingPortalMapper'],
169
- Entities['BillingPortalMapper']
170
- >;
171
- CreateBillingPortalMapper: RequestMapperConstructor<
172
- SchemaValidator,
173
- Dto['CreateBillingPortalMapper'],
174
- Entities['CreateBillingPortalMapper'],
175
- (
176
- dto: Dto['CreateBillingPortalMapper'],
177
- em: EntityManager
178
- ) => Promise<Entities['CreateBillingPortalMapper']>
179
- >;
180
- UpdateBillingPortalMapper: RequestMapperConstructor<
181
- SchemaValidator,
182
- Dto['UpdateBillingPortalMapper'],
183
- Entities['UpdateBillingPortalMapper'],
184
- (
185
- dto: Dto['UpdateBillingPortalMapper'],
186
- em: EntityManager
187
- ) => Promise<Entities['UpdateBillingPortalMapper']>
188
- >;
189
- };
190
- readonly options?:
191
- | {
62
+ declare class BaseBillingPortalService<SchemaValidator extends AnySchemaValidator, Entities extends BaseBillingEntities, Dto extends BaseBillingDtos = BaseBillingDtos> implements BillingPortalService {
63
+ protected em: EntityManager;
64
+ protected cache: TtlCache;
65
+ protected openTelemetryCollector: OpenTelemetryCollector<MetricsDefinition>;
66
+ protected schemaValidator: SchemaValidator;
67
+ protected mappers: {
68
+ BillingPortalMapper: ResponseMapperConstructor<SchemaValidator, Dto['BillingPortalMapper'], Entities['BillingPortalMapper']>;
69
+ CreateBillingPortalMapper: RequestMapperConstructor<SchemaValidator, Dto['CreateBillingPortalMapper'], Entities['CreateBillingPortalMapper'], (dto: Dto['CreateBillingPortalMapper'], em: EntityManager) => Promise<Entities['CreateBillingPortalMapper']>>;
70
+ UpdateBillingPortalMapper: RequestMapperConstructor<SchemaValidator, Dto['UpdateBillingPortalMapper'], Entities['UpdateBillingPortalMapper'], (dto: Dto['UpdateBillingPortalMapper'], em: EntityManager) => Promise<Entities['UpdateBillingPortalMapper']>>;
71
+ };
72
+ readonly options?: {
73
+ telemetry?: TelemetryOptions;
74
+ enableDatabaseBackup?: boolean;
75
+ } | undefined;
76
+ protected _mappers: InternalMapper<InstanceTypeRecord<typeof this.mappers>>;
77
+ protected evaluatedTelemetryOptions: {
78
+ logging?: boolean;
79
+ metrics?: boolean;
80
+ tracing?: boolean;
81
+ };
82
+ protected enableDatabaseBackup: boolean;
83
+ constructor(em: EntityManager, cache: TtlCache, openTelemetryCollector: OpenTelemetryCollector<MetricsDefinition>, schemaValidator: SchemaValidator, mappers: {
84
+ BillingPortalMapper: ResponseMapperConstructor<SchemaValidator, Dto['BillingPortalMapper'], Entities['BillingPortalMapper']>;
85
+ CreateBillingPortalMapper: RequestMapperConstructor<SchemaValidator, Dto['CreateBillingPortalMapper'], Entities['CreateBillingPortalMapper'], (dto: Dto['CreateBillingPortalMapper'], em: EntityManager) => Promise<Entities['CreateBillingPortalMapper']>>;
86
+ UpdateBillingPortalMapper: RequestMapperConstructor<SchemaValidator, Dto['UpdateBillingPortalMapper'], Entities['UpdateBillingPortalMapper'], (dto: Dto['UpdateBillingPortalMapper'], em: EntityManager) => Promise<Entities['UpdateBillingPortalMapper']>>;
87
+ }, options?: {
192
88
  telemetry?: TelemetryOptions;
193
89
  enableDatabaseBackup?: boolean;
194
- }
195
- | undefined;
196
- protected _mappers: InternalMapper<InstanceTypeRecord<typeof this.mappers>>;
197
- protected evaluatedTelemetryOptions: {
198
- logging?: boolean;
199
- metrics?: boolean;
200
- tracing?: boolean;
201
- };
202
- protected enableDatabaseBackup: boolean;
203
- constructor(
204
- em: EntityManager,
205
- cache: TtlCache,
206
- openTelemetryCollector: OpenTelemetryCollector<MetricsDefinition>,
207
- schemaValidator: SchemaValidator,
208
- mappers: {
209
- BillingPortalMapper: ResponseMapperConstructor<
210
- SchemaValidator,
211
- Dto['BillingPortalMapper'],
212
- Entities['BillingPortalMapper']
213
- >;
214
- CreateBillingPortalMapper: RequestMapperConstructor<
215
- SchemaValidator,
216
- Dto['CreateBillingPortalMapper'],
217
- Entities['CreateBillingPortalMapper'],
218
- (
219
- dto: Dto['CreateBillingPortalMapper'],
220
- em: EntityManager
221
- ) => Promise<Entities['CreateBillingPortalMapper']>
222
- >;
223
- UpdateBillingPortalMapper: RequestMapperConstructor<
224
- SchemaValidator,
225
- Dto['UpdateBillingPortalMapper'],
226
- Entities['UpdateBillingPortalMapper'],
227
- (
228
- dto: Dto['UpdateBillingPortalMapper'],
229
- em: EntityManager
230
- ) => Promise<Entities['UpdateBillingPortalMapper']>
231
- >;
232
- },
233
- options?:
234
- | {
235
- telemetry?: TelemetryOptions;
236
- enableDatabaseBackup?: boolean;
237
- }
238
- | undefined
239
- );
240
- protected createCacheKey: (id: string) => string;
241
- createBillingPortalSession(
242
- billingPortalDto: Dto['CreateBillingPortalMapper']
243
- ): Promise<Dto['BillingPortalMapper']>;
244
- getBillingPortalSession(idDto: IdDto): Promise<Dto['BillingPortalMapper']>;
245
- updateBillingPortalSession(
246
- billingPortalDto: UpdateBillingPortalDto
247
- ): Promise<Dto['BillingPortalMapper']>;
248
- expireBillingPortalSession(idDto: IdDto): Promise<void>;
90
+ } | undefined);
91
+ protected createCacheKey: (id: string) => string;
92
+ createBillingPortalSession(billingPortalDto: Dto['CreateBillingPortalMapper']): Promise<Dto['BillingPortalMapper']>;
93
+ getBillingPortalSession(idDto: IdDto): Promise<Dto['BillingPortalMapper']>;
94
+ updateBillingPortalSession(billingPortalDto: UpdateBillingPortalDto): Promise<Dto['BillingPortalMapper']>;
95
+ expireBillingPortalSession(idDto: IdDto): Promise<void>;
249
96
  }
250
97
 
251
- declare class BaseCheckoutSessionService<
252
- SchemaValidator extends AnySchemaValidator,
253
- PaymentMethodEnum,
254
- CurrencyEnum,
255
- StatusEnum,
256
- Entities extends BaseCheckoutSessionEntities<
257
- PaymentMethodEnum,
258
- CurrencyEnum,
259
- StatusEnum
260
- >,
261
- Dto extends BaseCheckoutSessionDtos<
262
- PaymentMethodEnum,
263
- CurrencyEnum,
264
- StatusEnum
265
- > = BaseCheckoutSessionDtos<PaymentMethodEnum, CurrencyEnum, StatusEnum>
266
- > implements CheckoutSessionService<PaymentMethodEnum, CurrencyEnum, StatusEnum>
267
- {
268
- protected readonly em: EntityManager;
269
- protected readonly cache: TtlCache;
270
- protected readonly openTelemetryCollector: OpenTelemetryCollector<MetricsDefinition>;
271
- protected readonly schemaValidator: SchemaValidator;
272
- protected readonly mappers: {
273
- CheckoutSessionMapper: ResponseMapperConstructor<
274
- SchemaValidator,
275
- Dto['CheckoutSessionMapper'],
276
- Entities['CheckoutSessionMapper']
277
- >;
278
- CreateCheckoutSessionMapper: RequestMapperConstructor<
279
- SchemaValidator,
280
- Dto['CreateCheckoutSessionMapper'],
281
- Entities['CreateCheckoutSessionMapper'],
282
- (
283
- dto: Dto['CreateCheckoutSessionMapper'],
284
- em: EntityManager
285
- ) => Promise<Entities['CreateCheckoutSessionMapper']>
286
- >;
287
- UpdateCheckoutSessionMapper: RequestMapperConstructor<
288
- SchemaValidator,
289
- Dto['UpdateCheckoutSessionMapper'],
290
- Entities['UpdateCheckoutSessionMapper'],
291
- (
292
- dto: Dto['UpdateCheckoutSessionMapper'],
293
- em: EntityManager
294
- ) => Promise<Entities['UpdateCheckoutSessionMapper']>
295
- >;
296
- };
297
- readonly options?:
298
- | {
98
+ declare class BaseCheckoutSessionService<SchemaValidator extends AnySchemaValidator, PaymentMethodEnum, CurrencyEnum, StatusEnum, Entities extends BaseCheckoutSessionEntities<PaymentMethodEnum, CurrencyEnum, StatusEnum>, Dto extends BaseCheckoutSessionDtos<PaymentMethodEnum, CurrencyEnum, StatusEnum> = BaseCheckoutSessionDtos<PaymentMethodEnum, CurrencyEnum, StatusEnum>> implements CheckoutSessionService<PaymentMethodEnum, CurrencyEnum, StatusEnum> {
99
+ protected readonly em: EntityManager;
100
+ protected readonly cache: TtlCache;
101
+ protected readonly openTelemetryCollector: OpenTelemetryCollector<MetricsDefinition>;
102
+ protected readonly schemaValidator: SchemaValidator;
103
+ protected readonly mappers: {
104
+ CheckoutSessionMapper: ResponseMapperConstructor<SchemaValidator, Dto['CheckoutSessionMapper'], Entities['CheckoutSessionMapper']>;
105
+ CreateCheckoutSessionMapper: RequestMapperConstructor<SchemaValidator, Dto['CreateCheckoutSessionMapper'], Entities['CreateCheckoutSessionMapper'], (dto: Dto['CreateCheckoutSessionMapper'], em: EntityManager) => Promise<Entities['CreateCheckoutSessionMapper']>>;
106
+ UpdateCheckoutSessionMapper: RequestMapperConstructor<SchemaValidator, Dto['UpdateCheckoutSessionMapper'], Entities['UpdateCheckoutSessionMapper'], (dto: Dto['UpdateCheckoutSessionMapper'], em: EntityManager) => Promise<Entities['UpdateCheckoutSessionMapper']>>;
107
+ };
108
+ readonly options?: {
109
+ enableDatabaseBackup?: boolean;
110
+ telemetry?: TelemetryOptions;
111
+ } | undefined;
112
+ protected _mappers: InternalMapper<InstanceTypeRecord<typeof this.mappers>>;
113
+ protected evaluatedTelemetryOptions: {
114
+ logging?: boolean;
115
+ metrics?: boolean;
116
+ tracing?: boolean;
117
+ };
118
+ protected enableDatabaseBackup: boolean;
119
+ constructor(em: EntityManager, cache: TtlCache, openTelemetryCollector: OpenTelemetryCollector<MetricsDefinition>, schemaValidator: SchemaValidator, mappers: {
120
+ CheckoutSessionMapper: ResponseMapperConstructor<SchemaValidator, Dto['CheckoutSessionMapper'], Entities['CheckoutSessionMapper']>;
121
+ CreateCheckoutSessionMapper: RequestMapperConstructor<SchemaValidator, Dto['CreateCheckoutSessionMapper'], Entities['CreateCheckoutSessionMapper'], (dto: Dto['CreateCheckoutSessionMapper'], em: EntityManager) => Promise<Entities['CreateCheckoutSessionMapper']>>;
122
+ UpdateCheckoutSessionMapper: RequestMapperConstructor<SchemaValidator, Dto['UpdateCheckoutSessionMapper'], Entities['UpdateCheckoutSessionMapper'], (dto: Dto['UpdateCheckoutSessionMapper'], em: EntityManager) => Promise<Entities['UpdateCheckoutSessionMapper']>>;
123
+ }, options?: {
299
124
  enableDatabaseBackup?: boolean;
300
125
  telemetry?: TelemetryOptions;
301
- }
302
- | undefined;
303
- protected _mappers: InternalMapper<InstanceTypeRecord<typeof this.mappers>>;
304
- protected evaluatedTelemetryOptions: {
305
- logging?: boolean;
306
- metrics?: boolean;
307
- tracing?: boolean;
308
- };
309
- protected enableDatabaseBackup: boolean;
310
- constructor(
311
- em: EntityManager,
312
- cache: TtlCache,
313
- openTelemetryCollector: OpenTelemetryCollector<MetricsDefinition>,
314
- schemaValidator: SchemaValidator,
315
- mappers: {
316
- CheckoutSessionMapper: ResponseMapperConstructor<
317
- SchemaValidator,
318
- Dto['CheckoutSessionMapper'],
319
- Entities['CheckoutSessionMapper']
320
- >;
321
- CreateCheckoutSessionMapper: RequestMapperConstructor<
322
- SchemaValidator,
323
- Dto['CreateCheckoutSessionMapper'],
324
- Entities['CreateCheckoutSessionMapper'],
325
- (
326
- dto: Dto['CreateCheckoutSessionMapper'],
327
- em: EntityManager
328
- ) => Promise<Entities['CreateCheckoutSessionMapper']>
329
- >;
330
- UpdateCheckoutSessionMapper: RequestMapperConstructor<
331
- SchemaValidator,
332
- Dto['UpdateCheckoutSessionMapper'],
333
- Entities['UpdateCheckoutSessionMapper'],
334
- (
335
- dto: Dto['UpdateCheckoutSessionMapper'],
336
- em: EntityManager
337
- ) => Promise<Entities['UpdateCheckoutSessionMapper']>
338
- >;
339
- },
340
- options?:
341
- | {
342
- enableDatabaseBackup?: boolean;
343
- telemetry?: TelemetryOptions;
344
- }
345
- | undefined
346
- );
347
- protected createCacheKey: (id: string) => string;
348
- createCheckoutSession(
349
- checkoutSessionDto: Dto['CreateCheckoutSessionMapper']
350
- ): Promise<Dto['CheckoutSessionMapper']>;
351
- getCheckoutSession({ id }: IdDto): Promise<Dto['CheckoutSessionMapper']>;
352
- expireCheckoutSession({ id }: IdDto): Promise<void>;
353
- handleCheckoutSuccess({ id }: IdDto): Promise<void>;
354
- handleCheckoutFailure({ id }: IdDto): Promise<void>;
126
+ } | undefined);
127
+ protected createCacheKey: (id: string) => string;
128
+ createCheckoutSession(checkoutSessionDto: Dto['CreateCheckoutSessionMapper']): Promise<Dto['CheckoutSessionMapper']>;
129
+ getCheckoutSession({ id }: IdDto): Promise<Dto['CheckoutSessionMapper']>;
130
+ expireCheckoutSession({ id }: IdDto): Promise<void>;
131
+ handleCheckoutSuccess({ id }: IdDto): Promise<void>;
132
+ handleCheckoutFailure({ id }: IdDto): Promise<void>;
355
133
  }
356
134
 
357
- declare class BasePaymentLinkService<
358
- SchemaValidator extends AnySchemaValidator,
359
- PaymentMethodEnum,
360
- CurrencyEnum,
361
- StatusEnum,
362
- Entities extends BasePaymentLinkEntities<
363
- PaymentMethodEnum,
364
- CurrencyEnum,
365
- StatusEnum
366
- >,
367
- Dto extends BasePaymentLinkDtos<
368
- PaymentMethodEnum,
369
- CurrencyEnum,
370
- StatusEnum
371
- > = BasePaymentLinkDtos<PaymentMethodEnum, CurrencyEnum, StatusEnum>
372
- > implements PaymentLinkService<PaymentMethodEnum, CurrencyEnum, StatusEnum>
373
- {
374
- protected readonly em: EntityManager;
375
- protected readonly cache: TtlCache;
376
- protected readonly openTelemetryCollector: OpenTelemetryCollector<MetricsDefinition>;
377
- protected readonly schemaValidator: SchemaValidator;
378
- protected readonly mappers: {
379
- PaymentLinkMapper: ResponseMapperConstructor<
380
- SchemaValidator,
381
- Dto['PaymentLinkMapper'],
382
- Entities['PaymentLinkMapper']
383
- >;
384
- CreatePaymentLinkMapper: RequestMapperConstructor<
385
- SchemaValidator,
386
- Dto['CreatePaymentLinkMapper'],
387
- Entities['CreatePaymentLinkMapper'],
388
- (
389
- dto: Dto['CreatePaymentLinkMapper'],
390
- em: EntityManager
391
- ) => Promise<Entities['CreatePaymentLinkMapper']>
392
- >;
393
- UpdatePaymentLinkMapper: RequestMapperConstructor<
394
- SchemaValidator,
395
- Dto['UpdatePaymentLinkMapper'],
396
- Entities['UpdatePaymentLinkMapper'],
397
- (
398
- dto: Dto['UpdatePaymentLinkMapper'],
399
- em: EntityManager
400
- ) => Promise<Entities['UpdatePaymentLinkMapper']>
401
- >;
402
- };
403
- readonly options?:
404
- | {
135
+ declare class BasePaymentLinkService<SchemaValidator extends AnySchemaValidator, PaymentMethodEnum, CurrencyEnum, StatusEnum, Entities extends BasePaymentLinkEntities<PaymentMethodEnum, CurrencyEnum, StatusEnum>, Dto extends BasePaymentLinkDtos<PaymentMethodEnum, CurrencyEnum, StatusEnum> = BasePaymentLinkDtos<PaymentMethodEnum, CurrencyEnum, StatusEnum>> implements PaymentLinkService<PaymentMethodEnum, CurrencyEnum, StatusEnum> {
136
+ protected readonly em: EntityManager;
137
+ protected readonly cache: TtlCache;
138
+ protected readonly openTelemetryCollector: OpenTelemetryCollector<MetricsDefinition>;
139
+ protected readonly schemaValidator: SchemaValidator;
140
+ protected readonly mappers: {
141
+ PaymentLinkMapper: ResponseMapperConstructor<SchemaValidator, Dto['PaymentLinkMapper'], Entities['PaymentLinkMapper']>;
142
+ CreatePaymentLinkMapper: RequestMapperConstructor<SchemaValidator, Dto['CreatePaymentLinkMapper'], Entities['CreatePaymentLinkMapper'], (dto: Dto['CreatePaymentLinkMapper'], em: EntityManager) => Promise<Entities['CreatePaymentLinkMapper']>>;
143
+ UpdatePaymentLinkMapper: RequestMapperConstructor<SchemaValidator, Dto['UpdatePaymentLinkMapper'], Entities['UpdatePaymentLinkMapper'], (dto: Dto['UpdatePaymentLinkMapper'], em: EntityManager) => Promise<Entities['UpdatePaymentLinkMapper']>>;
144
+ };
145
+ readonly options?: {
405
146
  enableDatabaseBackup?: boolean;
406
147
  telemetry?: TelemetryOptions;
407
- }
408
- | undefined;
409
- protected _mappers: InternalMapper<InstanceTypeRecord<typeof this.mappers>>;
410
- protected evaluatedTelemetryOptions: {
411
- logging?: boolean;
412
- metrics?: boolean;
413
- tracing?: boolean;
414
- };
415
- protected enableDatabaseBackup: boolean;
416
- constructor(
417
- em: EntityManager,
418
- cache: TtlCache,
419
- openTelemetryCollector: OpenTelemetryCollector<MetricsDefinition>,
420
- schemaValidator: SchemaValidator,
421
- mappers: {
422
- PaymentLinkMapper: ResponseMapperConstructor<
423
- SchemaValidator,
424
- Dto['PaymentLinkMapper'],
425
- Entities['PaymentLinkMapper']
426
- >;
427
- CreatePaymentLinkMapper: RequestMapperConstructor<
428
- SchemaValidator,
429
- Dto['CreatePaymentLinkMapper'],
430
- Entities['CreatePaymentLinkMapper'],
431
- (
432
- dto: Dto['CreatePaymentLinkMapper'],
433
- em: EntityManager
434
- ) => Promise<Entities['CreatePaymentLinkMapper']>
435
- >;
436
- UpdatePaymentLinkMapper: RequestMapperConstructor<
437
- SchemaValidator,
438
- Dto['UpdatePaymentLinkMapper'],
439
- Entities['UpdatePaymentLinkMapper'],
440
- (
441
- dto: Dto['UpdatePaymentLinkMapper'],
442
- em: EntityManager
443
- ) => Promise<Entities['UpdatePaymentLinkMapper']>
444
- >;
445
- },
446
- options?:
447
- | {
448
- enableDatabaseBackup?: boolean;
449
- telemetry?: TelemetryOptions;
450
- }
451
- | undefined
452
- );
453
- protected cacheKeyPrefix: string;
454
- protected createCacheKey: (id: string) => string;
455
- createPaymentLink(
456
- paymentLinkDto: Dto['CreatePaymentLinkMapper']
457
- ): Promise<Dto['PaymentLinkMapper']>;
458
- updatePaymentLink(
459
- paymentLinkDto: Dto['UpdatePaymentLinkMapper']
460
- ): Promise<Dto['PaymentLinkMapper']>;
461
- getPaymentLink({ id }: IdDto): Promise<Dto['PaymentLinkMapper']>;
462
- expirePaymentLink({ id }: IdDto): Promise<void>;
463
- handlePaymentSuccess({ id }: IdDto): Promise<void>;
464
- handlePaymentFailure({ id }: IdDto): Promise<void>;
465
- listPaymentLinks(idsDto?: IdsDto): Promise<Dto['PaymentLinkMapper'][]>;
148
+ } | undefined;
149
+ protected _mappers: InternalMapper<InstanceTypeRecord<typeof this.mappers>>;
150
+ protected evaluatedTelemetryOptions: {
151
+ logging?: boolean;
152
+ metrics?: boolean;
153
+ tracing?: boolean;
154
+ };
155
+ protected enableDatabaseBackup: boolean;
156
+ constructor(em: EntityManager, cache: TtlCache, openTelemetryCollector: OpenTelemetryCollector<MetricsDefinition>, schemaValidator: SchemaValidator, mappers: {
157
+ PaymentLinkMapper: ResponseMapperConstructor<SchemaValidator, Dto['PaymentLinkMapper'], Entities['PaymentLinkMapper']>;
158
+ CreatePaymentLinkMapper: RequestMapperConstructor<SchemaValidator, Dto['CreatePaymentLinkMapper'], Entities['CreatePaymentLinkMapper'], (dto: Dto['CreatePaymentLinkMapper'], em: EntityManager) => Promise<Entities['CreatePaymentLinkMapper']>>;
159
+ UpdatePaymentLinkMapper: RequestMapperConstructor<SchemaValidator, Dto['UpdatePaymentLinkMapper'], Entities['UpdatePaymentLinkMapper'], (dto: Dto['UpdatePaymentLinkMapper'], em: EntityManager) => Promise<Entities['UpdatePaymentLinkMapper']>>;
160
+ }, options?: {
161
+ enableDatabaseBackup?: boolean;
162
+ telemetry?: TelemetryOptions;
163
+ } | undefined);
164
+ protected cacheKeyPrefix: string;
165
+ protected createCacheKey: (id: string) => string;
166
+ createPaymentLink(paymentLinkDto: Dto['CreatePaymentLinkMapper']): Promise<Dto['PaymentLinkMapper']>;
167
+ updatePaymentLink(paymentLinkDto: Dto['UpdatePaymentLinkMapper']): Promise<Dto['PaymentLinkMapper']>;
168
+ getPaymentLink({ id }: IdDto): Promise<Dto['PaymentLinkMapper']>;
169
+ expirePaymentLink({ id }: IdDto): Promise<void>;
170
+ handlePaymentSuccess({ id }: IdDto): Promise<void>;
171
+ handlePaymentFailure({ id }: IdDto): Promise<void>;
172
+ listPaymentLinks(idsDto?: IdsDto): Promise<Dto['PaymentLinkMapper'][]>;
466
173
  }
467
174
 
468
- declare class BasePlanService<
469
- SchemaValidator extends AnySchemaValidator,
470
- PlanCadenceEnum,
471
- CurrencyEnum,
472
- BillingProviderEnum,
473
- Entities extends BasePlanEntities<
474
- PlanCadenceEnum,
475
- CurrencyEnum,
476
- BillingProviderEnum
477
- >,
478
- Dto extends BasePlanDtos<
479
- PlanCadenceEnum,
480
- CurrencyEnum,
481
- BillingProviderEnum
482
- > = BasePlanDtos<PlanCadenceEnum, CurrencyEnum, BillingProviderEnum>
483
- > implements PlanService<PlanCadenceEnum, CurrencyEnum, BillingProviderEnum>
484
- {
485
- protected em: EntityManager;
486
- protected readonly openTelemetryCollector: OpenTelemetryCollector<MetricsDefinition>;
487
- protected readonly schemaValidator: SchemaValidator;
488
- protected readonly mappers: {
489
- PlanMapper: ResponseMapperConstructor<
490
- SchemaValidator,
491
- Dto['PlanMapper'],
492
- Entities['PlanMapper']
493
- >;
494
- CreatePlanMapper: RequestMapperConstructor<
495
- SchemaValidator,
496
- Dto['CreatePlanMapper'],
497
- Entities['CreatePlanMapper'],
498
- (
499
- dto: Dto['CreatePlanMapper'],
500
- em: EntityManager
501
- ) => Promise<Entities['CreatePlanMapper']>
502
- >;
503
- UpdatePlanMapper: RequestMapperConstructor<
504
- SchemaValidator,
505
- Dto['UpdatePlanMapper'],
506
- Entities['UpdatePlanMapper'],
507
- (
508
- dto: Dto['UpdatePlanMapper'],
509
- em: EntityManager
510
- ) => Promise<Entities['UpdatePlanMapper']>
511
- >;
512
- };
513
- readonly options?:
514
- | {
175
+ declare class BasePlanService<SchemaValidator extends AnySchemaValidator, PlanCadenceEnum, CurrencyEnum, BillingProviderEnum, Entities extends BasePlanEntities<PlanCadenceEnum, CurrencyEnum, BillingProviderEnum>, Dto extends BasePlanDtos<PlanCadenceEnum, CurrencyEnum, BillingProviderEnum> = BasePlanDtos<PlanCadenceEnum, CurrencyEnum, BillingProviderEnum>> implements PlanService<PlanCadenceEnum, CurrencyEnum, BillingProviderEnum> {
176
+ protected em: EntityManager;
177
+ protected readonly openTelemetryCollector: OpenTelemetryCollector<MetricsDefinition>;
178
+ protected readonly schemaValidator: SchemaValidator;
179
+ protected readonly mappers: {
180
+ PlanMapper: ResponseMapperConstructor<SchemaValidator, Dto['PlanMapper'], Entities['PlanMapper']>;
181
+ CreatePlanMapper: RequestMapperConstructor<SchemaValidator, Dto['CreatePlanMapper'], Entities['CreatePlanMapper'], (dto: Dto['CreatePlanMapper'], em: EntityManager) => Promise<Entities['CreatePlanMapper']>>;
182
+ UpdatePlanMapper: RequestMapperConstructor<SchemaValidator, Dto['UpdatePlanMapper'], Entities['UpdatePlanMapper'], (dto: Dto['UpdatePlanMapper'], em: EntityManager) => Promise<Entities['UpdatePlanMapper']>>;
183
+ };
184
+ readonly options?: {
185
+ telemetry?: TelemetryOptions;
186
+ } | undefined;
187
+ protected _mappers: InternalMapper<InstanceTypeRecord<typeof this.mappers>>;
188
+ protected evaluatedTelemetryOptions: {
189
+ logging?: boolean;
190
+ metrics?: boolean;
191
+ tracing?: boolean;
192
+ };
193
+ constructor(em: EntityManager, openTelemetryCollector: OpenTelemetryCollector<MetricsDefinition>, schemaValidator: SchemaValidator, mappers: {
194
+ PlanMapper: ResponseMapperConstructor<SchemaValidator, Dto['PlanMapper'], Entities['PlanMapper']>;
195
+ CreatePlanMapper: RequestMapperConstructor<SchemaValidator, Dto['CreatePlanMapper'], Entities['CreatePlanMapper'], (dto: Dto['CreatePlanMapper'], em: EntityManager) => Promise<Entities['CreatePlanMapper']>>;
196
+ UpdatePlanMapper: RequestMapperConstructor<SchemaValidator, Dto['UpdatePlanMapper'], Entities['UpdatePlanMapper'], (dto: Dto['UpdatePlanMapper'], em: EntityManager) => Promise<Entities['UpdatePlanMapper']>>;
197
+ }, options?: {
515
198
  telemetry?: TelemetryOptions;
516
- }
517
- | undefined;
518
- protected _mappers: InternalMapper<InstanceTypeRecord<typeof this.mappers>>;
519
- protected evaluatedTelemetryOptions: {
520
- logging?: boolean;
521
- metrics?: boolean;
522
- tracing?: boolean;
523
- };
524
- constructor(
525
- em: EntityManager,
526
- openTelemetryCollector: OpenTelemetryCollector<MetricsDefinition>,
527
- schemaValidator: SchemaValidator,
528
- mappers: {
529
- PlanMapper: ResponseMapperConstructor<
530
- SchemaValidator,
531
- Dto['PlanMapper'],
532
- Entities['PlanMapper']
533
- >;
534
- CreatePlanMapper: RequestMapperConstructor<
535
- SchemaValidator,
536
- Dto['CreatePlanMapper'],
537
- Entities['CreatePlanMapper'],
538
- (
539
- dto: Dto['CreatePlanMapper'],
540
- em: EntityManager
541
- ) => Promise<Entities['CreatePlanMapper']>
542
- >;
543
- UpdatePlanMapper: RequestMapperConstructor<
544
- SchemaValidator,
545
- Dto['UpdatePlanMapper'],
546
- Entities['UpdatePlanMapper'],
547
- (
548
- dto: Dto['UpdatePlanMapper'],
549
- em: EntityManager
550
- ) => Promise<Entities['UpdatePlanMapper']>
551
- >;
552
- },
553
- options?:
554
- | {
555
- telemetry?: TelemetryOptions;
556
- }
557
- | undefined
558
- );
559
- listPlans(idsDto?: IdsDto, em?: EntityManager): Promise<Dto['PlanMapper'][]>;
560
- createPlan(
561
- planDto: Dto['CreatePlanMapper'],
562
- em?: EntityManager
563
- ): Promise<Dto['PlanMapper']>;
564
- getPlan(idDto: IdDto, em?: EntityManager): Promise<Dto['PlanMapper']>;
565
- updatePlan(
566
- planDto: Dto['UpdatePlanMapper'],
567
- em?: EntityManager
568
- ): Promise<Dto['PlanMapper']>;
569
- deletePlan(
570
- idDto: {
571
- id: string;
572
- },
573
- em?: EntityManager
574
- ): Promise<void>;
199
+ } | undefined);
200
+ listPlans(idsDto?: IdsDto, em?: EntityManager): Promise<Dto['PlanMapper'][]>;
201
+ createPlan(planDto: Dto['CreatePlanMapper'], em?: EntityManager): Promise<Dto['PlanMapper']>;
202
+ getPlan(idDto: IdDto, em?: EntityManager): Promise<Dto['PlanMapper']>;
203
+ updatePlan(planDto: Dto['UpdatePlanMapper'], em?: EntityManager): Promise<Dto['PlanMapper']>;
204
+ deletePlan(idDto: {
205
+ id: string;
206
+ }, em?: EntityManager): Promise<void>;
575
207
  }
576
208
 
577
- declare class BaseSubscriptionService<
578
- SchemaValidator extends AnySchemaValidator,
579
- PartyType,
580
- BillingProviderType,
581
- Entities extends BaseSubscriptionEntities<PartyType, BillingProviderType>,
582
- Dto extends BaseSubscriptionDtos<
583
- PartyType,
584
- BillingProviderType
585
- > = BaseSubscriptionDtos<PartyType, BillingProviderType>
586
- > implements SubscriptionService<PartyType, BillingProviderType>
587
- {
588
- protected em: EntityManager;
589
- protected readonly openTelemetryCollector: OpenTelemetryCollector<MetricsDefinition>;
590
- protected readonly schemaValidator: SchemaValidator;
591
- protected readonly mappers: {
592
- SubscriptionMapper: ResponseMapperConstructor<
593
- SchemaValidator,
594
- Dto['SubscriptionMapper'],
595
- Entities['SubscriptionMapper']
596
- >;
597
- CreateSubscriptionMapper: RequestMapperConstructor<
598
- SchemaValidator,
599
- Dto['CreateSubscriptionMapper'],
600
- Entities['CreateSubscriptionMapper'],
601
- (
602
- dto: Dto['CreateSubscriptionMapper'],
603
- em: EntityManager
604
- ) => Promise<Entities['CreateSubscriptionMapper']>
605
- >;
606
- UpdateSubscriptionMapper: RequestMapperConstructor<
607
- SchemaValidator,
608
- Dto['UpdateSubscriptionMapper'],
609
- Entities['UpdateSubscriptionMapper'],
610
- (
611
- dto: Dto['UpdateSubscriptionMapper'],
612
- em: EntityManager
613
- ) => Promise<Entities['UpdateSubscriptionMapper']>
614
- >;
615
- };
616
- readonly options?:
617
- | {
209
+ declare class BaseSubscriptionService<SchemaValidator extends AnySchemaValidator, PartyType, BillingProviderType, Entities extends BaseSubscriptionEntities<PartyType, BillingProviderType>, Dto extends BaseSubscriptionDtos<PartyType, BillingProviderType> = BaseSubscriptionDtos<PartyType, BillingProviderType>> implements SubscriptionService<PartyType, BillingProviderType> {
210
+ protected em: EntityManager;
211
+ protected readonly openTelemetryCollector: OpenTelemetryCollector<MetricsDefinition>;
212
+ protected readonly schemaValidator: SchemaValidator;
213
+ protected readonly mappers: {
214
+ SubscriptionMapper: ResponseMapperConstructor<SchemaValidator, Dto['SubscriptionMapper'], Entities['SubscriptionMapper']>;
215
+ CreateSubscriptionMapper: RequestMapperConstructor<SchemaValidator, Dto['CreateSubscriptionMapper'], Entities['CreateSubscriptionMapper'], (dto: Dto['CreateSubscriptionMapper'], em: EntityManager) => Promise<Entities['CreateSubscriptionMapper']>>;
216
+ UpdateSubscriptionMapper: RequestMapperConstructor<SchemaValidator, Dto['UpdateSubscriptionMapper'], Entities['UpdateSubscriptionMapper'], (dto: Dto['UpdateSubscriptionMapper'], em: EntityManager) => Promise<Entities['UpdateSubscriptionMapper']>>;
217
+ };
218
+ readonly options?: {
618
219
  telemetry?: TelemetryOptions;
619
- }
620
- | undefined;
621
- protected _mappers: InternalMapper<InstanceTypeRecord<typeof this.mappers>>;
622
- protected evaluatedTelemetryOptions: {
623
- logging?: boolean;
624
- metrics?: boolean;
625
- tracing?: boolean;
626
- };
627
- constructor(
628
- em: EntityManager,
629
- openTelemetryCollector: OpenTelemetryCollector<MetricsDefinition>,
630
- schemaValidator: SchemaValidator,
631
- mappers: {
632
- SubscriptionMapper: ResponseMapperConstructor<
633
- SchemaValidator,
634
- Dto['SubscriptionMapper'],
635
- Entities['SubscriptionMapper']
636
- >;
637
- CreateSubscriptionMapper: RequestMapperConstructor<
638
- SchemaValidator,
639
- Dto['CreateSubscriptionMapper'],
640
- Entities['CreateSubscriptionMapper'],
641
- (
642
- dto: Dto['CreateSubscriptionMapper'],
643
- em: EntityManager
644
- ) => Promise<Entities['CreateSubscriptionMapper']>
645
- >;
646
- UpdateSubscriptionMapper: RequestMapperConstructor<
647
- SchemaValidator,
648
- Dto['UpdateSubscriptionMapper'],
649
- Entities['UpdateSubscriptionMapper'],
650
- (
651
- dto: Dto['UpdateSubscriptionMapper'],
652
- em: EntityManager
653
- ) => Promise<Entities['UpdateSubscriptionMapper']>
654
- >;
655
- },
656
- options?:
657
- | {
658
- telemetry?: TelemetryOptions;
659
- }
660
- | undefined
661
- );
662
- createSubscription(
663
- subscriptionDto: Dto['CreateSubscriptionMapper'],
664
- em?: EntityManager
665
- ): Promise<Dto['SubscriptionMapper']>;
666
- getSubscription(
667
- idDto: IdDto,
668
- em?: EntityManager
669
- ): Promise<Dto['SubscriptionMapper']>;
670
- getUserSubscription(
671
- { id }: IdDto,
672
- em?: EntityManager
673
- ): Promise<Dto['SubscriptionMapper']>;
674
- getOrganizationSubscription(
675
- { id }: IdDto,
676
- em?: EntityManager
677
- ): Promise<Dto['SubscriptionMapper']>;
678
- updateSubscription(
679
- subscriptionDto: Dto['UpdateSubscriptionMapper'],
680
- em?: EntityManager
681
- ): Promise<Dto['SubscriptionMapper']>;
682
- deleteSubscription(
683
- idDto: {
684
- id: string;
685
- },
686
- em?: EntityManager
687
- ): Promise<void>;
688
- listSubscriptions(
689
- idsDto: {
690
- ids?: string[];
691
- },
692
- em?: EntityManager
693
- ): Promise<Dto['SubscriptionMapper'][]>;
694
- cancelSubscription(idDto: IdDto, em?: EntityManager): Promise<void>;
695
- resumeSubscription(idDto: IdDto, em?: EntityManager): Promise<void>;
220
+ } | undefined;
221
+ protected _mappers: InternalMapper<InstanceTypeRecord<typeof this.mappers>>;
222
+ protected evaluatedTelemetryOptions: {
223
+ logging?: boolean;
224
+ metrics?: boolean;
225
+ tracing?: boolean;
226
+ };
227
+ constructor(em: EntityManager, openTelemetryCollector: OpenTelemetryCollector<MetricsDefinition>, schemaValidator: SchemaValidator, mappers: {
228
+ SubscriptionMapper: ResponseMapperConstructor<SchemaValidator, Dto['SubscriptionMapper'], Entities['SubscriptionMapper']>;
229
+ CreateSubscriptionMapper: RequestMapperConstructor<SchemaValidator, Dto['CreateSubscriptionMapper'], Entities['CreateSubscriptionMapper'], (dto: Dto['CreateSubscriptionMapper'], em: EntityManager) => Promise<Entities['CreateSubscriptionMapper']>>;
230
+ UpdateSubscriptionMapper: RequestMapperConstructor<SchemaValidator, Dto['UpdateSubscriptionMapper'], Entities['UpdateSubscriptionMapper'], (dto: Dto['UpdateSubscriptionMapper'], em: EntityManager) => Promise<Entities['UpdateSubscriptionMapper']>>;
231
+ }, options?: {
232
+ telemetry?: TelemetryOptions;
233
+ } | undefined);
234
+ createSubscription(subscriptionDto: Dto['CreateSubscriptionMapper'], em?: EntityManager): Promise<Dto['SubscriptionMapper']>;
235
+ getSubscription(idDto: IdDto, em?: EntityManager): Promise<Dto['SubscriptionMapper']>;
236
+ getUserSubscription({ id }: IdDto, em?: EntityManager): Promise<Dto['SubscriptionMapper']>;
237
+ getOrganizationSubscription({ id }: IdDto, em?: EntityManager): Promise<Dto['SubscriptionMapper']>;
238
+ updateSubscription(subscriptionDto: Dto['UpdateSubscriptionMapper'], em?: EntityManager): Promise<Dto['SubscriptionMapper']>;
239
+ deleteSubscription(idDto: {
240
+ id: string;
241
+ }, em?: EntityManager): Promise<void>;
242
+ listSubscriptions(idsDto: {
243
+ ids?: string[];
244
+ }, em?: EntityManager): Promise<Dto['SubscriptionMapper'][]>;
245
+ cancelSubscription(idDto: IdDto, em?: EntityManager): Promise<void>;
246
+ resumeSubscription(idDto: IdDto, em?: EntityManager): Promise<void>;
696
247
  }
697
248
 
698
- export {
699
- BaseBillingPortalService,
700
- BaseCheckoutSessionService,
701
- BasePaymentLinkService,
702
- BasePlanService,
703
- BaseSubscriptionService
704
- };
249
+ export { BaseBillingPortalService, BaseCheckoutSessionService, BasePaymentLinkService, BasePlanService, BaseSubscriptionService };