@forklaunch/implementation-billing-stripe 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/LICENSE +21 -0
  2. package/lib/domain/index.d.mts +189 -0
  3. package/lib/domain/index.d.ts +189 -0
  4. package/lib/domain/index.js +231 -0
  5. package/lib/domain/index.mjs +201 -0
  6. package/lib/eject/domain/schemas/billingPortal.schema.ts +37 -0
  7. package/lib/eject/domain/schemas/checkoutSession.schema.ts +74 -0
  8. package/lib/eject/domain/schemas/index.ts +5 -0
  9. package/lib/eject/domain/schemas/paymentLink.schema.ts +62 -0
  10. package/lib/eject/domain/schemas/plan.schema.ts +68 -0
  11. package/lib/eject/domain/schemas/subscription.schema.ts +78 -0
  12. package/lib/eject/services/billingPortal.service.ts +185 -0
  13. package/lib/eject/services/checkoutSession.service.ts +179 -0
  14. package/lib/eject/services/index.ts +6 -0
  15. package/lib/eject/services/paymentLink.service.ts +239 -0
  16. package/lib/eject/services/plan.service.ts +219 -0
  17. package/lib/eject/services/subscription.service.ts +285 -0
  18. package/lib/eject/services/webhook.service.ts +272 -0
  19. package/lib/eject/types/index.ts +2 -0
  20. package/lib/eject/types/stripe.dto.types.ts +214 -0
  21. package/lib/eject/types/stripe.entity.types.ts +83 -0
  22. package/lib/schemas/index.d.mts +376 -0
  23. package/lib/schemas/index.d.ts +376 -0
  24. package/lib/schemas/index.js +704 -0
  25. package/lib/schemas/index.mjs +737 -0
  26. package/lib/services/index.d.mts +223 -0
  27. package/lib/services/index.d.ts +223 -0
  28. package/lib/services/index.js +788 -0
  29. package/lib/services/index.mjs +776 -0
  30. package/lib/types/index.d.mts +121 -0
  31. package/lib/types/index.d.ts +121 -0
  32. package/lib/types/index.js +18 -0
  33. package/lib/types/index.mjs +0 -0
  34. package/package.json +74 -0
