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