@deepintel-ltd/farmpro-contracts 1.5.16 → 1.5.18
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/dist/routes/auth.routes.d.ts +7 -0
- package/dist/routes/auth.routes.d.ts.map +1 -1
- package/dist/routes/payments.routes.d.ts +4 -4
- package/dist/routes/payments.routes.js +8 -8
- package/dist/routes/subscriptions.routes.d.ts +1387 -514
- package/dist/routes/subscriptions.routes.d.ts.map +1 -1
- package/dist/routes/subscriptions.routes.js +44 -2
- package/dist/schemas/auth.schemas.d.ts +8 -0
- package/dist/schemas/auth.schemas.d.ts.map +1 -1
- package/dist/schemas/auth.schemas.js +1 -0
- package/dist/schemas/payments.schemas.d.ts +65 -48
- package/dist/schemas/payments.schemas.d.ts.map +1 -1
- package/dist/schemas/payments.schemas.js +18 -15
- package/dist/schemas/subscriptions.schemas.d.ts +77 -29
- package/dist/schemas/subscriptions.schemas.d.ts.map +1 -1
- package/dist/schemas/subscriptions.schemas.js +20 -1
- package/package.json +1 -1
|
@@ -4,14 +4,14 @@ import { z } from 'zod';
|
|
|
4
4
|
*/
|
|
5
5
|
export declare const subscriptionTierSchema: z.ZodEnum<["FREE", "STARTER_PACK", "COOPERATIVE", "ENTERPRISE", "GOVERNMENT"]>;
|
|
6
6
|
export declare const subscriptionStatusSchema: z.ZodEnum<["active", "cancelled", "expired", "trial"]>;
|
|
7
|
-
export declare const billingCycleSchema: z.ZodEnum<["monthly", "annual", "
|
|
7
|
+
export declare const billingCycleSchema: z.ZodEnum<["monthly", "annual", "custom"]>;
|
|
8
8
|
export declare const satelliteFrequencySchema: z.ZodEnum<["monthly", "weekly", "daily"]>;
|
|
9
9
|
export declare const subscriptionAttributesSchema: z.ZodObject<{
|
|
10
10
|
tier: z.ZodEnum<["FREE", "STARTER_PACK", "COOPERATIVE", "ENTERPRISE", "GOVERNMENT"]>;
|
|
11
11
|
status: z.ZodEnum<["active", "cancelled", "expired", "trial"]>;
|
|
12
12
|
amount: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
13
13
|
currency: z.ZodEnum<["NGN", "USD"]>;
|
|
14
|
-
billingCycle: z.ZodOptional<z.ZodNullable<z.ZodEnum<["monthly", "annual", "
|
|
14
|
+
billingCycle: z.ZodOptional<z.ZodNullable<z.ZodEnum<["monthly", "annual", "custom"]>>>;
|
|
15
15
|
currentPeriodStart: z.ZodString;
|
|
16
16
|
currentPeriodEnd: z.ZodString;
|
|
17
17
|
cancelledAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
@@ -32,7 +32,7 @@ export declare const subscriptionAttributesSchema: z.ZodObject<{
|
|
|
32
32
|
currentPeriodStart: string;
|
|
33
33
|
currentPeriodEnd: string;
|
|
34
34
|
amount?: number | null | undefined;
|
|
35
|
-
billingCycle?: "custom" | "monthly" | "annual" |
|
|
35
|
+
billingCycle?: "custom" | "monthly" | "annual" | null | undefined;
|
|
36
36
|
cancelledAt?: string | null | undefined;
|
|
37
37
|
paymentGateway?: "other" | "flutterwave" | "paystack" | "stripe" | "paypal" | null | undefined;
|
|
38
38
|
gatewaySubscriptionId?: string | null | undefined;
|
|
@@ -48,7 +48,7 @@ export declare const subscriptionAttributesSchema: z.ZodObject<{
|
|
|
48
48
|
currentPeriodStart: string;
|
|
49
49
|
currentPeriodEnd: string;
|
|
50
50
|
amount?: number | null | undefined;
|
|
51
|
-
billingCycle?: "custom" | "monthly" | "annual" |
|
|
51
|
+
billingCycle?: "custom" | "monthly" | "annual" | null | undefined;
|
|
52
52
|
cancelledAt?: string | null | undefined;
|
|
53
53
|
paymentGateway?: "other" | "flutterwave" | "paystack" | "stripe" | "paypal" | null | undefined;
|
|
54
54
|
gatewaySubscriptionId?: string | null | undefined;
|
|
@@ -60,21 +60,21 @@ export declare const createSubscriptionAttributesSchema: z.ZodObject<{
|
|
|
60
60
|
tier: z.ZodEnum<["FREE", "STARTER_PACK", "COOPERATIVE", "ENTERPRISE", "GOVERNMENT"]>;
|
|
61
61
|
amount: z.ZodOptional<z.ZodNumber>;
|
|
62
62
|
currency: z.ZodDefault<z.ZodEnum<["NGN", "USD"]>>;
|
|
63
|
-
billingCycle: z.ZodOptional<z.ZodEnum<["monthly", "annual", "
|
|
63
|
+
billingCycle: z.ZodOptional<z.ZodEnum<["monthly", "annual", "custom"]>>;
|
|
64
64
|
paymentGateway: z.ZodOptional<z.ZodEnum<["flutterwave", "paystack", "stripe", "paypal", "other"]>>;
|
|
65
65
|
gatewaySubscriptionId: z.ZodOptional<z.ZodString>;
|
|
66
66
|
}, "strip", z.ZodTypeAny, {
|
|
67
67
|
currency: "NGN" | "USD";
|
|
68
68
|
tier: "FREE" | "STARTER_PACK" | "COOPERATIVE" | "ENTERPRISE" | "GOVERNMENT";
|
|
69
69
|
amount?: number | undefined;
|
|
70
|
-
billingCycle?: "custom" | "monthly" | "annual" |
|
|
70
|
+
billingCycle?: "custom" | "monthly" | "annual" | undefined;
|
|
71
71
|
paymentGateway?: "other" | "flutterwave" | "paystack" | "stripe" | "paypal" | undefined;
|
|
72
72
|
gatewaySubscriptionId?: string | undefined;
|
|
73
73
|
}, {
|
|
74
74
|
tier: "FREE" | "STARTER_PACK" | "COOPERATIVE" | "ENTERPRISE" | "GOVERNMENT";
|
|
75
75
|
currency?: "NGN" | "USD" | undefined;
|
|
76
76
|
amount?: number | undefined;
|
|
77
|
-
billingCycle?: "custom" | "monthly" | "annual" |
|
|
77
|
+
billingCycle?: "custom" | "monthly" | "annual" | undefined;
|
|
78
78
|
paymentGateway?: "other" | "flutterwave" | "paystack" | "stripe" | "paypal" | undefined;
|
|
79
79
|
gatewaySubscriptionId?: string | undefined;
|
|
80
80
|
}>;
|
|
@@ -82,24 +82,70 @@ export declare const upgradeSubscriptionAttributesSchema: z.ZodObject<{
|
|
|
82
82
|
tier: z.ZodEnum<["FREE", "STARTER_PACK", "COOPERATIVE", "ENTERPRISE", "GOVERNMENT"]>;
|
|
83
83
|
amount: z.ZodNumber;
|
|
84
84
|
currency: z.ZodDefault<z.ZodEnum<["NGN", "USD"]>>;
|
|
85
|
-
billingCycle: z.ZodEnum<["monthly", "annual", "
|
|
85
|
+
billingCycle: z.ZodEnum<["monthly", "annual", "custom"]>;
|
|
86
86
|
paymentGateway: z.ZodOptional<z.ZodEnum<["flutterwave", "paystack", "stripe", "paypal", "other"]>>;
|
|
87
87
|
gatewaySubscriptionId: z.ZodOptional<z.ZodString>;
|
|
88
88
|
}, "strip", z.ZodTypeAny, {
|
|
89
89
|
currency: "NGN" | "USD";
|
|
90
90
|
amount: number;
|
|
91
91
|
tier: "FREE" | "STARTER_PACK" | "COOPERATIVE" | "ENTERPRISE" | "GOVERNMENT";
|
|
92
|
-
billingCycle: "custom" | "monthly" | "annual"
|
|
92
|
+
billingCycle: "custom" | "monthly" | "annual";
|
|
93
93
|
paymentGateway?: "other" | "flutterwave" | "paystack" | "stripe" | "paypal" | undefined;
|
|
94
94
|
gatewaySubscriptionId?: string | undefined;
|
|
95
95
|
}, {
|
|
96
96
|
amount: number;
|
|
97
97
|
tier: "FREE" | "STARTER_PACK" | "COOPERATIVE" | "ENTERPRISE" | "GOVERNMENT";
|
|
98
|
-
billingCycle: "custom" | "monthly" | "annual"
|
|
98
|
+
billingCycle: "custom" | "monthly" | "annual";
|
|
99
99
|
currency?: "NGN" | "USD" | undefined;
|
|
100
100
|
paymentGateway?: "other" | "flutterwave" | "paystack" | "stripe" | "paypal" | undefined;
|
|
101
101
|
gatewaySubscriptionId?: string | undefined;
|
|
102
102
|
}>;
|
|
103
|
+
export declare const createSubscriptionPaymentLinkAttributesSchema: z.ZodObject<{
|
|
104
|
+
tier: z.ZodEffects<z.ZodEnum<["FREE", "STARTER_PACK", "COOPERATIVE", "ENTERPRISE", "GOVERNMENT"]>, "STARTER_PACK" | "COOPERATIVE" | "ENTERPRISE" | "GOVERNMENT", "FREE" | "STARTER_PACK" | "COOPERATIVE" | "ENTERPRISE" | "GOVERNMENT">;
|
|
105
|
+
billingCycle: z.ZodEffects<z.ZodEnum<["monthly", "annual", "custom"]>, "monthly" | "annual", "custom" | "monthly" | "annual">;
|
|
106
|
+
currency: z.ZodDefault<z.ZodEnum<["NGN", "USD"]>>;
|
|
107
|
+
}, "strip", z.ZodTypeAny, {
|
|
108
|
+
currency: "NGN" | "USD";
|
|
109
|
+
tier: "STARTER_PACK" | "COOPERATIVE" | "ENTERPRISE" | "GOVERNMENT";
|
|
110
|
+
billingCycle: "monthly" | "annual";
|
|
111
|
+
}, {
|
|
112
|
+
tier: "FREE" | "STARTER_PACK" | "COOPERATIVE" | "ENTERPRISE" | "GOVERNMENT";
|
|
113
|
+
billingCycle: "custom" | "monthly" | "annual";
|
|
114
|
+
currency?: "NGN" | "USD" | undefined;
|
|
115
|
+
}>;
|
|
116
|
+
export declare const subscriptionPaymentLinkResponseSchema: z.ZodObject<{
|
|
117
|
+
status: z.ZodLiteral<"success">;
|
|
118
|
+
message: z.ZodString;
|
|
119
|
+
data: z.ZodObject<{
|
|
120
|
+
paymentId: z.ZodString;
|
|
121
|
+
link: z.ZodString;
|
|
122
|
+
tx_ref: z.ZodString;
|
|
123
|
+
}, "strip", z.ZodTypeAny, {
|
|
124
|
+
link: string;
|
|
125
|
+
tx_ref: string;
|
|
126
|
+
paymentId: string;
|
|
127
|
+
}, {
|
|
128
|
+
link: string;
|
|
129
|
+
tx_ref: string;
|
|
130
|
+
paymentId: string;
|
|
131
|
+
}>;
|
|
132
|
+
}, "strip", z.ZodTypeAny, {
|
|
133
|
+
status: "success";
|
|
134
|
+
message: string;
|
|
135
|
+
data: {
|
|
136
|
+
link: string;
|
|
137
|
+
tx_ref: string;
|
|
138
|
+
paymentId: string;
|
|
139
|
+
};
|
|
140
|
+
}, {
|
|
141
|
+
status: "success";
|
|
142
|
+
message: string;
|
|
143
|
+
data: {
|
|
144
|
+
link: string;
|
|
145
|
+
tx_ref: string;
|
|
146
|
+
paymentId: string;
|
|
147
|
+
};
|
|
148
|
+
}>;
|
|
103
149
|
export declare const subscriptionResourceSchema: z.ZodObject<{
|
|
104
150
|
type: z.ZodLiteral<"subscriptions">;
|
|
105
151
|
id: z.ZodString;
|
|
@@ -108,7 +154,7 @@ export declare const subscriptionResourceSchema: z.ZodObject<{
|
|
|
108
154
|
status: z.ZodEnum<["active", "cancelled", "expired", "trial"]>;
|
|
109
155
|
amount: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
110
156
|
currency: z.ZodEnum<["NGN", "USD"]>;
|
|
111
|
-
billingCycle: z.ZodOptional<z.ZodNullable<z.ZodEnum<["monthly", "annual", "
|
|
157
|
+
billingCycle: z.ZodOptional<z.ZodNullable<z.ZodEnum<["monthly", "annual", "custom"]>>>;
|
|
112
158
|
currentPeriodStart: z.ZodString;
|
|
113
159
|
currentPeriodEnd: z.ZodString;
|
|
114
160
|
cancelledAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
@@ -129,7 +175,7 @@ export declare const subscriptionResourceSchema: z.ZodObject<{
|
|
|
129
175
|
currentPeriodStart: string;
|
|
130
176
|
currentPeriodEnd: string;
|
|
131
177
|
amount?: number | null | undefined;
|
|
132
|
-
billingCycle?: "custom" | "monthly" | "annual" |
|
|
178
|
+
billingCycle?: "custom" | "monthly" | "annual" | null | undefined;
|
|
133
179
|
cancelledAt?: string | null | undefined;
|
|
134
180
|
paymentGateway?: "other" | "flutterwave" | "paystack" | "stripe" | "paypal" | null | undefined;
|
|
135
181
|
gatewaySubscriptionId?: string | null | undefined;
|
|
@@ -145,7 +191,7 @@ export declare const subscriptionResourceSchema: z.ZodObject<{
|
|
|
145
191
|
currentPeriodStart: string;
|
|
146
192
|
currentPeriodEnd: string;
|
|
147
193
|
amount?: number | null | undefined;
|
|
148
|
-
billingCycle?: "custom" | "monthly" | "annual" |
|
|
194
|
+
billingCycle?: "custom" | "monthly" | "annual" | null | undefined;
|
|
149
195
|
cancelledAt?: string | null | undefined;
|
|
150
196
|
paymentGateway?: "other" | "flutterwave" | "paystack" | "stripe" | "paypal" | null | undefined;
|
|
151
197
|
gatewaySubscriptionId?: string | null | undefined;
|
|
@@ -165,7 +211,7 @@ export declare const subscriptionResourceSchema: z.ZodObject<{
|
|
|
165
211
|
currentPeriodStart: string;
|
|
166
212
|
currentPeriodEnd: string;
|
|
167
213
|
amount?: number | null | undefined;
|
|
168
|
-
billingCycle?: "custom" | "monthly" | "annual" |
|
|
214
|
+
billingCycle?: "custom" | "monthly" | "annual" | null | undefined;
|
|
169
215
|
cancelledAt?: string | null | undefined;
|
|
170
216
|
paymentGateway?: "other" | "flutterwave" | "paystack" | "stripe" | "paypal" | null | undefined;
|
|
171
217
|
gatewaySubscriptionId?: string | null | undefined;
|
|
@@ -185,7 +231,7 @@ export declare const subscriptionResourceSchema: z.ZodObject<{
|
|
|
185
231
|
currentPeriodStart: string;
|
|
186
232
|
currentPeriodEnd: string;
|
|
187
233
|
amount?: number | null | undefined;
|
|
188
|
-
billingCycle?: "custom" | "monthly" | "annual" |
|
|
234
|
+
billingCycle?: "custom" | "monthly" | "annual" | null | undefined;
|
|
189
235
|
cancelledAt?: string | null | undefined;
|
|
190
236
|
paymentGateway?: "other" | "flutterwave" | "paystack" | "stripe" | "paypal" | null | undefined;
|
|
191
237
|
gatewaySubscriptionId?: string | null | undefined;
|
|
@@ -203,7 +249,7 @@ export declare const subscriptionResponseSchema: z.ZodObject<{
|
|
|
203
249
|
status: z.ZodEnum<["active", "cancelled", "expired", "trial"]>;
|
|
204
250
|
amount: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
205
251
|
currency: z.ZodEnum<["NGN", "USD"]>;
|
|
206
|
-
billingCycle: z.ZodOptional<z.ZodNullable<z.ZodEnum<["monthly", "annual", "
|
|
252
|
+
billingCycle: z.ZodOptional<z.ZodNullable<z.ZodEnum<["monthly", "annual", "custom"]>>>;
|
|
207
253
|
currentPeriodStart: z.ZodString;
|
|
208
254
|
currentPeriodEnd: z.ZodString;
|
|
209
255
|
cancelledAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
@@ -224,7 +270,7 @@ export declare const subscriptionResponseSchema: z.ZodObject<{
|
|
|
224
270
|
currentPeriodStart: string;
|
|
225
271
|
currentPeriodEnd: string;
|
|
226
272
|
amount?: number | null | undefined;
|
|
227
|
-
billingCycle?: "custom" | "monthly" | "annual" |
|
|
273
|
+
billingCycle?: "custom" | "monthly" | "annual" | null | undefined;
|
|
228
274
|
cancelledAt?: string | null | undefined;
|
|
229
275
|
paymentGateway?: "other" | "flutterwave" | "paystack" | "stripe" | "paypal" | null | undefined;
|
|
230
276
|
gatewaySubscriptionId?: string | null | undefined;
|
|
@@ -240,7 +286,7 @@ export declare const subscriptionResponseSchema: z.ZodObject<{
|
|
|
240
286
|
currentPeriodStart: string;
|
|
241
287
|
currentPeriodEnd: string;
|
|
242
288
|
amount?: number | null | undefined;
|
|
243
|
-
billingCycle?: "custom" | "monthly" | "annual" |
|
|
289
|
+
billingCycle?: "custom" | "monthly" | "annual" | null | undefined;
|
|
244
290
|
cancelledAt?: string | null | undefined;
|
|
245
291
|
paymentGateway?: "other" | "flutterwave" | "paystack" | "stripe" | "paypal" | null | undefined;
|
|
246
292
|
gatewaySubscriptionId?: string | null | undefined;
|
|
@@ -260,7 +306,7 @@ export declare const subscriptionResponseSchema: z.ZodObject<{
|
|
|
260
306
|
currentPeriodStart: string;
|
|
261
307
|
currentPeriodEnd: string;
|
|
262
308
|
amount?: number | null | undefined;
|
|
263
|
-
billingCycle?: "custom" | "monthly" | "annual" |
|
|
309
|
+
billingCycle?: "custom" | "monthly" | "annual" | null | undefined;
|
|
264
310
|
cancelledAt?: string | null | undefined;
|
|
265
311
|
paymentGateway?: "other" | "flutterwave" | "paystack" | "stripe" | "paypal" | null | undefined;
|
|
266
312
|
gatewaySubscriptionId?: string | null | undefined;
|
|
@@ -280,7 +326,7 @@ export declare const subscriptionResponseSchema: z.ZodObject<{
|
|
|
280
326
|
currentPeriodStart: string;
|
|
281
327
|
currentPeriodEnd: string;
|
|
282
328
|
amount?: number | null | undefined;
|
|
283
|
-
billingCycle?: "custom" | "monthly" | "annual" |
|
|
329
|
+
billingCycle?: "custom" | "monthly" | "annual" | null | undefined;
|
|
284
330
|
cancelledAt?: string | null | undefined;
|
|
285
331
|
paymentGateway?: "other" | "flutterwave" | "paystack" | "stripe" | "paypal" | null | undefined;
|
|
286
332
|
gatewaySubscriptionId?: string | null | undefined;
|
|
@@ -326,7 +372,7 @@ export declare const subscriptionResponseSchema: z.ZodObject<{
|
|
|
326
372
|
currentPeriodStart: string;
|
|
327
373
|
currentPeriodEnd: string;
|
|
328
374
|
amount?: number | null | undefined;
|
|
329
|
-
billingCycle?: "custom" | "monthly" | "annual" |
|
|
375
|
+
billingCycle?: "custom" | "monthly" | "annual" | null | undefined;
|
|
330
376
|
cancelledAt?: string | null | undefined;
|
|
331
377
|
paymentGateway?: "other" | "flutterwave" | "paystack" | "stripe" | "paypal" | null | undefined;
|
|
332
378
|
gatewaySubscriptionId?: string | null | undefined;
|
|
@@ -358,7 +404,7 @@ export declare const subscriptionResponseSchema: z.ZodObject<{
|
|
|
358
404
|
currentPeriodStart: string;
|
|
359
405
|
currentPeriodEnd: string;
|
|
360
406
|
amount?: number | null | undefined;
|
|
361
|
-
billingCycle?: "custom" | "monthly" | "annual" |
|
|
407
|
+
billingCycle?: "custom" | "monthly" | "annual" | null | undefined;
|
|
362
408
|
cancelledAt?: string | null | undefined;
|
|
363
409
|
paymentGateway?: "other" | "flutterwave" | "paystack" | "stripe" | "paypal" | null | undefined;
|
|
364
410
|
gatewaySubscriptionId?: string | null | undefined;
|
|
@@ -387,7 +433,7 @@ export declare const subscriptionListResponseSchema: z.ZodObject<{
|
|
|
387
433
|
status: z.ZodEnum<["active", "cancelled", "expired", "trial"]>;
|
|
388
434
|
amount: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
389
435
|
currency: z.ZodEnum<["NGN", "USD"]>;
|
|
390
|
-
billingCycle: z.ZodOptional<z.ZodNullable<z.ZodEnum<["monthly", "annual", "
|
|
436
|
+
billingCycle: z.ZodOptional<z.ZodNullable<z.ZodEnum<["monthly", "annual", "custom"]>>>;
|
|
391
437
|
currentPeriodStart: z.ZodString;
|
|
392
438
|
currentPeriodEnd: z.ZodString;
|
|
393
439
|
cancelledAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
@@ -408,7 +454,7 @@ export declare const subscriptionListResponseSchema: z.ZodObject<{
|
|
|
408
454
|
currentPeriodStart: string;
|
|
409
455
|
currentPeriodEnd: string;
|
|
410
456
|
amount?: number | null | undefined;
|
|
411
|
-
billingCycle?: "custom" | "monthly" | "annual" |
|
|
457
|
+
billingCycle?: "custom" | "monthly" | "annual" | null | undefined;
|
|
412
458
|
cancelledAt?: string | null | undefined;
|
|
413
459
|
paymentGateway?: "other" | "flutterwave" | "paystack" | "stripe" | "paypal" | null | undefined;
|
|
414
460
|
gatewaySubscriptionId?: string | null | undefined;
|
|
@@ -424,7 +470,7 @@ export declare const subscriptionListResponseSchema: z.ZodObject<{
|
|
|
424
470
|
currentPeriodStart: string;
|
|
425
471
|
currentPeriodEnd: string;
|
|
426
472
|
amount?: number | null | undefined;
|
|
427
|
-
billingCycle?: "custom" | "monthly" | "annual" |
|
|
473
|
+
billingCycle?: "custom" | "monthly" | "annual" | null | undefined;
|
|
428
474
|
cancelledAt?: string | null | undefined;
|
|
429
475
|
paymentGateway?: "other" | "flutterwave" | "paystack" | "stripe" | "paypal" | null | undefined;
|
|
430
476
|
gatewaySubscriptionId?: string | null | undefined;
|
|
@@ -444,7 +490,7 @@ export declare const subscriptionListResponseSchema: z.ZodObject<{
|
|
|
444
490
|
currentPeriodStart: string;
|
|
445
491
|
currentPeriodEnd: string;
|
|
446
492
|
amount?: number | null | undefined;
|
|
447
|
-
billingCycle?: "custom" | "monthly" | "annual" |
|
|
493
|
+
billingCycle?: "custom" | "monthly" | "annual" | null | undefined;
|
|
448
494
|
cancelledAt?: string | null | undefined;
|
|
449
495
|
paymentGateway?: "other" | "flutterwave" | "paystack" | "stripe" | "paypal" | null | undefined;
|
|
450
496
|
gatewaySubscriptionId?: string | null | undefined;
|
|
@@ -464,7 +510,7 @@ export declare const subscriptionListResponseSchema: z.ZodObject<{
|
|
|
464
510
|
currentPeriodStart: string;
|
|
465
511
|
currentPeriodEnd: string;
|
|
466
512
|
amount?: number | null | undefined;
|
|
467
|
-
billingCycle?: "custom" | "monthly" | "annual" |
|
|
513
|
+
billingCycle?: "custom" | "monthly" | "annual" | null | undefined;
|
|
468
514
|
cancelledAt?: string | null | undefined;
|
|
469
515
|
paymentGateway?: "other" | "flutterwave" | "paystack" | "stripe" | "paypal" | null | undefined;
|
|
470
516
|
gatewaySubscriptionId?: string | null | undefined;
|
|
@@ -510,7 +556,7 @@ export declare const subscriptionListResponseSchema: z.ZodObject<{
|
|
|
510
556
|
currentPeriodStart: string;
|
|
511
557
|
currentPeriodEnd: string;
|
|
512
558
|
amount?: number | null | undefined;
|
|
513
|
-
billingCycle?: "custom" | "monthly" | "annual" |
|
|
559
|
+
billingCycle?: "custom" | "monthly" | "annual" | null | undefined;
|
|
514
560
|
cancelledAt?: string | null | undefined;
|
|
515
561
|
paymentGateway?: "other" | "flutterwave" | "paystack" | "stripe" | "paypal" | null | undefined;
|
|
516
562
|
gatewaySubscriptionId?: string | null | undefined;
|
|
@@ -542,7 +588,7 @@ export declare const subscriptionListResponseSchema: z.ZodObject<{
|
|
|
542
588
|
currentPeriodStart: string;
|
|
543
589
|
currentPeriodEnd: string;
|
|
544
590
|
amount?: number | null | undefined;
|
|
545
|
-
billingCycle?: "custom" | "monthly" | "annual" |
|
|
591
|
+
billingCycle?: "custom" | "monthly" | "annual" | null | undefined;
|
|
546
592
|
cancelledAt?: string | null | undefined;
|
|
547
593
|
paymentGateway?: "other" | "flutterwave" | "paystack" | "stripe" | "paypal" | null | undefined;
|
|
548
594
|
gatewaySubscriptionId?: string | null | undefined;
|
|
@@ -1341,4 +1387,6 @@ export type TierLimits = z.infer<typeof tierLimitsResponseSchema>;
|
|
|
1341
1387
|
export type CurrentUsage = z.infer<typeof currentUsageResponseSchema>;
|
|
1342
1388
|
export type AvailablePlan = z.infer<typeof availablePlanSchema>;
|
|
1343
1389
|
export type AvailablePlansResponse = z.infer<typeof availablePlansResponseSchema>;
|
|
1390
|
+
export type CreateSubscriptionPaymentLinkAttributes = z.infer<typeof createSubscriptionPaymentLinkAttributesSchema>;
|
|
1391
|
+
export type SubscriptionPaymentLinkResponse = z.infer<typeof subscriptionPaymentLinkResponseSchema>;
|
|
1344
1392
|
//# sourceMappingURL=subscriptions.schemas.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"subscriptions.schemas.d.ts","sourceRoot":"","sources":["../../src/schemas/subscriptions.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAQxB;;GAEG;AAGH,eAAO,MAAM,sBAAsB,gFAMjC,CAAC;AAGH,eAAO,MAAM,wBAAwB,wDAKnC,CAAC;AAGH,eAAO,MAAM,kBAAkB,
|
|
1
|
+
{"version":3,"file":"subscriptions.schemas.d.ts","sourceRoot":"","sources":["../../src/schemas/subscriptions.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAQxB;;GAEG;AAGH,eAAO,MAAM,sBAAsB,gFAMjC,CAAC;AAGH,eAAO,MAAM,wBAAwB,wDAKnC,CAAC;AAGH,eAAO,MAAM,kBAAkB,4CAI7B,CAAC;AAGH,eAAO,MAAM,wBAAwB,2CAAyC,CAAC;AAK/E,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAcf,CAAC;AAG3B,eAAO,MAAM,kCAAkC;;;;;;;;;;;;;;;;;;;;;EAO7C,CAAC;AAGH,eAAO,MAAM,mCAAmC;;;;;;;;;;;;;;;;;;;;;EAO9C,CAAC;AAGH,eAAO,MAAM,6CAA6C;;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AAO,kCAAkC,CAAC,CAAC;AAC9F,MAAM,MAAM,6BAA6B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mCAAmC,CAAC,CAAC;AAChG,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAC9E,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,8BAA8B,CAAC,CAAC;AACtF,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,6BAA6B,CAAC,CAAC;AACpF,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAChF,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,+BAA+B,CAAC,CAAC;AACxF,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAClE,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AACtE,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAChE,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC;AAClF,MAAM,MAAM,uCAAuC,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,6CAA6C,CAAC,CAAC;AACpH,MAAM,MAAM,+BAA+B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qCAAqC,CAAC,CAAC"}
|
|
@@ -23,7 +23,6 @@ export const subscriptionStatusSchema = z.enum([
|
|
|
23
23
|
export const billingCycleSchema = z.enum([
|
|
24
24
|
'monthly',
|
|
25
25
|
'annual',
|
|
26
|
-
'bi_annual',
|
|
27
26
|
'custom',
|
|
28
27
|
]);
|
|
29
28
|
// Satellite frequency enum
|
|
@@ -63,6 +62,26 @@ export const upgradeSubscriptionAttributesSchema = z.object({
|
|
|
63
62
|
paymentGateway: paymentGatewaySchema.optional(),
|
|
64
63
|
gatewaySubscriptionId: z.string().optional(),
|
|
65
64
|
});
|
|
65
|
+
// Subscription payment link request schema
|
|
66
|
+
export const createSubscriptionPaymentLinkAttributesSchema = z.object({
|
|
67
|
+
tier: subscriptionTierSchema.refine((val) => val !== 'FREE', {
|
|
68
|
+
message: 'Cannot create payment link for FREE tier',
|
|
69
|
+
}), // Cannot create payment link for FREE tier
|
|
70
|
+
billingCycle: billingCycleSchema.refine((val) => val !== 'custom', {
|
|
71
|
+
message: 'Only standard billing cycles are supported for payment links',
|
|
72
|
+
}), // Only standard billing cycles
|
|
73
|
+
currency: paymentCurrencySchema.default('NGN'),
|
|
74
|
+
});
|
|
75
|
+
// Subscription payment link response schema
|
|
76
|
+
export const subscriptionPaymentLinkResponseSchema = z.object({
|
|
77
|
+
status: z.literal('success'),
|
|
78
|
+
message: z.string(),
|
|
79
|
+
data: z.object({
|
|
80
|
+
paymentId: z.string().uuid(), // Payment ID for tracking
|
|
81
|
+
link: z.string().url(), // Payment link for redirect
|
|
82
|
+
tx_ref: z.string(), // Transaction reference for verification
|
|
83
|
+
}),
|
|
84
|
+
});
|
|
66
85
|
// Subscription resource schema (JSON:API resource object)
|
|
67
86
|
export const subscriptionResourceSchema = z.object({
|
|
68
87
|
type: z.literal('subscriptions'),
|