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