@forklaunch/implementation-billing-base 0.1.11 → 0.1.13

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 (51) hide show
  1. package/lib/__test__/schemaEquality.test.d.ts +1 -1
  2. package/lib/__test__/schemaEquality.test.js +146 -305
  3. package/lib/eject/domain/schemas/billingPortal.schema.ts +7 -1
  4. package/lib/jest.config.d.ts +1 -1
  5. package/lib/jest.config.js +16 -16
  6. package/lib/schemas/billingPortal.schema.d.ts +34 -107
  7. package/lib/schemas/billingPortal.schema.js +1 -4
  8. package/lib/schemas/checkoutSession.schema.d.ts +54 -169
  9. package/lib/schemas/checkoutSession.schema.js +1 -4
  10. package/lib/schemas/index.d.ts +1 -1
  11. package/lib/schemas/paymentLink.schema.d.ts +64 -210
  12. package/lib/schemas/paymentLink.schema.js +1 -4
  13. package/lib/schemas/plan.schema.d.ts +76 -326
  14. package/lib/schemas/plan.schema.js +1 -4
  15. package/lib/schemas/subscription.schema.d.ts +88 -364
  16. package/lib/schemas/subscription.schema.js +1 -4
  17. package/lib/schemas/typebox/billingPortal.schema.d.ts +38 -172
  18. package/lib/schemas/typebox/billingPortal.schema.js +17 -23
  19. package/lib/schemas/typebox/checkoutSession.schema.d.ts +55 -197
  20. package/lib/schemas/typebox/checkoutSession.schema.js +13 -25
  21. package/lib/schemas/typebox/paymentLink.schema.d.ts +65 -275
  22. package/lib/schemas/typebox/paymentLink.schema.js +15 -27
  23. package/lib/schemas/typebox/plan.schema.d.ts +77 -409
  24. package/lib/schemas/typebox/plan.schema.js +17 -31
  25. package/lib/schemas/typebox/subscription.schema.d.ts +89 -481
  26. package/lib/schemas/typebox/subscription.schema.js +19 -31
  27. package/lib/schemas/zod/billingPortal.schema.d.ts +38 -42
  28. package/lib/schemas/zod/billingPortal.schema.js +17 -23
  29. package/lib/schemas/zod/checkoutSession.schema.d.ts +55 -107
  30. package/lib/schemas/zod/checkoutSession.schema.js +13 -25
  31. package/lib/schemas/zod/paymentLink.schema.d.ts +65 -99
  32. package/lib/schemas/zod/paymentLink.schema.js +15 -27
  33. package/lib/schemas/zod/plan.schema.d.ts +77 -177
  34. package/lib/schemas/zod/plan.schema.js +17 -31
  35. package/lib/schemas/zod/subscription.schema.d.ts +89 -181
  36. package/lib/schemas/zod/subscription.schema.js +19 -31
  37. package/lib/services/billingPortal.service.d.ts +28 -77
  38. package/lib/services/billingPortal.service.js +45 -64
  39. package/lib/services/checkoutSession.service.d.ts +29 -77
  40. package/lib/services/checkoutSession.service.js +43 -54
  41. package/lib/services/index.d.ts +1 -1
  42. package/lib/services/paymentLink.service.d.ts +32 -82
  43. package/lib/services/paymentLink.service.js +66 -84
  44. package/lib/services/plan.service.d.ts +26 -73
  45. package/lib/services/plan.service.js +40 -45
  46. package/lib/services/subscription.service.d.ts +44 -136
  47. package/lib/services/subscription.service.js +88 -111
  48. package/lib/tsconfig.tsbuildinfo +1 -1
  49. package/lib/vitest.config.d.ts +2 -2
  50. package/lib/vitest.config.js +4 -4
  51. package/package.json +5 -5
@@ -1,2 +1,2 @@
1
1
  export {};
2
- //# sourceMappingURL=schemaEquality.test.d.ts.map
2
+ //# sourceMappingURL=schemaEquality.test.d.ts.map
@@ -1,255 +1,135 @@
1
1
  import { isTrue } from '@forklaunch/common';
