using CS2B_shipping_company.Exception;

namespace CS2B_shipping_company.Container;

public class HalfContainer : BaseContainer
{
    private const float FeePerM3 = 19.37f;
    private const int MaxVolume = 40;
    private int volume;
    
    public int Volume
    {
        get => volume;
        set
        {
            if (value > MaxVolume)
                throw new VolumeExceededException($"Volume cannot exceed {MaxVolume}m³");
            volume = value;
        }
    }
    
    public HalfContainer(string description, string countryOfOrigin) 
        : base(description, countryOfOrigin) { }
    
    public override float Fee() => Volume * FeePerM3;
}