@forklaunch/implementation-billing-base 0.3.3 → 0.3.4
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.
- package/lib/domain/schemas/index.d.mts +1202 -0
- package/lib/domain/schemas/index.d.ts +1202 -0
- package/lib/domain/schemas/index.js +627 -0
- package/lib/domain/schemas/index.mjs +595 -0
- package/lib/eject/domain/schemas/billingPortal.schema.ts +1 -7
- package/lib/eject/services/billingPortal.service.ts +2 -2
- package/lib/eject/services/checkoutSession.service.ts +2 -2
- package/lib/eject/services/paymentLink.service.ts +2 -2
- package/lib/eject/services/plan.service.ts +2 -2
- package/lib/eject/services/subscription.service.ts +2 -2
- package/lib/services/index.d.mts +661 -206
- package/lib/services/index.d.ts +661 -206
- package/lib/services/index.js +262 -202
- package/lib/services/index.mjs +226 -206
- package/package.json +12 -6
- package/lib/schemas/index.d.mts +0 -392
- package/lib/schemas/index.d.ts +0 -392
- package/lib/schemas/index.js +0 -488
- package/lib/schemas/index.mjs +0 -539
- /package/lib/eject/{types → domain/types}/baseBillingDto.types.ts +0 -0
- /package/lib/eject/{types → domain/types}/baseBillingEntity.types.ts +0 -0
|
@@ -0,0 +1,595 @@
|
|
|
1
|
+
// domain/schemas/billingPortal.schema.ts
|
|
2
|
+
import { serviceSchemaResolver } from '@forklaunch/internal';
|
|
3
|
+
|
|
4
|
+
// domain/schemas/typebox/billingPortal.schema.ts
|
|
5
|
+
import {
|
|
6
|
+
date,
|
|
7
|
+
optional,
|
|
8
|
+
string,
|
|
9
|
+
unknown,
|
|
10
|
+
uuid
|
|
11
|
+
} from '@forklaunch/validator/typebox';
|
|
12
|
+
var CreateBillingPortalSchema = {
|
|
13
|
+
customerId: string,
|
|
14
|
+
expiresAt: date,
|
|
15
|
+
uri: optional(string),
|
|
16
|
+
providerFields: optional(unknown)
|
|
17
|
+
};
|
|
18
|
+
var UpdateBillingPortalSchema = ({ uuidId }) => ({
|
|
19
|
+
id: uuidId ? uuid : string,
|
|
20
|
+
uri: optional(string),
|
|
21
|
+
expiresAt: optional(date),
|
|
22
|
+
providerFields: optional(unknown)
|
|
23
|
+
});
|
|
24
|
+
var BillingPortalSchema = ({ uuidId }) => ({
|
|
25
|
+
id: uuidId ? uuid : string,
|
|
26
|
+
customerId: string,
|
|
27
|
+
uri: optional(string),
|
|
28
|
+
expiresAt: date,
|
|
29
|
+
providerFields: optional(unknown),
|
|
30
|
+
createdAt: optional(date),
|
|
31
|
+
updatedAt: optional(date)
|
|
32
|
+
});
|
|
33
|
+
var BaseBillingPortalServiceSchemas = (options) => ({
|
|
34
|
+
CreateBillingPortalSchema,
|
|
35
|
+
UpdateBillingPortalSchema: UpdateBillingPortalSchema(options),
|
|
36
|
+
BillingPortalSchema: BillingPortalSchema(options)
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
// domain/schemas/zod/billingPortal.schema.ts
|
|
40
|
+
import {
|
|
41
|
+
date as date2,
|
|
42
|
+
optional as optional2,
|
|
43
|
+
string as string2,
|
|
44
|
+
unknown as unknown2,
|
|
45
|
+
uuid as uuid2
|
|
46
|
+
} from '@forklaunch/validator/zod';
|
|
47
|
+
var CreateBillingPortalSchema2 = {
|
|
48
|
+
customerId: string2,
|
|
49
|
+
expiresAt: date2,
|
|
50
|
+
uri: optional2(string2),
|
|
51
|
+
providerFields: optional2(unknown2)
|
|
52
|
+
};
|
|
53
|
+
var UpdateBillingPortalSchema2 = ({ uuidId }) => ({
|
|
54
|
+
id: uuidId ? uuid2 : string2,
|
|
55
|
+
uri: optional2(string2),
|
|
56
|
+
expiresAt: optional2(date2),
|
|
57
|
+
providerFields: optional2(unknown2)
|
|
58
|
+
});
|
|
59
|
+
var BillingPortalSchema2 = ({ uuidId }) => ({
|
|
60
|
+
id: uuidId ? uuid2 : string2,
|
|
61
|
+
customerId: string2,
|
|
62
|
+
uri: optional2(string2),
|
|
63
|
+
expiresAt: date2,
|
|
64
|
+
providerFields: optional2(unknown2),
|
|
65
|
+
createdAt: optional2(date2),
|
|
66
|
+
updatedAt: optional2(date2)
|
|
67
|
+
});
|
|
68
|
+
var BaseBillingPortalServiceSchemas2 = (options) => ({
|
|
69
|
+
CreateBillingPortalSchema: CreateBillingPortalSchema2,
|
|
70
|
+
UpdateBillingPortalSchema: UpdateBillingPortalSchema2(options),
|
|
71
|
+
BillingPortalSchema: BillingPortalSchema2(options)
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
// domain/schemas/billingPortal.schema.ts
|
|
75
|
+
var BaseBillingPortalServiceSchemas3 = serviceSchemaResolver(
|
|
76
|
+
BaseBillingPortalServiceSchemas,
|
|
77
|
+
BaseBillingPortalServiceSchemas2
|
|
78
|
+
);
|
|
79
|
+
|
|
80
|
+
// domain/schemas/checkoutSession.schema.ts
|
|
81
|
+
import { serviceSchemaResolver as serviceSchemaResolver2 } from '@forklaunch/internal';
|
|
82
|
+
|
|
83
|
+
// domain/schemas/typebox/checkoutSession.schema.ts
|
|
84
|
+
import {
|
|
85
|
+
array,
|
|
86
|
+
date as date3,
|
|
87
|
+
enum_,
|
|
88
|
+
optional as optional3,
|
|
89
|
+
string as string3,
|
|
90
|
+
unknown as unknown3,
|
|
91
|
+
uuid as uuid3
|
|
92
|
+
} from '@forklaunch/validator/typebox';
|
|
93
|
+
var CreateCheckoutSessionSchema = (
|
|
94
|
+
PaymentMethodEnum,
|
|
95
|
+
CurrencyEnum,
|
|
96
|
+
StatusEnum
|
|
97
|
+
) => ({
|
|
98
|
+
customerId: string3,
|
|
99
|
+
paymentMethods: array(enum_(PaymentMethodEnum)),
|
|
100
|
+
currency: enum_(CurrencyEnum),
|
|
101
|
+
successRedirectUri: optional3(string3),
|
|
102
|
+
cancelRedirectUri: optional3(string3),
|
|
103
|
+
expiresAt: date3,
|
|
104
|
+
status: enum_(StatusEnum),
|
|
105
|
+
providerFields: optional3(unknown3)
|
|
106
|
+
});
|
|
107
|
+
var UpdateCheckoutSessionSchema =
|
|
108
|
+
({ uuidId }) =>
|
|
109
|
+
(PaymentMethodEnum, CurrencyEnum, StatusEnum) => ({
|
|
110
|
+
id: uuidId ? uuid3 : string3,
|
|
111
|
+
customerId: optional3(string3),
|
|
112
|
+
paymentMethods: optional3(array(enum_(PaymentMethodEnum))),
|
|
113
|
+
currency: optional3(enum_(CurrencyEnum)),
|
|
114
|
+
successRedirectUri: optional3(string3),
|
|
115
|
+
cancelRedirectUri: optional3(string3),
|
|
116
|
+
expiresAt: optional3(date3),
|
|
117
|
+
status: optional3(enum_(StatusEnum)),
|
|
118
|
+
providerFields: optional3(unknown3)
|
|
119
|
+
});
|
|
120
|
+
var CheckoutSessionSchema =
|
|
121
|
+
({ uuidId }) =>
|
|
122
|
+
(PaymentMethodEnum, CurrencyEnum, StatusEnum) => ({
|
|
123
|
+
id: uuidId ? uuid3 : string3,
|
|
124
|
+
customerId: string3,
|
|
125
|
+
paymentMethods: array(enum_(PaymentMethodEnum)),
|
|
126
|
+
currency: enum_(CurrencyEnum),
|
|
127
|
+
successRedirectUri: optional3(string3),
|
|
128
|
+
cancelRedirectUri: optional3(string3),
|
|
129
|
+
expiresAt: date3,
|
|
130
|
+
status: enum_(StatusEnum),
|
|
131
|
+
providerFields: optional3(unknown3),
|
|
132
|
+
createdAt: optional3(date3),
|
|
133
|
+
updatedAt: optional3(date3)
|
|
134
|
+
});
|
|
135
|
+
var BaseCheckoutSessionServiceSchemas = (options) => ({
|
|
136
|
+
CreateCheckoutSessionSchema,
|
|
137
|
+
UpdateCheckoutSessionSchema: UpdateCheckoutSessionSchema(options),
|
|
138
|
+
CheckoutSessionSchema: CheckoutSessionSchema(options)
|
|
139
|
+
});
|
|
140
|
+
|
|
141
|
+
// domain/schemas/zod/checkoutSession.schema.ts
|
|
142
|
+
import {
|
|
143
|
+
array as array2,
|
|
144
|
+
date as date4,
|
|
145
|
+
enum_ as enum_2,
|
|
146
|
+
optional as optional4,
|
|
147
|
+
string as string4,
|
|
148
|
+
unknown as unknown4,
|
|
149
|
+
uuid as uuid4
|
|
150
|
+
} from '@forklaunch/validator/zod';
|
|
151
|
+
var CreateCheckoutSessionSchema2 = (
|
|
152
|
+
PaymentMethodEnum,
|
|
153
|
+
CurrencyEnum,
|
|
154
|
+
StatusEnum
|
|
155
|
+
) => ({
|
|
156
|
+
customerId: string4,
|
|
157
|
+
paymentMethods: array2(enum_2(PaymentMethodEnum)),
|
|
158
|
+
currency: enum_2(CurrencyEnum),
|
|
159
|
+
successRedirectUri: optional4(string4),
|
|
160
|
+
cancelRedirectUri: optional4(string4),
|
|
161
|
+
expiresAt: date4,
|
|
162
|
+
status: enum_2(StatusEnum),
|
|
163
|
+
providerFields: optional4(unknown4)
|
|
164
|
+
});
|
|
165
|
+
var UpdateCheckoutSessionSchema2 =
|
|
166
|
+
({ uuidId }) =>
|
|
167
|
+
(PaymentMethodEnum, CurrencyEnum, StatusEnum) => ({
|
|
168
|
+
id: uuidId ? uuid4 : string4,
|
|
169
|
+
customerId: optional4(string4),
|
|
170
|
+
paymentMethods: optional4(array2(enum_2(PaymentMethodEnum))),
|
|
171
|
+
currency: optional4(enum_2(CurrencyEnum)),
|
|
172
|
+
successRedirectUri: optional4(string4),
|
|
173
|
+
cancelRedirectUri: optional4(string4),
|
|
174
|
+
expiresAt: optional4(date4),
|
|
175
|
+
status: optional4(enum_2(StatusEnum)),
|
|
176
|
+
providerFields: optional4(unknown4)
|
|
177
|
+
});
|
|
178
|
+
var CheckoutSessionSchema2 =
|
|
179
|
+
({ uuidId }) =>
|
|
180
|
+
(PaymentMethodEnum, CurrencyEnum, StatusEnum) => ({
|
|
181
|
+
id: uuidId ? uuid4 : string4,
|
|
182
|
+
customerId: string4,
|
|
183
|
+
paymentMethods: array2(enum_2(PaymentMethodEnum)),
|
|
184
|
+
currency: enum_2(CurrencyEnum),
|
|
185
|
+
successRedirectUri: optional4(string4),
|
|
186
|
+
cancelRedirectUri: optional4(string4),
|
|
187
|
+
expiresAt: date4,
|
|
188
|
+
status: enum_2(StatusEnum),
|
|
189
|
+
providerFields: optional4(unknown4),
|
|
190
|
+
createdAt: optional4(date4),
|
|
191
|
+
updatedAt: optional4(date4)
|
|
192
|
+
});
|
|
193
|
+
var BaseCheckoutSessionServiceSchemas2 = (options) => ({
|
|
194
|
+
CreateCheckoutSessionSchema: CreateCheckoutSessionSchema2,
|
|
195
|
+
UpdateCheckoutSessionSchema: UpdateCheckoutSessionSchema2(options),
|
|
196
|
+
CheckoutSessionSchema: CheckoutSessionSchema2(options)
|
|
197
|
+
});
|
|
198
|
+
|
|
199
|
+
// domain/schemas/checkoutSession.schema.ts
|
|
200
|
+
var BaseCheckoutSessionServiceSchemas3 = serviceSchemaResolver2(
|
|
201
|
+
BaseCheckoutSessionServiceSchemas,
|
|
202
|
+
BaseCheckoutSessionServiceSchemas2
|
|
203
|
+
);
|
|
204
|
+
|
|
205
|
+
// domain/schemas/paymentLink.schema.ts
|
|
206
|
+
import { serviceSchemaResolver as serviceSchemaResolver3 } from '@forklaunch/internal';
|
|
207
|
+
|
|
208
|
+
// domain/schemas/typebox/paymentLink.schema.ts
|
|
209
|
+
import {
|
|
210
|
+
array as array3,
|
|
211
|
+
date as date5,
|
|
212
|
+
enum_ as enum_3,
|
|
213
|
+
number,
|
|
214
|
+
optional as optional5,
|
|
215
|
+
string as string5,
|
|
216
|
+
unknown as unknown5,
|
|
217
|
+
uuid as uuid5
|
|
218
|
+
} from '@forklaunch/validator/typebox';
|
|
219
|
+
var CreatePaymentLinkSchema = (
|
|
220
|
+
PaymentMethodEnum,
|
|
221
|
+
CurrencyEnum,
|
|
222
|
+
StatusEnum
|
|
223
|
+
) => ({
|
|
224
|
+
amount: number,
|
|
225
|
+
paymentMethods: array3(enum_3(PaymentMethodEnum)),
|
|
226
|
+
currency: enum_3(CurrencyEnum),
|
|
227
|
+
status: enum_3(StatusEnum),
|
|
228
|
+
providerFields: optional5(unknown5)
|
|
229
|
+
});
|
|
230
|
+
var UpdatePaymentLinkSchema =
|
|
231
|
+
({ uuidId }) =>
|
|
232
|
+
(PaymentMethodEnum, CurrencyEnum, StatusEnum) => ({
|
|
233
|
+
id: uuidId ? uuid5 : string5,
|
|
234
|
+
amount: optional5(number),
|
|
235
|
+
paymentMethods: optional5(array3(enum_3(PaymentMethodEnum))),
|
|
236
|
+
currency: optional5(enum_3(CurrencyEnum)),
|
|
237
|
+
status: optional5(enum_3(StatusEnum)),
|
|
238
|
+
providerFields: optional5(unknown5)
|
|
239
|
+
});
|
|
240
|
+
var PaymentLinkSchema =
|
|
241
|
+
({ uuidId }) =>
|
|
242
|
+
(PaymentMethodEnum, CurrencyEnum, StatusEnum) => ({
|
|
243
|
+
id: uuidId ? uuid5 : string5,
|
|
244
|
+
amount: number,
|
|
245
|
+
currency: enum_3(CurrencyEnum),
|
|
246
|
+
paymentMethods: array3(enum_3(PaymentMethodEnum)),
|
|
247
|
+
status: enum_3(StatusEnum),
|
|
248
|
+
providerFields: optional5(unknown5),
|
|
249
|
+
createdAt: optional5(date5),
|
|
250
|
+
updatedAt: optional5(date5)
|
|
251
|
+
});
|
|
252
|
+
var BasePaymentLinkServiceSchemas = (options) => ({
|
|
253
|
+
CreatePaymentLinkSchema,
|
|
254
|
+
UpdatePaymentLinkSchema: UpdatePaymentLinkSchema(options),
|
|
255
|
+
PaymentLinkSchema: PaymentLinkSchema(options)
|
|
256
|
+
});
|
|
257
|
+
|
|
258
|
+
// domain/schemas/zod/paymentLink.schema.ts
|
|
259
|
+
import {
|
|
260
|
+
array as array4,
|
|
261
|
+
date as date6,
|
|
262
|
+
enum_ as enum_4,
|
|
263
|
+
number as number2,
|
|
264
|
+
optional as optional6,
|
|
265
|
+
string as string6,
|
|
266
|
+
unknown as unknown6,
|
|
267
|
+
uuid as uuid6
|
|
268
|
+
} from '@forklaunch/validator/zod';
|
|
269
|
+
var CreatePaymentLinkSchema2 = (
|
|
270
|
+
PaymentMethodEnum,
|
|
271
|
+
CurrencyEnum,
|
|
272
|
+
StatusEnum
|
|
273
|
+
) => ({
|
|
274
|
+
amount: number2,
|
|
275
|
+
paymentMethods: array4(enum_4(PaymentMethodEnum)),
|
|
276
|
+
currency: enum_4(CurrencyEnum),
|
|
277
|
+
status: enum_4(StatusEnum),
|
|
278
|
+
providerFields: optional6(unknown6)
|
|
279
|
+
});
|
|
280
|
+
var UpdatePaymentLinkSchema2 =
|
|
281
|
+
({ uuidId }) =>
|
|
282
|
+
(PaymentMethodEnum, CurrencyEnum, StatusEnum) => ({
|
|
283
|
+
id: uuidId ? uuid6 : string6,
|
|
284
|
+
amount: optional6(number2),
|
|
285
|
+
paymentMethods: optional6(array4(enum_4(PaymentMethodEnum))),
|
|
286
|
+
currency: optional6(enum_4(CurrencyEnum)),
|
|
287
|
+
status: optional6(enum_4(StatusEnum)),
|
|
288
|
+
providerFields: optional6(unknown6)
|
|
289
|
+
});
|
|
290
|
+
var PaymentLinkSchema2 =
|
|
291
|
+
({ uuidId }) =>
|
|
292
|
+
(PaymentMethodEnum, CurrencyEnum, StatusEnum) => ({
|
|
293
|
+
id: uuidId ? uuid6 : string6,
|
|
294
|
+
amount: number2,
|
|
295
|
+
paymentMethods: array4(enum_4(PaymentMethodEnum)),
|
|
296
|
+
currency: enum_4(CurrencyEnum),
|
|
297
|
+
status: enum_4(StatusEnum),
|
|
298
|
+
providerFields: optional6(unknown6),
|
|
299
|
+
createdAt: optional6(date6),
|
|
300
|
+
updatedAt: optional6(date6)
|
|
301
|
+
});
|
|
302
|
+
var BasePaymentLinkServiceSchemas2 = (options) => ({
|
|
303
|
+
CreatePaymentLinkSchema: CreatePaymentLinkSchema2,
|
|
304
|
+
UpdatePaymentLinkSchema: UpdatePaymentLinkSchema2(options),
|
|
305
|
+
PaymentLinkSchema: PaymentLinkSchema2(options)
|
|
306
|
+
});
|
|
307
|
+
|
|
308
|
+
// domain/schemas/paymentLink.schema.ts
|
|
309
|
+
var BasePaymentLinkServiceSchemas3 = serviceSchemaResolver3(
|
|
310
|
+
BasePaymentLinkServiceSchemas,
|
|
311
|
+
BasePaymentLinkServiceSchemas2
|
|
312
|
+
);
|
|
313
|
+
|
|
314
|
+
// domain/schemas/plan.schema.ts
|
|
315
|
+
import { serviceSchemaResolver as serviceSchemaResolver4 } from '@forklaunch/internal';
|
|
316
|
+
|
|
317
|
+
// domain/schemas/typebox/plan.schema.ts
|
|
318
|
+
import {
|
|
319
|
+
array as array5,
|
|
320
|
+
boolean,
|
|
321
|
+
date as date7,
|
|
322
|
+
enum_ as enum_5,
|
|
323
|
+
number as number3,
|
|
324
|
+
optional as optional7,
|
|
325
|
+
string as string7,
|
|
326
|
+
unknown as unknown7,
|
|
327
|
+
uuid as uuid7
|
|
328
|
+
} from '@forklaunch/validator/typebox';
|
|
329
|
+
var CreatePlanSchema = (
|
|
330
|
+
PlanCadenceEnum,
|
|
331
|
+
CurrencyEnum,
|
|
332
|
+
BillingProviderEnum
|
|
333
|
+
) => ({
|
|
334
|
+
name: string7,
|
|
335
|
+
description: optional7(string7),
|
|
336
|
+
price: number3,
|
|
337
|
+
cadence: enum_5(PlanCadenceEnum),
|
|
338
|
+
currency: enum_5(CurrencyEnum),
|
|
339
|
+
features: optional7(array5(string7)),
|
|
340
|
+
externalId: string7,
|
|
341
|
+
billingProvider: optional7(enum_5(BillingProviderEnum)),
|
|
342
|
+
active: boolean,
|
|
343
|
+
providerFields: optional7(unknown7)
|
|
344
|
+
});
|
|
345
|
+
var UpdatePlanSchema =
|
|
346
|
+
({ uuidId }) =>
|
|
347
|
+
(PlanCadenceEnum, CurrencyEnum, BillingProviderEnum) => ({
|
|
348
|
+
id: uuidId ? uuid7 : string7,
|
|
349
|
+
name: optional7(string7),
|
|
350
|
+
description: optional7(string7),
|
|
351
|
+
price: optional7(number3),
|
|
352
|
+
cadence: optional7(enum_5(PlanCadenceEnum)),
|
|
353
|
+
currency: optional7(enum_5(CurrencyEnum)),
|
|
354
|
+
features: optional7(array5(string7)),
|
|
355
|
+
externalId: optional7(string7),
|
|
356
|
+
billingProvider: optional7(enum_5(BillingProviderEnum)),
|
|
357
|
+
active: optional7(boolean),
|
|
358
|
+
providerFields: optional7(unknown7)
|
|
359
|
+
});
|
|
360
|
+
var PlanSchema =
|
|
361
|
+
({ uuidId }) =>
|
|
362
|
+
(PlanCadenceEnum, CurrencyEnum, BillingProviderEnum) => ({
|
|
363
|
+
id: uuidId ? uuid7 : string7,
|
|
364
|
+
name: string7,
|
|
365
|
+
description: optional7(string7),
|
|
366
|
+
price: number3,
|
|
367
|
+
cadence: enum_5(PlanCadenceEnum),
|
|
368
|
+
currency: enum_5(CurrencyEnum),
|
|
369
|
+
features: optional7(array5(string7)),
|
|
370
|
+
externalId: string7,
|
|
371
|
+
billingProvider: optional7(enum_5(BillingProviderEnum)),
|
|
372
|
+
active: boolean,
|
|
373
|
+
providerFields: optional7(unknown7),
|
|
374
|
+
createdAt: optional7(date7),
|
|
375
|
+
updatedAt: optional7(date7)
|
|
376
|
+
});
|
|
377
|
+
var BasePlanServiceSchemas = (options) => ({
|
|
378
|
+
CreatePlanSchema,
|
|
379
|
+
UpdatePlanSchema: UpdatePlanSchema(options),
|
|
380
|
+
PlanSchema: PlanSchema(options)
|
|
381
|
+
});
|
|
382
|
+
|
|
383
|
+
// domain/schemas/zod/plan.schema.ts
|
|
384
|
+
import {
|
|
385
|
+
array as array6,
|
|
386
|
+
boolean as boolean2,
|
|
387
|
+
date as date8,
|
|
388
|
+
enum_ as enum_6,
|
|
389
|
+
number as number4,
|
|
390
|
+
optional as optional8,
|
|
391
|
+
string as string8,
|
|
392
|
+
unknown as unknown8,
|
|
393
|
+
uuid as uuid8
|
|
394
|
+
} from '@forklaunch/validator/zod';
|
|
395
|
+
var CreatePlanSchema2 = (
|
|
396
|
+
PlanCadenceEnum,
|
|
397
|
+
CurrencyEnum,
|
|
398
|
+
BillingProviderEnum
|
|
399
|
+
) => ({
|
|
400
|
+
name: string8,
|
|
401
|
+
description: optional8(string8),
|
|
402
|
+
price: number4,
|
|
403
|
+
cadence: enum_6(PlanCadenceEnum),
|
|
404
|
+
currency: enum_6(CurrencyEnum),
|
|
405
|
+
features: optional8(array6(string8)),
|
|
406
|
+
externalId: string8,
|
|
407
|
+
billingProvider: optional8(enum_6(BillingProviderEnum)),
|
|
408
|
+
active: boolean2,
|
|
409
|
+
providerFields: optional8(unknown8)
|
|
410
|
+
});
|
|
411
|
+
var UpdatePlanSchema2 =
|
|
412
|
+
({ uuidId }) =>
|
|
413
|
+
(PlanCadenceEnum, CurrencyEnum, BillingProviderEnum) => ({
|
|
414
|
+
id: uuidId ? uuid8 : string8,
|
|
415
|
+
name: optional8(string8),
|
|
416
|
+
description: optional8(string8),
|
|
417
|
+
price: optional8(number4),
|
|
418
|
+
cadence: optional8(enum_6(PlanCadenceEnum)),
|
|
419
|
+
currency: optional8(enum_6(CurrencyEnum)),
|
|
420
|
+
features: optional8(array6(string8)),
|
|
421
|
+
externalId: optional8(string8),
|
|
422
|
+
billingProvider: optional8(enum_6(BillingProviderEnum)),
|
|
423
|
+
active: optional8(boolean2),
|
|
424
|
+
providerFields: optional8(unknown8)
|
|
425
|
+
});
|
|
426
|
+
var PlanSchema2 =
|
|
427
|
+
({ uuidId }) =>
|
|
428
|
+
(PlanCadenceEnum, CurrencyEnum, BillingProviderEnum) => ({
|
|
429
|
+
id: uuidId ? uuid8 : string8,
|
|
430
|
+
name: string8,
|
|
431
|
+
description: optional8(string8),
|
|
432
|
+
price: number4,
|
|
433
|
+
cadence: enum_6(PlanCadenceEnum),
|
|
434
|
+
currency: enum_6(CurrencyEnum),
|
|
435
|
+
features: optional8(array6(string8)),
|
|
436
|
+
externalId: string8,
|
|
437
|
+
billingProvider: optional8(enum_6(BillingProviderEnum)),
|
|
438
|
+
active: boolean2,
|
|
439
|
+
providerFields: optional8(unknown8),
|
|
440
|
+
createdAt: optional8(date8),
|
|
441
|
+
updatedAt: optional8(date8)
|
|
442
|
+
});
|
|
443
|
+
var BasePlanServiceSchemas2 = (options) => ({
|
|
444
|
+
CreatePlanSchema: CreatePlanSchema2,
|
|
445
|
+
UpdatePlanSchema: UpdatePlanSchema2(options),
|
|
446
|
+
PlanSchema: PlanSchema2(options)
|
|
447
|
+
});
|
|
448
|
+
|
|
449
|
+
// domain/schemas/plan.schema.ts
|
|
450
|
+
var BasePlanServiceSchemas3 = serviceSchemaResolver4(
|
|
451
|
+
BasePlanServiceSchemas,
|
|
452
|
+
BasePlanServiceSchemas2
|
|
453
|
+
);
|
|
454
|
+
|
|
455
|
+
// domain/schemas/subscription.schema.ts
|
|
456
|
+
import { serviceSchemaResolver as serviceSchemaResolver5 } from '@forklaunch/internal';
|
|
457
|
+
|
|
458
|
+
// domain/schemas/typebox/subscription.schema.ts
|
|
459
|
+
import {
|
|
460
|
+
boolean as boolean3,
|
|
461
|
+
date as date9,
|
|
462
|
+
enum_ as enum_7,
|
|
463
|
+
optional as optional9,
|
|
464
|
+
string as string9,
|
|
465
|
+
unknown as unknown9,
|
|
466
|
+
uuid as uuid9
|
|
467
|
+
} from '@forklaunch/validator/typebox';
|
|
468
|
+
var CreateSubscriptionSchema = (PartyEnum, BillingProviderEnum) => ({
|
|
469
|
+
partyId: string9,
|
|
470
|
+
partyType: enum_7(PartyEnum),
|
|
471
|
+
productId: string9,
|
|
472
|
+
description: optional9(string9),
|
|
473
|
+
active: boolean3,
|
|
474
|
+
externalId: string9,
|
|
475
|
+
startDate: date9,
|
|
476
|
+
endDate: optional9(date9),
|
|
477
|
+
status: string9,
|
|
478
|
+
billingProvider: optional9(enum_7(BillingProviderEnum)),
|
|
479
|
+
providerFields: optional9(unknown9)
|
|
480
|
+
});
|
|
481
|
+
var UpdateSubscriptionSchema =
|
|
482
|
+
({ uuidId }) =>
|
|
483
|
+
(PartyEnum, BillingProviderEnum) => ({
|
|
484
|
+
id: uuidId ? uuid9 : string9,
|
|
485
|
+
partyId: optional9(string9),
|
|
486
|
+
partyType: optional9(enum_7(PartyEnum)),
|
|
487
|
+
productId: optional9(string9),
|
|
488
|
+
description: optional9(string9),
|
|
489
|
+
active: optional9(boolean3),
|
|
490
|
+
externalId: optional9(string9),
|
|
491
|
+
startDate: optional9(date9),
|
|
492
|
+
endDate: optional9(date9),
|
|
493
|
+
status: optional9(string9),
|
|
494
|
+
billingProvider: optional9(enum_7(BillingProviderEnum)),
|
|
495
|
+
providerFields: optional9(unknown9)
|
|
496
|
+
});
|
|
497
|
+
var SubscriptionSchema =
|
|
498
|
+
({ uuidId }) =>
|
|
499
|
+
(PartyEnum, BillingProviderEnum) => ({
|
|
500
|
+
id: uuidId ? uuid9 : string9,
|
|
501
|
+
partyId: string9,
|
|
502
|
+
partyType: enum_7(PartyEnum),
|
|
503
|
+
productId: string9,
|
|
504
|
+
description: optional9(string9),
|
|
505
|
+
active: boolean3,
|
|
506
|
+
externalId: string9,
|
|
507
|
+
startDate: date9,
|
|
508
|
+
endDate: optional9(date9),
|
|
509
|
+
status: string9,
|
|
510
|
+
billingProvider: optional9(enum_7(BillingProviderEnum)),
|
|
511
|
+
providerFields: optional9(unknown9),
|
|
512
|
+
createdAt: optional9(date9),
|
|
513
|
+
updatedAt: optional9(date9)
|
|
514
|
+
});
|
|
515
|
+
var BaseSubscriptionServiceSchemas = (options) => ({
|
|
516
|
+
CreateSubscriptionSchema,
|
|
517
|
+
UpdateSubscriptionSchema: UpdateSubscriptionSchema(options),
|
|
518
|
+
SubscriptionSchema: SubscriptionSchema(options)
|
|
519
|
+
});
|
|
520
|
+
|
|
521
|
+
// domain/schemas/zod/subscription.schema.ts
|
|
522
|
+
import {
|
|
523
|
+
boolean as boolean4,
|
|
524
|
+
date as date10,
|
|
525
|
+
enum_ as enum_8,
|
|
526
|
+
optional as optional10,
|
|
527
|
+
string as string10,
|
|
528
|
+
unknown as unknown10,
|
|
529
|
+
uuid as uuid10
|
|
530
|
+
} from '@forklaunch/validator/zod';
|
|
531
|
+
var CreateSubscriptionSchema2 = (PartyEnum, BillingProviderEnum) => ({
|
|
532
|
+
partyId: string10,
|
|
533
|
+
partyType: enum_8(PartyEnum),
|
|
534
|
+
productId: string10,
|
|
535
|
+
description: optional10(string10),
|
|
536
|
+
active: boolean4,
|
|
537
|
+
externalId: string10,
|
|
538
|
+
startDate: date10,
|
|
539
|
+
endDate: optional10(date10),
|
|
540
|
+
status: string10,
|
|
541
|
+
billingProvider: optional10(enum_8(BillingProviderEnum)),
|
|
542
|
+
providerFields: optional10(unknown10)
|
|
543
|
+
});
|
|
544
|
+
var UpdateSubscriptionSchema2 =
|
|
545
|
+
({ uuidId }) =>
|
|
546
|
+
(PartyEnum, BillingProviderEnum) => ({
|
|
547
|
+
id: uuidId ? uuid10 : string10,
|
|
548
|
+
partyId: optional10(string10),
|
|
549
|
+
partyType: optional10(enum_8(PartyEnum)),
|
|
550
|
+
productId: optional10(string10),
|
|
551
|
+
description: optional10(string10),
|
|
552
|
+
active: optional10(boolean4),
|
|
553
|
+
externalId: optional10(string10),
|
|
554
|
+
startDate: optional10(date10),
|
|
555
|
+
endDate: optional10(date10),
|
|
556
|
+
status: optional10(string10),
|
|
557
|
+
billingProvider: optional10(enum_8(BillingProviderEnum)),
|
|
558
|
+
providerFields: optional10(unknown10)
|
|
559
|
+
});
|
|
560
|
+
var SubscriptionSchema2 =
|
|
561
|
+
({ uuidId }) =>
|
|
562
|
+
(PartyEnum, BillingProviderEnum) => ({
|
|
563
|
+
id: uuidId ? uuid10 : string10,
|
|
564
|
+
partyId: string10,
|
|
565
|
+
partyType: enum_8(PartyEnum),
|
|
566
|
+
productId: string10,
|
|
567
|
+
description: optional10(string10),
|
|
568
|
+
active: boolean4,
|
|
569
|
+
externalId: string10,
|
|
570
|
+
startDate: date10,
|
|
571
|
+
endDate: optional10(date10),
|
|
572
|
+
status: string10,
|
|
573
|
+
billingProvider: optional10(enum_8(BillingProviderEnum)),
|
|
574
|
+
providerFields: optional10(unknown10),
|
|
575
|
+
createdAt: optional10(date10),
|
|
576
|
+
updatedAt: optional10(date10)
|
|
577
|
+
});
|
|
578
|
+
var BaseSubscriptionServiceSchemas2 = (options) => ({
|
|
579
|
+
CreateSubscriptionSchema: CreateSubscriptionSchema2,
|
|
580
|
+
UpdateSubscriptionSchema: UpdateSubscriptionSchema2(options),
|
|
581
|
+
SubscriptionSchema: SubscriptionSchema2(options)
|
|
582
|
+
});
|
|
583
|
+
|
|
584
|
+
// domain/schemas/subscription.schema.ts
|
|
585
|
+
var BaseSubscriptionServiceSchemas3 = serviceSchemaResolver5(
|
|
586
|
+
BaseSubscriptionServiceSchemas,
|
|
587
|
+
BaseSubscriptionServiceSchemas2
|
|
588
|
+
);
|
|
589
|
+
export {
|
|
590
|
+
BaseBillingPortalServiceSchemas3 as BaseBillingPortalServiceSchemas,
|
|
591
|
+
BaseCheckoutSessionServiceSchemas3 as BaseCheckoutSessionServiceSchemas,
|
|
592
|
+
BasePaymentLinkServiceSchemas3 as BasePaymentLinkServiceSchemas,
|
|
593
|
+
BasePlanServiceSchemas3 as BasePlanServiceSchemas,
|
|
594
|
+
BaseSubscriptionServiceSchemas3 as BaseSubscriptionServiceSchemas
|
|
595
|
+
};
|
|
@@ -16,8 +16,8 @@ import {
|
|
|
16
16
|
} from '@forklaunch/internal';
|
|
17
17
|
import { AnySchemaValidator } from '@forklaunch/validator';
|
|
18
18
|
import { EntityManager } from '@mikro-orm/core';
|
|
19
|
-
import { BaseBillingDtos } from '../types/baseBillingDto.types';
|
|
20
|
-
import { BaseBillingEntities } from '../types/baseBillingEntity.types';
|
|
19
|
+
import { BaseBillingDtos } from '../domain/types/baseBillingDto.types';
|
|
20
|
+
import { BaseBillingEntities } from '../domain/types/baseBillingEntity.types';
|
|
21
21
|
|
|
22
22
|
export class BaseBillingPortalService<
|
|
23
23
|
SchemaValidator extends AnySchemaValidator,
|
|
@@ -15,8 +15,8 @@ import {
|
|
|
15
15
|
} from '@forklaunch/internal';
|
|
16
16
|
import { AnySchemaValidator } from '@forklaunch/validator';
|
|
17
17
|
import { EntityManager } from '@mikro-orm/core';
|
|
18
|
-
import { BaseCheckoutSessionDtos } from '../types/baseBillingDto.types';
|
|
19
|
-
import { BaseCheckoutSessionEntities } from '../types/baseBillingEntity.types';
|
|
18
|
+
import { BaseCheckoutSessionDtos } from '../domain/types/baseBillingDto.types';
|
|
19
|
+
import { BaseCheckoutSessionEntities } from '../domain/types/baseBillingEntity.types';
|
|
20
20
|
|
|
21
21
|
export class BaseCheckoutSessionService<
|
|
22
22
|
SchemaValidator extends AnySchemaValidator,
|
|
@@ -15,8 +15,8 @@ import {
|
|
|
15
15
|
} from '@forklaunch/internal';
|
|
16
16
|
import { AnySchemaValidator } from '@forklaunch/validator';
|
|
17
17
|
import { EntityManager } from '@mikro-orm/core';
|
|
18
|
-
import { BasePaymentLinkDtos } from '../types/baseBillingDto.types';
|
|
19
|
-
import { BasePaymentLinkEntities } from '../types/baseBillingEntity.types';
|
|
18
|
+
import { BasePaymentLinkDtos } from '../domain/types/baseBillingDto.types';
|
|
19
|
+
import { BasePaymentLinkEntities } from '../domain/types/baseBillingEntity.types';
|
|
20
20
|
|
|
21
21
|
export class BasePaymentLinkService<
|
|
22
22
|
SchemaValidator extends AnySchemaValidator,
|
|
@@ -14,8 +14,8 @@ import {
|
|
|
14
14
|
} from '@forklaunch/internal';
|
|
15
15
|
import { AnySchemaValidator } from '@forklaunch/validator';
|
|
16
16
|
import { EntityManager } from '@mikro-orm/core';
|
|
17
|
-
import { BasePlanDtos } from '../types/baseBillingDto.types';
|
|
18
|
-
import { BasePlanEntities } from '../types/baseBillingEntity.types';
|
|
17
|
+
import { BasePlanDtos } from '../domain/types/baseBillingDto.types';
|
|
18
|
+
import { BasePlanEntities } from '../domain/types/baseBillingEntity.types';
|
|
19
19
|
|
|
20
20
|
export class BasePlanService<
|
|
21
21
|
SchemaValidator extends AnySchemaValidator,
|
|
@@ -14,8 +14,8 @@ import {
|
|
|
14
14
|
} from '@forklaunch/internal';
|
|
15
15
|
import { AnySchemaValidator } from '@forklaunch/validator';
|
|
16
16
|
import { EntityManager } from '@mikro-orm/core';
|
|
17
|
-
import { BaseSubscriptionDtos } from '../types/baseBillingDto.types';
|
|
18
|
-
import { BaseSubscriptionEntities } from '../types/baseBillingEntity.types';
|
|
17
|
+
import { BaseSubscriptionDtos } from '../domain/types/baseBillingDto.types';
|
|
18
|
+
import { BaseSubscriptionEntities } from '../domain/types/baseBillingEntity.types';
|
|
19
19
|
|
|
20
20
|
export class BaseSubscriptionService<
|
|
21
21
|
SchemaValidator extends AnySchemaValidator,
|