@@ -0,0 +1,737 @@
1
+ // schemas/billingPortal.schema.ts
2
+ import { serviceSchemaResolver } from "@forklaunch/internal";
3
+
4
+ // schemas/typebox/billingPortal.schema.ts
5
+ import { date, optional, string, type } from "@forklaunch/validator/typebox";
6
+ var CreateBillingPortalSchema = {
7
+ id: optional(string),
8
+ customerId: string,
9
+ uri: optional(string),
10
+ expiresAt: date,
11
+ stripeFields: type()
12
+ };
13
+ var UpdateBillingPortalSchema = {
14
+ id: string,
15
+ uri: optional(string),
16
+ expiresAt: optional(date),
17
+ stripeFields: optional(type())
18
+ };
19
+ var BillingPortalSchema = {
20
+ id: string,
21
+ customerId: string,
22
+ uri: optional(string),
23
+ expiresAt: date,
24
+ stripeFields: type(),
25
+ createdAt: optional(date),
26
+ updatedAt: optional(date)
27
+ };
28
+ var StripeBillingPortalServiceSchemas = {
29
+ CreateBillingPortalSchema,
30
+ UpdateBillingPortalSchema,
31
+ BillingPortalSchema
32
+ };
33
+
34
+ // schemas/zod/billingPortal.schema.ts
35
+ import { date as date2, optional as optional2, string as string2, type as type2 } from "@forklaunch/validator/zod";
36
+ var CreateBillingPortalSchema2 = {
37
+ id: optional2(string2),
38
+ customerId: string2,
39
+ uri: optional2(string2),
40
+ expiresAt: date2,
41
+ stripeFields: type2()
42
+ };
43
+ var UpdateBillingPortalSchema2 = {
44
+ id: string2,
45
+ uri: optional2(string2),
46
+ expiresAt: optional2(date2),
47
+ stripeFields: optional2(type2())
48
+ };
49
+ var BillingPortalSchema2 = {
50
+ id: string2,
51
+ customerId: string2,
52
+ uri: optional2(string2),
53
+ expiresAt: date2,
54
+ stripeFields: type2(),
55
+ createdAt: optional2(date2),
56
+ updatedAt: optional2(date2)
57
+ };
58
+ var StripeBillingPortalServiceSchemas2 = {
59
+ CreateBillingPortalSchema: CreateBillingPortalSchema2,
60
+ UpdateBillingPortalSchema: UpdateBillingPortalSchema2,
61
+ BillingPortalSchema: BillingPortalSchema2
62
+ };
63
+
64
+ // schemas/billingPortal.schema.ts
65
+ var StripeBillingPortalServiceSchemas3 = serviceSchemaResolver(
66
+ () => StripeBillingPortalServiceSchemas,
67
+ () => StripeBillingPortalServiceSchemas2
68
+ );
69
+
70
+ // schemas/checkoutSession.schema.ts
71
+ import { serviceSchemaResolver as serviceSchemaResolver2 } from "@forklaunch/internal";
72
+
73
+ // schemas/typebox/checkoutSession.schema.ts
74
+ import {
75
+ array,
76
+ date as date3,
77
+ enum_,
78
+ optional as optional3,
79
+ string as string3,
80
+ type as type3,
81
+ unknown
82
+ } from "@forklaunch/validator/typebox";
83
+
84
+ // domain/enums/currency.enum.ts
85
+ var CurrencyEnum = /* @__PURE__ */ ((CurrencyEnum2) => {
86
+ CurrencyEnum2["USD"] = "USD";
87
+ CurrencyEnum2["AED"] = "AED";
88
+ CurrencyEnum2["AFN"] = "AFN";
89
+ CurrencyEnum2["ALL"] = "ALL";
90
+ CurrencyEnum2["AMD"] = "AMD";
91
+ CurrencyEnum2["ANG"] = "ANG";
92
+ CurrencyEnum2["AOA"] = "AOA";
93
+ CurrencyEnum2["ARS"] = "ARS";
94
+ CurrencyEnum2["AUD"] = "AUD";
95
+ CurrencyEnum2["AWG"] = "AWG";
96
+ CurrencyEnum2["AZN"] = "AZN";
97
+ CurrencyEnum2["BAM"] = "BAM";
98
+ CurrencyEnum2["BBD"] = "BBD";
99
+ CurrencyEnum2["BDT"] = "BDT";
100
+ CurrencyEnum2["BGN"] = "BGN";
101
+ CurrencyEnum2["BIF"] = "BIF";
102
+ CurrencyEnum2["BMD"] = "BMD";
103
+ CurrencyEnum2["BND"] = "BND";
104
+ CurrencyEnum2["BOB"] = "BOB";
105
+ CurrencyEnum2["BRL"] = "BRL";
106
+ CurrencyEnum2["BSD"] = "BSD";
107
+ CurrencyEnum2["BWP"] = "BWP";
108
+ CurrencyEnum2["BYN"] = "BYN";
109
+ CurrencyEnum2["BZD"] = "BZD";
110
+ CurrencyEnum2["CAD"] = "CAD";
111
+ CurrencyEnum2["CDF"] = "CDF";
112
+ CurrencyEnum2["CHF"] = "CHF";
113
+ CurrencyEnum2["CLP"] = "CLP";
114
+ CurrencyEnum2["CNY"] = "CNY";
115
+ CurrencyEnum2["COP"] = "COP";
116
+ CurrencyEnum2["CRC"] = "CRC";
117
+ CurrencyEnum2["CVE"] = "CVE";
118
+ CurrencyEnum2["CZK"] = "CZK";
119
+ CurrencyEnum2["DJF"] = "DJF";
120
+ CurrencyEnum2["DKK"] = "DKK";
121
+ CurrencyEnum2["DOP"] = "DOP";
122
+ CurrencyEnum2["DZD"] = "DZD";
123
+ CurrencyEnum2["EGP"] = "EGP";
124
+ CurrencyEnum2["ETB"] = "ETB";
125
+ CurrencyEnum2["EUR"] = "EUR";
126
+ CurrencyEnum2["FJD"] = "FJD";
127
+ CurrencyEnum2["FKP"] = "FKP";
128
+ CurrencyEnum2["GBP"] = "GBP";
129
+ CurrencyEnum2["GEL"] = "GEL";
130
+ CurrencyEnum2["GIP"] = "GIP";
131
+ CurrencyEnum2["GMD"] = "GMD";
132
+ CurrencyEnum2["GNF"] = "GNF";
133
+ CurrencyEnum2["GTQ"] = "GTQ";
134
+ CurrencyEnum2["GYD"] = "GYD";
135
+ CurrencyEnum2["HKD"] = "HKD";
136
+ CurrencyEnum2["HNL"] = "HNL";
137
+ CurrencyEnum2["HTG"] = "HTG";
138
+ CurrencyEnum2["HUF"] = "HUF";
139
+ CurrencyEnum2["IDR"] = "IDR";
140
+ CurrencyEnum2["ILS"] = "ILS";
141
+ CurrencyEnum2["INR"] = "INR";
142
+ CurrencyEnum2["ISK"] = "ISK";
143
+ CurrencyEnum2["JMD"] = "JMD";
144
+ CurrencyEnum2["JPY"] = "JPY";
145
+ CurrencyEnum2["KES"] = "KES";
146
+ CurrencyEnum2["KGS"] = "KGS";
147
+ CurrencyEnum2["KHR"] = "KHR";
148
+ CurrencyEnum2["KMF"] = "KMF";
149
+ CurrencyEnum2["KRW"] = "KRW";
150
+ CurrencyEnum2["KYD"] = "KYD";
151
+ CurrencyEnum2["KZT"] = "KZT";
152
+ CurrencyEnum2["LAK"] = "LAK";
153
+ CurrencyEnum2["LBP"] = "LBP";
154
+ CurrencyEnum2["LKR"] = "LKR";
155
+ CurrencyEnum2["LRD"] = "LRD";
156
+ CurrencyEnum2["LSL"] = "LSL";
157
+ CurrencyEnum2["MAD"] = "MAD";
158
+ CurrencyEnum2["MDL"] = "MDL";
159
+ CurrencyEnum2["MGA"] = "MGA";
160
+ CurrencyEnum2["MKD"] = "MKD";
161
+ CurrencyEnum2["MMK"] = "MMK";
162
+ CurrencyEnum2["MNT"] = "MNT";
163
+ CurrencyEnum2["MOP"] = "MOP";
164
+ CurrencyEnum2["MUR"] = "MUR";
165
+ CurrencyEnum2["MVR"] = "MVR";
166
+ CurrencyEnum2["MWK"] = "MWK";
167
+ CurrencyEnum2["MXN"] = "MXN";
168
+ CurrencyEnum2["MYR"] = "MYR";
169
+ CurrencyEnum2["MZN"] = "MZN";
170
+ CurrencyEnum2["NAD"] = "NAD";
171
+ CurrencyEnum2["NGN"] = "NGN";
172
+ CurrencyEnum2["NIO"] = "NIO";
173
+ CurrencyEnum2["NOK"] = "NOK";
174
+ CurrencyEnum2["NPR"] = "NPR";
175
+ CurrencyEnum2["NZD"] = "NZD";
176
+ CurrencyEnum2["PAB"] = "PAB";
177
+ CurrencyEnum2["PEN"] = "PEN";
178
+ CurrencyEnum2["PGK"] = "PGK";
179
+ CurrencyEnum2["PHP"] = "PHP";
180
+ CurrencyEnum2["PKR"] = "PKR";
181
+ CurrencyEnum2["PLN"] = "PLN";
182
+ CurrencyEnum2["PYG"] = "PYG";
183
+ CurrencyEnum2["QAR"] = "QAR";
184
+ CurrencyEnum2["RON"] = "RON";
185
+ CurrencyEnum2["RSD"] = "RSD";
186
+ CurrencyEnum2["RUB"] = "RUB";
187
+ CurrencyEnum2["RWF"] = "RWF";
188
+ CurrencyEnum2["SAR"] = "SAR";
189
+ CurrencyEnum2["SBD"] = "SBD";
190
+ CurrencyEnum2["SCR"] = "SCR";
191
+ CurrencyEnum2["SEK"] = "SEK";
192
+ CurrencyEnum2["SGD"] = "SGD";
193
+ CurrencyEnum2["SHP"] = "SHP";
194
+ CurrencyEnum2["SLE"] = "SLE";
195
+ CurrencyEnum2["SOS"] = "SOS";
196
+ CurrencyEnum2["SRD"] = "SRD";
197
+ CurrencyEnum2["STD"] = "STD";
198
+ CurrencyEnum2["SZL"] = "SZL";
199
+ CurrencyEnum2["THB"] = "THB";
200
+ CurrencyEnum2["TJS"] = "TJS";
201
+ CurrencyEnum2["TOP"] = "TOP";
202
+ CurrencyEnum2["TRY"] = "TRY";
203
+ CurrencyEnum2["TTD"] = "TTD";
204
+ CurrencyEnum2["TWD"] = "TWD";
205
+ CurrencyEnum2["TZS"] = "TZS";
206
+ CurrencyEnum2["UAH"] = "UAH";
207
+ CurrencyEnum2["UGX"] = "UGX";
208
+ CurrencyEnum2["UYU"] = "UYU";
209
+ CurrencyEnum2["UZS"] = "UZS";
210
+ CurrencyEnum2["VND"] = "VND";
211
+ CurrencyEnum2["VUV"] = "VUV";
212
+ CurrencyEnum2["WST"] = "WST";
213
+ CurrencyEnum2["XAF"] = "XAF";
214
+ CurrencyEnum2["XCD"] = "XCD";
215
+ CurrencyEnum2["XCG"] = "XCG";
216
+ CurrencyEnum2["XOF"] = "XOF";
217
+ CurrencyEnum2["XPF"] = "XPF";
218
+ CurrencyEnum2["YER"] = "YER";
219
+ CurrencyEnum2["ZAR"] = "ZAR";
220
+ CurrencyEnum2["ZMW"] = "ZMW";
221
+ return CurrencyEnum2;
222
+ })(CurrencyEnum || {});
223
+
224
+ // domain/enums/paymentMethod.enum.ts
225
+ var PaymentMethodEnum = /* @__PURE__ */ ((PaymentMethodEnum2) => {
226
+ PaymentMethodEnum2["AFFIRM"] = "affirm";
227
+ PaymentMethodEnum2["AFTERPAY_CLEARPAY"] = "afterpay_clearpay";
228
+ PaymentMethodEnum2["ALIPAY"] = "alipay";
229
+ PaymentMethodEnum2["ALMA"] = "alma";
230
+ PaymentMethodEnum2["AU_BECS_DEBIT"] = "au_becs_debit";
231
+ PaymentMethodEnum2["BACS_DEBIT"] = "bacs_debit";
232
+ PaymentMethodEnum2["BANCONTACT"] = "bancontact";
233
+ PaymentMethodEnum2["BILLIE"] = "billie";
234
+ PaymentMethodEnum2["BLIK"] = "blik";
235
+ PaymentMethodEnum2["BOLETO"] = "boleto";
236
+ PaymentMethodEnum2["CARD"] = "card";
237
+ PaymentMethodEnum2["CASHAPP"] = "cashapp";
238
+ PaymentMethodEnum2["EPS"] = "eps";
239
+ PaymentMethodEnum2["FPX"] = "fpx";
240
+ PaymentMethodEnum2["GIROPAY"] = "giropay";
241
+ PaymentMethodEnum2["GRABPAY"] = "grabpay";
242
+ PaymentMethodEnum2["IDEAL"] = "ideal";
243
+ PaymentMethodEnum2["KLARNA"] = "klarna";
244
+ PaymentMethodEnum2["KONBINI"] = "konbini";
245
+ PaymentMethodEnum2["LINK"] = "link";
246
+ PaymentMethodEnum2["MOBILEPAY"] = "mobilepay";
247
+ PaymentMethodEnum2["MULTIBANCO"] = "multibanco";
248
+ PaymentMethodEnum2["OXXO"] = "oxxo";
249
+ PaymentMethodEnum2["P24"] = "p24";
250
+ PaymentMethodEnum2["PAY_BY_BANK"] = "pay_by_bank";
251
+ PaymentMethodEnum2["PAYNOW"] = "paynow";
252
+ PaymentMethodEnum2["PAYPAL"] = "paypal";
253
+ PaymentMethodEnum2["PIX"] = "pix";
254
+ PaymentMethodEnum2["PROMPTPAY"] = "promptpay";
255
+ PaymentMethodEnum2["SATISPAY"] = "satispay";
256
+ PaymentMethodEnum2["SEPA_DEBIT"] = "sepa_debit";
257
+ PaymentMethodEnum2["SOFORT"] = "sofort";
258
+ PaymentMethodEnum2["SWISH"] = "swish";
259
+ PaymentMethodEnum2["TWINT"] = "twint";
260
+ PaymentMethodEnum2["US_BANK_ACCOUNT"] = "us_bank_account";
261
+ PaymentMethodEnum2["WECHAT_PAY"] = "wechat_pay";
262
+ PaymentMethodEnum2["ZIP"] = "zip";
263
+ return PaymentMethodEnum2;
264
+ })(PaymentMethodEnum || {});
265
+
266
+ // schemas/typebox/checkoutSession.schema.ts
267
+ var CreateCheckoutSessionSchema = (StatusEnum) => ({
268
+ id: optional3(string3),
269
+ customerId: string3,
270
+ currency: enum_(CurrencyEnum),
271
+ paymentMethods: array(enum_(PaymentMethodEnum)),
272
+ successRedirectUri: optional3(string3),
273
+ cancelRedirectUri: optional3(string3),
274
+ expiresAt: date3,
275
+ status: enum_(StatusEnum),
276
+ stripeFields: type3()
277
+ });
278
+ var UpdateCheckoutSessionSchema = (StatusEnum) => ({
279
+ id: string3,
280
+ customerId: optional3(string3),
281
+ currency: optional3(enum_(CurrencyEnum)),
282
+ paymentMethods: optional3(array(enum_(PaymentMethodEnum))),
283
+ successRedirectUri: optional3(string3),
284
+ cancelRedirectUri: optional3(string3),
285
+ expiresAt: optional3(date3),
286
+ status: optional3(enum_(StatusEnum)),
287
+ stripeFields: optional3(
288
+ type3()
289
+ )
290
+ });
291
+ var CheckoutSessionSchema = (StatusEnum) => ({
292
+ id: string3,
293
+ customerId: string3,
294
+ metadata: optional3(unknown),
295
+ currency: enum_(CurrencyEnum),
296
+ paymentMethods: array(enum_(PaymentMethodEnum)),
297
+ successRedirectUri: optional3(string3),
298
+ cancelRedirectUri: optional3(string3),
299
+ expiresAt: date3,
300
+ status: enum_(StatusEnum),
301
+ stripeFields: type3(),
302
+ createdAt: optional3(date3),
303
+ updatedAt: optional3(date3)
304
+ });
305
+ var StripeCheckoutSessionServiceSchemas = {
306
+ CreateCheckoutSessionSchema,
307
+ UpdateCheckoutSessionSchema,
308
+ CheckoutSessionSchema
309
+ };
310
+
311
+ // schemas/zod/checkoutSession.schema.ts
312
+ import {
313
+ array as array2,
314
+ date as date4,
315
+ enum_ as enum_2,
316
+ optional as optional4,
317
+ string as string4,
318
+ type as type4,
319
+ unknown as unknown2
320
+ } from "@forklaunch/validator/zod";
321
+ var CreateCheckoutSessionSchema2 = (StatusEnum) => ({
322
+ id: optional4(string4),
323
+ customerId: string4,
324
+ currency: enum_2(CurrencyEnum),
325
+ paymentMethods: array2(enum_2(PaymentMethodEnum)),
326
+ successRedirectUri: optional4(string4),
327
+ cancelRedirectUri: optional4(string4),
328
+ expiresAt: date4,
329
+ status: enum_2(StatusEnum),
330
+ stripeFields: type4()
331
+ });
332
+ var UpdateCheckoutSessionSchema2 = (StatusEnum) => ({
333
+ id: string4,
334
+ customerId: optional4(string4),
335
+ currency: optional4(enum_2(CurrencyEnum)),
336
+ paymentMethods: optional4(array2(enum_2(PaymentMethodEnum))),
337
+ successRedirectUri: optional4(string4),
338
+ cancelRedirectUri: optional4(string4),
339
+ expiresAt: optional4(date4),
340
+ status: optional4(enum_2(StatusEnum)),
341
+ stripeFields: optional4(
342
+ type4()
343
+ )
344
+ });
345
+ var CheckoutSessionSchema2 = (StatusEnum) => ({
346
+ id: string4,
347
+ customerId: string4,
348
+ currency: enum_2(CurrencyEnum),
349
+ metadata: optional4(unknown2),
350
+ paymentMethods: array2(enum_2(PaymentMethodEnum)),
351
+ successRedirectUri: optional4(string4),
352
+ cancelRedirectUri: optional4(string4),
353
+ expiresAt: date4,
354
+ status: enum_2(StatusEnum),
355
+ stripeFields: type4(),
356
+ createdAt: optional4(date4),
357
+ updatedAt: optional4(date4)
358
+ });
359
+ var StripeCheckoutSessionServiceSchemas2 = {
360
+ CreateCheckoutSessionSchema: CreateCheckoutSessionSchema2,
361
+ UpdateCheckoutSessionSchema: UpdateCheckoutSessionSchema2,
362
+ CheckoutSessionSchema: CheckoutSessionSchema2
363
+ };
364
+
365
+ // schemas/checkoutSession.schema.ts
366
+ var StripeCheckoutSessionServiceSchemas3 = serviceSchemaResolver2(
367
+ () => StripeCheckoutSessionServiceSchemas,
368
+ () => StripeCheckoutSessionServiceSchemas2
369
+ );
370
+
371
+ // schemas/paymentLink.schema.ts
372
+ import { serviceSchemaResolver as serviceSchemaResolver3 } from "@forklaunch/internal";
373
+
374
+ // schemas/typebox/paymentLink.schema.ts
375
+ import {
376
+ array as array3,
377
+ date as date5,
378
+ enum_ as enum_3,
379
+ number,
380
+ optional as optional5,
381
+ string as string5,
382
+ type as type5
383
+ } from "@forklaunch/validator/typebox";
384
+ var CreatePaymentLinkSchema = (StatusEnum) => ({
385
+ id: optional5(string5),
386
+ amount: number,
387
+ currency: enum_3(CurrencyEnum),
388
+ paymentMethods: array3(enum_3(PaymentMethodEnum)),
389
+ status: enum_3(StatusEnum),
390
+ stripeFields: type5()
391
+ });
392
+ var UpdatePaymentLinkSchema = (StatusEnum) => ({
393
+ id: string5,
394
+ amount: optional5(number),
395
+ currency: optional5(enum_3(CurrencyEnum)),
396
+ paymentMethods: optional5(array3(enum_3(PaymentMethodEnum))),
397
+ status: optional5(enum_3(StatusEnum)),
398
+ stripeFields: optional5(type5())
399
+ });
400
+ var PaymentLinkSchema = (StatusEnum) => ({
401
+ id: string5,
402
+ amount: number,
403
+ currency: enum_3(CurrencyEnum),
404
+ paymentMethods: array3(enum_3(PaymentMethodEnum)),
405
+ status: enum_3(StatusEnum),
406
+ stripeFields: type5(),
407
+ createdAt: optional5(date5),
408
+ updatedAt: optional5(date5)
409
+ });
410
+ var StripePaymentLinkServiceSchemas = {
411
+ CreatePaymentLinkSchema,
412
+ UpdatePaymentLinkSchema,
413
+ PaymentLinkSchema
414
+ };
415
+
416
+ // schemas/zod/paymentLink.schema.ts
417
+ import {
418
+ array as array4,
419
+ date as date6,
420
+ enum_ as enum_4,
421
+ number as number2,
422
+ optional as optional6,
423
+ string as string6,
424
+ type as type6
425
+ } from "@forklaunch/validator/zod";
426
+ var CreatePaymentLinkSchema2 = (StatusEnum) => ({
427
+ id: optional6(string6),
428
+ amount: number2,
429
+ currency: enum_4(CurrencyEnum),
430
+ paymentMethods: array4(enum_4(PaymentMethodEnum)),
431
+ status: enum_4(StatusEnum),
432
+ stripeFields: type6()
433
+ });
434
+ var UpdatePaymentLinkSchema2 = (StatusEnum) => ({
435
+ id: string6,
436
+ amount: optional6(number2),
437
+ currency: optional6(enum_4(CurrencyEnum)),
438
+ paymentMethods: optional6(array4(enum_4(PaymentMethodEnum))),
439
+ status: optional6(enum_4(StatusEnum)),
440
+ stripeFields: optional6(type6())
441
+ });
442
+ var PaymentLinkSchema2 = (StatusEnum) => ({
443
+ id: string6,
444
+ amount: number2,
445
+ currency: enum_4(CurrencyEnum),
446
+ paymentMethods: array4(enum_4(PaymentMethodEnum)),
447
+ status: enum_4(StatusEnum),
448
+ stripeFields: type6(),
449
+ createdAt: optional6(date6),
450
+ updatedAt: optional6(date6)
451
+ });
452
+ var StripePaymentLinkServiceSchemas2 = {
453
+ CreatePaymentLinkSchema: CreatePaymentLinkSchema2,
454
+ UpdatePaymentLinkSchema: UpdatePaymentLinkSchema2,
455
+ PaymentLinkSchema: PaymentLinkSchema2
456
+ };
457
+
458
+ // schemas/paymentLink.schema.ts
459
+ var StripePaymentLinkServiceSchemas3 = serviceSchemaResolver3(
460
+ () => StripePaymentLinkServiceSchemas,
461
+ () => StripePaymentLinkServiceSchemas2
462
+ );
463
+
464
+ // schemas/plan.schema.ts
465
+ import { serviceSchemaResolver as serviceSchemaResolver4 } from "@forklaunch/internal";
466
+
467
+ // schemas/typebox/plan.schema.ts
468
+ import {
469
+ array as array5,
470
+ boolean,
471
+ date as date7,
472
+ enum_ as enum_5,
473
+ number as number3,
474
+ optional as optional7,
475
+ string as string7,
476
+ type as type7
477
+ } from "@forklaunch/validator/typebox";
478
+
479
+ // domain/enums/billingProvider.enum.ts
480
+ var BillingProviderEnum = /* @__PURE__ */ ((BillingProviderEnum2) => {
481
+ BillingProviderEnum2["STRIPE"] = "stripe";
482
+ return BillingProviderEnum2;
483
+ })(BillingProviderEnum || {});
484
+
485
+ // domain/enums/planCadence.enum.ts
486
+ var PlanCadenceEnum = /* @__PURE__ */ ((PlanCadenceEnum2) => {
487
+ PlanCadenceEnum2["WEEKLY"] = "week";
488
+ PlanCadenceEnum2["MONTHLY"] = "month";
489
+ PlanCadenceEnum2["ANNUALLY"] = "year";
490
+ return PlanCadenceEnum2;
491
+ })(PlanCadenceEnum || {});
492
+
493
+ // schemas/typebox/plan.schema.ts
494
+ var CreatePlanSchema = {
495
+ id: optional7(string7),
496
+ name: string7,
497
+ description: optional7(string7),
498
+ price: number3,
499
+ cadence: enum_5(PlanCadenceEnum),
500
+ currency: enum_5(CurrencyEnum),
501
+ features: optional7(array5(string7)),
502
+ stripeFields: type7(),
503
+ externalId: string7,
504
+ billingProvider: optional7(enum_5(BillingProviderEnum)),
505
+ active: boolean
506
+ };
507
+ var UpdatePlanSchema = {
508
+ id: string7,
509
+ name: optional7(string7),
510
+ description: optional7(string7),
511
+ price: optional7(number3),
512
+ cadence: optional7(enum_5(PlanCadenceEnum)),
513
+ currency: optional7(enum_5(CurrencyEnum)),
514
+ features: optional7(array5(string7)),
515
+ stripeFields: optional7(type7()),
516
+ externalId: optional7(string7),
517
+ billingProvider: optional7(enum_5(BillingProviderEnum)),
518
+ active: optional7(boolean)
519
+ };
520
+ var PlanSchema = {
521
+ id: string7,
522
+ name: string7,
523
+ description: optional7(string7),
524
+ price: number3,
525
+ cadence: enum_5(PlanCadenceEnum),
526
+ currency: enum_5(CurrencyEnum),
527
+ features: optional7(array5(string7)),
528
+ stripeFields: type7(),
529
+ externalId: string7,
530
+ billingProvider: optional7(enum_5(BillingProviderEnum)),
531
+ active: boolean,
532
+ createdAt: optional7(date7),
533
+ updatedAt: optional7(date7)
534
+ };
535
+ var StripePlanServiceSchemas = {
536
+ CreatePlanSchema,
537
+ UpdatePlanSchema,
538
+ PlanSchema
539
+ };
540
+
541
+ // schemas/zod/plan.schema.ts
542
+ import {
543
+ array as array6,
544
+ boolean as boolean2,
545
+ date as date8,
546
+ enum_ as enum_6,
547
+ number as number4,
548
+ optional as optional8,
549
+ string as string8,
550
+ type as type8
551
+ } from "@forklaunch/validator/zod";
552
+ var CreatePlanSchema2 = {
553
+ id: optional8(string8),
554
+ name: string8,
555
+ description: optional8(string8),
556
+ price: number4,
557
+ cadence: enum_6(PlanCadenceEnum),
558
+ currency: enum_6(CurrencyEnum),
559
+ features: optional8(array6(string8)),
560
+ stripeFields: type8(),
561
+ externalId: string8,
562
+ billingProvider: optional8(enum_6(BillingProviderEnum)),
563
+ active: boolean2
564
+ };
565
+ var UpdatePlanSchema2 = {
566
+ id: string8,
567
+ name: optional8(string8),
568
+ description: optional8(string8),
569
+ price: optional8(number4),
570
+ cadence: optional8(enum_6(PlanCadenceEnum)),
571
+ currency: optional8(enum_6(CurrencyEnum)),
572
+ features: optional8(array6(string8)),
573
+ stripeFields: optional8(type8()),
574
+ externalId: optional8(string8),
575
+ billingProvider: optional8(enum_6(BillingProviderEnum)),
576
+ active: optional8(boolean2)
577
+ };
578
+ var PlanSchema2 = {
579
+ id: string8,
580
+ name: string8,
581
+ description: optional8(string8),
582
+ price: number4,
583
+ cadence: enum_6(PlanCadenceEnum),
584
+ currency: enum_6(CurrencyEnum),
585
+ features: optional8(array6(string8)),
586
+ stripeFields: type8(),
587
+ externalId: string8,
588
+ billingProvider: optional8(enum_6(BillingProviderEnum)),
589
+ active: boolean2,
590
+ createdAt: optional8(date8),
591
+ updatedAt: optional8(date8)
592
+ };
593
+ var StripePlanServiceSchemas2 = {
594
+ CreatePlanSchema: CreatePlanSchema2,
595
+ UpdatePlanSchema: UpdatePlanSchema2,
596
+ PlanSchema: PlanSchema2
597
+ };
598
+
599
+ // schemas/plan.schema.ts
600
+ var StripePlanServiceSchemas3 = serviceSchemaResolver4(
601
+ () => StripePlanServiceSchemas,
602
+ () => StripePlanServiceSchemas2
603
+ );
604
+
605
+ // schemas/subscription.schema.ts
606
+ import { serviceSchemaResolver as serviceSchemaResolver5 } from "@forklaunch/internal";
607
+
608
+ // schemas/typebox/subscription.schema.ts
609
+ import {
610
+ boolean as boolean3,
611
+ date as date9,
612
+ enum_ as enum_7,
613
+ optional as optional9,
614
+ string as string9,
615
+ type as type9
616
+ } from "@forklaunch/validator/typebox";
617
+ var CreateSubscriptionSchema = (PartyEnum) => ({
618
+ id: optional9(string9),
619
+ partyId: string9,
620
+ partyType: enum_7(PartyEnum),
621
+ productId: string9,
622
+ description: optional9(string9),
623
+ active: boolean3,
624
+ externalId: string9,
625
+ startDate: date9,
626
+ endDate: optional9(date9),
627
+ status: string9,
628
+ billingProvider: optional9(enum_7(BillingProviderEnum)),
629
+ stripeFields: type9()
630
+ });
631
+ var UpdateSubscriptionSchema = (PartyEnum) => ({
632
+ id: string9,
633
+ partyId: optional9(string9),
634
+ partyType: optional9(enum_7(PartyEnum)),
635
+ productId: optional9(string9),
636
+ description: optional9(string9),
637
+ active: optional9(boolean3),
638
+ externalId: optional9(string9),
639
+ startDate: optional9(date9),
640
+ endDate: optional9(date9),
641
+ status: optional9(string9),
642
+ billingProvider: optional9(enum_7(BillingProviderEnum)),
643
+ stripeFields: optional9(type9())
644
+ });
645
+ var SubscriptionSchema = (PartyEnum) => ({
646
+ id: string9,
647
+ partyId: string9,
648
+ partyType: enum_7(PartyEnum),
649
+ productId: string9,
650
+ description: optional9(string9),
651
+ active: boolean3,
652
+ externalId: string9,
653
+ startDate: date9,
654
+ endDate: optional9(date9),
655
+ status: string9,
656
+ billingProvider: optional9(enum_7(BillingProviderEnum)),
657
+ stripeFields: type9(),
658
+ createdAt: optional9(date9),
659
+ updatedAt: optional9(date9)
660
+ });
661
+ var StripeSubscriptionServiceSchemas = {
662
+ CreateSubscriptionSchema,
663
+ UpdateSubscriptionSchema,
664
+ SubscriptionSchema
665
+ };
666
+
667
+ // schemas/zod/subscription.schema.ts
668
+ import {
669
+ boolean as boolean4,
670
+ date as date10,
671
+ enum_ as enum_8,
672
+ optional as optional10,
673
+ string as string10,
674
+ type as type10
675
+ } from "@forklaunch/validator/zod";
676
+ var CreateSubscriptionSchema2 = (PartyEnum) => ({
677
+ id: optional10(string10),
678
+ partyId: string10,
679
+ partyType: enum_8(PartyEnum),
680
+ productId: string10,
681
+ description: optional10(string10),
682
+ active: boolean4,
683
+ externalId: string10,
684
+ startDate: date10,
685
+ endDate: optional10(date10),
686
+ status: string10,
687
+ billingProvider: optional10(enum_8(BillingProviderEnum)),
688
+ stripeFields: type10()
689
+ });
690
+ var UpdateSubscriptionSchema2 = (PartyEnum) => ({
691
+ id: string10,
692
+ partyId: optional10(string10),
693
+ partyType: optional10(enum_8(PartyEnum)),
694
+ productId: optional10(string10),
695
+ description: optional10(string10),
696
+ active: optional10(boolean4),
697
+ externalId: optional10(string10),
698
+ startDate: optional10(date10),
699
+ endDate: optional10(date10),
700
+ status: optional10(string10),
701
+ billingProvider: optional10(enum_8(BillingProviderEnum)),
702
+ stripeFields: optional10(type10())
703
+ });
704
+ var SubscriptionSchema2 = (PartyEnum) => ({
705
+ id: string10,
706
+ partyId: string10,
707
+ partyType: enum_8(PartyEnum),
708
+ productId: string10,
709
+ description: optional10(string10),
710
+ active: boolean4,
711
+ externalId: string10,
712
+ startDate: date10,
713
+ endDate: optional10(date10),
714
+ status: string10,
715
+ billingProvider: optional10(enum_8(BillingProviderEnum)),
716
+ stripeFields: type10(),
717
+ createdAt: optional10(date10),
718
+ updatedAt: optional10(date10)
719
+ });
720
+ var StripeSubscriptionServiceSchemas2 = {
721
+ CreateSubscriptionSchema: CreateSubscriptionSchema2,
722
+ UpdateSubscriptionSchema: UpdateSubscriptionSchema2,
723
+ SubscriptionSchema: SubscriptionSchema2
724
+ };
725
+
726
+ // schemas/subscription.schema.ts
727
+ var StripeSubscriptionServiceSchemas3 = serviceSchemaResolver5(
728
+ () => StripeSubscriptionServiceSchemas,
729
+ () => StripeSubscriptionServiceSchemas2
730
+ );
731
+ export {
732
+ StripeBillingPortalServiceSchemas3 as StripeBillingPortalServiceSchemas,
733
+ StripeCheckoutSessionServiceSchemas3 as StripeCheckoutSessionServiceSchemas,
734
+ StripePaymentLinkServiceSchemas3 as StripePaymentLinkServiceSchemas,
735
+ StripePlanServiceSchemas3 as StripePlanServiceSchemas,
736
+ StripeSubscriptionServiceSchemas3 as StripeSubscriptionServiceSchemas
737
+ };