@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/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",
487
+ function: "validate_has_pastureGrass",
488
+ level: "warning",
489
+ message: "should add the term pastureGrass"
490
+ },
491
+ {
492
+ function: "validate_pastureGrass_key_termType",
483
493
  level: "error",
484
- message: "should be equal to cycleDuration for crop"
494
+ message: "pastureGrass key termType must be landCover"
485
495
  },
486
496
  {
487
- function: "validate_crop_siteDuration",
497
+ function: "validate_pastureGrass_key_value",
488
498
  level: "error",
489
- message: "should be greater than cycleDuration for crop"
499
+ message: "all values must be numbers"
490
500
  },
491
501
  {
492
- function: "validate_animal_siteDuration",
502
+ function: "validate_pastureGrass_key_value",
493
503
  level: "error",
494
- message: "should be equal to cycleDuration for animals"
504
+ message: "the sum of all pastureGrass values must be 100"
495
505
  },
496
506
  {
497
- function: "validate_animal_siteDuration",
507
+ function: "validate_permanent_crop_productive_phase",
498
508
  level: "error",
499
- message: "should be equal to cycleDuration - otherSitesDuration for animals"
509
+ message: "must add the term productivePhasePermanentCrops"
500
510
  },
501
511
  {
502
- function: "validate_animal_siteDuration",
512
+ function: "validate_primaryPercent",
503
513
  level: "error",
504
- message: "should be less than cycleDuration for animals"
514
+ message: "primaryPercent not allowed on this siteType"
505
515
  },
506
516
  {
507
- function: "validate_durations",
508
- level: "warning",
509
- message: "should add the fields for a relative cycle"
517
+ function: "validate_primaryPercent",
518
+ level: "error",
519
+ message: "primaryPercent not allowed on this practice"
510
520
  },
511
521
  {
512
- function: "validate_possibleCoverCrop",
522
+ function: "validate_processing_operation",
513
523
  level: "error",
514
- message: "cover crop cycle contains non cover crop product"
524
+ message: "must have a primary processing operation"
515
525
  },
516
526
  {
517
- function: "validate_set_treatment",
518
- level: "warning",
519
- message: "should specify a treatment when experimentDesign is specified"
527
+ function: "validate_landCover_match_products",
528
+ level: "error",
529
+ message: "at least one landCover practice must match an equivalent product"
520
530
  },
521
531
  {
522
- function: "validate_products_animals",
523
- level: "warning",
524
- message: "should not specify both liveAnimal and animalProduct"
532
+ function: "validate_coverCrop_landCover_primary_product",
533
+ level: "error",
534
+ message: "a cover crop can not be the land cover of the primary product"
525
535
  },
526
536
  {
527
- function: "validate_stocking_density",
528
- level: "warning",
529
- message: "should add the term stockingDensityPermanentPastureAverage"
537
+ function: "validate_practices_management",
538
+ level: "error",
539
+ message: "should match the site management node value"
530
540
  },
531
541
  {
532
- function: "validate_linked_impact_assessment",
542
+ function: "validate_irrigated_complete_has_inputs",
533
543
  level: "error",
534
- message: "multiple ImpactAssessment are associated with this Product"
544
+ message: "must contain water inputs"
535
545
  },
536
546
  {
537
- function: "validate_linked_impact_assessment",
547
+ function: "validate_rainfed_water_inputs",
538
548
  level: "error",
539
- message: "no ImpactAssessment are associated with this Product"
549
+ message: "must not set rainfed with water inputs"
540
550
  },
541
551
  {
542
- function: "validate_animal_product_mapping",
543
- level: "error",
544
- message: "is not an allowed animalProduct"
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,254 +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"
570
- },
571
- {
572
- function: "validate_value_empty",
573
- level: "warning",
574
- message: "may not be 0"
579
+ message: "must be before today"
575
580
  },
576
581
  {
577
- function: "validate_value_0",
582
+ function: "validate_node_dates",
578
583
  level: "error",
579
- message: "economicValueShare must be 0 for product value 0"
584
+ message: "must be greater than startDate"
580
585
  },
