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