@deepintel-ltd/farmpro-contracts 1.16.15 → 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/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/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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"farms.schemas.d.ts","sourceRoot":"","sources":["../../src/schemas/farms.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"farms.schemas.d.ts","sourceRoot":"","sources":["../../src/schemas/farms.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAiBxB;;GAEG;AAGH,eAAO,MAAM,cAAc,qEAAwB,CAAC;AAGpD,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;IAe/B,yDAAyD;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAGpC,CAAC;AAEH,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;YA5GvC,yDAAyD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiIzD,CAAC;AAEH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAC9D,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAC9E,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAC5E,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC"}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { geoJSONGeometrySchema, timestampsSchema, createJsonApiResourceSchema, jsonApiSingleResponseSchema, jsonApiCollectionResponseSchema } from './common.schemas';
|
|
3
3
|
import { teamMemberRoleSchema } from './team.schemas';
|
|
4
|
+
import { iso4217CurrencySchema, countryCodeSchema, unitSystemSchema, areaUnitSchema, } from './locale.schemas';
|
|
4
5
|
/**
|
|
5
6
|
* Farm schemas - JSON:API compliant
|
|
6
7
|
*/
|
|
7
|
-
// Currency
|
|
8
|
-
export const currencySchema =
|
|
8
|
+
// Currency — ISO 4217 codes supported by RegionPacks
|
|
9
|
+
export const currencySchema = iso4217CurrencySchema;
|
|
9
10
|
// Farm attributes schema (for JSON:API attributes object)
|
|
10
11
|
export const farmAttributesSchema = z.object({
|
|
11
12
|
name: z.string().min(1).max(100),
|
|
@@ -13,6 +14,15 @@ export const farmAttributesSchema = z.object({
|
|
|
13
14
|
size: z.number().nullable(),
|
|
14
15
|
boundary: geoJSONGeometrySchema.nullable(),
|
|
15
16
|
currency: currencySchema,
|
|
17
|
+
countryCode: countryCodeSchema,
|
|
18
|
+
regionCode: z.string().max(20).nullable(),
|
|
19
|
+
subRegionCode: z.string().max(100).nullable(),
|
|
20
|
+
timezone: z.string().min(1).max(64),
|
|
21
|
+
locale: z.string().min(2).max(10),
|
|
22
|
+
unitSystem: unitSystemSchema,
|
|
23
|
+
areaUnit: areaUnitSchema,
|
|
24
|
+
lat: z.number().min(-90).max(90).nullable(),
|
|
25
|
+
lng: z.number().min(-180).max(180).nullable(),
|
|
16
26
|
/** Current user's team role on this farm, when known. */
|
|
17
27
|
myTeamRole: teamMemberRoleSchema.nullable().optional(),
|
|
18
28
|
}).merge(timestampsSchema);
|
|
@@ -22,7 +32,16 @@ export const createFarmAttributesSchema = z.object({
|
|
|
22
32
|
location: z.string().min(1),
|
|
23
33
|
size: z.number().positive().optional(),
|
|
24
34
|
boundary: geoJSONGeometrySchema.optional(),
|
|
25
|
-
currency: currencySchema.optional()
|
|
35
|
+
currency: currencySchema.optional(),
|
|
36
|
+
countryCode: countryCodeSchema.optional(),
|
|
37
|
+
regionCode: z.string().max(20).optional(),
|
|
38
|
+
subRegionCode: z.string().max(100).optional(),
|
|
39
|
+
timezone: z.string().min(1).max(64).optional(),
|
|
40
|
+
locale: z.string().min(2).max(10).optional(),
|
|
41
|
+
unitSystem: unitSystemSchema.optional(),
|
|
42
|
+
areaUnit: areaUnitSchema.optional(),
|
|
43
|
+
lat: z.number().min(-90).max(90).optional(),
|
|
44
|
+
lng: z.number().min(-180).max(180).optional(),
|
|
26
45
|
});
|
|
27
46
|
// Farm attributes for update (input)
|
|
28
47
|
export const updateFarmAttributesSchema = createFarmAttributesSchema.partial();
|
|
@@ -78,10 +97,11 @@ export const onboardingFirstFieldSchema = z.object({
|
|
|
78
97
|
});
|
|
79
98
|
export const farmOnboardingAttributesSchema = z.object({
|
|
80
99
|
name: z.string().min(1).max(100),
|
|
100
|
+
countryCode: countryCodeSchema.optional().default('NG'),
|
|
81
101
|
location: farmLocationSchema,
|
|
82
102
|
boundary: geoJSONGeometrySchema,
|
|
83
103
|
firstField: onboardingFirstFieldSchema,
|
|
84
|
-
currency: currencySchema.optional()
|
|
104
|
+
currency: currencySchema.optional(),
|
|
85
105
|
});
|
|
86
106
|
export const farmOnboardingInputSchema = z.object({
|
|
87
107
|
type: z.literal('farm-onboarding'),
|
|
@@ -106,5 +126,6 @@ export const farmOnboardingResponseSchema = z.object({
|
|
|
106
126
|
meta: z.object({
|
|
107
127
|
onboardingCompleted: z.boolean(),
|
|
108
128
|
location: farmLocationSchema,
|
|
129
|
+
countryCode: countryCodeSchema.optional(),
|
|
109
130
|
}),
|
|
110
131
|
});
|
|
@@ -20,7 +20,7 @@ export declare const fieldActivityAttributesSchema: z.ZodObject<{
|
|
|
20
20
|
updatedAt: z.ZodString;
|
|
21
21
|
}, "strip", z.ZodTypeAny, {
|
|
22
22
|
type: "weeding" | "fertilizer";
|
|
23
|
-
source: "
|
|
23
|
+
source: "whatsapp" | "manual" | "agent";
|
|
24
24
|
createdAt: string;
|
|
25
25
|
updatedAt: string;
|
|
26
26
|
method: string | null;
|
|
@@ -36,7 +36,7 @@ export declare const fieldActivityAttributesSchema: z.ZodObject<{
|
|
|
36
36
|
fieldName?: string | undefined;
|
|
37
37
|
}, {
|
|
38
38
|
type: "weeding" | "fertilizer";
|
|
39
|
-
source: "
|
|
39
|
+
source: "whatsapp" | "manual" | "agent";
|
|
40
40
|
createdAt: string;
|
|
41
41
|
updatedAt: string;
|
|
42
42
|
method: string | null;
|
|
@@ -67,7 +67,7 @@ export declare const createFieldActivityAttributesSchema: z.ZodEffects<z.ZodObje
|
|
|
67
67
|
type: "weeding" | "fertilizer";
|
|
68
68
|
occurredAt: string;
|
|
69
69
|
fieldId: string;
|
|
70
|
-
source?: "
|
|
70
|
+
source?: "whatsapp" | "manual" | "agent" | undefined;
|
|
71
71
|
method?: string | undefined;
|
|
72
72
|
notes?: string | undefined;
|
|
73
73
|
quantity?: number | undefined;
|
|
@@ -79,7 +79,7 @@ export declare const createFieldActivityAttributesSchema: z.ZodEffects<z.ZodObje
|
|
|
79
79
|
type: "weeding" | "fertilizer";
|
|
80
80
|
occurredAt: string;
|
|
81
81
|
fieldId: string;
|
|
82
|
-
source?: "
|
|
82
|
+
source?: "whatsapp" | "manual" | "agent" | undefined;
|
|
83
83
|
method?: string | undefined;
|
|
84
84
|
notes?: string | undefined;
|
|
85
85
|
quantity?: number | undefined;
|
|
@@ -91,7 +91,7 @@ export declare const createFieldActivityAttributesSchema: z.ZodEffects<z.ZodObje
|
|
|
91
91
|
type: "weeding" | "fertilizer";
|
|
92
92
|
occurredAt: string;
|
|
93
93
|
fieldId: string;
|
|
94
|
-
source?: "
|
|
94
|
+
source?: "whatsapp" | "manual" | "agent" | undefined;
|
|
95
95
|
method?: string | undefined;
|
|
96
96
|
notes?: string | undefined;
|
|
97
97
|
quantity?: number | undefined;
|
|
@@ -103,7 +103,7 @@ export declare const createFieldActivityAttributesSchema: z.ZodEffects<z.ZodObje
|
|
|
103
103
|
type: "weeding" | "fertilizer";
|
|
104
104
|
occurredAt: string;
|
|
105
105
|
fieldId: string;
|
|
106
|
-
source?: "
|
|
106
|
+
source?: "whatsapp" | "manual" | "agent" | undefined;
|
|
107
107
|
method?: string | undefined;
|
|
108
108
|
notes?: string | undefined;
|
|
109
109
|
quantity?: number | undefined;
|
|
@@ -158,7 +158,7 @@ export declare const createFieldActivitySchema: z.ZodObject<{
|
|
|
158
158
|
type: "weeding" | "fertilizer";
|
|
159
159
|
occurredAt: string;
|
|
160
160
|
fieldId: string;
|
|
161
|
-
source?: "
|
|
161
|
+
source?: "whatsapp" | "manual" | "agent" | undefined;
|
|
162
162
|
method?: string | undefined;
|
|
163
163
|
notes?: string | undefined;
|
|
164
164
|
quantity?: number | undefined;
|
|
@@ -170,7 +170,7 @@ export declare const createFieldActivitySchema: z.ZodObject<{
|
|
|
170
170
|
type: "weeding" | "fertilizer";
|
|
171
171
|
occurredAt: string;
|
|
172
172
|
fieldId: string;
|
|
173
|
-
source?: "
|
|
173
|
+
source?: "whatsapp" | "manual" | "agent" | undefined;
|
|
174
174
|
method?: string | undefined;
|
|
175
175
|
notes?: string | undefined;
|
|
176
176
|
quantity?: number | undefined;
|
|
@@ -182,7 +182,7 @@ export declare const createFieldActivitySchema: z.ZodObject<{
|
|
|
182
182
|
type: "weeding" | "fertilizer";
|
|
183
183
|
occurredAt: string;
|
|
184
184
|
fieldId: string;
|
|
185
|
-
source?: "
|
|
185
|
+
source?: "whatsapp" | "manual" | "agent" | undefined;
|
|
186
186
|
method?: string | undefined;
|
|
187
187
|
notes?: string | undefined;
|
|
188
188
|
quantity?: number | undefined;
|
|
@@ -194,7 +194,7 @@ export declare const createFieldActivitySchema: z.ZodObject<{
|
|
|
194
194
|
type: "weeding" | "fertilizer";
|
|
195
195
|
occurredAt: string;
|
|
196
196
|
fieldId: string;
|
|
197
|
-
source?: "
|
|
197
|
+
source?: "whatsapp" | "manual" | "agent" | undefined;
|
|
198
198
|
method?: string | undefined;
|
|
199
199
|
notes?: string | undefined;
|
|
200
200
|
quantity?: number | undefined;
|
|
@@ -209,7 +209,7 @@ export declare const createFieldActivitySchema: z.ZodObject<{
|
|
|
209
209
|
type: "weeding" | "fertilizer";
|
|
210
210
|
occurredAt: string;
|
|
211
211
|
fieldId: string;
|
|
212
|
-
source?: "
|
|
212
|
+
source?: "whatsapp" | "manual" | "agent" | undefined;
|
|
213
213
|
method?: string | undefined;
|
|
214
214
|
notes?: string | undefined;
|
|
215
215
|
quantity?: number | undefined;
|
|
@@ -224,7 +224,7 @@ export declare const createFieldActivitySchema: z.ZodObject<{
|
|
|
224
224
|
type: "weeding" | "fertilizer";
|
|
225
225
|
occurredAt: string;
|
|
226
226
|
fieldId: string;
|
|
227
|
-
source?: "
|
|
227
|
+
source?: "whatsapp" | "manual" | "agent" | undefined;
|
|
228
228
|
method?: string | undefined;
|
|
229
229
|
notes?: string | undefined;
|
|
230
230
|
quantity?: number | undefined;
|
|
@@ -314,7 +314,7 @@ export declare const fieldActivityResourceSchema: z.ZodObject<{
|
|
|
314
314
|
updatedAt: z.ZodString;
|
|
315
315
|
}, "strip", z.ZodTypeAny, {
|
|
316
316
|
type: "weeding" | "fertilizer";
|
|
317
|
-
source: "
|
|
317
|
+
source: "whatsapp" | "manual" | "agent";
|
|
318
318
|
createdAt: string;
|
|
319
319
|
updatedAt: string;
|
|
320
320
|
method: string | null;
|
|
@@ -330,7 +330,7 @@ export declare const fieldActivityResourceSchema: z.ZodObject<{
|
|
|
330
330
|
fieldName?: string | undefined;
|
|
331
331
|
}, {
|
|
332
332
|
type: "weeding" | "fertilizer";
|
|
333
|
-
source: "
|
|
333
|
+
source: "whatsapp" | "manual" | "agent";
|
|
334
334
|
createdAt: string;
|
|
335
335
|
updatedAt: string;
|
|
336
336
|
method: string | null;
|
|
@@ -353,7 +353,7 @@ export declare const fieldActivityResourceSchema: z.ZodObject<{
|
|
|
353
353
|
id: string;
|
|
354
354
|
attributes: {
|
|
355
355
|
type: "weeding" | "fertilizer";
|
|
356
|
-
source: "
|
|
356
|
+
source: "whatsapp" | "manual" | "agent";
|
|
357
357
|
createdAt: string;
|
|
358
358
|
updatedAt: string;
|
|
359
359
|
method: string | null;
|
|
@@ -376,7 +376,7 @@ export declare const fieldActivityResourceSchema: z.ZodObject<{
|
|
|
376
376
|
id: string;
|
|
377
377
|
attributes: {
|
|
378
378
|
type: "weeding" | "fertilizer";
|
|
379
|
-
source: "
|
|
379
|
+
source: "whatsapp" | "manual" | "agent";
|
|
380
380
|
createdAt: string;
|
|
381
381
|
updatedAt: string;
|
|
382
382
|
method: string | null;
|
|
@@ -418,7 +418,7 @@ export declare const fieldActivityResponseSchema: z.ZodObject<{
|
|
|
418
418
|
updatedAt: z.ZodString;
|
|
419
419
|
}, "strip", z.ZodTypeAny, {
|
|
420
420
|
type: "weeding" | "fertilizer";
|
|
421
|
-
source: "
|
|
421
|
+
source: "whatsapp" | "manual" | "agent";
|
|
422
422
|
createdAt: string;
|
|
423
423
|
updatedAt: string;
|
|
424
424
|
method: string | null;
|
|
@@ -434,7 +434,7 @@ export declare const fieldActivityResponseSchema: z.ZodObject<{
|
|
|
434
434
|
fieldName?: string | undefined;
|
|
435
435
|
}, {
|
|
436
436
|
type: "weeding" | "fertilizer";
|
|
437
|
-
source: "
|
|
437
|
+
source: "whatsapp" | "manual" | "agent";
|
|
438
438
|
createdAt: string;
|
|
439
439
|
updatedAt: string;
|
|
440
440
|
method: string | null;
|
|
@@ -457,7 +457,7 @@ export declare const fieldActivityResponseSchema: z.ZodObject<{
|
|
|
457
457
|
id: string;
|
|
458
458
|
attributes: {
|
|
459
459
|
type: "weeding" | "fertilizer";
|
|
460
|
-
source: "
|
|
460
|
+
source: "whatsapp" | "manual" | "agent";
|
|
461
461
|
createdAt: string;
|
|
462
462
|
updatedAt: string;
|
|
463
463
|
method: string | null;
|
|
@@ -480,7 +480,7 @@ export declare const fieldActivityResponseSchema: z.ZodObject<{
|
|
|
480
480
|
id: string;
|
|
481
481
|
attributes: {
|
|
482
482
|
type: "weeding" | "fertilizer";
|
|
483
|
-
source: "
|
|
483
|
+
source: "whatsapp" | "manual" | "agent";
|
|
484
484
|
createdAt: string;
|
|
485
485
|
updatedAt: string;
|
|
486
486
|
method: string | null;
|
|
@@ -529,7 +529,7 @@ export declare const fieldActivityResponseSchema: z.ZodObject<{
|
|
|
529
529
|
id: string;
|
|
530
530
|
attributes: {
|
|
531
531
|
type: "weeding" | "fertilizer";
|
|
532
|
-
source: "
|
|
532
|
+
source: "whatsapp" | "manual" | "agent";
|
|
533
533
|
createdAt: string;
|
|
534
534
|
updatedAt: string;
|
|
535
535
|
method: string | null;
|
|
@@ -564,7 +564,7 @@ export declare const fieldActivityResponseSchema: z.ZodObject<{
|
|
|
564
564
|
id: string;
|
|
565
565
|
attributes: {
|
|
566
566
|
type: "weeding" | "fertilizer";
|
|
567
|
-
source: "
|
|
567
|
+
source: "whatsapp" | "manual" | "agent";
|
|
568
568
|
createdAt: string;
|
|
569
569
|
updatedAt: string;
|
|
570
570
|
method: string | null;
|
|
@@ -617,7 +617,7 @@ export declare const fieldActivityListResponseSchema: z.ZodObject<{
|
|
|
617
617
|
updatedAt: z.ZodString;
|
|
618
618
|
}, "strip", z.ZodTypeAny, {
|
|
619
619
|
type: "weeding" | "fertilizer";
|
|
620
|
-
source: "
|
|
620
|
+
source: "whatsapp" | "manual" | "agent";
|
|
621
621
|
createdAt: string;
|
|
622
622
|
updatedAt: string;
|
|
623
623
|
method: string | null;
|
|
@@ -633,7 +633,7 @@ export declare const fieldActivityListResponseSchema: z.ZodObject<{
|
|
|
633
633
|
fieldName?: string | undefined;
|
|
634
634
|
}, {
|
|
635
635
|
type: "weeding" | "fertilizer";
|
|
636
|
-
source: "
|
|
636
|
+
source: "whatsapp" | "manual" | "agent";
|
|
637
637
|
createdAt: string;
|
|
638
638
|
updatedAt: string;
|
|
639
639
|
method: string | null;
|
|
@@ -656,7 +656,7 @@ export declare const fieldActivityListResponseSchema: z.ZodObject<{
|
|
|
656
656
|
id: string;
|
|
657
657
|
attributes: {
|
|
658
658
|
type: "weeding" | "fertilizer";
|
|
659
|
-
source: "
|
|
659
|
+
source: "whatsapp" | "manual" | "agent";
|
|
660
660
|
createdAt: string;
|
|
661
661
|
updatedAt: string;
|
|
662
662
|
method: string | null;
|
|
@@ -679,7 +679,7 @@ export declare const fieldActivityListResponseSchema: z.ZodObject<{
|
|
|
679
679
|
id: string;
|
|
680
680
|
attributes: {
|
|
681
681
|
type: "weeding" | "fertilizer";
|
|
682
|
-
source: "
|
|
682
|
+
source: "whatsapp" | "manual" | "agent";
|
|
683
683
|
createdAt: string;
|
|
684
684
|
updatedAt: string;
|
|
685
685
|
method: string | null;
|
|
@@ -728,7 +728,7 @@ export declare const fieldActivityListResponseSchema: z.ZodObject<{
|
|
|
728
728
|
id: string;
|
|
729
729
|
attributes: {
|
|
730
730
|
type: "weeding" | "fertilizer";
|
|
731
|
-
source: "
|
|
731
|
+
source: "whatsapp" | "manual" | "agent";
|
|
732
732
|
createdAt: string;
|
|
733
733
|
updatedAt: string;
|
|
734
734
|
method: string | null;
|
|
@@ -763,7 +763,7 @@ export declare const fieldActivityListResponseSchema: z.ZodObject<{
|
|
|
763
763
|
id: string;
|
|
764
764
|
attributes: {
|
|
765
765
|
type: "weeding" | "fertilizer";
|
|
766
|
-
source: "
|
|
766
|
+
source: "whatsapp" | "manual" | "agent";
|
|
767
767
|
createdAt: string;
|
|
768
768
|
updatedAt: string;
|
|
769
769
|
method: string | null;
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/** ISO 3166-1 alpha-2 country code */
|
|
3
|
+
export declare const countryCodeSchema: z.ZodString;
|
|
4
|
+
export declare const unitSystemSchema: z.ZodEnum<["metric", "imperial", "mixed"]>;
|
|
5
|
+
export declare const areaUnitSchema: z.ZodEnum<["hectares", "acres"]>;
|
|
6
|
+
/** Currencies supported across active and future RegionPacks */
|
|
7
|
+
export declare const iso4217CurrencySchema: z.ZodEnum<["NGN", "USD", "GHS", "KES", "CAD", "AED", "GBP", "EUR"]>;
|
|
8
|
+
export declare const seasonModelSchema: z.ZodEnum<["tropical_bimodal", "tropical_highland", "temperate", "controlled_environment"]>;
|
|
9
|
+
export declare const regionPackChannelSchema: z.ZodEnum<["web", "pwa", "whatsapp", "ussd"]>;
|
|
10
|
+
export declare const regionPackSchema: z.ZodObject<{
|
|
11
|
+
countryCode: z.ZodString;
|
|
12
|
+
countryName: z.ZodString;
|
|
13
|
+
currencies: z.ZodArray<z.ZodEnum<["NGN", "USD", "GHS", "KES", "CAD", "AED", "GBP", "EUR"]>, "many">;
|
|
14
|
+
defaultCurrency: z.ZodEnum<["NGN", "USD", "GHS", "KES", "CAD", "AED", "GBP", "EUR"]>;
|
|
15
|
+
locales: z.ZodArray<z.ZodString, "many">;
|
|
16
|
+
defaultLocale: z.ZodString;
|
|
17
|
+
defaultTimezone: z.ZodString;
|
|
18
|
+
paymentGateways: z.ZodArray<z.ZodString, "many">;
|
|
19
|
+
seasonModel: z.ZodEnum<["tropical_bimodal", "tropical_highland", "temperate", "controlled_environment"]>;
|
|
20
|
+
cropCatalogId: z.ZodString;
|
|
21
|
+
marketDataSources: z.ZodArray<z.ZodString, "many">;
|
|
22
|
+
geoProvider: z.ZodString;
|
|
23
|
+
channels: z.ZodArray<z.ZodEnum<["web", "pwa", "whatsapp", "ussd"]>, "many">;
|
|
24
|
+
compliancePacks: z.ZodArray<z.ZodString, "many">;
|
|
25
|
+
}, "strip", z.ZodTypeAny, {
|
|
26
|
+
countryCode: string;
|
|
27
|
+
countryName: string;
|
|
28
|
+
currencies: ("NGN" | "USD" | "GHS" | "KES" | "CAD" | "AED" | "GBP" | "EUR")[];
|
|
29
|
+
defaultCurrency: "NGN" | "USD" | "GHS" | "KES" | "CAD" | "AED" | "GBP" | "EUR";
|
|
30
|
+
locales: string[];
|
|
31
|
+
defaultLocale: string;
|
|
32
|
+
defaultTimezone: string;
|
|
33
|
+
paymentGateways: string[];
|
|
34
|
+
seasonModel: "tropical_bimodal" | "tropical_highland" | "temperate" | "controlled_environment";
|
|
35
|
+
cropCatalogId: string;
|
|
36
|
+
marketDataSources: string[];
|
|
37
|
+
geoProvider: string;
|
|
38
|
+
channels: ("web" | "pwa" | "whatsapp" | "ussd")[];
|
|
39
|
+
compliancePacks: string[];
|
|
40
|
+
}, {
|
|
41
|
+
countryCode: string;
|
|
42
|
+
countryName: string;
|
|
43
|
+
currencies: ("NGN" | "USD" | "GHS" | "KES" | "CAD" | "AED" | "GBP" | "EUR")[];
|
|
44
|
+
defaultCurrency: "NGN" | "USD" | "GHS" | "KES" | "CAD" | "AED" | "GBP" | "EUR";
|
|
45
|
+
locales: string[];
|
|
46
|
+
defaultLocale: string;
|
|
47
|
+
defaultTimezone: string;
|
|
48
|
+
paymentGateways: string[];
|
|
49
|
+
seasonModel: "tropical_bimodal" | "tropical_highland" | "temperate" | "controlled_environment";
|
|
50
|
+
cropCatalogId: string;
|
|
51
|
+
marketDataSources: string[];
|
|
52
|
+
geoProvider: string;
|
|
53
|
+
channels: ("web" | "pwa" | "whatsapp" | "ussd")[];
|
|
54
|
+
compliancePacks: string[];
|
|
55
|
+
}>;
|
|
56
|
+
/** Locale fields persisted on Farm */
|
|
57
|
+
export declare const farmLocaleAttributesSchema: z.ZodObject<{
|
|
58
|
+
countryCode: z.ZodString;
|
|
59
|
+
regionCode: z.ZodNullable<z.ZodString>;
|
|
60
|
+
subRegionCode: z.ZodNullable<z.ZodString>;
|
|
61
|
+
timezone: z.ZodString;
|
|
62
|
+
locale: z.ZodString;
|
|
63
|
+
unitSystem: z.ZodEnum<["metric", "imperial", "mixed"]>;
|
|
64
|
+
areaUnit: z.ZodEnum<["hectares", "acres"]>;
|
|
65
|
+
lat: z.ZodNullable<z.ZodNumber>;
|
|
66
|
+
lng: z.ZodNullable<z.ZodNumber>;
|
|
67
|
+
}, "strip", z.ZodTypeAny, {
|
|
68
|
+
countryCode: string;
|
|
69
|
+
regionCode: string | null;
|
|
70
|
+
subRegionCode: string | null;
|
|
71
|
+
timezone: string;
|
|
72
|
+
locale: string;
|
|
73
|
+
unitSystem: "metric" | "imperial" | "mixed";
|
|
74
|
+
areaUnit: "hectares" | "acres";
|
|
75
|
+
lat: number | null;
|
|
76
|
+
lng: number | null;
|
|
77
|
+
}, {
|
|
78
|
+
countryCode: string;
|
|
79
|
+
regionCode: string | null;
|
|
80
|
+
subRegionCode: string | null;
|
|
81
|
+
timezone: string;
|
|
82
|
+
locale: string;
|
|
83
|
+
unitSystem: "metric" | "imperial" | "mixed";
|
|
84
|
+
areaUnit: "hectares" | "acres";
|
|
85
|
+
lat: number | null;
|
|
86
|
+
lng: number | null;
|
|
87
|
+
}>;
|
|
88
|
+
export type CountryCode = z.infer<typeof countryCodeSchema>;
|
|
89
|
+
export type Iso4217Currency = z.infer<typeof iso4217CurrencySchema>;
|
|
90
|
+
export type UnitSystem = z.infer<typeof unitSystemSchema>;
|
|
91
|
+
export type AreaUnit = z.infer<typeof areaUnitSchema>;
|
|
92
|
+
export type SeasonModel = z.infer<typeof seasonModelSchema>;
|
|
93
|
+
export type RegionPack = z.infer<typeof regionPackSchema>;
|
|
94
|
+
export type FarmLocaleAttributes = z.infer<typeof farmLocaleAttributesSchema>;
|
|
95
|
+
//# sourceMappingURL=locale.schemas.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"locale.schemas.d.ts","sourceRoot":"","sources":["../../src/schemas/locale.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,sCAAsC;AACtC,eAAO,MAAM,iBAAiB,aAGsC,CAAC;AAErE,eAAO,MAAM,gBAAgB,4CAA0C,CAAC;AACxE,eAAO,MAAM,cAAc,kCAAgC,CAAC;AAE5D,gEAAgE;AAChE,eAAO,MAAM,qBAAqB,qEAShC,CAAC;AAEH,eAAO,MAAM,iBAAiB,6FAK5B,CAAC;AAEH,eAAO,MAAM,uBAAuB,+CAA6C,CAAC;AAElF,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAe3B,CAAC;AAEH,sCAAsC;AACtC,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAUrC,CAAC;AAEH,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAC5D,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AACpE,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAC1D,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AACtD,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAC5D,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAC1D,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/** ISO 3166-1 alpha-2 country code */
|
|
3
|
+
export const countryCodeSchema = z
|
|
4
|
+
.string()
|
|
5
|
+
.length(2)
|
|
6
|
+
.regex(/^[A-Z]{2}$/, 'Country code must be two uppercase letters');
|
|
7
|
+
export const unitSystemSchema = z.enum(['metric', 'imperial', 'mixed']);
|
|
8
|
+
export const areaUnitSchema = z.enum(['hectares', 'acres']);
|
|
9
|
+
/** Currencies supported across active and future RegionPacks */
|
|
10
|
+
export const iso4217CurrencySchema = z.enum([
|
|
11
|
+
'NGN',
|
|
12
|
+
'USD',
|
|
13
|
+
'GHS',
|
|
14
|
+
'KES',
|
|
15
|
+
'CAD',
|
|
16
|
+
'AED',
|
|
17
|
+
'GBP',
|
|
18
|
+
'EUR',
|
|
19
|
+
]);
|
|
20
|
+
export const seasonModelSchema = z.enum([
|
|
21
|
+
'tropical_bimodal',
|
|
22
|
+
'tropical_highland',
|
|
23
|
+
'temperate',
|
|
24
|
+
'controlled_environment',
|
|
25
|
+
]);
|
|
26
|
+
export const regionPackChannelSchema = z.enum(['web', 'pwa', 'whatsapp', 'ussd']);
|
|
27
|
+
export const regionPackSchema = z.object({
|
|
28
|
+
countryCode: countryCodeSchema,
|
|
29
|
+
countryName: z.string().min(1),
|
|
30
|
+
currencies: z.array(iso4217CurrencySchema).min(1),
|
|
31
|
+
defaultCurrency: iso4217CurrencySchema,
|
|
32
|
+
locales: z.array(z.string().min(2)).min(1),
|
|
33
|
+
defaultLocale: z.string().min(2),
|
|
34
|
+
defaultTimezone: z.string().min(1),
|
|
35
|
+
paymentGateways: z.array(z.string().min(1)),
|
|
36
|
+
seasonModel: seasonModelSchema,
|
|
37
|
+
cropCatalogId: z.string().min(1),
|
|
38
|
+
marketDataSources: z.array(z.string()),
|
|
39
|
+
geoProvider: z.string().min(1),
|
|
40
|
+
channels: z.array(regionPackChannelSchema).min(1),
|
|
41
|
+
compliancePacks: z.array(z.string()),
|
|
42
|
+
});
|
|
43
|
+
/** Locale fields persisted on Farm */
|
|
44
|
+
export const farmLocaleAttributesSchema = z.object({
|
|
45
|
+
countryCode: countryCodeSchema,
|
|
46
|
+
regionCode: z.string().max(20).nullable(),
|
|
47
|
+
subRegionCode: z.string().max(100).nullable(),
|
|
48
|
+
timezone: z.string().min(1).max(64),
|
|
49
|
+
locale: z.string().min(2).max(10),
|
|
50
|
+
unitSystem: unitSystemSchema,
|
|
51
|
+
areaUnit: areaUnitSchema,
|
|
52
|
+
lat: z.number().min(-90).max(90).nullable(),
|
|
53
|
+
lng: z.number().min(-180).max(180).nullable(),
|
|
54
|
+
});
|