581
586
  {
582
- function: "validate_value_0",
587
+ function: "validate_node_dates",
583
588
  level: "error",
584
- message: "revenue must be 0 for product value 0"
589
+ message: "must be in the same format as endDate"
585
590
  },
586
591
  {
587
- function: "validate_primary",
592
+ function: "validate_list_dates",
588
593
  level: "error",
589
- message: "only 1 primary product allowed"
594
+ message: "must be greater than startDate"
590
595
  },
591
596
  {
592
- function: "validate_product_ha_functional_unit_ha",
597
+ function: "validate_list_dates_format",
593
598
  level: "error",
594
- message: "must be below or equal to 1 for unit in ha"
595
- },
596
- {
597
- function: "_validate_product_yield",
598
- level: "warning",
599
- message: "is outside confidence interval"
599
+ message: "must have the same length as endDate"
600
600
  },
601
601
  {
602
- function: "validate_excreta_product",
603
- level: "warning",
604
- message: "should add an excreta product"
602
+ function: "validate_list_dates_length",
603
+ level: "error",
604
+ message: "must contain as many items as values"
605
605
  },
606
606
  {
607
- function: "validate_excreta_product",
607
+ function: "validate_list_value_between_min_max",
608
608
  level: "error",
609
- message: "is not an allowed excreta product"
609
+ message: "must be between min and max"
610
610
  },
611
611
  {
612
- function: "validate_requires_water_salinity",
612
+ function: "validate_list_min_below_max",
613
613
  level: "error",
614
- message: "requires a water salinity measurement"
614
+ message: "must be greater than min"
615
615
  },
616
616
  {
617
- function: "validate_has_animals",
618
- level: "warning",
619
- message: "should specify the herd composition"
617
+ function: "validate_list_min_max_lookup",
618
+ level: "error",
619
+ message: "must be above the minimum"
620
620
  },
621
621
  {
622
- function: "validate_duplicated_feed_inputs",
622
+ function: "validate_list_min_max_lookup",
623
623
  level: "error",
624
- message: "must not add the feed input to the Cycle as well"
624
+ message: "must be below the maximum"
625
625
  },
626
626
  {
627
- function: "validate_has_milkYieldPractice",
627
+ function: "validate_region_list_value_diff_property_lookup",
628
628
  level: "warning",
629
- message: "should specify the a milkYield practice"
629
+ message: "should be within acceptable range of the lookup value"
630
630
  },
631
631
  {
632
- function: "validate_animal_has_recommended_products",
632
+ function: "validate_list_term_percent",
633
633
  level: "warning",
634
- message: "should specify a recommended product"
634
+ message: "may be between 0 and 100"
635
635
  },
636
636
  {
637
- function: "validate_must_include_id",
638
- level: "warning",
639
- message: "should add missing inputs"
637
+ function: "validate_list_term_percent",
638
+ level: "error",
639
+ message: "should be between 0 and 100 (percentage)"
640
640
  },
641
641
  {
642
- function: "validate_related_impacts",
642
+ function: "validate_list_percent_requires_value",
643
643
  level: "error",
644
- message: "can not be linked to the same type"
644
+ message: "should have required property 'value'"
645
645
  },
646
646
  {
647
- function: "validate_related_impact_product",
647
+ function: "validate_list_valueType",
648
648
  level: "error",
649
- message: "can not be linked to a different term"
649
+ message: "the node value type is incorrect"
650
650
  },
651
651
  {
652
- function: "_validate_input_value",
652
+ function: "validate_list_has_properties",
653
653
  level: "warning",
654
- message: "is outside confidence interval"
654
+ message: "should add missing properties"
655
655
  },
656
656
  {
657
- function: "validate_animalFeed_requires_isAnimalFeed",
657
+ function: "validate_is_region",
658
658
  level: "error",
659
- message: "must specify is it an animal feed"
659
+ message: "must not be a country"
660
660
  },
661
661
  {
662
- function: "validate_isAnimalFeed_animal_cycle",
662
+ function: "validate_region_in_country",
663
663
  level: "error",
664
- message: "isAnimalFeed not allowed on a non-animal cycle"
664
+ message: "must be within the country"
665
665
  },
