@deepintel-ltd/farmpro-contracts 1.7.19 → 1.7.21

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 (84) hide show
  1. package/dist/index.d.ts +18 -1
  2. package/dist/index.d.ts.map +1 -1
  3. package/dist/index.js +17 -0
  4. package/dist/routes/agents.routes.d.ts +6 -6
  5. package/dist/routes/commodity-deals.routes.d.ts +2702 -0
  6. package/dist/routes/commodity-deals.routes.d.ts.map +1 -0
  7. package/dist/routes/commodity-deals.routes.js +83 -0
  8. package/dist/routes/cooperative.routes.d.ts +1327 -0
  9. package/dist/routes/cooperative.routes.d.ts.map +1 -0
  10. package/dist/routes/cooperative.routes.js +47 -0
  11. package/dist/routes/extension.routes.d.ts +2431 -0
  12. package/dist/routes/extension.routes.d.ts.map +1 -0
  13. package/dist/routes/extension.routes.js +75 -0
  14. package/dist/routes/farms.routes.d.ts +775 -0
  15. package/dist/routes/farms.routes.d.ts.map +1 -1
  16. package/dist/routes/farms.routes.js +15 -1
  17. package/dist/routes/field-monitoring.routes.d.ts +505 -0
  18. package/dist/routes/field-monitoring.routes.d.ts.map +1 -1
  19. package/dist/routes/field-monitoring.routes.js +23 -1
  20. package/dist/routes/fields.routes.d.ts +156 -155
  21. package/dist/routes/fields.routes.d.ts.map +1 -1
  22. package/dist/routes/index.d.ts +18 -0
  23. package/dist/routes/index.d.ts.map +1 -1
  24. package/dist/routes/index.js +12 -0
  25. package/dist/routes/invoices.routes.d.ts +49 -0
  26. package/dist/routes/invoices.routes.d.ts.map +1 -1
  27. package/dist/routes/live-monitor.routes.d.ts +513 -0
  28. package/dist/routes/live-monitor.routes.d.ts.map +1 -0
  29. package/dist/routes/live-monitor.routes.js +81 -0
  30. package/dist/routes/livestock-map.routes.d.ts +4 -4
  31. package/dist/routes/monitoring-visualization.routes.d.ts +4 -4
  32. package/dist/routes/notifications.routes.d.ts +1350 -0
  33. package/dist/routes/notifications.routes.d.ts.map +1 -0
  34. package/dist/routes/notifications.routes.js +66 -0
  35. package/dist/routes/organizations.routes.d.ts +49 -0
  36. package/dist/routes/organizations.routes.d.ts.map +1 -1
  37. package/dist/routes/team-payments.routes.d.ts +9571 -0
  38. package/dist/routes/team-payments.routes.d.ts.map +1 -0
  39. package/dist/routes/team-payments.routes.js +262 -0
  40. package/dist/routes/waybills.routes.d.ts +42 -0
  41. package/dist/routes/waybills.routes.d.ts.map +1 -1
  42. package/dist/schemas/agents.schemas.d.ts +1 -0
  43. package/dist/schemas/agents.schemas.d.ts.map +1 -1
  44. package/dist/schemas/commodity-deals.schemas.d.ts +1109 -0
  45. package/dist/schemas/commodity-deals.schemas.d.ts.map +1 -0
  46. package/dist/schemas/commodity-deals.schemas.js +82 -0
  47. package/dist/schemas/cooperative.schemas.d.ts +560 -0
  48. package/dist/schemas/cooperative.schemas.d.ts.map +1 -0
  49. package/dist/schemas/cooperative.schemas.js +71 -0
  50. package/dist/schemas/extension.schemas.d.ts +1204 -0
  51. package/dist/schemas/extension.schemas.d.ts.map +1 -0
  52. package/dist/schemas/extension.schemas.js +68 -0
  53. package/dist/schemas/farms.schemas.d.ts +591 -0
  54. package/dist/schemas/farms.schemas.d.ts.map +1 -1
  55. package/dist/schemas/farms.schemas.js +44 -0
  56. package/dist/schemas/field-monitoring.schemas.d.ts +276 -0
  57. package/dist/schemas/field-monitoring.schemas.d.ts.map +1 -1
  58. package/dist/schemas/field-monitoring.schemas.js +9 -0
  59. package/dist/schemas/field-observations.schemas.d.ts +1 -0
  60. package/dist/schemas/field-observations.schemas.d.ts.map +1 -1
  61. package/dist/schemas/fields.schemas.d.ts +188 -186
  62. package/dist/schemas/fields.schemas.d.ts.map +1 -1
  63. package/dist/schemas/fields.schemas.js +10 -2
  64. package/dist/schemas/invoices.schemas.d.ts +38 -0
  65. package/dist/schemas/invoices.schemas.d.ts.map +1 -1
  66. package/dist/schemas/invoices.schemas.js +2 -0
  67. package/dist/schemas/live-monitor.schemas.d.ts +596 -0
  68. package/dist/schemas/live-monitor.schemas.d.ts.map +1 -0
  69. package/dist/schemas/live-monitor.schemas.js +107 -0
  70. package/dist/schemas/livestock-map.schemas.d.ts +10 -10
  71. package/dist/schemas/monitoring-visualization.schemas.d.ts +4 -4
  72. package/dist/schemas/notifications.schemas.d.ts +464 -0
  73. package/dist/schemas/notifications.schemas.d.ts.map +1 -0
  74. package/dist/schemas/notifications.schemas.js +40 -0
  75. package/dist/schemas/organizations.schemas.d.ts +38 -0
  76. package/dist/schemas/organizations.schemas.d.ts.map +1 -1
  77. package/dist/schemas/organizations.schemas.js +2 -0
  78. package/dist/schemas/team-payments.schemas.d.ts +2604 -0
  79. package/dist/schemas/team-payments.schemas.d.ts.map +1 -0
  80. package/dist/schemas/team-payments.schemas.js +151 -0
  81. package/dist/schemas/waybills.schemas.d.ts +48 -0
  82. package/dist/schemas/waybills.schemas.d.ts.map +1 -1
  83. package/dist/schemas/waybills.schemas.js +3 -0
  84. package/package.json +1 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"commodity-deals.schemas.d.ts","sourceRoot":"","sources":["../../src/schemas/commodity-deals.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAQxB,eAAO,MAAM,yBAAyB,qEAMpC,CAAC;AAEH,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;EAQtC,CAAC;AAEH,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiBhB,CAAC;AAE3B,eAAO,MAAM,mCAAmC;;;;;;;;;;;;;;;;;;;;;;;;;;;EAS9C,CAAC;AAEH,eAAO,MAAM,mCAAmC;;;;;;;;;;;;;;;;;;;;;;;;;;;EAS9C,CAAC;AAEH,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAE7C,CAAC;AAEH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAC5E,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAChF,MAAM,MAAM,6BAA6B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mCAAmC,CAAC,CAAC;AAChG,MAAM,MAAM,6BAA6B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mCAAmC,CAAC,CAAC;AAChG,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AACjF,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AACjF,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,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAC9E,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kCAAkC,CAAC,CAAC"}
