@hestia-earth/data-validation 0.41.15 → 0.41.17
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/file-errors/public-api.d.mts +1 -1
- package/file-errors/public-api.d.ts +1 -1
- package/file-errors/public-api.js +438 -356
- package/file-errors/public-api.mjs +438 -356
- package/index.js +379 -359
- package/index.mjs +379 -359
- package/package.json +1 -1
- package/validation.json +379 -359
package/index.js
CHANGED
|
@@ -14,384 +14,374 @@ __export(validation_exports, {
|
|
|
14
14
|
});
|
|
15
15
|
var validations = [
|
|
16
16
|
{
|
|
17
|
-
function: "
|
|
17
|
+
function: "validate_id",
|
|
18
18
|
level: "error",
|
|
19
|
-
message: "must
|
|
19
|
+
message: "aggregation id must contain a product, region, start, end year, and a timestamp"
|
|
20
20
|
},
|
|
21
21
|
{
|
|
22
|
-
function: "
|
|
23
|
-
level: "
|
|
24
|
-
message: "
|
|
22
|
+
function: "validate_has_termType",
|
|
23
|
+
level: "warning",
|
|
24
|
+
message: "should contain at least one management node"
|
|
25
25
|
},
|
|
26
26
|
{
|
|
27
|
-
function: "
|
|
27
|
+
function: "validate_fallow_dates",
|
|
28
28
|
level: "error",
|
|
29
|
-
message: "must be in
|
|
29
|
+
message: "duration must be in specified interval"
|
|
30
30
|
},
|
|
31
31
|
{
|
|
32
|
-
function: "
|
|
32
|
+
function: "validate_cycles_overlap",
|
|
33
33
|
level: "error",
|
|
34
|
-
message: "must be
|
|
34
|
+
message: "management date must be before cycle start date"
|
|
35
35
|
},
|
|
36
36
|
{
|
|
37
|
-
function: "
|
|
37
|
+
function: "validate_functionalUnit_not_1_ha",
|
|
38
38
|
level: "error",
|
|
39
|
-
message: "must
|
|
39
|
+
message: "must not be equal to 1 ha"
|
|
40
40
|
},
|
|
41
41
|
{
|
|
42
|
-
function: "
|
|
42
|
+
function: "validate_sum_aboveGroundCropResidue",
|
|
43
43
|
level: "error",
|
|
44
|
-
message: "must
|
|
44
|
+
message: "must be more than or equal to other crop residues"
|
|
45
45
|
},
|
|
46
46
|
{
|
|
47
|
-
function: "
|
|
47
|
+
function: "validate_crop_residue_complete",
|
|
48
48
|
level: "error",
|
|
49
|
-
message: "must
|
|
49
|
+
message: "must specify the fate of cropResidue"
|
|
50
50
|
},
|
|
51
51
|
{
|
|
52
|
-
function: "
|
|
52
|
+
function: "validate_crop_residue_incomplete",
|
|
53
|
+
level: "warning",
|
|
54
|
+
message: "should specify the fate of cropResidue"
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
function: "validate_cycleDuration",
|
|
53
58
|
level: "error",
|
|
54
|
-
message: "must be
|
|
59
|
+
message: "must be one year prior to endDate"
|
|
55
60
|
},
|
|
56
61
|
{
|
|
57
|
-
function: "
|
|
62
|
+
function: "validate_cycleDuration",
|
|
58
63
|
level: "error",
|
|
59
|
-
message: "must
|
|
64
|
+
message: "must equal to endDate - startDate in days"
|
|
60
65
|
},
|
|
61
66
|
{
|
|
62
|
-
function: "
|
|
67
|
+
function: "validate_harvestedArea",
|
|
63
68
|
level: "error",
|
|
64
|
-
message: "must be
|
|
69
|
+
message: "must be lower or equal to siteArea"
|
|
65
70
|
},
|
|
66
71
|
{
|
|
67
|
-
function: "
|
|
68
|
-
level: "
|
|
69
|
-
message: "
|
|
72
|
+
function: "validate_maximum_cycleDuration",
|
|
73
|
+
level: "error",
|
|
74
|
+
message: "must be below maximum cycleDuration"
|
|
70
75
|
},
|
|
71
76
|
{
|
|
72
|
-
function: "
|
|
77
|
+
function: "validate_riceGrainInHuskFlooded_minimum_cycleDuration",
|
|
73
78
|
level: "warning",
|
|
74
|
-
message: "
|
|
79
|
+
message: "should be more than the cropping duration"
|
|
75
80
|
},
|
|
76
81
|
{
|
|
77
|
-
function: "
|
|
82
|
+
function: "validate_crop_siteDuration",
|
|
78
83
|
level: "error",
|
|
79
|
-
message: "should be
|
|
84
|
+
message: "should be equal to cycleDuration for crop"
|
|
80
85
|
},
|
|
81
86
|
{
|
|
82
|
-
function: "
|
|
87
|
+
function: "validate_crop_siteDuration",
|
|
83
88
|
level: "error",
|
|
84
|
-
message: "should
|
|
89
|
+
message: "should be greater than cycleDuration for crop"
|
|
85
90
|
},
|
|
86
91
|
{
|
|
87
|
-
function: "
|
|
92
|
+
function: "validate_animal_siteDuration",
|
|
88
93
|
level: "error",
|
|
89
|
-
message: "
|
|
90
|
-
},
|
|
91
|
-
{
|
|
92
|
-
function: "validate_list_has_properties",
|
|
93
|
-
level: "warning",
|
|
94
|
-
message: "should add missing properties"
|
|
94
|
+
message: "should be equal to cycleDuration for animals"
|
|
95
95
|
},
|
|
96
96
|
{
|
|
97
|
-
function: "
|
|
97
|
+
function: "validate_animal_siteDuration",
|
|
98
98
|
level: "error",
|
|
99
|
-
message: "
|
|
99
|
+
message: "should be equal to cycleDuration - otherSitesDuration for animals"
|
|
100
100
|
},
|
|
101
101
|
{
|
|
102
|
-
function: "
|
|
102
|
+
function: "validate_animal_siteDuration",
|
|
103
103
|
level: "error",
|
|
104
|
-
message: "
|
|
104
|
+
message: "should be less than cycleDuration for animals"
|
|
105
105
|
},
|
|
106
106
|
{
|
|
107
|
-
function: "
|
|
108
|
-
level: "
|
|
109
|
-
message: "
|
|
107
|
+
function: "validate_durations",
|
|
108
|
+
level: "warning",
|
|
109
|
+
message: "should add the fields for a relative cycle"
|
|
110
110
|
},
|
|
111
111
|
{
|
|
112
|
-
function: "
|
|
112
|
+
function: "validate_possibleCoverCrop",
|
|
113
113
|
level: "error",
|
|
114
|
-
message: "
|
|
115
|
-
},
|
|
116
|
-
{
|
|
117
|
-
function: "validate_area",
|
|
118
|
-
level: "warning",
|
|
119
|
-
message: "should be equal to boundary"
|
|
114
|
+
message: "cover crop cycle contains non cover crop product"
|
|
120
115
|
},
|
|
121
116
|
{
|
|
122
|
-
function: "
|
|
117
|
+
function: "validate_set_treatment",
|
|
123
118
|
level: "warning",
|
|
124
|
-
message: "
|
|
119
|
+
message: "should specify a treatment when experimentDesign is specified"
|
|
125
120
|
},
|
|
126
121
|
{
|
|
127
|
-
function: "
|
|
122
|
+
function: "validate_products_animals",
|
|
128
123
|
level: "warning",
|
|
129
|
-
message: "should
|
|
124
|
+
message: "should not specify both liveAnimal and animalProduct"
|
|
130
125
|
},
|
|
131
126
|
{
|
|
132
|
-
function: "
|
|
127
|
+
function: "validate_stocking_density",
|
|
133
128
|
level: "warning",
|
|
134
|
-
message: "
|
|
129
|
+
message: "should add the term stockingDensityPermanentPastureAverage"
|
|
135
130
|
},
|
|
136
131
|
{
|
|
137
|
-
function: "
|
|
132
|
+
function: "validate_linked_impact_assessment",
|
|
138
133
|
level: "error",
|
|
139
|
-
message: "
|
|
134
|
+
message: "multiple ImpactAssessment are associated with this Product"
|
|
140
135
|
},
|
|
141
136
|
{
|
|
142
|
-
function: "
|
|
143
|
-
level: "
|
|
144
|
-
message: "
|
|
137
|
+
function: "validate_linked_impact_assessment",
|
|
138
|
+
level: "error",
|
|
139
|
+
message: "no ImpactAssessment are associated with this Product"
|
|
145
140
|
},
|
|
146
141
|
{
|
|
147
|
-
function: "
|
|
142
|
+
function: "validate_animal_product_mapping",
|
|
148
143
|
level: "error",
|
|
149
|
-
message: "
|
|
144
|
+
message: "is not an allowed animalProduct"
|
|
150
145
|
},
|
|
151
146
|
{
|
|
152
|
-
function: "
|
|
153
|
-
level: "
|
|
154
|
-
message: "
|
|
147
|
+
function: "validate_requires_substrate",
|
|
148
|
+
level: "error",
|
|
149
|
+
message: "must add substrate inputs"
|
|
155
150
|
},
|
|
156
151
|
{
|
|
157
|
-
function: "
|
|
152
|
+
function: "_validate_previous_transformationId",
|
|
158
153
|
level: "error",
|
|
159
|
-
message: "
|
|
154
|
+
message: "must point to a previous transformation in the list"
|
|
160
155
|
},
|
|
161
156
|
{
|
|
162
|
-
function: "
|
|
163
|
-
level: "
|
|
164
|
-
message: "
|
|
157
|
+
function: "_validate_previous_input",
|
|
158
|
+
level: "error",
|
|
159
|
+
message: "at least one Input must be a Product of the Cycle"
|
|
165
160
|
},
|
|
166
161
|
{
|
|
167
|
-
function: "
|
|
168
|
-
level: "
|
|
169
|
-
message: "
|
|
162
|
+
function: "_validate_previous_input",
|
|
163
|
+
level: "error",
|
|
164
|
+
message: "at least one Input must be a Product of the previous Transformation"
|
|
170
165
|
},
|
|
171
166
|
{
|
|
172
|
-
function: "
|
|
167
|
+
function: "_validate_previous_product_value",
|
|
173
168
|
level: "error",
|
|
174
|
-
message: "must equal to
|
|
169
|
+
message: "must be equal to previous product multiplied by the share"
|
|
175
170
|
},
|
|
176
171
|
{
|
|
177
|
-
function: "
|
|
172
|
+
function: "validate_linked_emission",
|
|
178
173
|
level: "warning",
|
|
179
|
-
message: "should
|
|
174
|
+
message: "should be linked to an emission in the Cycle"
|
|
180
175
|
},
|
|
181
176
|
{
|
|
182
|
-
function: "
|
|
183
|
-
level: "
|
|
184
|
-
message: "
|
|
177
|
+
function: "validate_excreta_inputs_products",
|
|
178
|
+
level: "error",
|
|
179
|
+
message: "must be included as an Input"
|
|
185
180
|
},
|
|
186
181
|
{
|
|
187
|
-
function: "
|
|
188
|
-
level: "
|
|
189
|
-
message: "
|
|
182
|
+
function: "validate_transformation_inputs_value",
|
|
183
|
+
level: "error",
|
|
184
|
+
message: "must be specified for multiple Inputs with the same term"
|
|
190
185
|
},
|
|
191
186
|
{
|
|
192
|
-
function: "
|
|
187
|
+
function: "validate_empty",
|
|
193
188
|
level: "error",
|
|
194
|
-
message: "
|
|
189
|
+
message: "should not be empty"
|
|
195
190
|
},
|
|
196
191
|
{
|
|
197
|
-
function: "
|
|
192
|
+
function: "validate_linked_cycle_product",
|
|
198
193
|
level: "error",
|
|
199
|
-
message: "
|
|
194
|
+
message: "should be included in the cycle products"
|
|
200
195
|
},
|
|
201
196
|
{
|
|
202
|
-
function: "
|
|
197
|
+
function: "validate_linked_cycle_endDate",
|
|
198
|
+
level: "error",
|
|
199
|
+
message: "must be equal to the Cycle endDate"
|
|
200
|
+
},
|
|
201
|
+
{
|
|
202
|
+
function: "validate_value_follows_area",
|
|
203
203
|
level: "warning",
|
|
204
|
-
message: "should
|
|
204
|
+
message: "should not be proportional to the site area"
|
|
205
205
|
},
|
|
206
206
|
{
|
|
207
|
-
function: "
|
|
207
|
+
function: "validate_fixed_nutrient_ratio",
|
|
208
208
|
level: "warning",
|
|
209
|
-
message: "should
|
|
209
|
+
message: "should be the amount of nutrient, not of fertiliser"
|
|
210
210
|
},
|
|
211
211
|
{
|
|
212
|
-
function: "
|
|
212
|
+
function: "validate_lifespan",
|
|
213
213
|
level: "error",
|
|
214
|
-
message: "
|
|
214
|
+
message: "must equal to endDate - startDate in decimal years"
|
|
215
215
|
},
|
|
216
216
|
{
|
|
217
|
-
function: "
|
|
218
|
-
level: "
|
|
219
|
-
message: "
|
|
217
|
+
function: "validate_functionalArea",
|
|
218
|
+
level: "warning",
|
|
219
|
+
message: "should specify functionalArea or site area"
|
|
220
220
|
},
|
|
221
221
|
{
|
|
222
|
-
function: "
|
|
222
|
+
function: "validate_soilTexture",
|
|
223
223
|
level: "error",
|
|
224
|
-
message: "
|
|
224
|
+
message: "is outside the allowed range"
|
|
225
225
|
},
|
|
226
226
|
{
|
|
227
|
-
function: "
|
|
227
|
+
function: "validate_soilTexture_depths",
|
|
228
228
|
level: "warning",
|
|
229
|
-
message: "
|
|
229
|
+
message: "should be given at the same depths as the soil content"
|
|
230
230
|
},
|
|
231
231
|
{
|
|
232
|
-
function: "
|
|
232
|
+
function: "validate_depths",
|
|
233
233
|
level: "error",
|
|
234
|
-
message: "
|
|
234
|
+
message: "must be greater than or equal to depthUpper"
|
|
235
235
|
},
|
|
236
236
|
{
|
|
237
|
-
function: "
|
|
237
|
+
function: "validate_required_depths",
|
|
238
238
|
level: "error",
|
|
239
|
-
message: "
|
|
239
|
+
message: "must set both depthUpper and depthLower"
|
|
240
240
|
},
|
|
241
241
|
{
|
|
242
|
-
function: "
|
|
242
|
+
function: "validate_required_depths",
|
|
243
243
|
level: "warning",
|
|
244
|
-
message: "should
|
|
244
|
+
message: "should set both depthUpper and depthLower"
|
|
245
245
|
},
|
|
246
246
|
{
|
|
247
|
-
function: "
|
|
247
|
+
function: "validate_term_unique",
|
|
248
248
|
level: "error",
|
|
249
|
-
message: "
|
|
249
|
+
message: "must be unique"
|
|
250
250
|
},
|
|
251
251
|
{
|
|
252
|
-
function: "
|
|
252
|
+
function: "validate_term_unique",
|
|
253
253
|
level: "error",
|
|
254
|
-
message: "
|
|
255
|
-
},
|
|
256
|
-
{
|
|
257
|
-
function: "validate_liveAnimal_system",
|
|
258
|
-
level: "warning",
|
|
259
|
-
message: "should add an animal production system"
|
|
254
|
+
message: "must provide value or min and max"
|
|
260
255
|
},
|
|
261
256
|
{
|
|
262
|
-
function: "
|
|
257
|
+
function: "validate_with_models",
|
|
263
258
|
level: "warning",
|
|
264
|
-
message: "
|
|
259
|
+
message: "the measurement provided might be in error"
|
|
265
260
|
},
|
|
266
261
|
{
|
|
267
|
-
function: "
|
|
262
|
+
function: "validate_value_length",
|
|
268
263
|
level: "error",
|
|
269
|
-
message: "
|
|
264
|
+
message: "must not contain more than 1 value"
|
|
270
265
|
},
|
|
271
266
|
{
|
|
272
|
-
function: "
|
|
267
|
+
function: "validate_water_measurements",
|
|
273
268
|
level: "error",
|
|
274
|
-
message: "
|
|
269
|
+
message: "must specify water type for ponds"
|
|
275
270
|
},
|
|
276
271
|
{
|
|
277
|
-
function: "
|
|
272
|
+
function: "validate_water_salinity",
|
|
278
273
|
level: "error",
|
|
279
|
-
message: "
|
|
274
|
+
message: "invalid water salinity"
|
|
280
275
|
},
|
|
281
276
|
{
|
|
282
|
-
function: "
|
|
277
|
+
function: "validate_soil_type_consistency",
|
|
283
278
|
level: "error",
|
|
284
|
-
message: "
|
|
279
|
+
message: "measurements for the same termType must be consistent"
|
|
285
280
|
},
|
|
286
281
|
{
|
|
287
|
-
function: "
|
|
288
|
-
level: "
|
|
289
|
-
message: "
|
|
282
|
+
function: "validate_must_include_id",
|
|
283
|
+
level: "warning",
|
|
284
|
+
message: "should add missing inputs"
|
|
290
285
|
},
|
|
291
286
|
{
|
|
292
|
-
function: "
|
|
293
|
-
level: "
|
|
294
|
-
message: "
|
|
287
|
+
function: "validate_compound_fertiliser_composition",
|
|
288
|
+
level: "warning",
|
|
289
|
+
message: "should match the nutrient ratio of the compound fertiliser"
|
|
295
290
|
},
|
|
296
291
|
{
|
|
297
|
-
function: "
|
|
292
|
+
function: "validate_related_impacts",
|
|
298
293
|
level: "error",
|
|
299
|
-
message: "
|
|
294
|
+
message: "can not be linked to the same type"
|
|
300
295
|
},
|
|
301
296
|
{
|
|
302
|
-
function: "
|
|
297
|
+
function: "validate_related_impact_product",
|
|
303
298
|
level: "error",
|
|
304
|
-
message: "
|
|
299
|
+
message: "can not be linked to a different term"
|
|
305
300
|
},
|
|
306
301
|
{
|
|
307
|
-
function: "
|
|
308
|
-
level: "
|
|
309
|
-
message: "
|
|
302
|
+
function: "_validate_input_value",
|
|
303
|
+
level: "warning",
|
|
304
|
+
message: "is outside confidence interval"
|
|
310
305
|
},
|
|
311
306
|
{
|
|
312
|
-
function: "
|
|
307
|
+
function: "validate_animalFeed_requires_isAnimalFeed",
|
|
313
308
|
level: "error",
|
|
314
|
-
message: "
|
|
309
|
+
message: "must specify is it an animal feed"
|
|
315
310
|
},
|
|
316
311
|
{
|
|
317
|
-
function: "
|
|
312
|
+
function: "validate_isAnimalFeed_animal_cycle",
|
|
318
313
|
level: "error",
|
|
319
|
-
message: "
|
|
314
|
+
message: "isAnimalFeed not allowed on a non-animal cycle"
|
|
320
315
|
},
|
|
321
316
|
{
|
|
322
|
-
function: "
|
|
317
|
+
function: "validate_saplings",
|
|
323
318
|
level: "error",
|
|
324
|
-
message: "
|
|
325
|
-
},
|
|
326
|
-
{
|
|
327
|
-
function: "validate_irrigating_operation_rainfed_water_regime",
|
|
328
|
-
level: "warning",
|
|
329
|
-
message: "should use irrigated water regime"
|
|
319
|
+
message: "saplings cannot be used as an input here"
|
|
330
320
|
},
|
|
331
321
|
{
|
|
332
|
-
function: "
|
|
322
|
+
function: "validate_seed",
|
|
333
323
|
level: "error",
|
|
334
|
-
message: "
|
|
324
|
+
message: "seed cannot be used as an input here"
|
|
335
325
|
},
|
|
336
326
|
{
|
|
337
|
-
function: "
|
|
327
|
+
function: "validate_saplings_depreciated",
|
|
338
328
|
level: "error",
|
|
339
|
-
message: "
|
|
329
|
+
message: "saplingsDepreciatedAmountPerCycle cannot be used as an input here"
|
|
340
330
|
},
|
|
341
331
|
{
|
|
342
|
-
function: "
|
|
343
|
-
level: "
|
|
344
|
-
message: "
|
|
332
|
+
function: "validate_seed_correspondingSpecies",
|
|
333
|
+
level: "error",
|
|
334
|
+
message: "must specify correspondingSpecies in intercropping"
|
|
345
335
|
},
|
|
346
336
|
{
|
|
347
|
-
function: "
|
|
337
|
+
function: "validate_material_depreciated",
|
|
348
338
|
level: "error",
|
|
349
|
-
message: "must
|
|
339
|
+
message: "must use the depreciated term"
|
|
350
340
|
},
|
|
351
341
|
{
|
|
352
|
-
function: "
|
|
342
|
+
function: "validate_input_is_product",
|
|
353
343
|
level: "error",
|
|
354
|
-
message: "must
|
|
344
|
+
message: "must be a product"
|
|
355
345
|
},
|
|
356
346
|
{
|
|
357
|
-
function: "
|
|
347
|
+
function: "validate_input_unspecified_term",
|
|
358
348
|
level: "warning",
|
|
359
|
-
message: "should
|
|
360
|
-
},
|
|
361
|
-
{
|
|
362
|
-
function: "validate_term_unique",
|
|
363
|
-
level: "error",
|
|
364
|
-
message: "must be unique"
|
|
349
|
+
message: "should use a specific term"
|
|
365
350
|
},
|
|
366
351
|
{
|
|
367
|
-
function: "
|
|
368
|
-
level: "
|
|
369
|
-
message: "
|
|
352
|
+
function: "validate_method_not_relevant",
|
|
353
|
+
level: "warning",
|
|
354
|
+
message: "should not use not relevant model"
|
|
370
355
|
},
|
|
371
356
|
{
|
|
372
|
-
function: "
|
|
357
|
+
function: "validate_methodTier_not_relevant",
|
|
373
358
|
level: "warning",
|
|
374
|
-
message: "
|
|
359
|
+
message: "should not use not relevant methodTier"
|
|
375
360
|
},
|
|
376
361
|
{
|
|
377
|
-
function: "
|
|
362
|
+
function: "validate_methodTier_background",
|
|
378
363
|
level: "error",
|
|
379
|
-
message: "must not
|
|
364
|
+
message: "must not have background methodTier"
|
|
380
365
|
},
|
|
381
366
|
{
|
|
382
|
-
function: "
|
|
367
|
+
function: "validate_methodTier_background",
|
|
383
368
|
level: "error",
|
|
384
|
-
message: "must
|
|
369
|
+
message: "must be an existing term"
|
|
385
370
|
},
|
|
386
371
|
{
|
|
387
|
-
function: "
|
|
372
|
+
function: "validate_depth",
|
|
373
|
+
level: "warning",
|
|
374
|
+
message: "should set the depth"
|
|
375
|
+
},
|
|
376
|
+
{
|
|
377
|
+
function: "validate_linked_impactAssessment",
|
|
388
378
|
level: "error",
|
|
389
|
-
message: "
|
|
379
|
+
message: "must be linked to a verified country-level Impact Assessment"
|
|
390
380
|
},
|
|
391
381
|
{
|
|
392
|
-
function: "
|
|
382
|
+
function: "validate_plantation_practices",
|
|
393
383
|
level: "error",
|
|
394
|
-
message: "
|
|
384
|
+
message: "must include practices for plantation weighting"
|
|
395
385
|
},
|
|
396
386
|
{
|
|
397
387
|
function: "validate_characterisedIndicator_model",
|
|
@@ -419,134 +409,154 @@ var validations = [
|
|
|
419
409
|
message: "this field is required"
|
|
420
410
|
},
|
|
421
411
|
{
|
|
422
|
-
function: "
|
|
423
|
-
level: "
|
|
424
|
-
message: "should
|
|
412
|
+
function: "validate_has_animals",
|
|
413
|
+
level: "warning",
|
|
414
|
+
message: "should specify the herd composition"
|
|
425
415
|
},
|
|
426
416
|
{
|
|
427
|
-
function: "
|
|
417
|
+
function: "validate_duplicated_feed_inputs",
|
|
428
418
|
level: "error",
|
|
429
|
-
message: "
|
|
419
|
+
message: "must not add the feed input to the Cycle as well"
|
|
430
420
|
},
|
|
431
421
|
{
|
|
432
|
-
function: "
|
|
433
|
-
level: "
|
|
434
|
-
message: "
|
|
422
|
+
function: "validate_has_milkYieldPractice",
|
|
423
|
+
level: "warning",
|
|
424
|
+
message: "should specify the a milkYield practice"
|
|
435
425
|
},
|
|
436
426
|
{
|
|
437
|
-
function: "
|
|
427
|
+
function: "validate_animal_has_recommended_products",
|
|
428
|
+
level: "warning",
|
|
429
|
+
message: "should specify a recommended product"
|
|
430
|
+
},
|
|
431
|
+
{
|
|
432
|
+
function: "validate_defaultValue",
|
|
433
|
+
level: "warning",
|
|
434
|
+
message: "should specify a value when HESTIA has a default one"
|
|
435
|
+
},
|
|
436
|
+
{
|
|
437
|
+
function: "validate_longFallowDuration",
|
|
438
438
|
level: "error",
|
|
439
|
-
message: "must
|
|
439
|
+
message: "longFallowDuration must be lower than 5 years"
|
|
440
440
|
},
|
|
441
441
|
{
|
|
442
|
-
function: "
|
|
442
|
+
function: "validate_plantationLifespan",
|
|
443
443
|
level: "error",
|
|
444
|
-
message: "must be
|
|
444
|
+
message: "must be greater than or equal to plantationProductiveLifespan"
|
|
445
445
|
},
|
|
446
446
|
{
|
|
447
|
-
function: "
|
|
447
|
+
function: "validate_waterRegime_rice_products",
|
|
448
448
|
level: "error",
|
|
449
|
-
message: "
|
|
449
|
+
message: "rice products not allowed for this water regime practice"
|
|
450
450
|
},
|
|
451
451
|
{
|
|
452
|
-
function: "
|
|
452
|
+
function: "validate_croppingDuration_riceGrainInHuskFlooded",
|
|
453
453
|
level: "warning",
|
|
454
|
-
message: "
|
|
454
|
+
message: "croppingDuration must be between min and max"
|
|
455
455
|
},
|
|
456
456
|
{
|
|
457
|
-
function: "
|
|
457
|
+
function: "validate_excretaManagement",
|
|
458
458
|
level: "error",
|
|
459
|
-
message: "
|
|
459
|
+
message: "an excreta input is required when using an excretaManagement practice"
|
|
460
460
|
},
|
|
461
461
|
{
|
|
462
|
-
function: "
|
|
462
|
+
function: "validate_no_tillage",
|
|
463
463
|
level: "error",
|
|
464
|
-
message: "
|
|
464
|
+
message: "is not allowed in combination with noTillage"
|
|
465
465
|
},
|
|
466
466
|
{
|
|
467
|
-
function: "
|
|
467
|
+
function: "validate_tillage_site_type",
|
|
468
|
+
level: "warning",
|
|
469
|
+
message: "should contain a tillage practice"
|
|
470
|
+
},
|
|
471
|
+
{
|
|
472
|
+
function: "validate_tillage_values",
|
|
468
473
|
level: "error",
|
|
469
|
-
message: "
|
|
474
|
+
message: "cannot use no tillage if depth or number of tillages is not 0"
|
|
470
475
|
},
|
|
471
476
|
{
|
|
472
|
-
function: "
|
|
477
|
+
function: "validate_tillage_values",
|
|
473
478
|
level: "error",
|
|
474
|
-
message: "
|
|
479
|
+
message: "cannot use full tillage if depth or number of tillages is 0"
|
|
475
480
|
},
|
|
476
481
|
{
|
|
477
|
-
function: "
|
|
482
|
+
function: "validate_liveAnimal_system",
|
|
478
483
|
level: "warning",
|
|
479
|
-
message: "should
|
|
484
|
+
message: "should add an animal production system"
|
|
480
485
|
},
|
|
481
486
|
{
|
|
482
|
-
function: "
|
|
487
|
+
function: "validate_has_pastureGrass",
|
|
488
|
+
level: "warning",
|
|
489
|
+
message: "should add the term pastureGrass"
|
|
490
|
+
},
|
|
491
|
+
{
|
|
492
|
+
function: "validate_pastureGrass_key_termType",
|
|
483
493
|
level: "error",
|
|
484
|
-
message: "
|
|
494
|
+
message: "pastureGrass key termType must be landCover"
|
|
485
495
|
},
|
|
486
496
|
{
|
|
487
|
-
function: "
|
|
497
|
+
function: "validate_pastureGrass_key_value",
|
|
488
498
|
level: "error",
|
|
489
|
-
message: "
|
|
499
|
+
message: "all values must be numbers"
|
|
490
500
|
},
|
|
491
501
|
{
|
|
492
|
-
function: "
|
|
502
|
+
function: "validate_pastureGrass_key_value",
|
|
493
503
|
level: "error",
|
|
494
|
-
message: "
|
|
504
|
+
message: "the sum of all pastureGrass values must be 100"
|
|
495
505
|
},
|
|
496
506
|
{
|
|
497
|
-
function: "
|
|
507
|
+
function: "validate_permanent_crop_productive_phase",
|
|
498
508
|
level: "error",
|
|
499
|
-
message: "
|
|
509
|
+
message: "must add the term productivePhasePermanentCrops"
|
|
500
510
|
},
|
|
501
511
|
{
|
|
502
|
-
function: "
|
|
512
|
+
function: "validate_primaryPercent",
|
|
503
513
|
level: "error",
|
|
504
|
-
message: "
|
|
514
|
+
message: "primaryPercent not allowed on this siteType"
|
|
505
515
|
},
|
|
506
516
|
{
|
|
507
|
-
function: "
|
|
508
|
-
level: "
|
|
509
|
-
message: "
|
|
517
|
+
function: "validate_primaryPercent",
|
|
518
|
+
level: "error",
|
|
519
|
+
message: "primaryPercent not allowed on this practice"
|
|
510
520
|
},
|
|
511
521
|
{
|
|
512
|
-
function: "
|
|
522
|
+
function: "validate_processing_operation",
|
|
513
523
|
level: "error",
|
|
514
|
-
message: "
|
|
524
|
+
message: "must have a primary processing operation"
|
|
515
525
|
},
|
|
516
526
|
{
|
|
517
|
-
function: "
|
|
518
|
-
level: "
|
|
519
|
-
message: "
|
|
527
|
+
function: "validate_landCover_match_products",
|
|
528
|
+
level: "error",
|
|
529
|
+
message: "at least one landCover practice must match an equivalent product"
|
|
520
530
|
},
|
|
521
531
|
{
|
|
522
|
-
function: "
|
|
523
|
-
level: "
|
|
524
|
-
message: "
|
|
532
|
+
function: "validate_coverCrop_landCover_primary_product",
|
|
533
|
+
level: "error",
|
|
534
|
+
message: "a cover crop can not be the land cover of the primary product"
|
|
525
535
|
},
|
|
526
536
|
{
|
|
527
|
-
function: "
|
|
528
|
-
level: "
|
|
529
|
-
message: "should
|
|
537
|
+
function: "validate_practices_management",
|
|
538
|
+
level: "error",
|
|
539
|
+
message: "should match the site management node value"
|
|
530
540
|
},
|
|
531
541
|
{
|
|
532
|
-
function: "
|
|
542
|
+
function: "validate_irrigated_complete_has_inputs",
|
|
533
543
|
level: "error",
|
|
534
|
-
message: "
|
|
544
|
+
message: "must contain water inputs"
|
|
535
545
|
},
|
|
536
546
|
{
|
|
537
|
-
function: "
|
|
547
|
+
function: "validate_rainfed_water_inputs",
|
|
538
548
|
level: "error",
|
|
539
|
-
message: "
|
|
549
|
+
message: "must not set rainfed with water inputs"
|
|
540
550
|
},
|
|
541
551
|
{
|
|
542
|
-
function: "
|
|
543
|
-
level: "
|
|
544
|
-
message: "
|
|
552
|
+
function: "validate_irrigating_operation_rainfed_water_regime",
|
|
553
|
+
level: "warning",
|
|
554
|
+
message: "should use irrigated water regime"
|
|
545
555
|
},
|
|
546
556
|
{
|
|
547
|
-
function: "
|
|
557
|
+
function: "validate_cropResidueManagement_products",
|
|
548
558
|
level: "error",
|
|
549
|
-
message: "
|
|
559
|
+
message: "cropResidue product is not accounted for by the cropResidueManagement practices"
|
|
550
560
|
},
|
|
551
561
|
{
|
|
552
562
|
function: "validate_property_valueType",
|
|
@@ -564,254 +574,264 @@ var validations = [
|
|
|
564
574
|
message: "should be within percentage of default value"
|
|
565
575
|
},
|
|
566
576
|
{
|
|
567
|
-
function: "
|
|
577
|
+
function: "validate_date_lt_today",
|
|
568
578
|
level: "error",
|
|
569
|
-
message: "
|
|
570
|
-
},
|
|
571
|
-
{
|
|
572
|
-
function: "validate_value_empty",
|
|
573
|
-
level: "warning",
|
|
574
|
-
message: "may not be 0"
|
|
579
|
+
message: "must be before today"
|
|
575
580
|
},
|
|
576
581
|
{
|
|
577
|
-
function: "
|
|
582
|
+
function: "validate_node_dates",
|
|
578
583
|
level: "error",
|
|
579
|
-
message: "
|
|
584
|
+
message: "must be greater than startDate"
|
|
580
585
|
},
|
|
581
586
|
{
|
|
582
|
-
function: "
|
|
587
|
+
function: "validate_node_dates",
|
|
583
588
|
level: "error",
|
|
584
|
-
message: "
|
|
589
|
+
message: "must be in the same format as endDate"
|
|
585
590
|
},
|
|
586
591
|
{
|
|
587
|
-
function: "
|
|
592
|
+
function: "validate_list_dates",
|
|
588
593
|
level: "error",
|
|
589
|
-
message: "
|
|
594
|
+
message: "must be greater than startDate"
|
|
590
595
|
},
|
|
591
596
|
{
|
|
592
|
-
function: "
|
|
597
|
+
function: "validate_list_dates_format",
|
|
593
598
|
level: "error",
|
|
594
|
-
message: "must
|
|
595
|
-
},
|
|
596
|
-
{
|
|
597
|
-
function: "_validate_product_yield",
|
|
598
|
-
level: "warning",
|
|
599
|
-
message: "is outside confidence interval"
|
|
599
|
+
message: "must have the same length as endDate"
|
|
600
600
|
},
|
|
601
601
|
{
|
|
602
|
-
function: "
|
|
603
|
-
level: "
|
|
604
|
-
message: "
|
|
602
|
+
function: "validate_list_dates_length",
|
|
603
|
+
level: "error",
|
|
604
|
+
message: "must contain as many items as values"
|
|
605
605
|
},
|
|
606
606
|
{
|
|
607
|
-
function: "
|
|
607
|
+
function: "validate_list_value_between_min_max",
|
|
608
608
|
level: "error",
|
|
609
|
-
message: "
|
|
609
|
+
message: "must be between min and max"
|
|
610
610
|
},
|
|
611
611
|
{
|
|
612
|
-
function: "
|
|
612
|
+
function: "validate_list_min_below_max",
|
|
613
613
|
level: "error",
|
|
614
|
-
message: "
|
|
614
|
+
message: "must be greater than min"
|
|
615
615
|
},
|
|
616
616
|
{
|
|
617
|
-
function: "
|
|
618
|
-
level: "
|
|
619
|
-
message: "
|
|
617
|
+
function: "validate_list_min_max_lookup",
|
|
618
|
+
level: "error",
|
|
619
|
+
message: "must be above the minimum"
|
|
620
620
|
},
|
|
621
621
|
{
|
|
622
|
-
function: "
|
|
622
|
+
function: "validate_list_min_max_lookup",
|
|
623
623
|
level: "error",
|
|
624
|
-
message: "must
|
|
624
|
+
message: "must be below the maximum"
|
|
625
625
|
},
|
|
626
626
|
{
|
|
627
|
-
function: "
|
|
627
|
+
function: "validate_region_list_value_diff_property_lookup",
|
|
628
628
|
level: "warning",
|
|
629
|
-
message: "should
|
|
629
|
+
message: "should be within acceptable range of the lookup value"
|
|
630
630
|
},
|
|
631
631
|
{
|
|
632
|
-
function: "
|
|
632
|
+
function: "validate_list_term_percent",
|
|
633
633
|
level: "warning",
|
|
634
|
-
message: "
|
|
634
|
+
message: "may be between 0 and 100"
|
|
635
635
|
},
|
|
636
636
|
{
|
|
637
|
-
function: "
|
|
638
|
-
level: "
|
|
639
|
-
message: "should
|
|
637
|
+
function: "validate_list_term_percent",
|
|
638
|
+
level: "error",
|
|
639
|
+
message: "should be between 0 and 100 (percentage)"
|
|
640
640
|
},
|
|
641
641
|
{
|
|
642
|
-
function: "
|
|
642
|
+
function: "validate_list_percent_requires_value",
|
|
643
643
|
level: "error",
|
|
644
|
-
message: "
|
|
644
|
+
message: "should have required property 'value'"
|
|
645
645
|
},
|
|
646
646
|
{
|
|
647
|
-
function: "
|
|
647
|
+
function: "validate_list_valueType",
|
|
648
648
|
level: "error",
|
|
649
|
-
message: "
|
|
649
|
+
message: "the node value type is incorrect"
|
|
650
650
|
},
|
|
651
651
|
{
|
|
652
|
-
function: "
|
|
652
|
+
function: "validate_list_has_properties",
|
|
653
653
|
level: "warning",
|
|
654
|
-
message: "
|
|
654
|
+
message: "should add missing properties"
|
|
655
655
|
},
|
|
656
656
|
{
|
|
657
|
-
function: "
|
|
657
|
+
function: "validate_is_region",
|
|
658
658
|
level: "error",
|
|
659
|
-
message: "must
|
|
659
|
+
message: "must not be a country"
|
|
660
660
|
},
|
|
661
661
|
{
|
|
662
|
-
function: "
|
|
662
|
+
function: "validate_region_in_country",
|
|
663
663
|
level: "error",
|
|
664
|
-
message: "
|
|
664
|
+
message: "must be within the country"
|
|
665
665
|
},
|
|
666
666
|
{
|
|
667
|
-
function: "
|
|
667
|
+
function: "validate_country",
|
|
668
668
|
level: "error",
|
|
669
|
-
message: "
|
|
669
|
+
message: "must be a country"
|
|
670
670
|
},
|
|
671
671
|
{
|
|
672
|
-
function: "
|
|
672
|
+
function: "validate_coordinates",
|
|
673
673
|
level: "error",
|
|
674
|
-
message: "
|
|
674
|
+
message: "does not contain latitude and longitude"
|
|
675
675
|
},
|
|
676
676
|
{
|
|
677
|
-
function: "
|
|
678
|
-
level: "
|
|
679
|
-
message: "
|
|
677
|
+
function: "validate_area",
|
|
678
|
+
level: "warning",
|
|
679
|
+
message: "should be equal to boundary"
|
|
680
680
|
},
|
|
681
681
|
{
|
|
682
|
-
function: "
|
|
683
|
-
level: "
|
|
684
|
-
message: "
|
|
682
|
+
function: "validate_boundary_area",
|
|
683
|
+
level: "warning",
|
|
684
|
+
message: "boundaryArea should be lower than max size"
|
|
685
685
|
},
|
|
686
686
|
{
|
|
687
|
-
function: "
|
|
688
|
-
level: "
|
|
689
|
-
message: "
|
|
687
|
+
function: "validate_region_size",
|
|
688
|
+
level: "warning",
|
|
689
|
+
message: "should be lower than max size"
|
|
690
690
|
},
|
|
691
691
|
{
|
|
692
|
-
function: "
|
|
692
|
+
function: "validate_empty_fields",
|
|
693
693
|
level: "warning",
|
|
694
|
-
message: "
|
|
694
|
+
message: "may not be empty"
|
|
695
695
|
},
|
|
696
696
|
{
|
|
697
|
-
function: "
|
|
697
|
+
function: "validate_linked_source_privacy",
|
|
698
|
+
level: "error",
|
|
699
|
+
message: "should have the same privacy as the related source"
|
|
700
|
+
},
|
|
701
|
+
{
|
|
702
|
+
function: "validate_private_has_source",
|
|
698
703
|
level: "warning",
|
|
699
|
-
message: "
|
|
704
|
+
message: "should add a source"
|
|
700
705
|
},
|
|
701
706
|
{
|
|
702
|
-
function: "
|
|
707
|
+
function: "_validate_list_model",
|
|
703
708
|
level: "error",
|
|
704
|
-
message: "
|
|
709
|
+
message: "the value provided is not consistent with the model result"
|
|
705
710
|
},
|
|
706
711
|
{
|
|
707
|
-
function: "
|
|
708
|
-
level: "
|
|
709
|
-
message: "
|
|
712
|
+
function: "validate_duplicated_terms",
|
|
713
|
+
level: "warning",
|
|
714
|
+
message: "should not use several terms describing the same product"
|
|
710
715
|
},
|
|
711
716
|
{
|
|
712
|
-
function: "
|
|
717
|
+
function: "validate_other_model",
|
|
713
718
|
level: "error",
|
|
714
|
-
message: "
|
|
719
|
+
message: "is required when using other model"
|
|
715
720
|
},
|
|
716
721
|
{
|
|
717
|
-
function: "
|
|
718
|
-
level: "
|
|
719
|
-
message: "
|
|
722
|
+
function: "validate_nested_existing_node",
|
|
723
|
+
level: "warning",
|
|
724
|
+
message: "should not link to an existing node"
|
|
720
725
|
},
|
|
721
726
|
{
|
|
722
|
-
function: "
|
|
723
|
-
level: "
|
|
724
|
-
message: "
|
|
727
|
+
function: "validate_nested_existing_node",
|
|
728
|
+
level: "warning",
|
|
729
|
+
message: "should not link to an existing node"
|
|
725
730
|
},
|
|
726
731
|
{
|
|
727
|
-
function: "
|
|
732
|
+
function: "validate_cycle_dates",
|
|
728
733
|
level: "error",
|
|
729
|
-
message: "
|
|
734
|
+
message: "multiple cycles on the same site cannot overlap"
|
|
730
735
|
},
|
|
731
736
|
{
|
|
732
|
-
function: "
|
|
737
|
+
function: "validate_cycles_linked_ia",
|
|
733
738
|
level: "error",
|
|
734
|
-
message: "
|
|
739
|
+
message: "cycles linked together cannot be added to the same site"
|
|
735
740
|
},
|
|
736
741
|
{
|
|
737
|
-
function: "
|
|
738
|
-
level: "
|
|
739
|
-
message: "
|
|
742
|
+
function: "validate_economicValueShare",
|
|
743
|
+
level: "error",
|
|
744
|
+
message: "economicValueShare should sum to 100 or less across all products"
|
|
740
745
|
},
|
|
741
746
|
{
|
|
742
|
-
function: "
|
|
747
|
+
function: "validate_value_empty",
|
|
743
748
|
level: "warning",
|
|
744
|
-
message: "
|
|
749
|
+
message: "may not be 0"
|
|
745
750
|
},
|
|
746
751
|
{
|
|
747
|
-
function: "
|
|
752
|
+
function: "validate_value_0",
|
|
748
753
|
level: "error",
|
|
749
|
-
message: "
|
|
754
|
+
message: "economicValueShare must be 0 for product value 0"
|
|
750
755
|
},
|
|
751
756
|
{
|
|
752
|
-
function: "
|
|
757
|
+
function: "validate_value_0",
|
|
753
758
|
level: "error",
|
|
754
|
-
message: "
|
|
759
|
+
message: "revenue must be 0 for product value 0"
|
|
755
760
|
},
|
|
756
761
|
{
|
|
757
|
-
function: "
|
|
762
|
+
function: "validate_primary",
|
|
758
763
|
level: "error",
|
|
759
|
-
message: "
|
|
764
|
+
message: "only 1 primary product allowed"
|
|
760
765
|
},
|
|
761
766
|
{
|
|
762
|
-
function: "
|
|
767
|
+
function: "validate_product_ha_functional_unit_ha",
|
|
763
768
|
level: "error",
|
|
764
|
-
message: "
|
|
769
|
+
message: "must be below or equal to 1 for unit in ha"
|
|
765
770
|
},
|
|
766
771
|
{
|
|
767
|
-
function: "
|
|
768
|
-
level: "
|
|
769
|
-
message: "
|
|
772
|
+
function: "_validate_product_yield",
|
|
773
|
+
level: "warning",
|
|
774
|
+
message: "is outside confidence interval"
|
|
770
775
|
},
|
|
771
776
|
{
|
|
772
|
-
function: "
|
|
777
|
+
function: "validate_excreta_product",
|
|
778
|
+
level: "warning",
|
|
779
|
+
message: "should add an excreta product"
|
|
780
|
+
},
|
|
781
|
+
{
|
|
782
|
+
function: "validate_excreta_product",
|
|
773
783
|
level: "error",
|
|
774
|
-
message: "
|
|
784
|
+
message: "is not an allowed excreta product"
|
|
775
785
|
},
|
|
776
786
|
{
|
|
777
|
-
function: "
|
|
787
|
+
function: "validate_requires_water_salinity",
|
|
778
788
|
level: "error",
|
|
779
|
-
message: "
|
|
789
|
+
message: "requires a water salinity measurement"
|
|
780
790
|
},
|
|
781
791
|
{
|
|
782
|
-
function: "
|
|
792
|
+
function: "_validate_all_values",
|
|
793
|
+
level: "warning",
|
|
794
|
+
message: "may not all be set to false"
|
|
795
|
+
},
|
|
796
|
+
{
|
|
797
|
+
function: "_validate_material",
|
|
783
798
|
level: "error",
|
|
784
|
-
message: "must
|
|
799
|
+
message: "must be set to false when specifying fuel use"
|
|
785
800
|
},
|
|
786
801
|
{
|
|
787
|
-
function: "
|
|
802
|
+
function: "_validate_freshForage",
|
|
788
803
|
level: "error",
|
|
789
|
-
message: "
|
|
804
|
+
message: "must have inputs representing the forage when set to true"
|
|
790
805
|
},
|
|
791
806
|
{
|
|
792
|
-
function: "
|
|
807
|
+
function: "_validate_ingredient",
|
|
793
808
|
level: "error",
|
|
794
|
-
message: "
|
|
809
|
+
message: "must have inputs to represent ingredients"
|
|
795
810
|
},
|
|
796
811
|
{
|
|
797
|
-
function: "
|
|
812
|
+
function: "_validate_ingredient",
|
|
798
813
|
level: "error",
|
|
799
|
-
message: "
|
|
814
|
+
message: "ingredients should be complete"
|
|
800
815
|
},
|
|
801
816
|
{
|
|
802
|
-
function: "
|
|
803
|
-
level: "
|
|
804
|
-
message: "
|
|
817
|
+
function: "_validate_animalPopulation",
|
|
818
|
+
level: "error",
|
|
819
|
+
message: "animal population must not be complete"
|
|
805
820
|
},
|
|
806
821
|
{
|
|
807
|
-
function: "
|
|
822
|
+
function: "_validate_completeness_blank_nodes_key",
|
|
808
823
|
level: "error",
|
|
809
|
-
message: "must be
|
|
824
|
+
message: "must not be blank if complete"
|
|
810
825
|
},
|
|
811
826
|
{
|
|
812
|
-
function: "
|
|
827
|
+
function: "validate_completeness_transport",
|
|
813
828
|
level: "error",
|
|
814
|
-
message: "must
|
|
829
|
+
message: "must have a value or a distance if complete"
|
|
830
|
+
},
|
|
831
|
+
{
|
|
832
|
+
function: "validate_coverage",
|
|
833
|
+
level: "warning",
|
|
834
|
+
message: "can not calculate all emissions"
|
|
815
835
|
}
|
|
816
836
|
];
|
|
817
837
|
var validation_default = {
|