fix mapping
All checks were successful
FarmMaps.Develop/CarbonLib/pipeline/head This commit looks good

This commit is contained in:
2021-07-26 14:47:24 +02:00
parent cb981ef805
commit ee361e0085
2 changed files with 6 additions and 5 deletions

View File

@@ -154,6 +154,7 @@ namespace FarmMapsAPI.Carbon
Crops = new List<OrgManureApplied> {
new OrgManureApplied {
Crop = cropYear.MiterraCropName,
CropRes = cropYear.CropRes,
OrganicManures =
cropYear.OrganicManures.Select(x => new OrganicManureType { Type = x.Type, Quantity = x.Quantity }).ToList(),
CropYield = cropYear.CropYield } }
@@ -175,7 +176,7 @@ namespace FarmMapsAPI.Carbon
var crop = mappedCropData.SingleOrDefault(x => x.Year == crops.Year);
if (crop == null)
{
mappedCropData.Add(new HistoricalCropData { Year = crops.Year, Crops = new List<OrgManureApplied> { new OrgManureApplied { Crop = cropMapping.MiterraRothCCrop, OrganicManures = orgManure, CropYield = cropYear.CropYield } } });
mappedCropData.Add(new HistoricalCropData { Year = crops.Year, Crops = new List<OrgManureApplied> { new OrgManureApplied { Crop = cropMapping.MiterraRothCCrop, OrganicManures = orgManure, CropYield = cropYear.CropYield, CropRes = cropYear.CropRes } } });
}
else
{
@@ -184,7 +185,7 @@ namespace FarmMapsAPI.Carbon
}
else
{
mappedCropData.Add(new HistoricalCropData { Year = crops.Year, Crops = new List<OrgManureApplied> { new OrgManureApplied { Crop = cropYear.CropCode, OrganicManures = null, CropYield = cropYear.CropYield } } });
mappedCropData.Add(new HistoricalCropData { Year = crops.Year, Crops = new List<OrgManureApplied> { new OrgManureApplied { Crop = cropYear.CropCode, OrganicManures = null, CropYield = cropYear.CropYield, CropRes = cropYear.CropRes } } });
}
}
}

View File

@@ -85,10 +85,10 @@ namespace FarmMapsAPI.Carbon.Models
public enum QualityFarmMaps
{
[EnumMember(Value = "Goed")]
Good,
Good = 1,
[EnumMember(Value = "Matig")]
Average,
Average = 2,
[EnumMember(Value = "Slecht")]
Bad
Bad = 3
}
}