@deepintel-ltd/farmpro-contracts 1.16.14 → 1.17.0
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/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/routes/farms.routes.d.ts +523 -70
- package/dist/routes/farms.routes.d.ts.map +1 -1
- package/dist/routes/field-activities.routes.d.ts +32 -32
- package/dist/routes/monitoring-visualization.routes.d.ts +151 -8
- package/dist/routes/monitoring-visualization.routes.d.ts.map +1 -1
- package/dist/routes/monitoring-visualization.routes.js +15 -1
- package/dist/routes/payments.routes.d.ts +22 -22
- package/dist/routes/subscriptions.routes.d.ts +52 -16
- package/dist/routes/subscriptions.routes.d.ts.map +1 -1
- package/dist/routes/subscriptions.routes.js +2 -1
- package/dist/schemas/farms.schemas.d.ts +610 -84
- package/dist/schemas/farms.schemas.d.ts.map +1 -1
- package/dist/schemas/farms.schemas.js +25 -4
- package/dist/schemas/field-activities.schemas.d.ts +28 -28
- package/dist/schemas/locale.schemas.d.ts +95 -0
- package/dist/schemas/locale.schemas.d.ts.map +1 -0
- package/dist/schemas/locale.schemas.js +54 -0
- package/dist/schemas/monitoring-visualization.schemas.d.ts +138 -11
- package/dist/schemas/monitoring-visualization.schemas.d.ts.map +1 -1
- package/dist/schemas/monitoring-visualization.schemas.js +33 -2
- package/dist/schemas/payments.schemas.d.ts +22 -22
- package/dist/schemas/subscriptions.schemas.d.ts +77 -13
- package/dist/schemas/subscriptions.schemas.d.ts.map +1 -1
- package/dist/schemas/subscriptions.schemas.js +11 -10
- package/package.json +1 -1
|
@@ -73,7 +73,7 @@ export declare const paymentsRouter: {
|
|
|
73
73
|
gateway: "other" | "flutterwave" | "paystack" | "stripe" | "paypal";
|
|
74
74
|
metadata?: Record<string, unknown> | null | undefined;
|
|
75
75
|
description?: string | null | undefined;
|
|
76
|
-
paymentMethod?: "
|
|
76
|
+
paymentMethod?: "ussd" | "card" | "bank_transfer" | "mobile_money" | "account" | null | undefined;
|
|
77
77
|
gatewayTxRef?: string | null | undefined;
|
|
78
78
|
gatewayTxId?: string | null | undefined;
|
|
79
79
|
failureReason?: string | null | undefined;
|
|
@@ -87,7 +87,7 @@ export declare const paymentsRouter: {
|
|
|
87
87
|
gateway: "other" | "flutterwave" | "paystack" | "stripe" | "paypal";
|
|
88
88
|
metadata?: Record<string, unknown> | null | undefined;
|
|
89
89
|
description?: string | null | undefined;
|
|
90
|
-
paymentMethod?: "
|
|
90
|
+
paymentMethod?: "ussd" | "card" | "bank_transfer" | "mobile_money" | "account" | null | undefined;
|
|
91
91
|
gatewayTxRef?: string | null | undefined;
|
|
92
92
|
gatewayTxId?: string | null | undefined;
|
|
93
93
|
failureReason?: string | null | undefined;
|
|
@@ -108,7 +108,7 @@ export declare const paymentsRouter: {
|
|
|
108
108
|
gateway: "other" | "flutterwave" | "paystack" | "stripe" | "paypal";
|
|
109
109
|
metadata?: Record<string, unknown> | null | undefined;
|
|
110
110
|
description?: string | null | undefined;
|
|
111
|
-
paymentMethod?: "
|
|
111
|
+
paymentMethod?: "ussd" | "card" | "bank_transfer" | "mobile_money" | "account" | null | undefined;
|
|
112
112
|
gatewayTxRef?: string | null | undefined;
|
|
113
113
|
gatewayTxId?: string | null | undefined;
|
|
114
114
|
failureReason?: string | null | undefined;
|
|
@@ -129,7 +129,7 @@ export declare const paymentsRouter: {
|
|
|
129
129
|
gateway: "other" | "flutterwave" | "paystack" | "stripe" | "paypal";
|
|
130
130
|
metadata?: Record<string, unknown> | null | undefined;
|
|
131
131
|
description?: string | null | undefined;
|
|
132
|
-
paymentMethod?: "
|
|
132
|
+
paymentMethod?: "ussd" | "card" | "bank_transfer" | "mobile_money" | "account" | null | undefined;
|
|
133
133
|
gatewayTxRef?: string | null | undefined;
|
|
134
134
|
gatewayTxId?: string | null | undefined;
|
|
135
135
|
failureReason?: string | null | undefined;
|
|
@@ -176,7 +176,7 @@ export declare const paymentsRouter: {
|
|
|
176
176
|
gateway: "other" | "flutterwave" | "paystack" | "stripe" | "paypal";
|
|
177
177
|
metadata?: Record<string, unknown> | null | undefined;
|
|
178
178
|
description?: string | null | undefined;
|
|
179
|
-
paymentMethod?: "
|
|
179
|
+
paymentMethod?: "ussd" | "card" | "bank_transfer" | "mobile_money" | "account" | null | undefined;
|
|
180
180
|
gatewayTxRef?: string | null | undefined;
|
|
181
181
|
gatewayTxId?: string | null | undefined;
|
|
182
182
|
failureReason?: string | null | undefined;
|
|
@@ -209,7 +209,7 @@ export declare const paymentsRouter: {
|
|
|
209
209
|
gateway: "other" | "flutterwave" | "paystack" | "stripe" | "paypal";
|
|
210
210
|
metadata?: Record<string, unknown> | null | undefined;
|
|
211
211
|
description?: string | null | undefined;
|
|
212
|
-
paymentMethod?: "
|
|
212
|
+
paymentMethod?: "ussd" | "card" | "bank_transfer" | "mobile_money" | "account" | null | undefined;
|
|
213
213
|
gatewayTxRef?: string | null | undefined;
|
|
214
214
|
gatewayTxId?: string | null | undefined;
|
|
215
215
|
failureReason?: string | null | undefined;
|
|
@@ -463,7 +463,7 @@ export declare const paymentsRouter: {
|
|
|
463
463
|
gateway: "other" | "flutterwave" | "paystack" | "stripe" | "paypal";
|
|
464
464
|
metadata?: Record<string, unknown> | null | undefined;
|
|
465
465
|
description?: string | null | undefined;
|
|
466
|
-
paymentMethod?: "
|
|
466
|
+
paymentMethod?: "ussd" | "card" | "bank_transfer" | "mobile_money" | "account" | null | undefined;
|
|
467
467
|
gatewayTxRef?: string | null | undefined;
|
|
468
468
|
gatewayTxId?: string | null | undefined;
|
|
469
469
|
failureReason?: string | null | undefined;
|
|
@@ -477,7 +477,7 @@ export declare const paymentsRouter: {
|
|
|
477
477
|
gateway: "other" | "flutterwave" | "paystack" | "stripe" | "paypal";
|
|
478
478
|
metadata?: Record<string, unknown> | null | undefined;
|
|
479
479
|
description?: string | null | undefined;
|
|
480
|
-
paymentMethod?: "
|
|
480
|
+
paymentMethod?: "ussd" | "card" | "bank_transfer" | "mobile_money" | "account" | null | undefined;
|
|
481
481
|
gatewayTxRef?: string | null | undefined;
|
|
482
482
|
gatewayTxId?: string | null | undefined;
|
|
483
483
|
failureReason?: string | null | undefined;
|
|
@@ -498,7 +498,7 @@ export declare const paymentsRouter: {
|
|
|
498
498
|
gateway: "other" | "flutterwave" | "paystack" | "stripe" | "paypal";
|
|
499
499
|
metadata?: Record<string, unknown> | null | undefined;
|
|
500
500
|
description?: string | null | undefined;
|
|
501
|
-
paymentMethod?: "
|
|
501
|
+
paymentMethod?: "ussd" | "card" | "bank_transfer" | "mobile_money" | "account" | null | undefined;
|
|
502
502
|
gatewayTxRef?: string | null | undefined;
|
|
503
503
|
gatewayTxId?: string | null | undefined;
|
|
504
504
|
failureReason?: string | null | undefined;
|
|
@@ -519,7 +519,7 @@ export declare const paymentsRouter: {
|
|
|
519
519
|
gateway: "other" | "flutterwave" | "paystack" | "stripe" | "paypal";
|
|
520
520
|
metadata?: Record<string, unknown> | null | undefined;
|
|
521
521
|
description?: string | null | undefined;
|
|
522
|
-
paymentMethod?: "
|
|
522
|
+
paymentMethod?: "ussd" | "card" | "bank_transfer" | "mobile_money" | "account" | null | undefined;
|
|
523
523
|
gatewayTxRef?: string | null | undefined;
|
|
524
524
|
gatewayTxId?: string | null | undefined;
|
|
525
525
|
failureReason?: string | null | undefined;
|
|
@@ -566,7 +566,7 @@ export declare const paymentsRouter: {
|
|
|
566
566
|
gateway: "other" | "flutterwave" | "paystack" | "stripe" | "paypal";
|
|
567
567
|
metadata?: Record<string, unknown> | null | undefined;
|
|
568
568
|
description?: string | null | undefined;
|
|
569
|
-
paymentMethod?: "
|
|
569
|
+
paymentMethod?: "ussd" | "card" | "bank_transfer" | "mobile_money" | "account" | null | undefined;
|
|
570
570
|
gatewayTxRef?: string | null | undefined;
|
|
571
571
|
gatewayTxId?: string | null | undefined;
|
|
572
572
|
failureReason?: string | null | undefined;
|
|
@@ -599,7 +599,7 @@ export declare const paymentsRouter: {
|
|
|
599
599
|
gateway: "other" | "flutterwave" | "paystack" | "stripe" | "paypal";
|
|
600
600
|
metadata?: Record<string, unknown> | null | undefined;
|
|
601
601
|
description?: string | null | undefined;
|
|
602
|
-
paymentMethod?: "
|
|
602
|
+
paymentMethod?: "ussd" | "card" | "bank_transfer" | "mobile_money" | "account" | null | undefined;
|
|
603
603
|
gatewayTxRef?: string | null | undefined;
|
|
604
604
|
gatewayTxId?: string | null | undefined;
|
|
605
605
|
failureReason?: string | null | undefined;
|
|
@@ -831,7 +831,7 @@ export declare const paymentsRouter: {
|
|
|
831
831
|
phone?: string | undefined;
|
|
832
832
|
metadata?: Record<string, unknown> | undefined;
|
|
833
833
|
description?: string | undefined;
|
|
834
|
-
paymentMethod?: "
|
|
834
|
+
paymentMethod?: "ussd" | "card" | "bank_transfer" | "mobile_money" | "account" | undefined;
|
|
835
835
|
}, {
|
|
836
836
|
email: string;
|
|
837
837
|
currency: "NGN" | "USD";
|
|
@@ -840,7 +840,7 @@ export declare const paymentsRouter: {
|
|
|
840
840
|
phone?: string | undefined;
|
|
841
841
|
metadata?: Record<string, unknown> | undefined;
|
|
842
842
|
description?: string | undefined;
|
|
843
|
-
paymentMethod?: "
|
|
843
|
+
paymentMethod?: "ussd" | "card" | "bank_transfer" | "mobile_money" | "account" | undefined;
|
|
844
844
|
}>;
|
|
845
845
|
}, "strip", z.ZodTypeAny, {
|
|
846
846
|
data: {
|
|
@@ -851,7 +851,7 @@ export declare const paymentsRouter: {
|
|
|
851
851
|
phone?: string | undefined;
|
|
852
852
|
metadata?: Record<string, unknown> | undefined;
|
|
853
853
|
description?: string | undefined;
|
|
854
|
-
paymentMethod?: "
|
|
854
|
+
paymentMethod?: "ussd" | "card" | "bank_transfer" | "mobile_money" | "account" | undefined;
|
|
855
855
|
};
|
|
856
856
|
}, {
|
|
857
857
|
data: {
|
|
@@ -862,7 +862,7 @@ export declare const paymentsRouter: {
|
|
|
862
862
|
phone?: string | undefined;
|
|
863
863
|
metadata?: Record<string, unknown> | undefined;
|
|
864
864
|
description?: string | undefined;
|
|
865
|
-
paymentMethod?: "
|
|
865
|
+
paymentMethod?: "ussd" | "card" | "bank_transfer" | "mobile_money" | "account" | undefined;
|
|
866
866
|
};
|
|
867
867
|
}>;
|
|
868
868
|
path: "/farms/:farmId/payments/initialize";
|
|
@@ -1302,7 +1302,7 @@ export declare const paymentsRouter: {
|
|
|
1302
1302
|
gateway: "other" | "flutterwave" | "paystack" | "stripe" | "paypal";
|
|
1303
1303
|
metadata?: Record<string, unknown> | null | undefined;
|
|
1304
1304
|
description?: string | null | undefined;
|
|
1305
|
-
paymentMethod?: "
|
|
1305
|
+
paymentMethod?: "ussd" | "card" | "bank_transfer" | "mobile_money" | "account" | null | undefined;
|
|
1306
1306
|
gatewayTxRef?: string | null | undefined;
|
|
1307
1307
|
gatewayTxId?: string | null | undefined;
|
|
1308
1308
|
failureReason?: string | null | undefined;
|
|
@@ -1316,7 +1316,7 @@ export declare const paymentsRouter: {
|
|
|
1316
1316
|
gateway: "other" | "flutterwave" | "paystack" | "stripe" | "paypal";
|
|
1317
1317
|
metadata?: Record<string, unknown> | null | undefined;
|
|
1318
1318
|
description?: string | null | undefined;
|
|
1319
|
-
paymentMethod?: "
|
|
1319
|
+
paymentMethod?: "ussd" | "card" | "bank_transfer" | "mobile_money" | "account" | null | undefined;
|
|
1320
1320
|
gatewayTxRef?: string | null | undefined;
|
|
1321
1321
|
gatewayTxId?: string | null | undefined;
|
|
1322
1322
|
failureReason?: string | null | undefined;
|
|
@@ -1337,7 +1337,7 @@ export declare const paymentsRouter: {
|
|
|
1337
1337
|
gateway: "other" | "flutterwave" | "paystack" | "stripe" | "paypal";
|
|
1338
1338
|
metadata?: Record<string, unknown> | null | undefined;
|
|
1339
1339
|
description?: string | null | undefined;
|
|
1340
|
-
paymentMethod?: "
|
|
1340
|
+
paymentMethod?: "ussd" | "card" | "bank_transfer" | "mobile_money" | "account" | null | undefined;
|
|
1341
1341
|
gatewayTxRef?: string | null | undefined;
|
|
1342
1342
|
gatewayTxId?: string | null | undefined;
|
|
1343
1343
|
failureReason?: string | null | undefined;
|
|
@@ -1358,7 +1358,7 @@ export declare const paymentsRouter: {
|
|
|
1358
1358
|
gateway: "other" | "flutterwave" | "paystack" | "stripe" | "paypal";
|
|
1359
1359
|
metadata?: Record<string, unknown> | null | undefined;
|
|
1360
1360
|
description?: string | null | undefined;
|
|
1361
|
-
paymentMethod?: "
|
|
1361
|
+
paymentMethod?: "ussd" | "card" | "bank_transfer" | "mobile_money" | "account" | null | undefined;
|
|
1362
1362
|
gatewayTxRef?: string | null | undefined;
|
|
1363
1363
|
gatewayTxId?: string | null | undefined;
|
|
1364
1364
|
failureReason?: string | null | undefined;
|
|
@@ -1405,7 +1405,7 @@ export declare const paymentsRouter: {
|
|
|
1405
1405
|
gateway: "other" | "flutterwave" | "paystack" | "stripe" | "paypal";
|
|
1406
1406
|
metadata?: Record<string, unknown> | null | undefined;
|
|
1407
1407
|
description?: string | null | undefined;
|
|
1408
|
-
paymentMethod?: "
|
|
1408
|
+
paymentMethod?: "ussd" | "card" | "bank_transfer" | "mobile_money" | "account" | null | undefined;
|
|
1409
1409
|
gatewayTxRef?: string | null | undefined;
|
|
1410
1410
|
gatewayTxId?: string | null | undefined;
|
|
1411
1411
|
failureReason?: string | null | undefined;
|
|
@@ -1438,7 +1438,7 @@ export declare const paymentsRouter: {
|
|
|
1438
1438
|
gateway: "other" | "flutterwave" | "paystack" | "stripe" | "paypal";
|
|
1439
1439
|
metadata?: Record<string, unknown> | null | undefined;
|
|
1440
1440
|
description?: string | null | undefined;
|
|
1441
|
-
paymentMethod?: "
|
|
1441
|
+
paymentMethod?: "ussd" | "card" | "bank_transfer" | "mobile_money" | "account" | null | undefined;
|
|
1442
1442
|
gatewayTxRef?: string | null | undefined;
|
|
1443
1443
|
gatewayTxId?: string | null | undefined;
|
|
1444
1444
|
failureReason?: string | null | undefined;
|
|
@@ -2,16 +2,16 @@ import { z } from 'zod';
|
|
|
2
2
|
export declare const subscriptionsRouter: {
|
|
3
3
|
getAvailablePlans: {
|
|
4
4
|
query: z.ZodObject<{
|
|
5
|
-
currency: z.ZodOptional<z.ZodEnum<["NGN", "USD"]>>;
|
|
5
|
+
currency: z.ZodOptional<z.ZodEnum<["NGN", "USD", "GHS", "KES", "CAD", "AED", "GBP", "EUR"]>>;
|
|
6
6
|
country: z.ZodOptional<z.ZodString>;
|
|
7
7
|
farmId: z.ZodOptional<z.ZodString>;
|
|
8
8
|
}, "strip", z.ZodTypeAny, {
|
|
9
9
|
farmId?: string | undefined;
|
|
10
|
-
currency?: "NGN" | "USD" | undefined;
|
|
10
|
+
currency?: "NGN" | "USD" | "GHS" | "KES" | "CAD" | "AED" | "GBP" | "EUR" | undefined;
|
|
11
11
|
country?: string | undefined;
|
|
12
12
|
}, {
|
|
13
13
|
farmId?: string | undefined;
|
|
14
|
-
currency?: "NGN" | "USD" | undefined;
|
|
14
|
+
currency?: "NGN" | "USD" | "GHS" | "KES" | "CAD" | "AED" | "GBP" | "EUR" | undefined;
|
|
15
15
|
country?: string | undefined;
|
|
16
16
|
}>;
|
|
17
17
|
summary: "Get available subscription plans";
|
|
@@ -28,22 +28,34 @@ export declare const subscriptionsRouter: {
|
|
|
28
28
|
monthly: z.ZodNullable<z.ZodObject<{
|
|
29
29
|
ngn: z.ZodNullable<z.ZodNumber>;
|
|
30
30
|
usd: z.ZodNullable<z.ZodNumber>;
|
|
31
|
+
ghs: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
32
|
+
kes: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
31
33
|
}, "strip", z.ZodTypeAny, {
|
|
32
34
|
ngn: number | null;
|
|
33
35
|
usd: number | null;
|
|
36
|
+
ghs?: number | null | undefined;
|
|
37
|
+
kes?: number | null | undefined;
|
|
34
38
|
}, {
|
|
35
39
|
ngn: number | null;
|
|
36
40
|
usd: number | null;
|
|
41
|
+
ghs?: number | null | undefined;
|
|
42
|
+
kes?: number | null | undefined;
|
|
37
43
|
}>>;
|
|
38
44
|
annual: z.ZodNullable<z.ZodObject<{
|
|
39
45
|
ngn: z.ZodNullable<z.ZodNumber>;
|
|
40
46
|
usd: z.ZodNullable<z.ZodNumber>;
|
|
47
|
+
ghs: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
48
|
+
kes: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
41
49
|
}, "strip", z.ZodTypeAny, {
|
|
42
50
|
ngn: number | null;
|
|
43
51
|
usd: number | null;
|
|
52
|
+
ghs?: number | null | undefined;
|
|
53
|
+
kes?: number | null | undefined;
|
|
44
54
|
}, {
|
|
45
55
|
ngn: number | null;
|
|
46
56
|
usd: number | null;
|
|
57
|
+
ghs?: number | null | undefined;
|
|
58
|
+
kes?: number | null | undefined;
|
|
47
59
|
}>>;
|
|
48
60
|
custom: z.ZodBoolean;
|
|
49
61
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -51,20 +63,28 @@ export declare const subscriptionsRouter: {
|
|
|
51
63
|
monthly: {
|
|
52
64
|
ngn: number | null;
|
|
53
65
|
usd: number | null;
|
|
66
|
+
ghs?: number | null | undefined;
|
|
67
|
+
kes?: number | null | undefined;
|
|
54
68
|
} | null;
|
|
55
69
|
annual: {
|
|
56
70
|
ngn: number | null;
|
|
57
71
|
usd: number | null;
|
|
72
|
+
ghs?: number | null | undefined;
|
|
73
|
+
kes?: number | null | undefined;
|
|
58
74
|
} | null;
|
|
59
75
|
}, {
|
|
60
76
|
custom: boolean;
|
|
61
77
|
monthly: {
|
|
62
78
|
ngn: number | null;
|
|
63
79
|
usd: number | null;
|
|
80
|
+
ghs?: number | null | undefined;
|
|
81
|
+
kes?: number | null | undefined;
|
|
64
82
|
} | null;
|
|
65
83
|
annual: {
|
|
66
84
|
ngn: number | null;
|
|
67
85
|
usd: number | null;
|
|
86
|
+
ghs?: number | null | undefined;
|
|
87
|
+
kes?: number | null | undefined;
|
|
68
88
|
} | null;
|
|
69
89
|
}>;
|
|
70
90
|
features: z.ZodObject<{
|
|
@@ -135,10 +155,14 @@ export declare const subscriptionsRouter: {
|
|
|
135
155
|
monthly: {
|
|
136
156
|
ngn: number | null;
|
|
137
157
|
usd: number | null;
|
|
158
|
+
ghs?: number | null | undefined;
|
|
159
|
+
kes?: number | null | undefined;
|
|
138
160
|
} | null;
|
|
139
161
|
annual: {
|
|
140
162
|
ngn: number | null;
|
|
141
163
|
usd: number | null;
|
|
164
|
+
ghs?: number | null | undefined;
|
|
165
|
+
kes?: number | null | undefined;
|
|
142
166
|
} | null;
|
|
143
167
|
};
|
|
144
168
|
popular?: boolean | undefined;
|
|
@@ -166,10 +190,14 @@ export declare const subscriptionsRouter: {
|
|
|
166
190
|
monthly: {
|
|
167
191
|
ngn: number | null;
|
|
168
192
|
usd: number | null;
|
|
193
|
+
ghs?: number | null | undefined;
|
|
194
|
+
kes?: number | null | undefined;
|
|
169
195
|
} | null;
|
|
170
196
|
annual: {
|
|
171
197
|
ngn: number | null;
|
|
172
198
|
usd: number | null;
|
|
199
|
+
ghs?: number | null | undefined;
|
|
200
|
+
kes?: number | null | undefined;
|
|
173
201
|
} | null;
|
|
174
202
|
};
|
|
175
203
|
popular?: boolean | undefined;
|
|
@@ -178,27 +206,27 @@ export declare const subscriptionsRouter: {
|
|
|
178
206
|
detectedLocation: z.ZodObject<{
|
|
179
207
|
country: z.ZodString;
|
|
180
208
|
countryName: z.ZodString;
|
|
181
|
-
currency: z.ZodEnum<["NGN", "USD"]>;
|
|
209
|
+
currency: z.ZodEnum<["NGN", "USD", "GHS", "KES", "CAD", "AED", "GBP", "EUR"]>;
|
|
182
210
|
}, "strip", z.ZodTypeAny, {
|
|
183
|
-
currency: "NGN" | "USD";
|
|
184
|
-
country: string;
|
|
185
211
|
countryName: string;
|
|
186
|
-
|
|
187
|
-
currency: "NGN" | "USD";
|
|
212
|
+
currency: "NGN" | "USD" | "GHS" | "KES" | "CAD" | "AED" | "GBP" | "EUR";
|
|
188
213
|
country: string;
|
|
214
|
+
}, {
|
|
189
215
|
countryName: string;
|
|
216
|
+
currency: "NGN" | "USD" | "GHS" | "KES" | "CAD" | "AED" | "GBP" | "EUR";
|
|
217
|
+
country: string;
|
|
190
218
|
}>;
|
|
191
219
|
}, "strip", z.ZodTypeAny, {
|
|
192
220
|
detectedLocation: {
|
|
193
|
-
currency: "NGN" | "USD";
|
|
194
|
-
country: string;
|
|
195
221
|
countryName: string;
|
|
222
|
+
currency: "NGN" | "USD" | "GHS" | "KES" | "CAD" | "AED" | "GBP" | "EUR";
|
|
223
|
+
country: string;
|
|
196
224
|
};
|
|
197
225
|
}, {
|
|
198
226
|
detectedLocation: {
|
|
199
|
-
currency: "NGN" | "USD";
|
|
200
|
-
country: string;
|
|
201
227
|
countryName: string;
|
|
228
|
+
currency: "NGN" | "USD" | "GHS" | "KES" | "CAD" | "AED" | "GBP" | "EUR";
|
|
229
|
+
country: string;
|
|
202
230
|
};
|
|
203
231
|
}>>;
|
|
204
232
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -226,19 +254,23 @@ export declare const subscriptionsRouter: {
|
|
|
226
254
|
monthly: {
|
|
227
255
|
ngn: number | null;
|
|
228
256
|
usd: number | null;
|
|
257
|
+
ghs?: number | null | undefined;
|
|
258
|
+
kes?: number | null | undefined;
|
|
229
259
|
} | null;
|
|
230
260
|
annual: {
|
|
231
261
|
ngn: number | null;
|
|
232
262
|
usd: number | null;
|
|
263
|
+
ghs?: number | null | undefined;
|
|
264
|
+
kes?: number | null | undefined;
|
|
233
265
|
} | null;
|
|
234
266
|
};
|
|
235
267
|
popular?: boolean | undefined;
|
|
236
268
|
}[];
|
|
237
269
|
meta?: {
|
|
238
270
|
detectedLocation: {
|
|
239
|
-
currency: "NGN" | "USD";
|
|
240
|
-
country: string;
|
|
241
271
|
countryName: string;
|
|
272
|
+
currency: "NGN" | "USD" | "GHS" | "KES" | "CAD" | "AED" | "GBP" | "EUR";
|
|
273
|
+
country: string;
|
|
242
274
|
};
|
|
243
275
|
} | undefined;
|
|
244
276
|
}, {
|
|
@@ -266,19 +298,23 @@ export declare const subscriptionsRouter: {
|
|
|
266
298
|
monthly: {
|
|
267
299
|
ngn: number | null;
|
|
268
300
|
usd: number | null;
|
|
301
|
+
ghs?: number | null | undefined;
|
|
302
|
+
kes?: number | null | undefined;
|
|
269
303
|
} | null;
|
|
270
304
|
annual: {
|
|
271
305
|
ngn: number | null;
|
|
272
306
|
usd: number | null;
|
|
307
|
+
ghs?: number | null | undefined;
|
|
308
|
+
kes?: number | null | undefined;
|
|
273
309
|
} | null;
|
|
274
310
|
};
|
|
275
311
|
popular?: boolean | undefined;
|
|
276
312
|
}[];
|
|
277
313
|
meta?: {
|
|
278
314
|
detectedLocation: {
|
|
279
|
-
currency: "NGN" | "USD";
|
|
280
|
-
country: string;
|
|
281
315
|
countryName: string;
|
|
316
|
+
currency: "NGN" | "USD" | "GHS" | "KES" | "CAD" | "AED" | "GBP" | "EUR";
|
|
317
|
+
country: string;
|
|
282
318
|
};
|
|
283
319
|
} | undefined;
|
|
284
320
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"subscriptions.routes.d.ts","sourceRoot":"","sources":["../../src/routes/subscriptions.routes.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"subscriptions.routes.d.ts","sourceRoot":"","sources":["../../src/routes/subscriptions.routes.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAoBxB,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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O9B,CAAC"}
|
|
@@ -2,6 +2,7 @@ import { initContract } from '@ts-rest/core';
|
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
import { subscriptionResponseSchema, subscriptionListResponseSchema, upgradeSubscriptionAttributesSchema, usageTrackingListResponseSchema, tierLimitsResponseSchema, currentUsageResponseSchema, availablePlansResponseSchema, createSubscriptionPaymentLinkAttributesSchema, subscriptionPaymentLinkResponseSchema, } from '../schemas/subscriptions.schemas';
|
|
4
4
|
import { jsonApiErrorResponseSchema, jsonApiPaginationQuerySchema, } from '../schemas/common.schemas';
|
|
5
|
+
import { iso4217CurrencySchema } from '../schemas/locale.schemas';
|
|
5
6
|
const c = initContract();
|
|
6
7
|
export const subscriptionsRouter = c.router({
|
|
7
8
|
// Get all available subscription plans (public endpoint for landing page)
|
|
@@ -9,7 +10,7 @@ export const subscriptionsRouter = c.router({
|
|
|
9
10
|
method: 'GET',
|
|
10
11
|
path: '/subscriptions/plans',
|
|
11
12
|
query: z.object({
|
|
12
|
-
'currency':
|
|
13
|
+
'currency': iso4217CurrencySchema.optional(),
|
|
13
14
|
'country': z.string().optional(), // ISO 3166-1 alpha-2 country code (e.g., 'NG', 'US')
|
|
14
15
|
'farmId': z.string().uuid().optional(), // Optional: use farm location for detection
|
|
15
16
|
}),
|