2
2
  import { DummyEnum, testSchemaEquality } from '@forklaunch/core/test';
3
- import {
4
- BillingPortalSchema as TypeboxBillingPortalSchema,
5
- CreateBillingPortalSchema as TypeboxCreateBillingPortalSchema,
6
- UpdateBillingPortalSchema as TypeboxUpdateBillingPortalSchema
7
- } from '../schemas/typebox/billingPortal.schema';
8
- import {
9
- CheckoutSessionSchema as TypeboxCheckoutSessionSchema,
10
- CreateCheckoutSessionSchema as TypeboxCreateCheckoutSessionSchema,
11
- UpdateCheckoutSessionSchema as TypeboxUpdateCheckoutSessionSchema
12
- } from '../schemas/typebox/checkoutSession.schema';
13
- import {
14
- CreatePaymentLinkSchema as TypeboxCreatePaymentLinkSchema,
15
- PaymentLinkSchema as TypeboxPaymentLinkSchema,
16
- UpdatePaymentLinkSchema as TypeboxUpdatePaymentLinkSchema
17
- } from '../schemas/typebox/paymentLink.schema';
18
- import {
19
- CreatePlanSchema as TypeboxCreatePlanSchema,
20
- PlanSchema as TypeboxPlanSchema,
21
- UpdatePlanSchema as TypeboxUpdatePlanSchema
22
- } from '../schemas/typebox/plan.schema';
23
- import {
24
- CreateSubscriptionSchema as TypeboxCreateSubscriptionSchema,
25
- SubscriptionSchema as TypeboxSubscriptionSchema,
26
- UpdateSubscriptionSchema as TypeboxUpdateSubscriptionSchema
27
- } from '../schemas/typebox/subscription.schema';
28
- import {
29
- BillingPortalSchema as ZodBillingPortalSchema,
30
- CreateBillingPortalSchema as ZodCreateBillingPortalSchema,
31
- UpdateBillingPortalSchema as ZodUpdateBillingPortalSchema
32
- } from '../schemas/zod/billingPortal.schema';
33
- import {
34
- CheckoutSessionSchema as ZodCheckoutSessionSchema,
35
- CreateCheckoutSessionSchema as ZodCreateCheckoutSessionSchema,
36
- UpdateCheckoutSessionSchema as ZodUpdateCheckoutSessionSchema
37
- } from '../schemas/zod/checkoutSession.schema';
38
- import {
39
- CreatePaymentLinkSchema as ZodCreatePaymentLinkSchema,
40
- PaymentLinkSchema as ZodPaymentLinkSchema,
41
- UpdatePaymentLinkSchema as ZodUpdatePaymentLinkSchema
42
- } from '../schemas/zod/paymentLink.schema';
43
- import {
44
- CreatePlanSchema as ZodCreatePlanSchema,
45
- PlanSchema as ZodPlanSchema,
46
- UpdatePlanSchema as ZodUpdatePlanSchema
47
- } from '../schemas/zod/plan.schema';
48
- import {
49
- CreateSubscriptionSchema as ZodCreateSubscriptionSchema,
50
- SubscriptionSchema as ZodSubscriptionSchema,
51
- UpdateSubscriptionSchema as ZodUpdateSubscriptionSchema
52
- } from '../schemas/zod/subscription.schema';
3
+ import { BillingPortalSchema as TypeboxBillingPortalSchema, CreateBillingPortalSchema as TypeboxCreateBillingPortalSchema, UpdateBillingPortalSchema as TypeboxUpdateBillingPortalSchema } from '../schemas/typebox/billingPortal.schema';
4
+ import { CheckoutSessionSchema as TypeboxCheckoutSessionSchema, CreateCheckoutSessionSchema as TypeboxCreateCheckoutSessionSchema, UpdateCheckoutSessionSchema as TypeboxUpdateCheckoutSessionSchema } from '../schemas/typebox/checkoutSession.schema';
5
+ import { CreatePaymentLinkSchema as TypeboxCreatePaymentLinkSchema, PaymentLinkSchema as TypeboxPaymentLinkSchema, UpdatePaymentLinkSchema as TypeboxUpdatePaymentLinkSchema } from '../schemas/typebox/paymentLink.schema';
6
+ import { CreatePlanSchema as TypeboxCreatePlanSchema, PlanSchema as TypeboxPlanSchema, UpdatePlanSchema as TypeboxUpdatePlanSchema } from '../schemas/typebox/plan.schema';
7
+ import { CreateSubscriptionSchema as TypeboxCreateSubscriptionSchema, SubscriptionSchema as TypeboxSubscriptionSchema, UpdateSubscriptionSchema as TypeboxUpdateSubscriptionSchema } from '../schemas/typebox/subscription.schema';
8
+ import { BillingPortalSchema as ZodBillingPortalSchema, CreateBillingPortalSchema as ZodCreateBillingPortalSchema, UpdateBillingPortalSchema as ZodUpdateBillingPortalSchema } from '../schemas/zod/billingPortal.schema';
9
+ import { CheckoutSessionSchema as ZodCheckoutSessionSchema, CreateCheckoutSessionSchema as ZodCreateCheckoutSessionSchema, UpdateCheckoutSessionSchema as ZodUpdateCheckoutSessionSchema } from '../schemas/zod/checkoutSession.schema';
10
+ import { CreatePaymentLinkSchema as ZodCreatePaymentLinkSchema, PaymentLinkSchema as ZodPaymentLinkSchema, UpdatePaymentLinkSchema as ZodUpdatePaymentLinkSchema } from '../schemas/zod/paymentLink.schema';
11
+ import { CreatePlanSchema as ZodCreatePlanSchema, PlanSchema as ZodPlanSchema, UpdatePlanSchema as ZodUpdatePlanSchema } from '../schemas/zod/plan.schema';
12
+ import { CreateSubscriptionSchema as ZodCreateSubscriptionSchema, SubscriptionSchema as ZodSubscriptionSchema, UpdateSubscriptionSchema as ZodUpdateSubscriptionSchema } from '../schemas/zod/subscription.schema';
53
13
  const zodUpdateBillingPortalSchema = ZodUpdateBillingPortalSchema({
54
- uuidId: false
14
+ uuidId: false
55
15
  });
