using NetTopologySuite.Geometries; using Newtonsoft.Json; using Newtonsoft.Json.Converters; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Linq; using System.Runtime.Serialization; using System.Threading.Tasks; namespace CarbonService.Models { public class CarbonRequest { public Geometry geometry { get; set; } [Required] public int PostalCode { get; set; } public List CropFields { get; set; } } public class CropField { [Required] public string Name { get; set; } [Required] public double Area { get; set; } [Required] public string SoilType { get; set; } [Required] public SoilProperty SoilProperty { get; set; } [Required] public List HistoricalCropData { get; set; } public List GreenManures { get; set; } } public class SoilProperty { public double? OM_Const { get; set; } public double? Clay_Content { get; set; } public bool? Depth10 { get; set; } public int? Depth { get; set; } } public class OrgManureApplied { double? yield; [Required] public string Crop { get; set; } public List OrganicManures { get; set; } public double? CropYield { get { return (int?)yield; } set { yield = value; } } public bool CropRes { get; set; } public string Irrigation { get; set; } } public class OrganicManureType { [Required] public string Type { get; set; } [Required] public double Quantity { get; set; } } public class HistoricalCropData { [Required] public int Year { get; set; } [Required] public List Crops { get; set; } } public class GreenManure { [Required] public int Year { get; set; } [Required] public List GreenManureTypes { get; set; } } public class GreenManureType { [Required] public string Type { get; set; } [JsonConverter(typeof(StringEnumConverter))] public Quality Quality { get; set; } } public enum Quality { [EnumMember(Value = "Goed")] Good, [EnumMember(Value = "Matig")] Average, [EnumMember(Value = "Slecht")] Bad } }