All checks were successful
FarmMaps.Develop/CarbonLib/pipeline/head This commit looks good
95 lines
2.6 KiB
C#
95 lines
2.6 KiB
C#
//using CarbonService.Models;
|
|
using NetTopologySuite.Geometries;
|
|
using Newtonsoft.Json.Converters;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel.DataAnnotations;
|
|
using System.Linq;
|
|
using System.Runtime.Serialization;
|
|
using System.Text.Json.Serialization;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace FarmMapsAPI.Carbon.Models
|
|
{
|
|
public class FarmMapsCarbonRequest
|
|
{
|
|
public int PostalCode { get; set; }
|
|
|
|
public List<CropFieldFarmMaps> CropFields { get; set; }
|
|
|
|
//added
|
|
public int CalculateUntil { get; set; }
|
|
}
|
|
|
|
public class CropFieldFarmMaps
|
|
{
|
|
[Required]
|
|
public string Name { get; set; }
|
|
[Required]
|
|
public double Area { get; set; }
|
|
[Required]
|
|
public string SoilType { get; set; }
|
|
[Required]
|
|
public SoilPropertyFarmMaps SoilProperty { get; set; }
|
|
[Required]
|
|
public List<HistoricalCropDataFarmMaps> HistoricalCropData { get; set; }
|
|
}
|
|
|
|
public class HistoricalCropDataFarmMaps
|
|
{
|
|
[Required]
|
|
public int Year { get; set; }
|
|
[Required]
|
|
public List<CropData> Crops { get; set; }
|
|
public List<GreenManureTypeFarmMaps> GreenManures { get; set; }
|
|
public bool Rotation { get; set; }
|
|
|
|
public HistoricalCropDataFarmMaps DeepCopy()
|
|
{
|
|
HistoricalCropDataFarmMaps other = (HistoricalCropDataFarmMaps)this.MemberwiseClone();
|
|
return other;
|
|
}
|
|
}
|
|
|
|
public class CropData
|
|
{
|
|
[Required]
|
|
public string CropCode { get; set; }
|
|
public string MiterraCropName { get; set; }
|
|
public List<OrganicManureFarmMaps> OrganicManures { get; set; }
|
|
public int? CropYield { get; set; }
|
|
public bool CropRes { get; set; }
|
|
}
|
|
|
|
public class OrganicManureFarmMaps
|
|
{
|
|
[Required]
|
|
public string Type { get; set; }
|
|
[Required]
|
|
public double Quantity { get; set; }
|
|
}
|
|
|
|
public class SoilPropertyFarmMaps
|
|
{
|
|
public double? OM_Const { get; set; }
|
|
public double? Clay_Content { get; set; }
|
|
}
|
|
|
|
public class GreenManureTypeFarmMaps
|
|
{
|
|
public string CropCode { get; set; }
|
|
[JsonConverter(typeof(StringEnumConverter))]
|
|
public QualityFarmMaps? Quality { get; set; }
|
|
}
|
|
|
|
public enum QualityFarmMaps
|
|
{
|
|
[EnumMember(Value = "Goed")]
|
|
Good,
|
|
[EnumMember(Value = "Matig")]
|
|
Average,
|
|
[EnumMember(Value = "Slecht")]
|
|
Bad
|
|
}
|
|
}
|