56
16
  const typeboxUpdateBillingPortalSchema = TypeboxUpdateBillingPortalSchema({
57
- uuidId: false
17
+ uuidId: false
58
18
  });
59
19
  const zodBillingPortalSchema = ZodBillingPortalSchema({ uuidId: false });
60
20
  const typeboxBillingPortalSchema = TypeboxBillingPortalSchema({
61
- uuidId: false
21
+ uuidId: false
62
22
  });
63
- const zodCreateCheckoutSessionSchema =
64
- ZodCreateCheckoutSessionSchema(DummyEnum);
65
- const typeboxCreateCheckoutSessionSchema =
66
- TypeboxCreateCheckoutSessionSchema(DummyEnum);
23
+ const zodCreateCheckoutSessionSchema = ZodCreateCheckoutSessionSchema(DummyEnum);
24
+ const typeboxCreateCheckoutSessionSchema = TypeboxCreateCheckoutSessionSchema(DummyEnum);
67
25
  const zodUpdateCheckoutSessionSchema = ZodUpdateCheckoutSessionSchema({
68
- uuidId: false
26
+ uuidId: false
69
27
  })(DummyEnum);
70
28
  const typeboxUpdateCheckoutSessionSchema = TypeboxUpdateCheckoutSessionSchema({
71
- uuidId: false
29
+ uuidId: false
72
30
  })(DummyEnum);
73
- const zodCheckoutSessionSchema = ZodCheckoutSessionSchema({ uuidId: true })(
74
- DummyEnum
75
- );
31
+ const zodCheckoutSessionSchema = ZodCheckoutSessionSchema({ uuidId: true })(DummyEnum);
76
32
  const typeboxCheckoutSessionSchema = TypeboxCheckoutSessionSchema({
77
- uuidId: true
33
+ uuidId: true
78
34
  })(DummyEnum);