666
666
  {
667
- function: "validate_saplings",
667
+ function: "validate_country",
668
668
  level: "error",
669
- message: "saplings cannot be used as an input here"
669
+ message: "must be a country"
670
670
  },
671
671
  {
672
- function: "validate_seed",
672
+ function: "validate_coordinates",
673
673
  level: "error",
674
- message: "seed cannot be used as an input here"
674
+ message: "does not contain latitude and longitude"
675
675
  },
676
676
  {
677
- function: "validate_saplings_depreciated",
678
- level: "error",
679
- message: "saplingsDepreciatedAmountPerCycle cannot be used as an input here"
677
+ function: "validate_area",
678
+ level: "warning",
679
+ message: "should be equal to boundary"
680
680
  },
681
681
  {
682
- function: "validate_material_depreciated",
683
- level: "error",
684
- message: "must use the depreciated term"
682
+ function: "validate_boundary_area",
683
+ level: "warning",
684
+ message: "boundaryArea should be lower than max size"
685
685
  },
686
686
  {
687
- function: "validate_input_is_product",
688
- level: "error",
689
- message: "must be a product"
687
+ function: "validate_region_size",
688
+ level: "warning",
689
+ message: "should be lower than max size"
690
690
  },
691
691
  {
692
- function: "validate_input_unspecified_term",
692
+ function: "validate_empty_fields",
693
693
  level: "warning",
694
- message: "should use a specific term"
694
+ message: "may not be empty"
695
695
  },
696
696
  {
697
- function: "_validate_all_values",
697
+ function: "validate_linked_source_privacy",
698
+ level: "error",
699
+ message: "should have the same privacy as the related source"
700
+ },
701
+ {
702
+ function: "validate_private_has_source",
698
703
  level: "warning",
699
- message: "may not all be set to false"
704
+ message: "should add a source"
700
705
  },
701
706
  {
702
- function: "_validate_material",
707
+ function: "_validate_list_model",
703
708
  level: "error",
704
- message: "must be set to false when specifying fuel use"
709
+ message: "the value provided is not consistent with the model result"
705
710
  },
706
711
  {
707
- function: "_validate_freshForage",
708
- level: "error",
709
- message: "must have inputs representing the forage when set to true"
712
+ function: "validate_duplicated_terms",
713
+ level: "warning",
714
+ message: "should not use several terms describing the same product"
710
715
  },
711
716
  {
712
- function: "_validate_ingredient",
717
+ function: "validate_other_model",
713
718
  level: "error",
714
- message: "must have inputs to represent ingredients"
719
+ message: "is required when using other model"
715
720
  },
716
721
  {
717
- function: "_validate_ingredient",
718
- level: "error",
719
- message: "ingredients should be complete"
722
+ function: "validate_nested_existing_node",
723
+ level: "warning",
724
+ message: "should not link to an existing node"
720
725
  },
721
726
  {
722
- function: "_validate_animalPopulation",
723
- level: "error",
724
- message: "animal population must not be complete"
727
+ function: "validate_nested_existing_node",
728
+ level: "warning",
729
+ message: "should not link to an existing node"
725
730
  },
726
731
  {
727
- function: "_validate_completeness_blank_nodes_key",
732
+ function: "validate_cycle_dates",
728
733
  level: "error",
729
- message: "must not be blank if complete"
734
+ message: "multiple cycles on the same site cannot overlap"
730
735
  },
731
736
  {
732
- function: "validate_completeness_transport",
737
+ function: "validate_cycles_linked_ia",
733
738
  level: "error",
734
- message: "must have a value or a distance if complete"
739
+ message: "cycles linked together cannot be added to the same site"
735
740
  },
736
741
  {
737
- function: "validate_coverage",
738
- level: "warning",
739
- message: "can not calculate all emissions"
742
+ function: "validate_economicValueShare",
743
+ level: "error",
744
+ message: "economicValueShare should sum to 100 or less across all products"
740
745
  },
741
746
  {
742
- function: "validate_has_termType",
747
+ function: "validate_value_empty",
743
748
  level: "warning",
744
- message: "should contain at least one management node"
749
+ message: "may not be 0"
745
750
  },
