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