@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.
- package/dist/routes/index.d.ts +6 -0
- package/dist/routes/index.d.ts.map +1 -1
- package/dist/routes/index.js +4 -0
- package/dist/routes/input-usage.routes.d.ts +409 -0
- package/dist/routes/input-usage.routes.d.ts.map +1 -0
- package/dist/routes/input-usage.routes.js +28 -0
- package/dist/routes/seasonal-plans.routes.d.ts +409 -0
- package/dist/routes/seasonal-plans.routes.d.ts.map +1 -0
- package/dist/routes/seasonal-plans.routes.js +28 -0
- package/dist/schemas/input-usage.schemas.d.ts +401 -0
- package/dist/schemas/input-usage.schemas.d.ts.map +1 -0
- package/dist/schemas/input-usage.schemas.js +37 -0
- package/dist/schemas/seasonal-plans.schemas.d.ts +401 -0
- package/dist/schemas/seasonal-plans.schemas.d.ts.map +1 -0
- package/dist/schemas/seasonal-plans.schemas.js +37 -0
- package/package.json +1 -1
package/dist/routes/index.d.ts
CHANGED
|
@@ -20,6 +20,8 @@ import { fieldMonitoringRouter } from './field-monitoring.routes';
|
|
|
20
20
|
import { fieldObservationsRouter } from './field-observations.routes';
|
|
21
21
|
import { adminRouter } from './admin.routes';
|
|
22
22
|
import { healthRouter } from './health.routes';
|
|
23
|
+
import { seasonalPlansRouter } from './seasonal-plans.routes';
|
|
24
|
+
import { inputUsageRouter } from './input-usage.routes';
|
|
23
25
|
/**
|
|
24
26
|
* Explicit interface definition for the API contract.
|
|
25
27
|
* This avoids TypeScript's type serialization limit when combining many routers
|
|
@@ -48,6 +50,8 @@ export interface ApiContractDefinition {
|
|
|
48
50
|
fieldObservations: typeof fieldObservationsRouter;
|
|
49
51
|
admin: typeof adminRouter;
|
|
50
52
|
health: typeof healthRouter;
|
|
53
|
+
seasonalPlans: typeof seasonalPlansRouter;
|
|
54
|
+
inputUsage: typeof inputUsageRouter;
|
|
51
55
|
}
|
|
52
56
|
/**
|
|
53
57
|
* Main API contract combining all routers
|
|
@@ -86,4 +90,6 @@ export type FieldMonitoringEndpoints = ApiContractType['fieldMonitoring'];
|
|
|
86
90
|
export type FieldObservationsEndpoints = ApiContractType['fieldObservations'];
|
|
87
91
|
export type AdminEndpoints = ApiContractType['admin'];
|
|
88
92
|
export type HealthEndpoints = ApiContractType['health'];
|
|
93
|
+
export type SeasonalPlansEndpoints = ApiContractType['seasonalPlans'];
|
|
94
|
+
export type InputUsageEndpoints = ApiContractType['inputUsage'];
|
|
89
95
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/routes/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,gB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AmB,GAAG,eAAe,CAAC,YAAY,CAAC,CAAC;AAChE,MAAM,MAAM,eAAe,GAAG,eAAe,CAAC,QAAQ,CAAC,CAAC;AACxD,MAAM,MAAM,uBAAuB,GAAG,eAAe,CAAC,gBAAgB,CAAC,CAAC;AACxE,MAAM,MAAM,wBAAwB,GAAG,eAAe,CAAC,iBAAiB,CAAC,CAAC;AAC1E,MAAM,MAAM,0BAA0B,GAAG,eAAe,CAAC,mBAAmB,CAAC,CAAC;AAC9E,MAAM,MAAM,cAAc,GAAG,eAAe,CAAC,OAAO,CAAC,CAAC;AACtD,MAAM,MAAM,eAAe,GAAG,eAAe,CAAC,QAAQ,CAAC,CAAC;AACxD,MAAM,MAAM,sBAAsB,GAAG,eAAe,CAAC,eAAe,CAAC,CAAC;AACtE,MAAM,MAAM,mBAAmB,GAAG,eAAe,CAAC,YAAY,CAAC,CAAC"}
|
package/dist/routes/index.js
CHANGED
|
@@ -24,6 +24,8 @@ const field_monitoring_routes_1 = require("./field-monitoring.routes");
|
|
|
24
24
|
const field_observations_routes_1 = require("./field-observations.routes");
|
|
25
25
|
const admin_routes_1 = require("./admin.routes");
|
|
26
26
|
const health_routes_1 = require("./health.routes");
|
|
27
|
+
const seasonal_plans_routes_1 = require("./seasonal-plans.routes");
|
|
28
|
+
const input_usage_routes_1 = require("./input-usage.routes");
|
|
27
29
|
const c = (0, core_1.initContract)();
|
|
28
30
|
/**
|
|
29
31
|
* Main API contract combining all routers
|
|
@@ -54,4 +56,6 @@ exports.apiContract = c.router({
|
|
|
54
56
|
fieldObservations: field_observations_routes_1.fieldObservationsRouter,
|
|
55
57
|
admin: admin_routes_1.adminRouter,
|
|
56
58
|
health: health_routes_1.healthRouter,
|
|
59
|
+
seasonalPlans: seasonal_plans_routes_1.seasonalPlansRouter,
|
|
60
|
+
inputUsage: input_usage_routes_1.inputUsageRouter,
|
|
57
61
|
});
|
|
@@ -0,0 +1,409 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const inputUsageRouter: {
|
|
3
|
+
getInputUsage: {
|
|
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 input usage";
|
|
25
|
+
description: "Get input usage with planned vs actual metrics calculated from tasks that reference inventory items";
|
|
26
|
+
method: "GET";
|
|
27
|
+
path: "/farms/:farmId/input-usage";
|
|
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.ZodOptional<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
|
+
name: z.ZodString;
|
|
41
|
+
planned: z.ZodNumber;
|
|
42
|
+
actual: z.ZodNumber;
|
|
43
|
+
unit: z.ZodString;
|
|
44
|
+
}, "strip", z.ZodTypeAny, {
|
|
45
|
+
id: string;
|
|
46
|
+
name: string;
|
|
47
|
+
unit: string;
|
|
48
|
+
planned: number;
|
|
49
|
+
actual: number;
|
|
50
|
+
}, {
|
|
51
|
+
id: string;
|
|
52
|
+
name: 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
|
+
farmId: string;
|
|
64
|
+
items: {
|
|
65
|
+
id: string;
|
|
66
|
+
name: string;
|
|
67
|
+
unit: string;
|
|
68
|
+
planned: number;
|
|
69
|
+
actual: number;
|
|
70
|
+
}[];
|
|
71
|
+
season?: string | undefined;
|
|
72
|
+
startDate?: string | undefined;
|
|
73
|
+
endDate?: string | undefined;
|
|
74
|
+
}, {
|
|
75
|
+
createdAt: string;
|
|
76
|
+
updatedAt: string;
|
|
77
|
+
farmId: string;
|
|
78
|
+
items: {
|
|
79
|
+
id: string;
|
|
80
|
+
name: string;
|
|
81
|
+
unit: string;
|
|
82
|
+
planned: number;
|
|
83
|
+
actual: number;
|
|
84
|
+
}[];
|
|
85
|
+
season?: string | undefined;
|
|
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
|
+
farmId: string;
|
|
99
|
+
items: {
|
|
100
|
+
id: string;
|
|
101
|
+
name: string;
|
|
102
|
+
unit: string;
|
|
103
|
+
planned: number;
|
|
104
|
+
actual: number;
|
|
105
|
+
}[];
|
|
106
|
+
season?: string | undefined;
|
|
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
|
+
farmId: string;
|
|
120
|
+
items: {
|
|
121
|
+
id: string;
|
|
122
|
+
name: string;
|
|
123
|
+
unit: string;
|
|
124
|
+
planned: number;
|
|
125
|
+
actual: number;
|
|
126
|
+
}[];
|
|
127
|
+
season?: string | undefined;
|
|
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
|
+
farmId: string;
|
|
167
|
+
items: {
|
|
168
|
+
id: string;
|
|
169
|
+
name: string;
|
|
170
|
+
unit: string;
|
|
171
|
+
planned: number;
|
|
172
|
+
actual: number;
|
|
173
|
+
}[];
|
|
174
|
+
season?: string | undefined;
|
|
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
|
+
farmId: string;
|
|
200
|
+
items: {
|
|
201
|
+
id: string;
|
|
202
|
+
name: string;
|
|
203
|
+
unit: string;
|
|
204
|
+
planned: number;
|
|
205
|
+
actual: number;
|
|
206
|
+
}[];
|
|
207
|
+
season?: string | undefined;
|
|
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=input-usage.routes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"input-usage.routes.d.ts","sourceRoot":"","sources":["../../src/routes/input-usage.routes.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAUxB,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmB3B,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.inputUsageRouter = void 0;
|
|
4
|
+
const core_1 = require("@ts-rest/core");
|
|
5
|
+
const zod_1 = require("zod");
|
|
6
|
+
const input_usage_schemas_1 = require("../schemas/input-usage.schemas");
|
|
7
|
+
const common_schemas_1 = require("../schemas/common.schemas");
|
|
8
|
+
const c = (0, core_1.initContract)();
|
|
9
|
+
exports.inputUsageRouter = c.router({
|
|
10
|
+
// Get input usage for a farm
|
|
11
|
+
getInputUsage: {
|
|
12
|
+
method: 'GET',
|
|
13
|
+
path: '/farms/:farmId/input-usage',
|
|
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: input_usage_schemas_1.inputUsageResponseSchema,
|
|
22
|
+
404: common_schemas_1.jsonApiErrorResponseSchema,
|
|
23
|
+
401: common_schemas_1.jsonApiErrorResponseSchema,
|
|
24
|
+
},
|
|
25
|
+
summary: 'Get input usage',
|
|
26
|
+
description: 'Get input usage with planned vs actual metrics calculated from tasks that reference inventory items',
|
|
27
|
+
},
|
|
28
|
+
});
|