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