using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Bellwether.Model
{
    public class SolarenergyCapacityModel
    {
        public string Area { get; set; }
        public long Capacity { get; set; }

        public static SolarenergyCapacityModel Parse(SolarenergyCapacityRawModel rawModel)
        {
            if (rawModel is null)
            {
                return new SolarenergyCapacityModel();
            }

            if (!long.TryParse(rawModel.Capacity, out var capacity))
            {
                return new SolarenergyCapacityModel();
            }

            return new SolarenergyCapacityModel()
            {
                Area = rawModel.Area,
                Capacity = capacity
            };
        }
    }

    public class SolarenergyCapacityRawModel
    {
        public string Area { get; set; }
        public string Capacity { get; set; }
    }
}