746
751
  {
747
- function: "validate_fallow_dates",
752
+ function: "validate_value_0",
748
753
  level: "error",
749
- message: "duration must be in specified interval"
754
+ message: "economicValueShare must be 0 for product value 0"
750
755
  },
751
756
  {
752
- function: "validate_cycles_overlap",
757
+ function: "validate_value_0",
753
758
  level: "error",
754
- message: "management date must be before cycle start date"
759
+ message: "revenue must be 0 for product value 0"
755
760
  },
756
761
  {
757
- function: "validate_cycle_dates",
762
+ function: "validate_primary",
758
763
  level: "error",
759
- message: "multiple cycles on the same site cannot overlap"
764
+ message: "only 1 primary product allowed"
760
765
  },
761
766
  {
762
- function: "validate_cycles_linked_ia",
767
+ function: "validate_product_ha_functional_unit_ha",
763
768
  level: "error",
764
- message: "cycles linked together cannot be added to the same site"
769
+ message: "must be below or equal to 1 for unit in ha"
765
770
  },
766
771
  {
767
- function: "validate_linked_impactAssessment",
768
- level: "error",
769
- message: "must be linked to a verified country-level Impact Assessment"
772
+ function: "_validate_product_yield",
773
+ level: "warning",
774
+ message: "is outside confidence interval"
770
775
  },
771
776
  {
772
- function: "validate_plantation_practices",
777
+ function: "validate_excreta_product",
778
+ level: "warning",
779
+ message: "should add an excreta product"
780
+ },
781
+ {
782
+ function: "validate_excreta_product",
773
783
  level: "error",
774
- message: "must include practices for plantation weighting"
784
+ message: "is not an allowed excreta product"
775
785
  },
776
786
  {
777
- function: "validate_id",
787
+ function: "validate_requires_water_salinity",
778
788
  level: "error",
779
- message: "aggregation id must contain a product, region, start, end year, and a timestamp"
789
+ message: "requires a water salinity measurement"
780
790
  },
781
791
  {
782
- function: "_validate_previous_transformationId",
792
+ function: "_validate_all_values",
793
+ level: "warning",
794
+ message: "may not all be set to false"
795
+ },
796
+ {
797
+ function: "_validate_material",
783
798
  level: "error",
784
- message: "must point to a previous transformation in the list"
799
+ message: "must be set to false when specifying fuel use"
785
800
  },
786
801
  {
787
- function: "_validate_previous_input",
802
+ function: "_validate_freshForage",
788
803
  level: "error",
789
- message: "at least one Input must be a Product of the Cycle"
804
+ message: "must have inputs representing the forage when set to true"
790
805
  },
791
806
  {
792
- function: "_validate_previous_input",
807
+ function: "_validate_ingredient",
793
808
  level: "error",
794
- message: "at least one Input must be a Product of the previous Transformation"
809
+ message: "must have inputs to represent ingredients"
795
810
  },
796
811
  {
797
- function: "_validate_previous_product_value",
812
+ function: "_validate_ingredient",
798
813
  level: "error",
799
- message: "must be equal to previous product multiplied by the share"
814
+ message: "ingredients should be complete"
800
815
  },
801
816
  {
802
- function: "validate_linked_emission",
803
- level: "warning",
804
- message: "should be linked to an emission in the Cycle"
817
+ function: "_validate_animalPopulation",
818
+ level: "error",
819
+ message: "animal population must not be complete"
805
820
  },
806
821
  {
807
- function: "validate_excreta_inputs_products",
822
+ function: "_validate_completeness_blank_nodes_key",
808
823
  level: "error",
809
- message: "must be included as an Input"
824
+ message: "must not be blank if complete"
810
825
  },
811
826
  {
812
- function: "validate_transformation_inputs_value",
827
+ function: "validate_completeness_transport",
813
828
  level: "error",
814
- message: "must be specified for multiple Inputs with the same term"
829
+ message: "must have a value or a distance if complete"
830
+ },
831
+ {
832
+ function: "validate_coverage",
833
+ level: "warning",
834
+ message: "can not calculate all emissions"
815
835
  }
816
836
  ];
817
837
  var validation_default = {