aw3831: fix yield with decimal
All checks were successful
FarmMaps.Develop/CarbonLib/pipeline/head This commit looks good

This commit is contained in:
2022-05-26 10:24:43 +02:00
parent 6cc39e3482
commit b0ac42a957
4 changed files with 7 additions and 9 deletions

View File

@@ -8,7 +8,7 @@
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute> <GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute> <GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute> <GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
<Version>1.1.5</Version> <Version>1.1.6</Version>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>

View File

@@ -16,7 +16,6 @@ namespace CarbonService.Models
[Required] [Required]
public int PostalCode { get; set; } public int PostalCode { get; set; }
public List<CropField> CropFields { get; set; } public List<CropField> CropFields { get; set; }
//public List<OrgManureApplied> OrgManureApplied { get; set; }
} }
public class CropField public class CropField
@@ -43,10 +42,12 @@ namespace CarbonService.Models
public class OrgManureApplied public class OrgManureApplied
{ {
double? yield;
[Required] [Required]
public string Crop { get; set; } public string Crop { get; set; }
public List<OrganicManureType> OrganicManures { get; set; } public List<OrganicManureType> OrganicManures { get; set; }
public int? CropYield { get; set; } public double? CropYield { get { return (int?)yield; } set { yield = value; } }
public bool CropRes { get; set; } public bool CropRes { get; set; }
} }
@@ -62,8 +63,6 @@ namespace CarbonService.Models
{ {
[Required] [Required]
public int Year { get; set; } public int Year { get; set; }
//[Required]
//public List<string> Crops { get; set; }
[Required] [Required]
public List<OrgManureApplied> Crops { get; set; } public List<OrgManureApplied> Crops { get; set; }
} }
@@ -81,7 +80,6 @@ namespace CarbonService.Models
[Required] [Required]
public string Type { get; set; } public string Type { get; set; }
//public string Quality { get; set; }
[JsonConverter(typeof(StringEnumConverter))] [JsonConverter(typeof(StringEnumConverter))]
public Quality Quality { get; set; } public Quality Quality { get; set; }
} }

View File

@@ -9,8 +9,6 @@ namespace FarmMapsAPI.Carbon.Models
{ {
[JsonProperty("cropField")] [JsonProperty("cropField")]
public List<CropFieldSummary> CropField { get; set; } public List<CropFieldSummary> CropField { get; set; }
//[JsonProperty("farmSummary")]
//public List<FarmYearSummary> FarmSummary { get; set; }
} }
public class CropFieldSummary public class CropFieldSummary

View File

@@ -54,11 +54,13 @@ namespace FarmMapsAPI.Carbon.Models
public class CropData public class CropData
{ {
double? yield;
[Required] [Required]
public string CropCode { get; set; } public string CropCode { get; set; }
public string MiterraCropName { get; set; } public string MiterraCropName { get; set; }
public List<OrganicManureFarmMaps> OrganicManures { get; set; } public List<OrganicManureFarmMaps> OrganicManures { get; set; }
public int? CropYield { get; set; } public double? CropYield { get { return (int?)yield; } set { yield = value; } }
public bool CropRes { get; set; } public bool CropRes { get; set; }
} }