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

namespace ShippingCostCalculator
{
    public class WorldWideShippingStrategy : ShippingStrategy
    {
        public WorldWideShippingStrategy(decimal flatRate)
            : base(flatRate)
        {
            
        }

        public decimal FlatRate
        {
            get
            {
                return flatRate;
            }
            set
            {
                flatRate = value;
            }
        }

        public override decimal CalculateShippingCost(float packageWeightInKilograms, Size<float> packageDimensionsInInches, RegionInfo destination)
        {
            if (destination == null)
                throw new ArgumentNullException("destination", "Nieokreślony region docelowy");

            if (packageWeightInKilograms <= 0f)
                throw new ArgumentOutOfRangeException("packageWeightInKilograms", "Waga przesyłki musi być liczbą większą od zera");

            if (packageDimensionsInInches.X <= 0f || packageDimensionsInInches.Y <= 0f)
                throw new ArgumentOutOfRangeException("packageDimensionsInInches", "Wymiary przesyłki muszą być liczbami większymi od zera");

            return decimal.One;
        }
    }
}
