@forklaunch/implementation-billing-stripe 0.3.5 → 0.4.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.
@@ -1,424 +1,184 @@
1
1
  import { EntityManager } from '@mikro-orm/core';
2
2
  import stripe__default from 'stripe';
3
- import {
4
- BillingPortalDto,
5
- CreateBillingPortalDto,
6
- UpdateBillingPortalDto,
7
- CheckoutSessionDto,
8
- CreateCheckoutSessionDto,
9
- UpdateCheckoutSessionDto,
10
- PaymentLinkDto,
11
- CreatePaymentLinkDto,
12
- UpdatePaymentLinkDto,
13
- PlanDto,
14
- CreatePlanDto,
15
- UpdatePlanDto,
16
- SubscriptionDto,
17
- CreateSubscriptionDto,
18
- UpdateSubscriptionDto
19
- } from '@forklaunch/interfaces-billing/types';
20
- import {
21
- PaymentMethodEnum,
22
- CurrencyEnum,
23
- PlanCadenceEnum,
24
- BillingProviderEnum
25
- } from '../enum/index.mjs';
3
+ import { BillingPortalDto, CreateBillingPortalDto, UpdateBillingPortalDto, CheckoutSessionDto, CreateCheckoutSessionDto, UpdateCheckoutSessionDto, PaymentLinkDto, CreatePaymentLinkDto, UpdatePaymentLinkDto, PlanDto, CreatePlanDto, UpdatePlanDto, SubscriptionDto, CreateSubscriptionDto, UpdateSubscriptionDto } from '@forklaunch/interfaces-billing/types';
4
+ import { PaymentMethodEnum, CurrencyEnum, PlanCadenceEnum, BillingProviderEnum } from '../enum/index.mjs';
26
5
 
27
6
  type BillingPortalOmissions = 'customer';