79
35
  const zodCreatePaymentLinkSchema = ZodCreatePaymentLinkSchema(DummyEnum);
80
- const typeboxCreatePaymentLinkSchema =
81
- TypeboxCreatePaymentLinkSchema(DummyEnum);
36
+ const typeboxCreatePaymentLinkSchema = TypeboxCreatePaymentLinkSchema(DummyEnum);
82
37
  const zodUpdatePaymentLinkSchema = ZodUpdatePaymentLinkSchema({
83
- uuidId: false
38
+ uuidId: false
84
39
  })(DummyEnum);
85
40
  const typeboxUpdatePaymentLinkSchema = TypeboxUpdatePaymentLinkSchema({
86
- uuidId: false
41
+ uuidId: false
87
42
  })(DummyEnum);
88
43
  const zodPaymentLinkSchema = ZodPaymentLinkSchema({ uuidId: true })(DummyEnum);
89
44
  const typeboxPaymentLinkSchema = TypeboxPaymentLinkSchema({
90
- uuidId: false
45
+ uuidId: false
91
46
  })(DummyEnum);
92
47
  const zodCreatePlanSchema = ZodCreatePlanSchema(DummyEnum, DummyEnum);
93
48
  const typeboxCreatePlanSchema = TypeboxCreatePlanSchema(DummyEnum, DummyEnum);
94
- const zodUpdatePlanSchema = ZodUpdatePlanSchema({ uuidId: false })(
95
- DummyEnum,
96
- DummyEnum
97
- );
98
- const typeboxUpdatePlanSchema = TypeboxUpdatePlanSchema({ uuidId: false })(
99
- DummyEnum,
100
- DummyEnum
101
- );
49
+ const zodUpdatePlanSchema = ZodUpdatePlanSchema({ uuidId: false })(DummyEnum, DummyEnum);
50
+ const typeboxUpdatePlanSchema = TypeboxUpdatePlanSchema({ uuidId: false })(DummyEnum, DummyEnum);
102
51
  const zodPlanSchema = ZodPlanSchema({ uuidId: true })(DummyEnum, DummyEnum);
103
- const typeboxPlanSchema = TypeboxPlanSchema({ uuidId: true })(
104
- DummyEnum,
105
- DummyEnum
106
- );
107
- const zodCreateSubscriptionSchema = ZodCreateSubscriptionSchema(
108
- DummyEnum,
109
- DummyEnum
110
- );
111
- const typeboxCreateSubscriptionSchema = TypeboxCreateSubscriptionSchema(
112
- DummyEnum,
113
- DummyEnum
114
- );
52
+ const typeboxPlanSchema = TypeboxPlanSchema({ uuidId: true })(DummyEnum, DummyEnum);
53
+ const zodCreateSubscriptionSchema = ZodCreateSubscriptionSchema(DummyEnum, DummyEnum);
54
+ const typeboxCreateSubscriptionSchema = TypeboxCreateSubscriptionSchema(DummyEnum, DummyEnum);
115
55
  const zodUpdateSubscriptionSchema = ZodUpdateSubscriptionSchema({
116
- uuidId: false
56
+ uuidId: false
117
57
  })(DummyEnum, DummyEnum);
118
58
  const typeboxUpdateSubscriptionSchema = TypeboxUpdateSubscriptionSchema({
119
- uuidId: false
59
+ uuidId: false
120
60
  })(DummyEnum, DummyEnum);
121
- const zodSubscriptionSchema = ZodSubscriptionSchema({ uuidId: true })(
122
- DummyEnum,
123
- DummyEnum
124
- );
61
+ const zodSubscriptionSchema = ZodSubscriptionSchema({ uuidId: true })(DummyEnum, DummyEnum);
125
62
  const typeboxSubscriptionSchema = TypeboxSubscriptionSchema({
126
- uuidId: true
63
+ uuidId: true
127
64
  })(DummyEnum, DummyEnum);
