@deepintel-ltd/farmpro-contracts 1.5.4 → 1.5.6

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.
@@ -0,0 +1,409 @@
1
+ import { z } from 'zod';
2
+ export declare const seasonalPlansRouter: {
3
+ getSeasonalPlan: {
4
+ pathParams: z.ZodObject<{
5
+ farmId: z.ZodString;
6
+ }, "strip", z.ZodTypeAny, {
7
+ farmId: string;
8
+ }, {
9
+ farmId: string;
10
+ }>;
11
+ query: z.ZodObject<{
12
+ season: z.ZodOptional<z.ZodString>;
13
+ 'filter[startDate]': z.ZodOptional<z.ZodString>;
14
+ 'filter[endDate]': z.ZodOptional<z.ZodString>;
15
+ }, "strip", z.ZodTypeAny, {
16
+ 'filter[startDate]'?: string | undefined;
17
+ 'filter[endDate]'?: string | undefined;
18
+ season?: string | undefined;
19
+ }, {
20
+ 'filter[startDate]'?: string | undefined;
21
+ 'filter[endDate]'?: string | undefined;
22
+ season?: string | undefined;
23
+ }>;
24
+ summary: "Get seasonal plan progress";
25
+ description: "Get seasonal plan progress with planned vs actual metrics calculated from tasks and field data";
26
+ method: "GET";
27
+ path: "/farms/:farmId/seasonal-plans";
28
+ responses: {
29
+ 200: z.ZodObject<{
30
+ data: z.ZodObject<{
31
+ type: z.ZodLiteral<string>;
32
+ id: z.ZodString;
33
+ attributes: z.ZodObject<{
34
+ farmId: z.ZodString;
35
+ season: z.ZodString;
36
+ startDate: z.ZodOptional<z.ZodString>;
37
+ endDate: z.ZodOptional<z.ZodString>;
38
+ items: z.ZodArray<z.ZodObject<{
39
+ id: z.ZodString;
40
+ title: z.ZodString;
41
+ planned: z.ZodNumber;
42
+ actual: z.ZodNumber;
43
+ unit: z.ZodString;
44
+ }, "strip", z.ZodTypeAny, {
45
+ id: string;
46
+ title: string;
47
+ unit: string;
48
+ planned: number;
49
+ actual: number;
50
+ }, {
51
+ id: string;
52
+ title: string;
53
+ unit: string;
54
+ planned: number;
55
+ actual: number;
56
+ }>, "many">;
57
+ } & {
58
+ createdAt: z.ZodString;
59
+ updatedAt: z.ZodString;
60
+ }, "strip", z.ZodTypeAny, {
61
+ createdAt: string;
62
+ updatedAt: string;
63
+ season: string;
64
+ farmId: string;
65
+ items: {
66
+ id: string;
67
+ title: string;
68
+ unit: string;
69
+ planned: number;
70
+ actual: number;
71
+ }[];
72
+ startDate?: string | undefined;
73
+ endDate?: string | undefined;
74
+ }, {
75
+ createdAt: string;
76
+ updatedAt: string;
77
+ season: string;
78
+ farmId: string;
79
+ items: {
80
+ id: string;
81
+ title: string;
82
+ unit: string;
83
+ planned: number;
84
+ actual: number;
85
+ }[];
86
+ startDate?: string | undefined;
87
+ endDate?: string | undefined;
88
+ }>;
89
+ relationships: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
90
+ links: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
91
+ meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
92
+ }, "strip", z.ZodTypeAny, {
93
+ type: string;
94
+ id: string;
95
+ attributes: {
96
+ createdAt: string;
97
+ updatedAt: string;
98
+ season: string;
99
+ farmId: string;
100
+ items: {
101
+ id: string;
102
+ title: string;
103
+ unit: string;
104
+ planned: number;
105
+ actual: number;
106
+ }[];
107
+ startDate?: string | undefined;
108
+ endDate?: string | undefined;
109
+ };
110
+ relationships?: Record<string, unknown> | undefined;
111
+ links?: Record<string, string> | undefined;
112
+ meta?: Record<string, unknown> | undefined;
113
+ }, {
114
+ type: string;
115
+ id: string;
116
+ attributes: {
117
+ createdAt: string;
118
+ updatedAt: string;
119
+ season: string;
120
+ farmId: string;
121
+ items: {
122
+ id: string;
123
+ title: string;
124
+ unit: string;
125
+ planned: number;
126
+ actual: number;
127
+ }[];
128
+ startDate?: string | undefined;
129
+ endDate?: string | undefined;
130
+ };
131
+ relationships?: Record<string, unknown> | undefined;
132
+ links?: Record<string, string> | undefined;
133
+ meta?: Record<string, unknown> | undefined;
134
+ }>;
135
+ included: z.ZodOptional<z.ZodArray<z.ZodObject<{
136
+ type: z.ZodString;
137
+ id: z.ZodString;
138
+ attributes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
139
+ relationships: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
140
+ links: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
141
+ meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
142
+ }, "strip", z.ZodTypeAny, {
143
+ type: string;
144
+ id: string;
145
+ attributes?: Record<string, unknown> | undefined;
146
+ relationships?: Record<string, unknown> | undefined;
147
+ links?: Record<string, string> | undefined;
148
+ meta?: Record<string, unknown> | undefined;
149
+ }, {
150
+ type: string;
151
+ id: string;
152
+ attributes?: Record<string, unknown> | undefined;
153
+ relationships?: Record<string, unknown> | undefined;
154
+ links?: Record<string, string> | undefined;
155
+ meta?: Record<string, unknown> | undefined;
156
+ }>, "many">>;
157
+ meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
158
+ links: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
159
+ }, "strip", z.ZodTypeAny, {
160
+ data: {
161
+ type: string;
162
+ id: string;
163
+ attributes: {
164
+ createdAt: string;
165
+ updatedAt: string;
166
+ season: string;
167
+ farmId: string;
168
+ items: {
169
+ id: string;
170
+ title: string;
171
+ unit: string;
172
+ planned: number;
173
+ actual: number;
174
+ }[];
175
+ startDate?: string | undefined;
176
+ endDate?: string | undefined;
177
+ };
178
+ relationships?: Record<string, unknown> | undefined;
179
+ links?: Record<string, string> | undefined;
180
+ meta?: Record<string, unknown> | undefined;
181
+ };
182
+ links?: Record<string, string> | undefined;
183
+ meta?: Record<string, unknown> | undefined;
184
+ included?: {
185
+ type: string;
186
+ id: string;
187
+ attributes?: Record<string, unknown> | undefined;
188
+ relationships?: Record<string, unknown> | undefined;
189
+ links?: Record<string, string> | undefined;
190
+ meta?: Record<string, unknown> | undefined;
191
+ }[] | undefined;
192
+ }, {
193
+ data: {
194
+ type: string;
195
+ id: string;
196
+ attributes: {
197
+ createdAt: string;
198
+ updatedAt: string;
199
+ season: string;
200
+ farmId: string;
201
+ items: {
202
+ id: string;
203
+ title: string;
204
+ unit: string;
205
+ planned: number;
206
+ actual: number;
207
+ }[];
208
+ startDate?: string | undefined;
209
+ endDate?: string | undefined;
210
+ };
211
+ relationships?: Record<string, unknown> | undefined;
212
+ links?: Record<string, string> | undefined;
213
+ meta?: Record<string, unknown> | undefined;
214
+ };
215
+ links?: Record<string, string> | undefined;
216
+ meta?: Record<string, unknown> | undefined;
217
+ included?: {
218
+ type: string;
219
+ id: string;
220
+ attributes?: Record<string, unknown> | undefined;
221
+ relationships?: Record<string, unknown> | undefined;
222
+ links?: Record<string, string> | undefined;
223
+ meta?: Record<string, unknown> | undefined;
224
+ }[] | undefined;
225
+ }>;
226
+ 404: z.ZodObject<{
227
+ errors: z.ZodArray<z.ZodObject<{
228
+ id: z.ZodOptional<z.ZodString>;
229
+ links: z.ZodOptional<z.ZodObject<{
230
+ about: z.ZodOptional<z.ZodString>;
231
+ }, "strip", z.ZodTypeAny, {
232
+ about?: string | undefined;
233
+ }, {
234
+ about?: string | undefined;
235
+ }>>;
236
+ status: z.ZodOptional<z.ZodString>;
237
+ code: z.ZodOptional<z.ZodString>;
238
+ title: z.ZodOptional<z.ZodString>;
239
+ detail: z.ZodOptional<z.ZodString>;
240
+ source: z.ZodOptional<z.ZodObject<{
241
+ pointer: z.ZodOptional<z.ZodString>;
242
+ parameter: z.ZodOptional<z.ZodString>;
243
+ }, "strip", z.ZodTypeAny, {
244
+ pointer?: string | undefined;
245
+ parameter?: string | undefined;
246
+ }, {
247
+ pointer?: string | undefined;
248
+ parameter?: string | undefined;
249
+ }>>;
250
+ meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
251
+ }, "strip", z.ZodTypeAny, {
252
+ status?: string | undefined;
253
+ code?: string | undefined;
254
+ id?: string | undefined;
255
+ links?: {
256
+ about?: string | undefined;
257
+ } | undefined;
258
+ meta?: Record<string, unknown> | undefined;
259
+ title?: string | undefined;
260
+ detail?: string | undefined;
261
+ source?: {
262
+ pointer?: string | undefined;
263
+ parameter?: string | undefined;
264
+ } | undefined;
265
+ }, {
266
+ status?: string | undefined;
267
+ code?: string | undefined;
268
+ id?: string | undefined;
269
+ links?: {
270
+ about?: string | undefined;
271
+ } | undefined;
272
+ meta?: Record<string, unknown> | undefined;
273
+ title?: string | undefined;
274
+ detail?: string | undefined;
275
+ source?: {
276
+ pointer?: string | undefined;
277
+ parameter?: string | undefined;
278
+ } | undefined;
279
+ }>, "many">;
280
+ meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
281
+ }, "strip", z.ZodTypeAny, {
282
+ errors: {
283
+ status?: string | undefined;
284
+ code?: string | undefined;
285
+ id?: string | undefined;
286
+ links?: {
287
+ about?: string | undefined;
288
+ } | undefined;
289
+ meta?: Record<string, unknown> | undefined;
290
+ title?: string | undefined;
291
+ detail?: string | undefined;
292
+ source?: {
293
+ pointer?: string | undefined;
294
+ parameter?: string | undefined;
295
+ } | undefined;
296
+ }[];
297
+ meta?: Record<string, unknown> | undefined;
298
+ }, {
299
+ errors: {
300
+ status?: string | undefined;
301
+ code?: string | undefined;
302
+ id?: string | undefined;
303
+ links?: {
304
+ about?: string | undefined;
305
+ } | undefined;
306
+ meta?: Record<string, unknown> | undefined;
307
+ title?: string | undefined;
308
+ detail?: string | undefined;
309
+ source?: {
310
+ pointer?: string | undefined;
311
+ parameter?: string | undefined;
312
+ } | undefined;
313
+ }[];
314
+ meta?: Record<string, unknown> | undefined;
315
+ }>;
316
+ 401: z.ZodObject<{
317
+ errors: z.ZodArray<z.ZodObject<{
318
+ id: z.ZodOptional<z.ZodString>;
319
+ links: z.ZodOptional<z.ZodObject<{
320
+ about: z.ZodOptional<z.ZodString>;
321
+ }, "strip", z.ZodTypeAny, {
322
+ about?: string | undefined;
323
+ }, {
324
+ about?: string | undefined;
325
+ }>>;
326
+ status: z.ZodOptional<z.ZodString>;
327
+ code: z.ZodOptional<z.ZodString>;
328
+ title: z.ZodOptional<z.ZodString>;
329
+ detail: z.ZodOptional<z.ZodString>;
330
+ source: z.ZodOptional<z.ZodObject<{
331
+ pointer: z.ZodOptional<z.ZodString>;
332
+ parameter: z.ZodOptional<z.ZodString>;
333
+ }, "strip", z.ZodTypeAny, {
334
+ pointer?: string | undefined;
335
+ parameter?: string | undefined;
336
+ }, {
337
+ pointer?: string | undefined;
338
+ parameter?: string | undefined;
339
+ }>>;
340
+ meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
341
+ }, "strip", z.ZodTypeAny, {
342
+ status?: string | undefined;
343
+ code?: string | undefined;
344
+ id?: string | undefined;
345
+ links?: {
346
+ about?: string | undefined;
347
+ } | undefined;
348
+ meta?: Record<string, unknown> | undefined;
349
+ title?: string | undefined;
350
+ detail?: string | undefined;
351
+ source?: {
352
+ pointer?: string | undefined;
353
+ parameter?: string | undefined;
354
+ } | undefined;
355
+ }, {
356
+ status?: string | undefined;
357
+ code?: string | undefined;
358
+ id?: string | undefined;
359
+ links?: {
360
+ about?: string | undefined;
361
+ } | undefined;
362
+ meta?: Record<string, unknown> | undefined;
363
+ title?: string | undefined;
364
+ detail?: string | undefined;
365
+ source?: {
366
+ pointer?: string | undefined;
367
+ parameter?: string | undefined;
368
+ } | undefined;
369
+ }>, "many">;
370
+ meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
371
+ }, "strip", z.ZodTypeAny, {
372
+ errors: {
373
+ status?: string | undefined;
374
+ code?: string | undefined;
375
+ id?: string | undefined;
376
+ links?: {
377
+ about?: string | undefined;
378
+ } | undefined;
379
+ meta?: Record<string, unknown> | undefined;
380
+ title?: string | undefined;
381
+ detail?: string | undefined;
382
+ source?: {
383
+ pointer?: string | undefined;
384
+ parameter?: string | undefined;
385
+ } | undefined;
386
+ }[];
387
+ meta?: Record<string, unknown> | undefined;
388
+ }, {
389
+ errors: {
390
+ status?: string | undefined;
391
+ code?: string | undefined;
392
+ id?: string | undefined;
393
+ links?: {
394
+ about?: string | undefined;
395
+ } | undefined;
396
+ meta?: Record<string, unknown> | undefined;
397
+ title?: string | undefined;
398
+ detail?: string | undefined;
399
+ source?: {
400
+ pointer?: string | undefined;
401
+ parameter?: string | undefined;
402
+ } | undefined;
403
+ }[];
404
+ meta?: Record<string, unknown> | undefined;
405
+ }>;
406
+ };
407
+ };
408
+ };
409
+ //# sourceMappingURL=seasonal-plans.routes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"seasonal-plans.routes.d.ts","sourceRoot":"","sources":["../../src/routes/seasonal-plans.routes.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAUxB,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmB9B,CAAC"}
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.seasonalPlansRouter = void 0;
4
+ const core_1 = require("@ts-rest/core");
5
+ const zod_1 = require("zod");
6
+ const seasonal_plans_schemas_1 = require("../schemas/seasonal-plans.schemas");
7
+ const common_schemas_1 = require("../schemas/common.schemas");
8
+ const c = (0, core_1.initContract)();
9
+ exports.seasonalPlansRouter = c.router({
10
+ // Get seasonal plan progress for a farm
11
+ getSeasonalPlan: {
12
+ method: 'GET',
13
+ path: '/farms/:farmId/seasonal-plans',
14
+ pathParams: zod_1.z.object({ farmId: zod_1.z.string().uuid() }),
15
+ query: zod_1.z.object({
16
+ season: zod_1.z.string().optional(), // e.g., "2024-2025"
17
+ 'filter[startDate]': zod_1.z.string().datetime().optional(),
18
+ 'filter[endDate]': zod_1.z.string().datetime().optional(),
19
+ }),
20
+ responses: {
21
+ 200: seasonal_plans_schemas_1.seasonalPlanResponseSchema,
22
+ 404: common_schemas_1.jsonApiErrorResponseSchema,
23
+ 401: common_schemas_1.jsonApiErrorResponseSchema,
24
+ },
25
+ summary: 'Get seasonal plan progress',
26
+ description: 'Get seasonal plan progress with planned vs actual metrics calculated from tasks and field data',
27
+ },
28
+ });