28
- type StripeCreateBillingPortalDto = Omit<
29
- CreateBillingPortalDto,
30
- 'providerFields'
31
- > & {
32
- stripeFields: Omit<
33
- stripe__default.BillingPortal.SessionCreateParams,
34
- BillingPortalOmissions
35
- >;
36
- };
37
- type StripeUpdateBillingPortalDto = Omit<
38
- UpdateBillingPortalDto,
39
- 'providerFields'
40
- > & {
41
- stripeFields?: Omit<
42
- stripe__default.BillingPortal.SessionCreateParams,
43
- BillingPortalOmissions
44
- >;
7
+ type StripeCreateBillingPortalDto = Omit<CreateBillingPortalDto, 'providerFields'> & {
8
+ stripeFields: Omit<stripe__default.BillingPortal.SessionCreateParams, BillingPortalOmissions>;
9
+ };
10
+ type StripeUpdateBillingPortalDto = Omit<UpdateBillingPortalDto, 'providerFields'> & {
11
+ stripeFields?: Omit<stripe__default.BillingPortal.SessionCreateParams, BillingPortalOmissions>;
45
12
  };
46
13
  type StripeBillingPortalDto = Omit<BillingPortalDto, 'providerFields'> & {
47
- stripeFields: stripe__default.BillingPortal.Session;
14
+ stripeFields: stripe__default.BillingPortal.Session;
48
15
  };
49
16
  type StripeBillingPortalDtos = {
50
- BillingPortalMapper: StripeBillingPortalDto;
51
- CreateBillingPortalMapper: StripeCreateBillingPortalDto;
52
- UpdateBillingPortalMapper: StripeUpdateBillingPortalDto;
53
- };
54
- type CheckoutSessionOmissions =
55
- | 'payment_method_types'
56
- | 'currency'
57
- | 'success_url'
58
- | 'cancel_url';
59
- type StripeCreateCheckoutSessionDto<StatusEnum> = Omit<
60
- CreateCheckoutSessionDto<
61
- typeof PaymentMethodEnum,
62
- typeof CurrencyEnum,
63
- StatusEnum
64
- >,
65
- 'providerFields' | 'uri'
66
- > & {
67
- uri: string;
68
- stripeFields: Omit<
69
- stripe__default.Checkout.SessionCreateParams,
70
- CheckoutSessionOmissions
71
- >;
72
- };
73
- type StripeUpdateCheckoutSessionDto<StatusEnum> = Omit<
74
- UpdateCheckoutSessionDto<
75
- typeof PaymentMethodEnum,
76
- typeof CurrencyEnum,
77
- StatusEnum
78
- >,
79
- 'providerFields'
80
- > & {
81
- stripeFields?: Omit<
82
- stripe__default.Checkout.SessionCreateParams,
83
- CheckoutSessionOmissions
84
- >;
85
- };
86
- type StripeCheckoutSessionDto<StatusEnum> = Omit<
87
- CheckoutSessionDto<typeof PaymentMethodEnum, typeof CurrencyEnum, StatusEnum>,
88
- 'providerFields' | 'uri'
89
- > & {
90
- uri: string;
91
- stripeFields: stripe__default.Checkout.Session;
17
+ BillingPortalMapper: StripeBillingPortalDto;
18
+ CreateBillingPortalMapper: StripeCreateBillingPortalDto;
19
+ UpdateBillingPortalMapper: StripeUpdateBillingPortalDto;
20
+ };
21
+ type CheckoutSessionOmissions = 'payment_method_types' | 'currency' | 'success_url' | 'cancel_url';
22
+ type StripeCreateCheckoutSessionDto<StatusEnum> = Omit<CreateCheckoutSessionDto<typeof PaymentMethodEnum, typeof CurrencyEnum, StatusEnum>, 'providerFields' | 'uri'> & {
23
+ uri: string;
24
+ stripeFields: Omit<stripe__default.Checkout.SessionCreateParams, CheckoutSessionOmissions>;
25
+ };
26
+ type StripeUpdateCheckoutSessionDto<StatusEnum> = Omit<UpdateCheckoutSessionDto<typeof PaymentMethodEnum, typeof CurrencyEnum, StatusEnum>, 'providerFields'> & {
27
+ stripeFields?: Omit<stripe__default.Checkout.SessionCreateParams, CheckoutSessionOmissions>;
28
+ };
29
+ type StripeCheckoutSessionDto<StatusEnum> = Omit<CheckoutSessionDto<typeof PaymentMethodEnum, typeof CurrencyEnum, StatusEnum>, 'providerFields' | 'uri'> & {
30
+ uri: string;
31
+ stripeFields: stripe__default.Checkout.Session;
92
32
  };
93
33
  type StripeCheckoutSessionDtos<StatusEnum> = {
94
- CheckoutSessionMapper: StripeCheckoutSessionDto<StatusEnum>;
95
- CreateCheckoutSessionMapper: StripeCreateCheckoutSessionDto<StatusEnum>;
96
- UpdateCheckoutSessionMapper: StripeUpdateCheckoutSessionDto<StatusEnum>;
97
- };
98
- type StripeCreatePaymentLinkDto<StatusEnum> = Omit<
99
- CreatePaymentLinkDto<
100
- typeof PaymentMethodEnum,
101
- typeof CurrencyEnum,
102
- StatusEnum
103
- >,
104
- 'providerFields'
105
- > & {
106
- stripeFields: stripe__default.PaymentLinkCreateParams;
107
- };
108
- type StripeUpdatePaymentLinkDto<StatusEnum> = Omit<
109
- UpdatePaymentLinkDto<
110
- typeof PaymentMethodEnum,
111
- typeof CurrencyEnum,
112
- StatusEnum
113
- >,
114
- 'providerFields'
115
- > & {
116
- stripeFields?: stripe__default.PaymentLinkUpdateParams;
117
- };
118
- type StripePaymentLinkDto<StatusEnum> = Omit<
119
- PaymentLinkDto<typeof PaymentMethodEnum, typeof CurrencyEnum, StatusEnum>,
120
- 'providerFields'
121
- > & {
122
- stripeFields: stripe__default.PaymentLink;
34
+ CheckoutSessionMapper: StripeCheckoutSessionDto<StatusEnum>;
35
+ CreateCheckoutSessionMapper: StripeCreateCheckoutSessionDto<StatusEnum>;
36
+ UpdateCheckoutSessionMapper: StripeUpdateCheckoutSessionDto<StatusEnum>;
37
+ };
38
+ type StripeCreatePaymentLinkDto<StatusEnum> = Omit<CreatePaymentLinkDto<typeof PaymentMethodEnum, typeof CurrencyEnum, StatusEnum>, 'providerFields'> & {
39
+ stripeFields: stripe__default.PaymentLinkCreateParams;
40
+ };
41
+ type StripeUpdatePaymentLinkDto<StatusEnum> = Omit<UpdatePaymentLinkDto<typeof PaymentMethodEnum, typeof CurrencyEnum, StatusEnum>, 'providerFields'> & {
42
+ stripeFields?: stripe__default.PaymentLinkUpdateParams;
43
+ };
44
+ type StripePaymentLinkDto<StatusEnum> = Omit<PaymentLinkDto<typeof PaymentMethodEnum, typeof CurrencyEnum, StatusEnum>, 'providerFields'> & {
45
+ stripeFields: stripe__default.PaymentLink;
123
46
  };
124
47
  type StripePaymentLinkDtos<StatusEnum> = {
125
- PaymentLinkMapper: StripePaymentLinkDto<StatusEnum>;
126
- CreatePaymentLinkMapper: StripeCreatePaymentLinkDto<StatusEnum>;
127
- UpdatePaymentLinkMapper: StripeUpdatePaymentLinkDto<StatusEnum>;
48
+ PaymentLinkMapper: StripePaymentLinkDto<StatusEnum>;
49
+ CreatePaymentLinkMapper: StripeCreatePaymentLinkDto<StatusEnum>;
50
+ UpdatePaymentLinkMapper: StripeUpdatePaymentLinkDto<StatusEnum>;
128
51
  };
129
52
  type PlanOmissions = 'product' | 'interval' | 'currency';
130
- type StripeCreatePlanDto = Omit<
131
- CreatePlanDto<
132
- typeof PlanCadenceEnum,
133
- typeof CurrencyEnum,
134
- typeof BillingProviderEnum
135
- >,
136
- 'providerFields'
137
- > & {
138
- stripeFields: Omit<stripe__default.PlanCreateParams, PlanOmissions>;
139
- };
140
- type StripeUpdatePlanDto = Omit<
141
- UpdatePlanDto<
142
- typeof PlanCadenceEnum,
143
- typeof CurrencyEnum,
144
- typeof BillingProviderEnum
145
- >,
146
- 'providerFields'
147
- > & {
148
- stripeFields?: Omit<stripe__default.PlanUpdateParams, PlanOmissions>;
149
- };
150
- type StripePlanDto = Omit<
151
- PlanDto<
152
- typeof PlanCadenceEnum,
153
- typeof CurrencyEnum,
154
- typeof BillingProviderEnum
155
- >,
156
- 'providerFields'
157
- > & {
158
- stripeFields: stripe__default.Plan;
53
+ type StripeCreatePlanDto = Omit<CreatePlanDto<typeof PlanCadenceEnum, typeof CurrencyEnum, typeof BillingProviderEnum>, 'providerFields'> & {
54
+ stripeFields: Omit<stripe__default.PlanCreateParams, PlanOmissions>;
55
+ };
56
+ type StripeUpdatePlanDto = Omit<UpdatePlanDto<typeof PlanCadenceEnum, typeof CurrencyEnum, typeof BillingProviderEnum>, 'providerFields'> & {
57
+ stripeFields?: Omit<stripe__default.PlanUpdateParams, PlanOmissions>;
58
+ };
59
+ type StripePlanDto = Omit<PlanDto<typeof PlanCadenceEnum, typeof CurrencyEnum, typeof BillingProviderEnum>, 'providerFields'> & {
60
+ stripeFields: stripe__default.Plan;
159
61
  };
160
62
  type StripePlanDtos = {
161
- PlanMapper: StripePlanDto;
162
- CreatePlanMapper: StripeCreatePlanDto;
163
- UpdatePlanMapper: StripeUpdatePlanDto;
63
+ PlanMapper: StripePlanDto;
64
+ CreatePlanMapper: StripeCreatePlanDto;
65
+ UpdatePlanMapper: StripeUpdatePlanDto;
164
66
  };
165
67
  type SubscriptionOmissions = 'items' | 'customer';
166
- type StripeCreateSubscriptionDto<PartyType> = Omit<
167
- CreateSubscriptionDto<PartyType, typeof BillingProviderEnum>,
168
- 'providerFields'
169
- > & {
170
- stripeFields: Omit<
171
- stripe__default.SubscriptionCreateParams,
172
- SubscriptionOmissions
173
- >;
174
- };
175
- type StripeUpdateSubscriptionDto<PartyType> = Omit<
176
- UpdateSubscriptionDto<PartyType, typeof BillingProviderEnum>,
177
- 'providerFields'
178
- > & {
179
- stripeFields?: Omit<
180
- stripe__default.SubscriptionUpdateParams,
181
- SubscriptionOmissions
182
- >;
183
- };
184
- type StripeSubscriptionDto<PartyType> = Omit<
185
- SubscriptionDto<PartyType, typeof BillingProviderEnum>,
186
- 'providerFields'
187
- > & {
188
- stripeFields: stripe__default.Subscription;
68
+ type StripeCreateSubscriptionDto<PartyType> = Omit<CreateSubscriptionDto<PartyType, typeof BillingProviderEnum>, 'providerFields'> & {
69
+ stripeFields: Omit<stripe__default.SubscriptionCreateParams, SubscriptionOmissions>;
70
+ };
71
+ type StripeUpdateSubscriptionDto<PartyType> = Omit<UpdateSubscriptionDto<PartyType, typeof BillingProviderEnum>, 'providerFields'> & {
72
+ stripeFields?: Omit<stripe__default.SubscriptionUpdateParams, SubscriptionOmissions>;
73
+ };
74
+ type StripeSubscriptionDto<PartyType> = Omit<SubscriptionDto<PartyType, typeof BillingProviderEnum>, 'providerFields'> & {
75
+ stripeFields: stripe__default.Subscription;
189
76
  };
190
77
  type StripeSubscriptionDtos<PartyType> = {
191
- SubscriptionMapper: StripeSubscriptionDto<PartyType>;
192
- CreateSubscriptionMapper: StripeCreateSubscriptionDto<PartyType>;
193
- UpdateSubscriptionMapper: StripeUpdateSubscriptionDto<PartyType>;
78
+ SubscriptionMapper: StripeSubscriptionDto<PartyType>;
79
+ CreateSubscriptionMapper: StripeCreateSubscriptionDto<PartyType>;
80
+ UpdateSubscriptionMapper: StripeUpdateSubscriptionDto<PartyType>;
194
81
  };
195
82
 
196
83
  type StripeBillingPortalEntity = BillingPortalDto & {
197
- providerFields: stripe__default.BillingPortal.Session;
84
+ providerFields: stripe__default.BillingPortal.Session;
198
85
  };
199
86
  type StripeBillingPortalEntities = {
200
- BillingPortalMapper: StripeBillingPortalEntity;
201
- CreateBillingPortalMapper: StripeBillingPortalEntity;
202
- UpdateBillingPortalMapper: StripeBillingPortalEntity;
87
+ BillingPortalMapper: StripeBillingPortalEntity;
88
+ CreateBillingPortalMapper: StripeBillingPortalEntity;
89
+ UpdateBillingPortalMapper: StripeBillingPortalEntity;
203
90
  };
204
- type StripeCheckoutSessionEntity<StatusEnum> = CheckoutSessionDto<
205
- typeof PaymentMethodEnum,
206
- typeof CurrencyEnum,
207
- StatusEnum
208
- > & {
209
- providerFields: stripe__default.Checkout.Session;
91
+ type StripeCheckoutSessionEntity<StatusEnum> = CheckoutSessionDto<typeof PaymentMethodEnum, typeof CurrencyEnum, StatusEnum> & {
92
+ providerFields: stripe__default.Checkout.Session;
210
93
  };
211
94
  type StripeCheckoutSessionEntities<StatusEnum> = {
212
- CheckoutSessionMapper: StripeCheckoutSessionEntity<StatusEnum>;
213
- CreateCheckoutSessionMapper: StripeCheckoutSessionEntity<StatusEnum>;
214
- UpdateCheckoutSessionMapper: StripeCheckoutSessionEntity<StatusEnum>;
95
+ CheckoutSessionMapper: StripeCheckoutSessionEntity<StatusEnum>;
96
+ CreateCheckoutSessionMapper: StripeCheckoutSessionEntity<StatusEnum>;
97
+ UpdateCheckoutSessionMapper: StripeCheckoutSessionEntity<StatusEnum>;
215
98
  };
216
- type StripePaymentLinkEntity<StatusEnum> = PaymentLinkDto<
217
- typeof PaymentMethodEnum,
218
- typeof CurrencyEnum,
219
- StatusEnum
220
- > & {
221
- providerFields: stripe__default.PaymentLink;
99
+ type StripePaymentLinkEntity<StatusEnum> = PaymentLinkDto<typeof PaymentMethodEnum, typeof CurrencyEnum, StatusEnum> & {
100
+ providerFields: stripe__default.PaymentLink;
222
101
  };
223
102
  type StripePaymentLinkEntities<StatusEnum> = {
224
- PaymentLinkMapper: StripePaymentLinkEntity<StatusEnum>;
225
- CreatePaymentLinkMapper: StripePaymentLinkEntity<StatusEnum>;
226
- UpdatePaymentLinkMapper: StripePaymentLinkEntity<StatusEnum>;
103
+ PaymentLinkMapper: StripePaymentLinkEntity<StatusEnum>;
104
+ CreatePaymentLinkMapper: StripePaymentLinkEntity<StatusEnum>;
105
+ UpdatePaymentLinkMapper: StripePaymentLinkEntity<StatusEnum>;
227
106
  };
228
- type StripePlanEntity = PlanDto<
229
- typeof PlanCadenceEnum,
230
- typeof CurrencyEnum,
231
- typeof BillingProviderEnum
232
- > & {
233
- providerFields: stripe__default.Plan;
107
+ type StripePlanEntity = PlanDto<typeof PlanCadenceEnum, typeof CurrencyEnum, typeof BillingProviderEnum> & {
108
+ providerFields: stripe__default.Plan;
234
109
  };
235
110
  type StripePlanEntities = {
236
- PlanMapper: StripePlanEntity;
237
- CreatePlanMapper: StripePlanEntity;
238
- UpdatePlanMapper: StripePlanEntity;
111
+ PlanMapper: StripePlanEntity;
112
+ CreatePlanMapper: StripePlanEntity;
113
+ UpdatePlanMapper: StripePlanEntity;
239
114
  };
240
- type StripeSubscriptionEntity<PartyType> = SubscriptionDto<
241
- PartyType,
242
- typeof BillingProviderEnum
243
- > & {
244
- providerFields: stripe__default.Subscription;
115
+ type StripeSubscriptionEntity<PartyType> = SubscriptionDto<PartyType, typeof BillingProviderEnum> & {
116
+ providerFields: stripe__default.Subscription;
245
117
  };
246
118
  type StripeSubscriptionEntities<PartyType> = {
247
- SubscriptionMapper: StripeSubscriptionEntity<PartyType>;
248
- CreateSubscriptionMapper: StripeSubscriptionEntity<PartyType>;
249
- UpdateSubscriptionMapper: StripeSubscriptionEntity<PartyType>;
119
+ SubscriptionMapper: StripeSubscriptionEntity<PartyType>;
120
+ CreateSubscriptionMapper: StripeSubscriptionEntity<PartyType>;
121
+ UpdateSubscriptionMapper: StripeSubscriptionEntity<PartyType>;
250
122
  };
251
123
 
252
- type StripeBillingPortalMappers<
253
- Entities extends StripeBillingPortalEntities,
254
- Dto extends StripeBillingPortalDtos
255
- > = {
256
- BillingPortalMapper: {
257
- toDto: (
258
- entity: Entities['BillingPortalMapper']
259
- ) => Promise<Dto['BillingPortalMapper']>;
260
- };
261
- CreateBillingPortalMapper: {
262
- toEntity: (
263
- dto: Dto['CreateBillingPortalMapper'],
264
- em: EntityManager,
265
- stripeSession: stripe__default.BillingPortal.Session,
266
- ...args: unknown[]
267
- ) => Promise<Entities['CreateBillingPortalMapper']>;
268
- };
269
- UpdateBillingPortalMapper: {
270
- toEntity: (
271
- dto: Dto['UpdateBillingPortalMapper'],
272
- em: EntityManager,
273
- stripeSession: stripe__default.BillingPortal.Session,
274
- ...args: unknown[]
275
- ) => Promise<Entities['UpdateBillingPortalMapper']>;
276
- };
124
+ type StripeBillingPortalMappers<Entities extends StripeBillingPortalEntities, Dto extends StripeBillingPortalDtos> = {
125
+ BillingPortalMapper: {
126
+ toDto: (entity: Entities['BillingPortalMapper']) => Promise<Dto['BillingPortalMapper']>;
127
+ };
128
+ CreateBillingPortalMapper: {
129
+ toEntity: (dto: Dto['CreateBillingPortalMapper'], em: EntityManager, stripeSession: stripe__default.BillingPortal.Session, ...args: unknown[]) => Promise<Entities['CreateBillingPortalMapper']>;
130
+ };
131
+ UpdateBillingPortalMapper: {
132
+ toEntity: (dto: Dto['UpdateBillingPortalMapper'], em: EntityManager, stripeSession: stripe__default.BillingPortal.Session, ...args: unknown[]) => Promise<Entities['UpdateBillingPortalMapper']>;
133
+ };
277
134
  };
278
135
 
279
- type StripeCheckoutSessionMappers<
280
- StatusEnum,
281
- Entities extends StripeCheckoutSessionEntities<StatusEnum>,
282
- Dto extends StripeCheckoutSessionDtos<StatusEnum>
283
- > = {
284
- CheckoutSessionMapper: {
285
- toDto: (
286
- entity: Entities['CheckoutSessionMapper']
287
- ) => Promise<Dto['CheckoutSessionMapper']>;
288
- };
289
- CreateCheckoutSessionMapper: {
290
- toEntity: (
291
- dto: Dto['CreateCheckoutSessionMapper'],
292
- em: EntityManager,
293
- stripeSession: stripe__default.Checkout.Session,
294
- ...args: unknown[]
295
- ) => Promise<Entities['CreateCheckoutSessionMapper']>;
296
- };
297
- UpdateCheckoutSessionMapper: {
298
- toEntity: (
299
- dto: Dto['UpdateCheckoutSessionMapper'],
300
- em: EntityManager,
301
- stripeSession: stripe__default.Checkout.Session,
302
- ...args: unknown[]
303
- ) => Promise<Entities['UpdateCheckoutSessionMapper']>;
304
- };
136
+ type StripeCheckoutSessionMappers<StatusEnum, Entities extends StripeCheckoutSessionEntities<StatusEnum>, Dto extends StripeCheckoutSessionDtos<StatusEnum>> = {
137
+ CheckoutSessionMapper: {
138
+ toDto: (entity: Entities['CheckoutSessionMapper']) => Promise<Dto['CheckoutSessionMapper']>;
139
+ };
140
+ CreateCheckoutSessionMapper: {
141
+ toEntity: (dto: Dto['CreateCheckoutSessionMapper'], em: EntityManager, stripeSession: stripe__default.Checkout.Session, ...args: unknown[]) => Promise<Entities['CreateCheckoutSessionMapper']>;
142
+ };
143
+ UpdateCheckoutSessionMapper: {
144
+ toEntity: (dto: Dto['UpdateCheckoutSessionMapper'], em: EntityManager, stripeSession: stripe__default.Checkout.Session, ...args: unknown[]) => Promise<Entities['UpdateCheckoutSessionMapper']>;
145
+ };
305
146
  };
306
147
 
307
- type StripePaymentLinkMappers<
308
- StatusEnum,
309
- Entities extends StripePaymentLinkEntities<StatusEnum>,
310
- Dto extends StripePaymentLinkDtos<StatusEnum>
311
- > = {
312
- PaymentLinkMapper: {
313
- toDto: (
314
- entity: Entities['PaymentLinkMapper']
315
- ) => Promise<Dto['PaymentLinkMapper']>;
316
- };
317
- CreatePaymentLinkMapper: {
318
- toEntity: (
319
- dto: Dto['CreatePaymentLinkMapper'],
320
- em: EntityManager,
321
- stripePaymentLink: stripe__default.PaymentLink,
322
- ...args: unknown[]
323
- ) => Promise<Entities['CreatePaymentLinkMapper']>;
324
- };
325
- UpdatePaymentLinkMapper: {
326
- toEntity: (
327
- dto: Dto['UpdatePaymentLinkMapper'],
328
- em: EntityManager,
329
- stripePaymentLink: stripe__default.PaymentLink,
330
- ...args: unknown[]
331
- ) => Promise<Entities['UpdatePaymentLinkMapper']>;
332
- };
148
+ type StripePaymentLinkMappers<StatusEnum, Entities extends StripePaymentLinkEntities<StatusEnum>, Dto extends StripePaymentLinkDtos<StatusEnum>> = {
149
+ PaymentLinkMapper: {
150
+ toDto: (entity: Entities['PaymentLinkMapper']) => Promise<Dto['PaymentLinkMapper']>;
151
+ };
152
+ CreatePaymentLinkMapper: {
153
+ toEntity: (dto: Dto['CreatePaymentLinkMapper'], em: EntityManager, stripePaymentLink: stripe__default.PaymentLink, ...args: unknown[]) => Promise<Entities['CreatePaymentLinkMapper']>;
154
+ };
155
+ UpdatePaymentLinkMapper: {
156
+ toEntity: (dto: Dto['UpdatePaymentLinkMapper'], em: EntityManager, stripePaymentLink: stripe__default.PaymentLink, ...args: unknown[]) => Promise<Entities['UpdatePaymentLinkMapper']>;
157
+ };
333
158
  };
334
159
 
335
- type StripePlanMappers<
336
- Entities extends StripePlanEntities,
337
- Dto extends StripePlanDtos
338
- > = {
339
- PlanMapper: {
340
- toDto: (entity: Entities['PlanMapper']) => Promise<Dto['PlanMapper']>;
341
- };
342
- CreatePlanMapper: {
343
- toEntity: (
344
- dto: Dto['CreatePlanMapper'],
345
- em: EntityManager,
346
- stripePlan: stripe__default.Plan,
347
- ...args: unknown[]
348
- ) => Promise<Entities['CreatePlanMapper']>;
349
- };
350
- UpdatePlanMapper: {
351
- toEntity: (
352
- dto: Dto['UpdatePlanMapper'],
353
- em: EntityManager,
354
- stripePlan: stripe__default.Plan,
355
- ...args: unknown[]
356
- ) => Promise<Entities['UpdatePlanMapper']>;
357
- };
160
+ type StripePlanMappers<Entities extends StripePlanEntities, Dto extends StripePlanDtos> = {
161
+ PlanMapper: {
162
+ toDto: (entity: Entities['PlanMapper']) => Promise<Dto['PlanMapper']>;
163
+ };
164
+ CreatePlanMapper: {
165
+ toEntity: (dto: Dto['CreatePlanMapper'], em: EntityManager, stripePlan: stripe__default.Plan, ...args: unknown[]) => Promise<Entities['CreatePlanMapper']>;
166
+ };
167
+ UpdatePlanMapper: {
168
+ toEntity: (dto: Dto['UpdatePlanMapper'], em: EntityManager, stripePlan: stripe__default.Plan, ...args: unknown[]) => Promise<Entities['UpdatePlanMapper']>;
169
+ };
358
170
  };
359
171
 
360
- type StripeSubscriptionMappers<
361
- PartyType,
362
- Entities extends StripeSubscriptionEntities<PartyType>,
363
- Dto extends StripeSubscriptionDtos<PartyType>
364
- > = {
365
- SubscriptionMapper: {
366
- toDto: (
367
- entity: Entities['SubscriptionMapper']
368
- ) => Promise<Dto['SubscriptionMapper']>;
369
- };
370
- CreateSubscriptionMapper: {
371
- toEntity: (
372
- dto: Dto['CreateSubscriptionMapper'],
373
- em: EntityManager,
374
- stripeSubscription: stripe__default.Subscription,
375
- ...args: unknown[]
376
- ) => Promise<Entities['CreateSubscriptionMapper']>;
377
- };
378
- UpdateSubscriptionMapper: {
379
- toEntity: (
380
- dto: Dto['UpdateSubscriptionMapper'],
381
- em: EntityManager,
382
- stripeSubscription: stripe__default.Subscription,
383
- ...args: unknown[]
384
- ) => Promise<Entities['UpdateSubscriptionMapper']>;
385
- };
172
+ type StripeSubscriptionMappers<PartyType, Entities extends StripeSubscriptionEntities<PartyType>, Dto extends StripeSubscriptionDtos<PartyType>> = {
173
+ SubscriptionMapper: {
174
+ toDto: (entity: Entities['SubscriptionMapper']) => Promise<Dto['SubscriptionMapper']>;
175
+ };
176
+ CreateSubscriptionMapper: {
177
+ toEntity: (dto: Dto['CreateSubscriptionMapper'], em: EntityManager, stripeSubscription: stripe__default.Subscription, ...args: unknown[]) => Promise<Entities['CreateSubscriptionMapper']>;
178
+ };
179
+ UpdateSubscriptionMapper: {
180
+ toEntity: (dto: Dto['UpdateSubscriptionMapper'], em: EntityManager, stripeSubscription: stripe__default.Subscription, ...args: unknown[]) => Promise<Entities['UpdateSubscriptionMapper']>;
181
+ };
386
182
  };
387
183
 
388
- export type {
389
- StripeBillingPortalDto,
390
- StripeBillingPortalDtos,
391
- StripeBillingPortalEntities,
392
- StripeBillingPortalEntity,
393
- StripeBillingPortalMappers,
394
- StripeCheckoutSessionDto,
395
- StripeCheckoutSessionDtos,
396
- StripeCheckoutSessionEntities,
397
- StripeCheckoutSessionEntity,
398
- StripeCheckoutSessionMappers,
399
- StripeCreateBillingPortalDto,
400
- StripeCreateCheckoutSessionDto,
401
- StripeCreatePaymentLinkDto,
402
- StripeCreatePlanDto,
403
- StripeCreateSubscriptionDto,
404
- StripePaymentLinkDto,
405
- StripePaymentLinkDtos,
406
- StripePaymentLinkEntities,
407
- StripePaymentLinkEntity,
408
- StripePaymentLinkMappers,
409
- StripePlanDto,
410
- StripePlanDtos,
411
- StripePlanEntities,
412
- StripePlanEntity,
413
- StripePlanMappers,
414
- StripeSubscriptionDto,
415
- StripeSubscriptionDtos,
416
- StripeSubscriptionEntities,
417
- StripeSubscriptionEntity,
418
- StripeSubscriptionMappers,
419
- StripeUpdateBillingPortalDto,
420
- StripeUpdateCheckoutSessionDto,
421
- StripeUpdatePaymentLinkDto,
422
- StripeUpdatePlanDto,
423
- StripeUpdateSubscriptionDto
424
- };
184
+ export type { StripeBillingPortalDto, StripeBillingPortalDtos, StripeBillingPortalEntities, StripeBillingPortalEntity, StripeBillingPortalMappers, StripeCheckoutSessionDto, StripeCheckoutSessionDtos, StripeCheckoutSessionEntities, StripeCheckoutSessionEntity, StripeCheckoutSessionMappers, StripeCreateBillingPortalDto, StripeCreateCheckoutSessionDto, StripeCreatePaymentLinkDto, StripeCreatePlanDto, StripeCreateSubscriptionDto, StripePaymentLinkDto, StripePaymentLinkDtos, StripePaymentLinkEntities, StripePaymentLinkEntity, StripePaymentLinkMappers, StripePlanDto, StripePlanDtos, StripePlanEntities, StripePlanEntity, StripePlanMappers, StripeSubscriptionDto, StripeSubscriptionDtos, StripeSubscriptionEntities, StripeSubscriptionEntity, StripeSubscriptionMappers, StripeUpdateBillingPortalDto, StripeUpdateCheckoutSessionDto, StripeUpdatePaymentLinkDto, StripeUpdatePlanDto, StripeUpdateSubscriptionDto };