@deepintel-ltd/farmpro-contracts 1.21.0 → 1.22.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/routes/fields.routes.d.ts +1413 -1
- package/dist/routes/fields.routes.d.ts.map +1 -1
- package/dist/routes/fields.routes.js +43 -3
- package/dist/schemas/fields.schemas.d.ts +63 -0
- package/dist/schemas/fields.schemas.d.ts.map +1 -1
- package/dist/schemas/fields.schemas.js +11 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fields.routes.d.ts","sourceRoot":"","sources":["../../src/routes/fields.routes.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"fields.routes.d.ts","sourceRoot":"","sources":["../../src/routes/fields.routes.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AA0BxB,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;YAWjB,kEAAkE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgNxE,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { initContract } from '@ts-rest/core';
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
-
import { createFieldSchema, updateFieldSchema, recordPlantingSchema, endSeasonSchema, fieldResponseSchema, fieldDetailResponseSchema, fieldListResponseSchema, seasonTimelineListResponseSchema, } from '../schemas/fields.schemas';
|
|
3
|
+
import { createFieldSchema, updateFieldSchema, recordPlantingSchema, endSeasonSchema, fieldArchiveSchema, fieldRestoreSchema, fieldResponseSchema, fieldDetailResponseSchema, fieldListResponseSchema, seasonTimelineListResponseSchema, } from '../schemas/fields.schemas';
|
|
4
4
|
import { jsonApiErrorResponseSchema, jsonApiSuccessResponseSchema, jsonApiPaginationQuerySchema, jsonApiSortQuerySchema, jsonApiIncludeQuerySchema, jsonApiFilterQuerySchema, simpleApiErrorSchema, } from '../schemas/common.schemas';
|
|
5
5
|
import { uploadFileBodySchema } from '../schemas/files.schemas';
|
|
6
6
|
const c = initContract();
|
|
@@ -13,7 +13,11 @@ export const fieldsRouter = c.router({
|
|
|
13
13
|
query: jsonApiPaginationQuerySchema
|
|
14
14
|
.merge(jsonApiSortQuerySchema)
|
|
15
15
|
.merge(jsonApiIncludeQuerySchema)
|
|
16
|
-
.merge(jsonApiFilterQuerySchema)
|
|
16
|
+
.merge(jsonApiFilterQuerySchema)
|
|
17
|
+
.extend({
|
|
18
|
+
/** Default omits archived. Pass `true` for archived-only list. */
|
|
19
|
+
'filter[archived]': z.enum(['true', 'false']).optional(),
|
|
20
|
+
}),
|
|
17
21
|
responses: {
|
|
18
22
|
200: fieldListResponseSchema,
|
|
19
23
|
400: jsonApiErrorResponseSchema,
|
|
@@ -21,7 +25,7 @@ export const fieldsRouter = c.router({
|
|
|
21
25
|
401: jsonApiErrorResponseSchema,
|
|
22
26
|
},
|
|
23
27
|
summary: 'List fields for a farm',
|
|
24
|
-
description: 'Get
|
|
28
|
+
description: 'Get fields for a farm. Active fields only by default; use filter[archived]=true for archived fields',
|
|
25
29
|
},
|
|
26
30
|
// Create a new field
|
|
27
31
|
createField: {
|
|
@@ -115,6 +119,42 @@ export const fieldsRouter = c.router({
|
|
|
115
119
|
summary: 'End season',
|
|
116
120
|
description: 'Archive the active crop into cropHistory, clear crop lifecycle fields, cancel in-season tasks, and pause fertigation schedules',
|
|
117
121
|
},
|
|
122
|
+
// Soft-archive field (hide from default lists)
|
|
123
|
+
archiveField: {
|
|
124
|
+
method: 'POST',
|
|
125
|
+
path: '/farms/:farmId/fields/:id/archive',
|
|
126
|
+
pathParams: z.object({
|
|
127
|
+
farmId: z.string().uuid(),
|
|
128
|
+
id: z.string().uuid(),
|
|
129
|
+
}),
|
|
130
|
+
body: z.object({ data: fieldArchiveSchema }),
|
|
131
|
+
responses: {
|
|
132
|
+
200: fieldResponseSchema,
|
|
133
|
+
400: jsonApiErrorResponseSchema,
|
|
134
|
+
404: jsonApiErrorResponseSchema,
|
|
135
|
+
401: jsonApiErrorResponseSchema,
|
|
136
|
+
},
|
|
137
|
+
summary: 'Archive field',
|
|
138
|
+
description: 'Soft-archive a field so it is hidden from the default fields list',
|
|
139
|
+
},
|
|
140
|
+
// Restore archived field
|
|
141
|
+
restoreField: {
|
|
142
|
+
method: 'POST',
|
|
143
|
+
path: '/farms/:farmId/fields/:id/restore',
|
|
144
|
+
pathParams: z.object({
|
|
145
|
+
farmId: z.string().uuid(),
|
|
146
|
+
id: z.string().uuid(),
|
|
147
|
+
}),
|
|
148
|
+
body: z.object({ data: fieldRestoreSchema }),
|
|
149
|
+
responses: {
|
|
150
|
+
200: fieldResponseSchema,
|
|
151
|
+
400: jsonApiErrorResponseSchema,
|
|
152
|
+
404: jsonApiErrorResponseSchema,
|
|
153
|
+
401: jsonApiErrorResponseSchema,
|
|
154
|
+
},
|
|
155
|
+
summary: 'Restore field',
|
|
156
|
+
description: 'Restore a soft-archived field to the active fields list',
|
|
157
|
+
},
|
|
118
158
|
// Merged season timeline (harvests, soil tests, field activities, planting)
|
|
119
159
|
listSeasonTimeline: {
|
|
120
160
|
method: 'GET',
|
|
@@ -69,6 +69,8 @@ export declare const fieldAttributesSchema: z.ZodObject<{
|
|
|
69
69
|
/** Optional target stand for gap display (plants per hectare). */
|
|
70
70
|
targetStandPerHa: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
71
71
|
coverImage: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
72
|
+
/** ISO datetime when the field was soft-archived; null = active */
|
|
73
|
+
archivedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
72
74
|
historicalNdvi: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
73
75
|
date: z.ZodString;
|
|
74
76
|
value: z.ZodNumber;
|
|
@@ -131,6 +133,7 @@ export declare const fieldAttributesSchema: z.ZodObject<{
|
|
|
131
133
|
standCountPerHa?: number | null | undefined;
|
|
132
134
|
targetStandPerHa?: number | null | undefined;
|
|
133
135
|
coverImage?: string | null | undefined;
|
|
136
|
+
archivedAt?: string | null | undefined;
|
|
134
137
|
historicalNdvi?: {
|
|
135
138
|
value: number;
|
|
136
139
|
date: string;
|
|
@@ -166,6 +169,7 @@ export declare const fieldAttributesSchema: z.ZodObject<{
|
|
|
166
169
|
standCountPerHa?: number | null | undefined;
|
|
167
170
|
targetStandPerHa?: number | null | undefined;
|
|
168
171
|
coverImage?: string | null | undefined;
|
|
172
|
+
archivedAt?: string | null | undefined;
|
|
169
173
|
historicalNdvi?: {
|
|
170
174
|
value: number;
|
|
171
175
|
date: string;
|
|
@@ -464,6 +468,27 @@ export declare const endSeasonSchema: z.ZodObject<{
|
|
|
464
468
|
notes?: string | undefined;
|
|
465
469
|
} | undefined;
|
|
466
470
|
}>;
|
|
471
|
+
/** Soft-archive / restore field (no attributes required) */
|
|
472
|
+
export declare const fieldArchiveSchema: z.ZodObject<{
|
|
473
|
+
type: z.ZodLiteral<"field-archives">;
|
|
474
|
+
attributes: z.ZodDefault<z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>>;
|
|
475
|
+
}, "strip", z.ZodTypeAny, {
|
|
476
|
+
type: "field-archives";
|
|
477
|
+
attributes: {};
|
|
478
|
+
}, {
|
|
479
|
+
type: "field-archives";
|
|
480
|
+
attributes?: {} | undefined;
|
|
481
|
+
}>;
|
|
482
|
+
export declare const fieldRestoreSchema: z.ZodObject<{
|
|
483
|
+
type: z.ZodLiteral<"field-restores">;
|
|
484
|
+
attributes: z.ZodDefault<z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>>;
|
|
485
|
+
}, "strip", z.ZodTypeAny, {
|
|
486
|
+
type: "field-restores";
|
|
487
|
+
attributes: {};
|
|
488
|
+
}, {
|
|
489
|
+
type: "field-restores";
|
|
490
|
+
attributes?: {} | undefined;
|
|
491
|
+
}>;
|
|
467
492
|
export declare const createFieldSchema: z.ZodObject<{
|
|
468
493
|
type: z.ZodLiteral<"fields">;
|
|
469
494
|
attributes: z.ZodObject<{
|
|
@@ -822,6 +847,8 @@ export declare const fieldResourceSchema: z.ZodObject<{
|
|
|
822
847
|
/** Optional target stand for gap display (plants per hectare). */
|
|
823
848
|
targetStandPerHa: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
824
849
|
coverImage: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
850
|
+
/** ISO datetime when the field was soft-archived; null = active */
|
|
851
|
+
archivedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
825
852
|
historicalNdvi: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
826
853
|
date: z.ZodString;
|
|
827
854
|
value: z.ZodNumber;
|
|
@@ -884,6 +911,7 @@ export declare const fieldResourceSchema: z.ZodObject<{
|
|
|
884
911
|
standCountPerHa?: number | null | undefined;
|
|
885
912
|
targetStandPerHa?: number | null | undefined;
|
|
886
913
|
coverImage?: string | null | undefined;
|
|
914
|
+
archivedAt?: string | null | undefined;
|
|
887
915
|
historicalNdvi?: {
|
|
888
916
|
value: number;
|
|
889
917
|
date: string;
|
|
@@ -919,6 +947,7 @@ export declare const fieldResourceSchema: z.ZodObject<{
|
|
|
919
947
|
standCountPerHa?: number | null | undefined;
|
|
920
948
|
targetStandPerHa?: number | null | undefined;
|
|
921
949
|
coverImage?: string | null | undefined;
|
|
950
|
+
archivedAt?: string | null | undefined;
|
|
922
951
|
historicalNdvi?: {
|
|
923
952
|
value: number;
|
|
924
953
|
date: string;
|
|
@@ -961,6 +990,7 @@ export declare const fieldResourceSchema: z.ZodObject<{
|
|
|
961
990
|
standCountPerHa?: number | null | undefined;
|
|
962
991
|
targetStandPerHa?: number | null | undefined;
|
|
963
992
|
coverImage?: string | null | undefined;
|
|
993
|
+
archivedAt?: string | null | undefined;
|
|
964
994
|
historicalNdvi?: {
|
|
965
995
|
value: number;
|
|
966
996
|
date: string;
|
|
@@ -1003,6 +1033,7 @@ export declare const fieldResourceSchema: z.ZodObject<{
|
|
|
1003
1033
|
standCountPerHa?: number | null | undefined;
|
|
1004
1034
|
targetStandPerHa?: number | null | undefined;
|
|
1005
1035
|
coverImage?: string | null | undefined;
|
|
1036
|
+
archivedAt?: string | null | undefined;
|
|
1006
1037
|
historicalNdvi?: {
|
|
1007
1038
|
value: number;
|
|
1008
1039
|
date: string;
|
|
@@ -1052,6 +1083,8 @@ export declare const fieldDetailResourceSchema: z.ZodObject<{
|
|
|
1052
1083
|
/** Optional target stand for gap display (plants per hectare). */
|
|
1053
1084
|
targetStandPerHa: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
1054
1085
|
coverImage: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1086
|
+
/** ISO datetime when the field was soft-archived; null = active */
|
|
1087
|
+
archivedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1055
1088
|
historicalNdvi: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1056
1089
|
date: z.ZodString;
|
|
1057
1090
|
value: z.ZodNumber;
|
|
@@ -1114,6 +1147,7 @@ export declare const fieldDetailResourceSchema: z.ZodObject<{
|
|
|
1114
1147
|
standCountPerHa?: number | null | undefined;
|
|
1115
1148
|
targetStandPerHa?: number | null | undefined;
|
|
1116
1149
|
coverImage?: string | null | undefined;
|
|
1150
|
+
archivedAt?: string | null | undefined;
|
|
1117
1151
|
historicalNdvi?: {
|
|
1118
1152
|
value: number;
|
|
1119
1153
|
date: string;
|
|
@@ -1149,6 +1183,7 @@ export declare const fieldDetailResourceSchema: z.ZodObject<{
|
|
|
1149
1183
|
standCountPerHa?: number | null | undefined;
|
|
1150
1184
|
targetStandPerHa?: number | null | undefined;
|
|
1151
1185
|
coverImage?: string | null | undefined;
|
|
1186
|
+
archivedAt?: string | null | undefined;
|
|
1152
1187
|
historicalNdvi?: {
|
|
1153
1188
|
value: number;
|
|
1154
1189
|
date: string;
|
|
@@ -1386,6 +1421,7 @@ export declare const fieldDetailResourceSchema: z.ZodObject<{
|
|
|
1386
1421
|
standCountPerHa?: number | null | undefined;
|
|
1387
1422
|
targetStandPerHa?: number | null | undefined;
|
|
1388
1423
|
coverImage?: string | null | undefined;
|
|
1424
|
+
archivedAt?: string | null | undefined;
|
|
1389
1425
|
historicalNdvi?: {
|
|
1390
1426
|
value: number;
|
|
1391
1427
|
date: string;
|
|
@@ -1462,6 +1498,7 @@ export declare const fieldDetailResourceSchema: z.ZodObject<{
|
|
|
1462
1498
|
standCountPerHa?: number | null | undefined;
|
|
1463
1499
|
targetStandPerHa?: number | null | undefined;
|
|
1464
1500
|
coverImage?: string | null | undefined;
|
|
1501
|
+
archivedAt?: string | null | undefined;
|
|
1465
1502
|
historicalNdvi?: {
|
|
1466
1503
|
value: number;
|
|
1467
1504
|
date: string;
|
|
@@ -1546,6 +1583,8 @@ export declare const fieldResponseSchema: z.ZodObject<{
|
|
|
1546
1583
|
/** Optional target stand for gap display (plants per hectare). */
|
|
1547
1584
|
targetStandPerHa: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
1548
1585
|
coverImage: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1586
|
+
/** ISO datetime when the field was soft-archived; null = active */
|
|
1587
|
+
archivedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1549
1588
|
historicalNdvi: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1550
1589
|
date: z.ZodString;
|
|
1551
1590
|
value: z.ZodNumber;
|
|
@@ -1608,6 +1647,7 @@ export declare const fieldResponseSchema: z.ZodObject<{
|
|
|
1608
1647
|
standCountPerHa?: number | null | undefined;
|
|
1609
1648
|
targetStandPerHa?: number | null | undefined;
|
|
1610
1649
|
coverImage?: string | null | undefined;
|
|
1650
|
+
archivedAt?: string | null | undefined;
|
|
1611
1651
|
historicalNdvi?: {
|
|
1612
1652
|
value: number;
|
|
1613
1653
|
date: string;
|
|
@@ -1643,6 +1683,7 @@ export declare const fieldResponseSchema: z.ZodObject<{
|
|
|
1643
1683
|
standCountPerHa?: number | null | undefined;
|
|
1644
1684
|
targetStandPerHa?: number | null | undefined;
|
|
1645
1685
|
coverImage?: string | null | undefined;
|
|
1686
|
+
archivedAt?: string | null | undefined;
|
|
1646
1687
|
historicalNdvi?: {
|
|
1647
1688
|
value: number;
|
|
1648
1689
|
date: string;
|
|
@@ -1685,6 +1726,7 @@ export declare const fieldResponseSchema: z.ZodObject<{
|
|
|
1685
1726
|
standCountPerHa?: number | null | undefined;
|
|
1686
1727
|
targetStandPerHa?: number | null | undefined;
|
|
1687
1728
|
coverImage?: string | null | undefined;
|
|
1729
|
+
archivedAt?: string | null | undefined;
|
|
1688
1730
|
historicalNdvi?: {
|
|
1689
1731
|
value: number;
|
|
1690
1732
|
date: string;
|
|
@@ -1727,6 +1769,7 @@ export declare const fieldResponseSchema: z.ZodObject<{
|
|
|
1727
1769
|
standCountPerHa?: number | null | undefined;
|
|
1728
1770
|
targetStandPerHa?: number | null | undefined;
|
|
1729
1771
|
coverImage?: string | null | undefined;
|
|
1772
|
+
archivedAt?: string | null | undefined;
|
|
1730
1773
|
historicalNdvi?: {
|
|
1731
1774
|
value: number;
|
|
1732
1775
|
date: string;
|
|
@@ -1795,6 +1838,7 @@ export declare const fieldResponseSchema: z.ZodObject<{
|
|
|
1795
1838
|
standCountPerHa?: number | null | undefined;
|
|
1796
1839
|
targetStandPerHa?: number | null | undefined;
|
|
1797
1840
|
coverImage?: string | null | undefined;
|
|
1841
|
+
archivedAt?: string | null | undefined;
|
|
1798
1842
|
historicalNdvi?: {
|
|
1799
1843
|
value: number;
|
|
1800
1844
|
date: string;
|
|
@@ -1849,6 +1893,7 @@ export declare const fieldResponseSchema: z.ZodObject<{
|
|
|
1849
1893
|
standCountPerHa?: number | null | undefined;
|
|
1850
1894
|
targetStandPerHa?: number | null | undefined;
|
|
1851
1895
|
coverImage?: string | null | undefined;
|
|
1896
|
+
archivedAt?: string | null | undefined;
|
|
1852
1897
|
historicalNdvi?: {
|
|
1853
1898
|
value: number;
|
|
1854
1899
|
date: string;
|
|
@@ -1910,6 +1955,8 @@ export declare const fieldDetailResponseSchema: z.ZodObject<{
|
|
|
1910
1955
|
/** Optional target stand for gap display (plants per hectare). */
|
|
1911
1956
|
targetStandPerHa: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
1912
1957
|
coverImage: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1958
|
+
/** ISO datetime when the field was soft-archived; null = active */
|
|
1959
|
+
archivedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1913
1960
|
historicalNdvi: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1914
1961
|
date: z.ZodString;
|
|
1915
1962
|
value: z.ZodNumber;
|
|
@@ -1972,6 +2019,7 @@ export declare const fieldDetailResponseSchema: z.ZodObject<{
|
|
|
1972
2019
|
standCountPerHa?: number | null | undefined;
|
|
1973
2020
|
targetStandPerHa?: number | null | undefined;
|
|
1974
2021
|
coverImage?: string | null | undefined;
|
|
2022
|
+
archivedAt?: string | null | undefined;
|
|
1975
2023
|
historicalNdvi?: {
|
|
1976
2024
|
value: number;
|
|
1977
2025
|
date: string;
|
|
@@ -2007,6 +2055,7 @@ export declare const fieldDetailResponseSchema: z.ZodObject<{
|
|
|
2007
2055
|
standCountPerHa?: number | null | undefined;
|
|
2008
2056
|
targetStandPerHa?: number | null | undefined;
|
|
2009
2057
|
coverImage?: string | null | undefined;
|
|
2058
|
+
archivedAt?: string | null | undefined;
|
|
2010
2059
|
historicalNdvi?: {
|
|
2011
2060
|
value: number;
|
|
2012
2061
|
date: string;
|
|
@@ -2244,6 +2293,7 @@ export declare const fieldDetailResponseSchema: z.ZodObject<{
|
|
|
2244
2293
|
standCountPerHa?: number | null | undefined;
|
|
2245
2294
|
targetStandPerHa?: number | null | undefined;
|
|
2246
2295
|
coverImage?: string | null | undefined;
|
|
2296
|
+
archivedAt?: string | null | undefined;
|
|
2247
2297
|
historicalNdvi?: {
|
|
2248
2298
|
value: number;
|
|
2249
2299
|
date: string;
|
|
@@ -2320,6 +2370,7 @@ export declare const fieldDetailResponseSchema: z.ZodObject<{
|
|
|
2320
2370
|
standCountPerHa?: number | null | undefined;
|
|
2321
2371
|
targetStandPerHa?: number | null | undefined;
|
|
2322
2372
|
coverImage?: string | null | undefined;
|
|
2373
|
+
archivedAt?: string | null | undefined;
|
|
2323
2374
|
historicalNdvi?: {
|
|
2324
2375
|
value: number;
|
|
2325
2376
|
date: string;
|
|
@@ -2422,6 +2473,7 @@ export declare const fieldDetailResponseSchema: z.ZodObject<{
|
|
|
2422
2473
|
standCountPerHa?: number | null | undefined;
|
|
2423
2474
|
targetStandPerHa?: number | null | undefined;
|
|
2424
2475
|
coverImage?: string | null | undefined;
|
|
2476
|
+
archivedAt?: string | null | undefined;
|
|
2425
2477
|
historicalNdvi?: {
|
|
2426
2478
|
value: number;
|
|
2427
2479
|
date: string;
|
|
@@ -2510,6 +2562,7 @@ export declare const fieldDetailResponseSchema: z.ZodObject<{
|
|
|
2510
2562
|
standCountPerHa?: number | null | undefined;
|
|
2511
2563
|
targetStandPerHa?: number | null | undefined;
|
|
2512
2564
|
coverImage?: string | null | undefined;
|
|
2565
|
+
archivedAt?: string | null | undefined;
|
|
2513
2566
|
historicalNdvi?: {
|
|
2514
2567
|
value: number;
|
|
2515
2568
|
date: string;
|
|
@@ -2605,6 +2658,8 @@ export declare const fieldListResponseSchema: z.ZodObject<{
|
|
|
2605
2658
|
/** Optional target stand for gap display (plants per hectare). */
|
|
2606
2659
|
targetStandPerHa: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
2607
2660
|
coverImage: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
2661
|
+
/** ISO datetime when the field was soft-archived; null = active */
|
|
2662
|
+
archivedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
2608
2663
|
historicalNdvi: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
2609
2664
|
date: z.ZodString;
|
|
2610
2665
|
value: z.ZodNumber;
|
|
@@ -2667,6 +2722,7 @@ export declare const fieldListResponseSchema: z.ZodObject<{
|
|
|
2667
2722
|
standCountPerHa?: number | null | undefined;
|
|
2668
2723
|
targetStandPerHa?: number | null | undefined;
|
|
2669
2724
|
coverImage?: string | null | undefined;
|
|
2725
|
+
archivedAt?: string | null | undefined;
|
|
2670
2726
|
historicalNdvi?: {
|
|
2671
2727
|
value: number;
|
|
2672
2728
|
date: string;
|
|
@@ -2702,6 +2758,7 @@ export declare const fieldListResponseSchema: z.ZodObject<{
|
|
|
2702
2758
|
standCountPerHa?: number | null | undefined;
|
|
2703
2759
|
targetStandPerHa?: number | null | undefined;
|
|
2704
2760
|
coverImage?: string | null | undefined;
|
|
2761
|
+
archivedAt?: string | null | undefined;
|
|
2705
2762
|
historicalNdvi?: {
|
|
2706
2763
|
value: number;
|
|
2707
2764
|
date: string;
|
|
@@ -2744,6 +2801,7 @@ export declare const fieldListResponseSchema: z.ZodObject<{
|
|
|
2744
2801
|
standCountPerHa?: number | null | undefined;
|
|
2745
2802
|
targetStandPerHa?: number | null | undefined;
|
|
2746
2803
|
coverImage?: string | null | undefined;
|
|
2804
|
+
archivedAt?: string | null | undefined;
|
|
2747
2805
|
historicalNdvi?: {
|
|
2748
2806
|
value: number;
|
|
2749
2807
|
date: string;
|
|
@@ -2786,6 +2844,7 @@ export declare const fieldListResponseSchema: z.ZodObject<{
|
|
|
2786
2844
|
standCountPerHa?: number | null | undefined;
|
|
2787
2845
|
targetStandPerHa?: number | null | undefined;
|
|
2788
2846
|
coverImage?: string | null | undefined;
|
|
2847
|
+
archivedAt?: string | null | undefined;
|
|
2789
2848
|
historicalNdvi?: {
|
|
2790
2849
|
value: number;
|
|
2791
2850
|
date: string;
|
|
@@ -2854,6 +2913,7 @@ export declare const fieldListResponseSchema: z.ZodObject<{
|
|
|
2854
2913
|
standCountPerHa?: number | null | undefined;
|
|
2855
2914
|
targetStandPerHa?: number | null | undefined;
|
|
2856
2915
|
coverImage?: string | null | undefined;
|
|
2916
|
+
archivedAt?: string | null | undefined;
|
|
2857
2917
|
historicalNdvi?: {
|
|
2858
2918
|
value: number;
|
|
2859
2919
|
date: string;
|
|
@@ -2908,6 +2968,7 @@ export declare const fieldListResponseSchema: z.ZodObject<{
|
|
|
2908
2968
|
standCountPerHa?: number | null | undefined;
|
|
2909
2969
|
targetStandPerHa?: number | null | undefined;
|
|
2910
2970
|
coverImage?: string | null | undefined;
|
|
2971
|
+
archivedAt?: string | null | undefined;
|
|
2911
2972
|
historicalNdvi?: {
|
|
2912
2973
|
value: number;
|
|
2913
2974
|
date: string;
|
|
@@ -2956,6 +3017,8 @@ export type RecordPlantingAttributes = z.infer<typeof recordPlantingAttributesSc
|
|
|
2956
3017
|
export type RecordPlantingInput = z.infer<typeof recordPlantingSchema>;
|
|
2957
3018
|
export type EndSeasonAttributes = z.infer<typeof endSeasonAttributesSchema>;
|
|
2958
3019
|
export type EndSeasonInput = z.infer<typeof endSeasonSchema>;
|
|
3020
|
+
export type FieldArchiveInput = z.infer<typeof fieldArchiveSchema>;
|
|
3021
|
+
export type FieldRestoreInput = z.infer<typeof fieldRestoreSchema>;
|
|
2959
3022
|
export declare const seasonTimelineEventKindSchema: z.ZodEnum<["harvest", "soil-test", "field-activity", "planting"]>;
|
|
2960
3023
|
export declare const seasonTimelineActivityTypeSchema: z.ZodEnum<["weeding", "fertilizer"]>;
|
|
2961
3024
|
export declare const seasonTimelineEventAttributesSchema: z.ZodObject<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fields.schemas.d.ts","sourceRoot":"","sources":["../../src/schemas/fields.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AASxB;;GAEG;AAGH,eAAO,MAAM,iBAAiB,wCAAsC,CAAC;AAGrE,eAAO,MAAM,eAAe,mFAO1B,CAAC;AAGH,eAAO,MAAM,yBAAyB;;;;;;;;;EAGpC,CAAC;AAGH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;EASjC,CAAC;AAGH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;IAchC,+EAA+E;;IAE/E,kEAAkE
|
|
1
|
+
{"version":3,"file":"fields.schemas.d.ts","sourceRoot":"","sources":["../../src/schemas/fields.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAA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GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AACnE,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAMnE,eAAO,MAAM,6BAA6B,mEAKxC,CAAC;AAEH,eAAO,MAAM,gCAAgC,sCAAoC,CAAC;AAElF,eAAO,MAAM,mCAAmC;;IAE9C,wDAAwD;;;;;;;;;IASxD,yDAAyD;;;;;;;;;;;;;;;;;;;;;;;;EAEzD,CAAC;AAEH,eAAO,MAAM,iCAAiC;;;;;QAb5C,wDAAwD;;;;;;;;;QASxD,yDAAyD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAO1D,CAAC;AAEF,eAAO,MAAM,gCAAgC;;;;;;YAlB3C,wDAAwD;;;;;;;;;YASxD,yDAAyD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAW1D,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,6BAA6B,CAAC,CAAC;AACpF,MAAM,MAAM,6BAA6B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mCAAmC,CAAC,CAAC;AAChG,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iCAAiC,CAAC,CAAC;AAC5F,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gCAAgC,CAAC,CAAC"}
|
|
@@ -51,6 +51,8 @@ export const fieldAttributesSchema = z.object({
|
|
|
51
51
|
targetStandPerHa: z.number().positive().max(10_000_000).nullable().optional(),
|
|
52
52
|
// Card cover: preset:<id> or /files/view/fields/...
|
|
53
53
|
coverImage: z.string().max(500).nullable().optional(),
|
|
54
|
+
/** ISO datetime when the field was soft-archived; null = active */
|
|
55
|
+
archivedAt: z.string().datetime().nullable().optional(),
|
|
54
56
|
// Historical data
|
|
55
57
|
historicalNdvi: z.array(historicalDataPointSchema).optional(),
|
|
56
58
|
cropHistory: z.array(cropHistoryEntrySchema).optional(),
|
|
@@ -112,6 +114,15 @@ export const endSeasonSchema = z.object({
|
|
|
112
114
|
type: z.literal('field-end-seasons'),
|
|
113
115
|
attributes: endSeasonAttributesSchema.default({}),
|
|
114
116
|
});
|
|
117
|
+
/** Soft-archive / restore field (no attributes required) */
|
|
118
|
+
export const fieldArchiveSchema = z.object({
|
|
119
|
+
type: z.literal('field-archives'),
|
|
120
|
+
attributes: z.object({}).default({}),
|
|
121
|
+
});
|
|
122
|
+
export const fieldRestoreSchema = z.object({
|
|
123
|
+
type: z.literal('field-restores'),
|
|
124
|
+
attributes: z.object({}).default({}),
|
|
125
|
+
});
|
|
115
126
|
// Create field input (JSON:API format)
|
|
116
127
|
export const createFieldSchema = z.object({
|
|
117
128
|
type: z.literal('fields'),
|