@@ -0,0 +1,82 @@
1
+ import { z } from 'zod';
2
+ import { timestampsSchema, createJsonApiResourceSchema, jsonApiSingleResponseSchema, jsonApiCollectionResponseSchema, } from './common.schemas';
3
+ export const commodityDealStatusSchema = z.enum([
4
+ 'draft',
5
+ 'in_transit',
6
+ 'invoiced',
7
+ 'paid',
8
+ 'cancelled',
9
+ ]);
10
+ export const commodityDealComputedSchema = z.object({
11
+ totalCost: z.number(),
12
+ saleAmount: z.number().nullable(),
13
+ grossProfit: z.number().nullable(),
14
+ commissionRate: z.number().nullable(),
15
+ commissionAmount: z.number().nullable(),
16
+ companyNet: z.number().nullable(),
17
+ isRealized: z.boolean(),
18
+ });
19
+ export const commodityDealAttributesSchema = z
20
+ .object({
21
+ organizationId: z.string().uuid(),
22
+ waybillId: z.string().uuid(),
23
+ invoiceId: z.string().uuid().nullable(),
24
+ handlerUserId: z.string().uuid().nullable(),
25
+ waybillNumber: z.string().nullable(),
26
+ invoiceNumber: z.string().nullable(),
27
+ buyerName: z.string().nullable(),
28
+ purchaseCost: z.number().nonnegative(),
29
+ transportCost: z.number().nonnegative(),
30
+ miscellaneousCost: z.number().nonnegative(),
31
+ currency: z.string().length(3).default('NGN'),
32
+ status: commodityDealStatusSchema,
33
+ notes: z.string().nullable(),
34
+ computed: commodityDealComputedSchema,
35
+ })
36
+ .merge(timestampsSchema);
37
+ export const createCommodityDealAttributesSchema = z.object({
38
+ waybillId: z.string().uuid(),
39
+ purchaseCost: z.number().nonnegative(),
40
+ transportCost: z.number().nonnegative().optional().default(0),
41
+ miscellaneousCost: z.number().nonnegative().optional().default(0),
42
+ currency: z.string().length(3).optional().default('NGN'),
43
+ status: commodityDealStatusSchema.optional(),
44
+ notes: z.string().optional(),
45
+ handlerUserId: z.string().uuid().optional(),
46
+ });
47
+ export const updateCommodityDealAttributesSchema = z.object({
48
+ purchaseCost: z.number().nonnegative().optional(),
49
+ transportCost: z.number().nonnegative().optional(),
50
+ miscellaneousCost: z.number().nonnegative().optional(),
51
+ currency: z.string().length(3).optional(),
52
+ status: commodityDealStatusSchema.optional(),
53
+ notes: z.string().nullable().optional(),
54
+ invoiceId: z.string().uuid().optional(),
55
+ handlerUserId: z.string().uuid().nullable().optional(),
56
+ });
57
+ export const createCommodityDealSchema = z.object({
58
+ type: z.literal('commodity-deals'),
59
+ attributes: createCommodityDealAttributesSchema,
60
+ });
61
+ export const updateCommodityDealSchema = z.object({
62
+ type: z.literal('commodity-deals'),
63
+ id: z.string().uuid().optional(),
64
+ attributes: updateCommodityDealAttributesSchema,
65
+ });
66
+ export const commodityDealResourceSchema = createJsonApiResourceSchema('commodity-deals', commodityDealAttributesSchema);
67
+ export const commodityDealResponseSchema = jsonApiSingleResponseSchema(commodityDealResourceSchema);
68
+ export const commodityDealListResponseSchema = jsonApiCollectionResponseSchema(commodityDealResourceSchema);
69
+ export const commodityDealSummarySchema = z.object({
70
+ paidDealCount: z.number().int().nonnegative(),
71
+ invoicedUnpaidCount: z.number().int().nonnegative(),
72
+ totalPaidRevenue: z.number(),
73
+ totalCostsOnPaidDeals: z.number(),
74
+ grossProfitOnPaidDeals: z.number(),
75
+ totalCommissionOnPaidDeals: z.number(),
76
+ companyNetOnPaidDeals: z.number(),
77
+ unrealizedGrossProfit: z.number(),
78
+ currency: z.string().length(3).default('NGN'),
79
+ });
80
+ export const commodityDealSummaryResponseSchema = z.object({
81
+ data: commodityDealSummarySchema,
82
+ });
@@ -0,0 +1,560 @@
1
+ import { z } from 'zod';
2
+ export declare const cooperativeHealthStatusSchema: z.ZodEnum<["healthy", "warning", "critical", "unknown"]>;
3
+ export declare const cooperativeDashboardAttributesSchema: z.ZodObject<{
4
+ organizationId: z.ZodString;
5
+ memberFarmCount: z.ZodNumber;
6
+ totalHectares: z.ZodNumber;
7
+ aggregateHealthScore: z.ZodNullable<z.ZodNumber>;
8
+ healthBreakdown: z.ZodObject<{
9
+ healthy: z.ZodNumber;
10
+ warning: z.ZodNumber;
11
+ critical: z.ZodNumber;
12
+ unknown: z.ZodNumber;
13
+ }, "strip", z.ZodTypeAny, {
14
+ unknown: number;
15
+ critical: number;
16
+ warning: number;
17
+ healthy: number;
18
+ }, {
19
+ unknown: number;
20
+ critical: number;
21
+ warning: number;
22
+ healthy: number;
23
+ }>;
24
+ activeAlerts: z.ZodNumber;
25
+ criticalFarms: z.ZodNumber;
26
+ totalFields: z.ZodNumber;
27
+ computedAt: z.ZodString;
28
+ }, "strip", z.ZodTypeAny, {
29
+ organizationId: string;
30
+ totalFields: number;
31
+ computedAt: string;
32
+ activeAlerts: number;
33
+ memberFarmCount: number;
34
+ totalHectares: number;
35
+ aggregateHealthScore: number | null;
36
+ healthBreakdown: {
37
+ unknown: number;
38
+ critical: number;
39
+ warning: number;
40
+ healthy: number;
41
+ };
42
+ criticalFarms: number;
43
+ }, {
44
+ organizationId: string;
45
+ totalFields: number;
46
+ computedAt: string;
47
+ activeAlerts: number;
48
+ memberFarmCount: number;
49
+ totalHectares: number;
50
+ aggregateHealthScore: number | null;
51
+ healthBreakdown: {
52
+ unknown: number;
53
+ critical: number;
54
+ warning: number;
55
+ healthy: number;
56
+ };
57
+ criticalFarms: number;
58
+ }>;
59
+ export declare const cooperativeDashboardResponseSchema: z.ZodObject<{
60
+ data: z.ZodObject<{
61
+ type: z.ZodLiteral<"cooperative-dashboard">;
62
+ id: z.ZodString;
63
+ attributes: z.ZodObject<{
64
+ organizationId: z.ZodString;
65
+ memberFarmCount: z.ZodNumber;
66
+ totalHectares: z.ZodNumber;
67
+ aggregateHealthScore: z.ZodNullable<z.ZodNumber>;
68
+ healthBreakdown: z.ZodObject<{
69
+ healthy: z.ZodNumber;
70
+ warning: z.ZodNumber;
71
+ critical: z.ZodNumber;
72
+ unknown: z.ZodNumber;
73
+ }, "strip", z.ZodTypeAny, {
74
+ unknown: number;
75
+ critical: number;
76
+ warning: number;
77
+ healthy: number;
78
+ }, {
79
+ unknown: number;
80
+ critical: number;
81
+ warning: number;
82
+ healthy: number;
83
+ }>;
84
+ activeAlerts: z.ZodNumber;
85
+ criticalFarms: z.ZodNumber;
86
+ totalFields: z.ZodNumber;
87
+ computedAt: z.ZodString;
88
+ }, "strip", z.ZodTypeAny, {
89
+ organizationId: string;
90
+ totalFields: number;
91
+ computedAt: string;
92
+ activeAlerts: number;
93
+ memberFarmCount: number;
94
+ totalHectares: number;
95
+ aggregateHealthScore: number | null;
96
+ healthBreakdown: {
97
+ unknown: number;
98
+ critical: number;
99
+ warning: number;
100
+ healthy: number;
101
+ };
102
+ criticalFarms: number;
103
+ }, {
104
+ organizationId: string;
105
+ totalFields: number;
106
+ computedAt: string;
107
+ activeAlerts: number;
108
+ memberFarmCount: number;
109
+ totalHectares: number;
110
+ aggregateHealthScore: number | null;
111
+ healthBreakdown: {
112
+ unknown: number;
113
+ critical: number;
114
+ warning: number;
115
+ healthy: number;
116
+ };
117
+ criticalFarms: number;
118
+ }>;
119
+ }, "strip", z.ZodTypeAny, {
120
+ type: "cooperative-dashboard";
121
+ id: string;
122
+ attributes: {
123
+ organizationId: string;
124
+ totalFields: number;
125
+ computedAt: string;
126
+ activeAlerts: number;
127
+ memberFarmCount: number;
128
+ totalHectares: number;
129
+ aggregateHealthScore: number | null;
130
+ healthBreakdown: {
131
+ unknown: number;
132
+ critical: number;
133
+ warning: number;
134
+ healthy: number;
135
+ };
136
+ criticalFarms: number;
137
+ };
138
+ }, {
139
+ type: "cooperative-dashboard";
140
+ id: string;
141
+ attributes: {
142
+ organizationId: string;
143
+ totalFields: number;
144
+ computedAt: string;
145
+ activeAlerts: number;
146
+ memberFarmCount: number;
147
+ totalHectares: number;
148
+ aggregateHealthScore: number | null;
149
+ healthBreakdown: {
150
+ unknown: number;
151
+ critical: number;
152
+ warning: number;
153
+ healthy: number;
154
+ };
155
+ criticalFarms: number;
156
+ };
157
+ }>;
158
+ }, "strip", z.ZodTypeAny, {
159
+ data: {
160
+ type: "cooperative-dashboard";
161
+ id: string;
162
+ attributes: {
163
+ organizationId: string;
164
+ totalFields: number;
165
+ computedAt: string;
166
+ activeAlerts: number;
167
+ memberFarmCount: number;
168
+ totalHectares: number;
169
+ aggregateHealthScore: number | null;
170
+ healthBreakdown: {
171
+ unknown: number;
172
+ critical: number;
173
+ warning: number;
174
+ healthy: number;
175
+ };
176
+ criticalFarms: number;
177
+ };
178
+ };
179
+ }, {
180
+ data: {
181
+ type: "cooperative-dashboard";
182
+ id: string;
183
+ attributes: {
184
+ organizationId: string;
185
+ totalFields: number;
186
+ computedAt: string;
187
+ activeAlerts: number;
188
+ memberFarmCount: number;
189
+ totalHectares: number;
190
+ aggregateHealthScore: number | null;
191
+ healthBreakdown: {
192
+ unknown: number;
193
+ critical: number;
194
+ warning: number;
195
+ healthy: number;
196
+ };
197
+ criticalFarms: number;
198
+ };
199
+ };
200
+ }>;
201
+ export declare const cooperativeMemberAttributesSchema: z.ZodObject<{
202
+ farmId: z.ZodString;
203
+ farmName: z.ZodString;
204
+ ownerName: z.ZodString;
205
+ ownerEmail: z.ZodString;
206
+ fieldCount: z.ZodNumber;
207
+ totalHectares: z.ZodNumber;
208
+ healthScore: z.ZodNullable<z.ZodNumber>;
209
+ healthStatus: z.ZodEnum<["healthy", "warning", "critical", "unknown"]>;
210
+ activeAlerts: z.ZodNumber;
211
+ lastActivityAt: z.ZodNullable<z.ZodString>;
212
+ }, "strip", z.ZodTypeAny, {
213
+ farmId: string;
214
+ farmName: string;
215
+ healthScore: number | null;
216
+ healthStatus: "unknown" | "critical" | "warning" | "healthy";
217
+ fieldCount: number;
218
+ activeAlerts: number;
219
+ totalHectares: number;
220
+ ownerName: string;
221
+ ownerEmail: string;
222
+ lastActivityAt: string | null;
223
+ }, {
224
+ farmId: string;
225
+ farmName: string;
226
+ healthScore: number | null;
227
+ healthStatus: "unknown" | "critical" | "warning" | "healthy";
228
+ fieldCount: number;
229
+ activeAlerts: number;
230
+ totalHectares: number;
231
+ ownerName: string;
232
+ ownerEmail: string;
233
+ lastActivityAt: string | null;
234
+ }>;
235
+ export declare const cooperativeMembersResponseSchema: z.ZodObject<{
236
+ data: z.ZodArray<z.ZodObject<{
237
+ type: z.ZodLiteral<"cooperative-members">;
238
+ id: z.ZodString;
239
+ attributes: z.ZodObject<{
240
+ farmId: z.ZodString;
241
+ farmName: z.ZodString;
242
+ ownerName: z.ZodString;
243
+ ownerEmail: z.ZodString;
244
+ fieldCount: z.ZodNumber;
245
+ totalHectares: z.ZodNumber;
246
+ healthScore: z.ZodNullable<z.ZodNumber>;
247
+ healthStatus: z.ZodEnum<["healthy", "warning", "critical", "unknown"]>;
248
+ activeAlerts: z.ZodNumber;
249
+ lastActivityAt: z.ZodNullable<z.ZodString>;
250
+ }, "strip", z.ZodTypeAny, {
251
+ farmId: string;
252
+ farmName: string;
253
+ healthScore: number | null;
254
+ healthStatus: "unknown" | "critical" | "warning" | "healthy";
255
+ fieldCount: number;
256
+ activeAlerts: number;
257
+ totalHectares: number;
258
+ ownerName: string;
259
+ ownerEmail: string;
260
+ lastActivityAt: string | null;
261
+ }, {
262
+ farmId: string;
263
+ farmName: string;
264
+ healthScore: number | null;
265
+ healthStatus: "unknown" | "critical" | "warning" | "healthy";
266
+ fieldCount: number;
267
+ activeAlerts: number;
268
+ totalHectares: number;
269
+ ownerName: string;
270
+ ownerEmail: string;
271
+ lastActivityAt: string | null;
272
+ }>;
273
+ }, "strip", z.ZodTypeAny, {
274
+ type: "cooperative-members";
275
+ id: string;
276
+ attributes: {
277
+ farmId: string;
278
+ farmName: string;
279
+ healthScore: number | null;
280
+ healthStatus: "unknown" | "critical" | "warning" | "healthy";
281
+ fieldCount: number;
282
+ activeAlerts: number;
283
+ totalHectares: number;
284
+ ownerName: string;
285
+ ownerEmail: string;
286
+ lastActivityAt: string | null;
287
+ };
288
+ }, {
289
+ type: "cooperative-members";
290
+ id: string;
291
+ attributes: {
292
+ farmId: string;
293
+ farmName: string;
294
+ healthScore: number | null;
295
+ healthStatus: "unknown" | "critical" | "warning" | "healthy";
296
+ fieldCount: number;
297
+ activeAlerts: number;
298
+ totalHectares: number;
299
+ ownerName: string;
300
+ ownerEmail: string;
301
+ lastActivityAt: string | null;
302
+ };
303
+ }>, "many">;
304
+ meta: z.ZodObject<{
305
+ totalMembers: z.ZodNumber;
306
+ }, "strip", z.ZodTypeAny, {
307
+ totalMembers: number;
308
+ }, {
309
+ totalMembers: number;
310
+ }>;
311
+ }, "strip", z.ZodTypeAny, {
312
+ meta: {
313
+ totalMembers: number;
314
+ };
315
+ data: {
316
+ type: "cooperative-members";
317
+ id: string;
318
+ attributes: {
319
+ farmId: string;
320
+ farmName: string;
321
+ healthScore: number | null;
322
+ healthStatus: "unknown" | "critical" | "warning" | "healthy";
323
+ fieldCount: number;
324
+ activeAlerts: number;
325
+ totalHectares: number;
326
+ ownerName: string;
327
+ ownerEmail: string;
328
+ lastActivityAt: string | null;
329
+ };
330
+ }[];
331
+ }, {
332
+ meta: {
333
+ totalMembers: number;
334
+ };
335
+ data: {
336
+ type: "cooperative-members";
337
+ id: string;
338
+ attributes: {
339
+ farmId: string;
340
+ farmName: string;
341
+ healthScore: number | null;
342
+ healthStatus: "unknown" | "critical" | "warning" | "healthy";
343
+ fieldCount: number;
344
+ activeAlerts: number;
345
+ totalHectares: number;
346
+ ownerName: string;
347
+ ownerEmail: string;
348
+ lastActivityAt: string | null;
349
+ };
350
+ }[];
351
+ }>;
352
+ export declare const bulkAlertAttributesSchema: z.ZodObject<{
353
+ title: z.ZodString;
354
+ message: z.ZodString;
355
+ severity: z.ZodDefault<z.ZodEnum<["low", "medium", "high", "critical"]>>;
356
+ farmIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
357
+ recommendation: z.ZodOptional<z.ZodString>;
358
+ }, "strip", z.ZodTypeAny, {
359
+ message: string;
360
+ title: string;
361
+ severity: "critical" | "low" | "medium" | "high";
362
+ recommendation?: string | undefined;
363
+ farmIds?: string[] | undefined;
364
+ }, {
365
+ message: string;
366
+ title: string;
367
+ recommendation?: string | undefined;
368
+ severity?: "critical" | "low" | "medium" | "high" | undefined;
369
+ farmIds?: string[] | undefined;
370
+ }>;
371
+ export declare const bulkAlertInputSchema: z.ZodObject<{
372
+ type: z.ZodLiteral<"cooperative-bulk-alerts">;
373
+ attributes: z.ZodObject<{
374
+ title: z.ZodString;
375
+ message: z.ZodString;
376
+ severity: z.ZodDefault<z.ZodEnum<["low", "medium", "high", "critical"]>>;
377
+ farmIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
378
+ recommendation: z.ZodOptional<z.ZodString>;
379
+ }, "strip", z.ZodTypeAny, {
380
+ message: string;
381
+ title: string;
382
+ severity: "critical" | "low" | "medium" | "high";
383
+ recommendation?: string | undefined;
384
+ farmIds?: string[] | undefined;
385
+ }, {
386
+ message: string;
387
+ title: string;
388
+ recommendation?: string | undefined;
389
+ severity?: "critical" | "low" | "medium" | "high" | undefined;
390
+ farmIds?: string[] | undefined;
391
+ }>;
392
+ }, "strip", z.ZodTypeAny, {
393
+ type: "cooperative-bulk-alerts";
394
+ attributes: {
395
+ message: string;
396
+ title: string;
397
+ severity: "critical" | "low" | "medium" | "high";
398
+ recommendation?: string | undefined;
399
+ farmIds?: string[] | undefined;
400
+ };
401
+ }, {
402
+ type: "cooperative-bulk-alerts";
403
+ attributes: {
404
+ message: string;
405
+ title: string;
406
+ recommendation?: string | undefined;
407
+ severity?: "critical" | "low" | "medium" | "high" | undefined;
408
+ farmIds?: string[] | undefined;
409
+ };
410
+ }>;
411
+ export declare const bulkAlertResponseSchema: z.ZodObject<{
412
+ data: z.ZodObject<{
413
+ type: z.ZodLiteral<"cooperative-bulk-alerts">;
414
+ id: z.ZodString;
415
+ attributes: z.ZodObject<{
416
+ alertsCreated: z.ZodNumber;
417
+ farmsNotified: z.ZodNumber;
418
+ farmIds: z.ZodArray<z.ZodString, "many">;
419
+ }, "strip", z.ZodTypeAny, {
420
+ farmIds: string[];
421
+ alertsCreated: number;
422
+ farmsNotified: number;
423
+ }, {
424
+ farmIds: string[];
425
+ alertsCreated: number;
426
+ farmsNotified: number;
427
+ }>;
428
+ }, "strip", z.ZodTypeAny, {
429
+ type: "cooperative-bulk-alerts";
430
+ id: string;
431
+ attributes: {
432
+ farmIds: string[];
433
+ alertsCreated: number;
434
+ farmsNotified: number;
435
+ };
436
+ }, {
437
+ type: "cooperative-bulk-alerts";
438
+ id: string;
439
+ attributes: {
440
+ farmIds: string[];
441
+ alertsCreated: number;
442
+ farmsNotified: number;
443
+ };
444
+ }>;
445
+ }, "strip", z.ZodTypeAny, {
446
+ data: {
447
+ type: "cooperative-bulk-alerts";
448
+ id: string;
449
+ attributes: {
450
+ farmIds: string[];
451
+ alertsCreated: number;
452
+ farmsNotified: number;
453
+ };
454
+ };
455
+ }, {
456
+ data: {
457
+ type: "cooperative-bulk-alerts";
458
+ id: string;
459
+ attributes: {
460
+ farmIds: string[];
461
+ alertsCreated: number;
462
+ farmsNotified: number;
463
+ };
464
+ };
465
+ }>;
466
+ export declare const cooperativeErrorSchema: z.ZodObject<{
467
+ errors: z.ZodArray<z.ZodObject<{
468
+ id: z.ZodOptional<z.ZodString>;
469
+ links: z.ZodOptional<z.ZodObject<{
470
+ about: z.ZodOptional<z.ZodString>;
471
+ }, "strip", z.ZodTypeAny, {
472
+ about?: string | undefined;
473
+ }, {
474
+ about?: string | undefined;
475
+ }>>;
476
+ status: z.ZodOptional<z.ZodString>;
477
+ code: z.ZodOptional<z.ZodString>;
478
+ title: z.ZodOptional<z.ZodString>;
479
+ detail: z.ZodOptional<z.ZodString>;
480
+ source: z.ZodOptional<z.ZodObject<{
481
+ pointer: z.ZodOptional<z.ZodString>;
482
+ parameter: z.ZodOptional<z.ZodString>;
483
+ }, "strip", z.ZodTypeAny, {
484
+ pointer?: string | undefined;
485
+ parameter?: string | undefined;
486
+ }, {
487
+ pointer?: string | undefined;
488
+ parameter?: string | undefined;
489
+ }>>;
490
+ meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
491
+ }, "strip", z.ZodTypeAny, {
492
+ status?: string | undefined;
493
+ code?: string | undefined;
494
+ id?: string | undefined;
495
+ links?: {
496
+ about?: string | undefined;
497
+ } | undefined;
498
+ meta?: Record<string, unknown> | undefined;
499
+ title?: string | undefined;
500
+ detail?: string | undefined;
501
+ source?: {
502
+ pointer?: string | undefined;
503
+ parameter?: string | undefined;
504
+ } | undefined;
505
+ }, {
506
+ status?: string | undefined;
507
+ code?: string | undefined;
508
+ id?: string | undefined;
509
+ links?: {
510
+ about?: string | undefined;
511
+ } | undefined;
512
+ meta?: Record<string, unknown> | undefined;
513
+ title?: string | undefined;
514
+ detail?: string | undefined;
515
+ source?: {
516
+ pointer?: string | undefined;
517
+ parameter?: string | undefined;
518
+ } | undefined;
519
+ }>, "many">;
520
+ meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
521
+ }, "strip", z.ZodTypeAny, {
522
+ errors: {
523
+ status?: string | undefined;
524
+ code?: string | undefined;
525
+ id?: string | undefined;
526
+ links?: {
527
+ about?: string | undefined;
528
+ } | undefined;
529
+ meta?: Record<string, unknown> | undefined;
530
+ title?: string | undefined;
531
+ detail?: string | undefined;
532
+ source?: {
533
+ pointer?: string | undefined;
534
+ parameter?: string | undefined;
535
+ } | undefined;
536
+ }[];
537
+ meta?: Record<string, unknown> | undefined;
538
+ }, {
539
+ errors: {
540
+ status?: string | undefined;
541
+ code?: string | undefined;
542
+ id?: string | undefined;
543
+ links?: {
544
+ about?: string | undefined;
545
+ } | undefined;
546
+ meta?: Record<string, unknown> | undefined;
547
+ title?: string | undefined;
548
+ detail?: string | undefined;
549
+ source?: {
550
+ pointer?: string | undefined;
551
+ parameter?: string | undefined;
552
+ } | undefined;
553
+ }[];
554
+ meta?: Record<string, unknown> | undefined;
555
+ }>;
556
+ export type CooperativeDashboardResponse = z.infer<typeof cooperativeDashboardResponseSchema>;
557
+ export type CooperativeMembersResponse = z.infer<typeof cooperativeMembersResponseSchema>;
558
+ export type BulkAlertInput = z.infer<typeof bulkAlertInputSchema>;
559
+ export type BulkAlertResponse = z.infer<typeof bulkAlertResponseSchema>;
560
+ //# sourceMappingURL=cooperative.schemas.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cooperative.schemas.d.ts","sourceRoot":"","sources":["../../src/schemas/cooperative.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,6BAA6B,0DAAw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