128
65
  describe('schema equality', () => {
129
- it('should be equal for billing portal', () => {
130
- expect(
131
- isTrue(
132
- testSchemaEquality(
133
- ZodCreateBillingPortalSchema,
134
- TypeboxCreateBillingPortalSchema,
135
- {
66
+ it('should be equal for billing portal', () => {
67
+ expect(isTrue(testSchemaEquality(ZodCreateBillingPortalSchema, TypeboxCreateBillingPortalSchema, {
136
68
  customerId: 'test',
137
69
  uri: 'https://example.com',
138
70
  expiresAt: new Date()
139
- }
140
- )
141
- )
142
- ).toBeTruthy();
143
- expect(
144
- isTrue(
145
- testSchemaEquality(
146
- zodUpdateBillingPortalSchema,
147
- typeboxUpdateBillingPortalSchema,
148
- {
71
+ }))).toBeTruthy();
72
+ expect(isTrue(testSchemaEquality(zodUpdateBillingPortalSchema, typeboxUpdateBillingPortalSchema, {
149
73
  id: 'test',
150
74
  uri: 'https://example.com',
151
75
  expiresAt: new Date()
152
- }
153
- )
154
- )
155
- ).toBeTruthy();
156
- expect(
157
- isTrue(
158
- testSchemaEquality(zodBillingPortalSchema, typeboxBillingPortalSchema, {
159
- id: 'test',
160
- customerId: 'test',
161
- uri: 'https://example.com',
162
- expiresAt: new Date(),
163
- extraFields: {
164
- test: 'test'
165
- }
166
- })
167
- )
168
- ).toBeTruthy();
169
- });
170
- it('should be equal for checkout session', () => {
171
- expect(
172
- isTrue(
173
- testSchemaEquality(
174
- zodCreateCheckoutSessionSchema,
175
- typeboxCreateCheckoutSessionSchema,
176
- {
76
+ }))).toBeTruthy();
77
+ expect(isTrue(testSchemaEquality(zodBillingPortalSchema, typeboxBillingPortalSchema, {
78
+ id: 'test',
79
+ customerId: 'test',
80
+ uri: 'https://example.com',
81
+ expiresAt: new Date(),
82
+ extraFields: {
83
+ test: 'test'
84
+ }
85
+ }))).toBeTruthy();
86
+ });
87
+ it('should be equal for checkout session', () => {
88
+ expect(isTrue(testSchemaEquality(zodCreateCheckoutSessionSchema, typeboxCreateCheckoutSessionSchema, {
177
89
  customerId: 'test',
178
90
  paymentMethods: [DummyEnum.A, DummyEnum.B],
179
91
  successRedirectUri: 'https://example.com',
180
92
  cancelRedirectUri: 'https://example.com',
181
93
  extraFields: {
182
- test: 'test'
94
+ test: 'test'
183
95
  }
184
- }
185
- )
186
- )
187
- ).toBeTruthy();
188
- expect(
189
- isTrue(
190
- testSchemaEquality(
191
- zodUpdateCheckoutSessionSchema,
192
- typeboxUpdateCheckoutSessionSchema,
193
- {
96
+ }))).toBeTruthy();
97
+ expect(isTrue(testSchemaEquality(zodUpdateCheckoutSessionSchema, typeboxUpdateCheckoutSessionSchema, {
194
98
  id: 'test',
195
99
  customerId: 'test',
196
100
  paymentMethods: [DummyEnum.A, DummyEnum.B],
197
101
  successRedirectUri: 'https://example.com',
198
102
  cancelRedirectUri: 'https://example.com',
199
103
  extraFields: {
200
- test: 'test'
104
+ test: 'test'
201
105
  }
202
- }
203
- )
204
- )
205
- ).toBeTruthy();
206
- expect(
207
- isTrue(
208
- testSchemaEquality(
209
- zodCheckoutSessionSchema,
210
- typeboxCheckoutSessionSchema,
211
- {
106
+ }))).toBeTruthy();
107
+ expect(isTrue(testSchemaEquality(zodCheckoutSessionSchema, typeboxCheckoutSessionSchema, {
212
108
  id: 'test',
213
109
  customerId: 'test',
214
110
  paymentMethods: [DummyEnum.A, DummyEnum.B],
215
111
  successRedirectUri: 'https://example.com',
216
112
  cancelRedirectUri: 'https://example.com',
217
113
  extraFields: {
218
- test: 'test'
114
+ test: 'test'
219
115
  }
220
- }
221
- )
222
- )
223
- ).toBeTruthy();
224
- });
225
- it('should be equal for payment link', () => {
226
- expect(
227
- isTrue(
228
- testSchemaEquality(
229
- zodCreatePaymentLinkSchema,
230
- typeboxCreatePaymentLinkSchema,
231
- {
116
+ }))).toBeTruthy();
117
+ });
118
+ it('should be equal for payment link', () => {
119
+ expect(isTrue(testSchemaEquality(zodCreatePaymentLinkSchema, typeboxCreatePaymentLinkSchema, {
232
120
  amount: 100,
233
121
  currency: DummyEnum.A,
234
122
  successRedirectUri: 'https://example.com',
235
123
  cancelRedirectUri: 'https://example.com',
236
124
  description: 'test',
237
125
  metadata: {
238
- test: 'test'
126
+ test: 'test'
239
127
  },
240
128
  extraFields: {
241
- test: 'test'
129
+ test: 'test'
242
130
  }
243
- }
244
- )
245
- )
246
- ).toBeTruthy();
247
- expect(
248
- isTrue(
249
- testSchemaEquality(
250
- zodUpdatePaymentLinkSchema,
251
- typeboxUpdatePaymentLinkSchema,
252
- {
131
+ }))).toBeTruthy();
132
+ expect(isTrue(testSchemaEquality(zodUpdatePaymentLinkSchema, typeboxUpdatePaymentLinkSchema, {
253
133
  id: 'test',
254
134
  amount: 100,
255
135
  currency: DummyEnum.A,
@@ -257,93 +137,85 @@ describe('schema equality', () => {
257
137
  cancelRedirectUri: 'https://example.com',
258
138
  description: 'test',
259
139
  metadata: {
260
- test: 'test'
140
+ test: 'test'
261
141
  },
262
142
  extraFields: {
263
- test: 'test'
143
+ test: 'test'
264
144
  }
265
- }
266
- )
267
- )
268
- );
269
- expect(
270
- isTrue(
271
- testSchemaEquality(zodPaymentLinkSchema, typeboxPaymentLinkSchema, {
272
- id: 'test',
273
- amount: 100,
274
- currency: DummyEnum.A,
275
- successRedirectUri: 'https://example.com',
276
- cancelRedirectUri: 'https://example.com',
277
- description: 'test',
278
- metadata: {
279
- test: 'test'
280
- },
281
- extraFields: {
282
- test: 'test'
283
- }
284
- })
285
- )
286
- ).toBeTruthy();
287
- });
288
- it('should be equal for plan', () => {
289
- expect(
290
- isTrue(
291
- testSchemaEquality(zodCreatePlanSchema, typeboxCreatePlanSchema, {
292
- name: 'test',
293
- price: 100,
294
- cadence: DummyEnum.A,
295
- features: [DummyEnum.A, DummyEnum.B],
296
- externalId: 'test',
297
- active: true,
298
- description: 'test',
299
- extraFields: {
300
- test: 'test'
301
- }
302
- })
303
- )
304
- ).toBeTruthy();
305
- expect(
306
- isTrue(
307
- testSchemaEquality(zodUpdatePlanSchema, typeboxUpdatePlanSchema, {
308
- id: 'test',
309
- name: 'test',
310
- price: 100,
311
- cadence: DummyEnum.A,
312
- features: [DummyEnum.A, DummyEnum.B],
313
- externalId: 'test',
314
- active: true,
315
- description: 'test',
316
- extraFields: {
317
- test: 'test'
318
- }
319
- })
320
- )
321
- ).toBeTruthy();
322
- expect(
323
- isTrue(
324
- testSchemaEquality(zodPlanSchema, typeboxPlanSchema, {
325
- id: 'test',
326
- name: 'test',
327
- price: 100,
328
- cadence: DummyEnum.A,
329
- features: [DummyEnum.A, DummyEnum.B],
330
- externalId: 'test',
331
- active: true,
332
- description: 'test',
333
- extraFields: {
334
- test: 'test'
335
- }
336
- })
337
- )
338
- ).toBeTruthy();
339
- });
340
- it('should be equal for subscription', () => {
341
- expect(
342
- isTrue(
343
- testSchemaEquality(
344
- zodCreateSubscriptionSchema,
345
- typeboxCreateSubscriptionSchema,
346
- {
145
+ })));
146
+ expect(isTrue(testSchemaEquality(zodPaymentLinkSchema, typeboxPaymentLinkSchema, {
147
+ id: 'test',
148
+ amount: 100,
149
+ currency: DummyEnum.A,
150
+ successRedirectUri: 'https://example.com',
151
+ cancelRedirectUri: 'https://example.com',
152
+ description: 'test',
153
+ metadata: {
154
+ test: 'test'
155
+ },
156
+ extraFields: {
157
+ test: 'test'
158
+ }
159
+ }))).toBeTruthy();
160
+ });
161
+ it('should be equal for plan', () => {
162
+ expect(isTrue(testSchemaEquality(zodCreatePlanSchema, typeboxCreatePlanSchema, {
163
+ name: 'test',
164
+ price: 100,
165
+ cadence: DummyEnum.A,
166
+ features: [DummyEnum.A, DummyEnum.B],
167
+ externalId: 'test',
168
+ active: true,
169
+ description: 'test',
170
+ extraFields: {
171
+ test: 'test'
172
+ }
173
+ }))).toBeTruthy();
174
+ expect(isTrue(testSchemaEquality(zodUpdatePlanSchema, typeboxUpdatePlanSchema, {
175
+ id: 'test',
176
+ name: 'test',
177
+ price: 100,
178
+ cadence: DummyEnum.A,
179
+ features: [DummyEnum.A, DummyEnum.B],
180
+ externalId: 'test',
181
+ active: true,
182
+ description: 'test',
183
+ extraFields: {
184
+ test: 'test'
185
+ }
186
+ }))).toBeTruthy();
187
+ expect(isTrue(testSchemaEquality(zodPlanSchema, typeboxPlanSchema, {
188
+ id: 'test',
189
+ name: 'test',
190
+ price: 100,
191
+ cadence: DummyEnum.A,
192
+ features: [DummyEnum.A, DummyEnum.B],
193
+ externalId: 'test',
194
+ active: true,
195
+ description: 'test',
196
+ extraFields: {
197
+ test: 'test'
198
+ }
199
+ }))).toBeTruthy();
200
+ });
201
+ it('should be equal for subscription', () => {
202
+ expect(isTrue(testSchemaEquality(zodCreateSubscriptionSchema, typeboxCreateSubscriptionSchema, {
203
+ partyId: 'test',
204
+ partyType: DummyEnum.A,
205
+ productId: 'test',
206
+ status: DummyEnum.A,
207
+ active: true,
208
+ externalId: 'test',
209
+ startDate: new Date(),
210
+ endDate: new Date(),
211
+ description: 'test',
212
+ extraFields: {
213
+ test: 'test'
214
+ },
215
+ billingProvider: DummyEnum.A
216
+ }))).toBeTruthy();
217
+ expect(isTrue(testSchemaEquality(zodUpdateSubscriptionSchema, typeboxUpdateSubscriptionSchema, {
218
+ id: 'test',
347
219
  partyId: 'test',
348
220
  partyType: DummyEnum.A,
349
221
  productId: 'test',
@@ -354,19 +226,11 @@ describe('schema equality', () => {
354
226
  endDate: new Date(),
355
227
  description: 'test',
356
228
  extraFields: {
357
- test: 'test'
229
+ test: 'test'
358
230
  },
359
231
  billingProvider: DummyEnum.A
360
- }
361
- )
362
- )
363
- ).toBeTruthy();
364
- expect(
365
- isTrue(
366
- testSchemaEquality(
367
- zodUpdateSubscriptionSchema,
368
- typeboxUpdateSubscriptionSchema,
369
- {
232
+ }))).toBeTruthy();
233
+ expect(isTrue(testSchemaEquality(zodSubscriptionSchema, typeboxSubscriptionSchema, {
370
234
  id: 'test',
371
235
  partyId: 'test',
372
236
  partyType: DummyEnum.A,
@@ -378,32 +242,9 @@ describe('schema equality', () => {
378
242
  endDate: new Date(),
379
243
  description: 'test',
380
244
  extraFields: {
381
- test: 'test'
245
+ test: 'test'
382
246
  },
383
247
  billingProvider: DummyEnum.A
384
- }
385
- )
386
- )
387
- ).toBeTruthy();
388
- expect(
389
- isTrue(
390
- testSchemaEquality(zodSubscriptionSchema, typeboxSubscriptionSchema, {
391
- id: 'test',
392
- partyId: 'test',
393
- partyType: DummyEnum.A,
394
- productId: 'test',
395
- status: DummyEnum.A,
396
- active: true,
397
- externalId: 'test',
398
- startDate: new Date(),
399
- endDate: new Date(),
400
- description: 'test',
401
- extraFields: {
402
- test: 'test'
403
- },
404
- billingProvider: DummyEnum.A
405
- })
406
- )
407
- ).toBeTruthy();
408
- });
248
+ }))).toBeTruthy();
249
+ });
409
250
  });
@@ -1,4 +1,10 @@
1
- import { date, optional, string, unknown, uuid } from '@{{app_name}}/core';
1
+ import {
2
+ date,
3
+ optional,
4
+ string,
5
+ unknown,
6
+ uuid
7
+ } from '@{{app_name}}/core';
2
8
 
3
9
  export const CreateBillingPortalSchema = {
4
10
  customerId: string,
@@ -1,4 +1,4 @@
1
1
  import type { JestConfigWithTsJest } from 'ts-jest';
2
2
  declare const jestConfig: JestConfigWithTsJest;
3
3
  export default jestConfig;
4
- //# sourceMappingURL=jest.config.d.ts.map
4
+ //# sourceMappingURL=jest.config.d.ts.map
@@ -1,19 +1,19 @@
1
1
  const jestConfig = {
2
- preset: 'ts-jest/presets/default-esm', // or other ESM presets
3
- moduleNameMapper: {
4
- '^(\\.{1,2}/.*)\\.js$': '$1'
5
- },
6
- transform: {
7
- // '^.+\\.[tj]sx?$' to process ts,js,tsx,jsx with `ts-jest`
8
- // '^.+\\.m?[tj]sx?$' to process ts,js,tsx,jsx,mts,mjs,mtsx,mjsx with `ts-jest`
9
- '^.+\\.[tj]sx?$': [
10
- 'ts-jest',
11
- {
12
- useESM: true
13
- }
14
- ],
15
- '^.+\\.js$': 'babel-jest'
16
- },
17
- testPathIgnorePatterns: ['.*dist/', '.*node_modules/']
2
+ preset: 'ts-jest/presets/default-esm', // or other ESM presets
3
+ moduleNameMapper: {
4
+ '^(\\.{1,2}/.*)\\.js$': '$1'
5
+ },
6
+ transform: {
7
+ // '^.+\\.[tj]sx?$' to process ts,js,tsx,jsx with `ts-jest`
8
+ // '^.+\\.m?[tj]sx?$' to process ts,js,tsx,jsx,mts,mjs,mtsx,mjsx with `ts-jest`
9
+ '^.+\\.[tj]sx?$': [
10
+ 'ts-jest',
11
+ {
12
+ useESM: true
13
+ }
14
+ ],
15
+ '^.+\\.js$': 'babel-jest'
16
+ },
17
+ testPathIgnorePatterns: ['.*dist/', '.*node_modules/']
18
18
  };
19
19
  export default jestConfig;