ex-int-04-shipping-cost/ShippingCosts/Implementations/ShippingCostCalculatorBase.cs
github-classroom[bot] 5db225db88
Initial commit
2025-04-29 15:01:53 +00:00

26 lines
883 B
C#

using ShippingCosts.Contracts;
namespace ShippingCosts.Implementations;
/// <summary>
/// A base class for different shipping carriers
/// </summary>
public abstract class ShippingCostCalculatorBase(ICountryDistanceProvider countryDistanceProvider)
: IShippingCostCalculator
{
protected ICountryDistanceProvider CountryDistanceProvider { get; } = countryDistanceProvider;
public abstract string CarrierName { get; }
public abstract decimal? CalculateShippingCosts(string targetCountry, IMeasuredBox box);
/// <summary>
/// Calculates the sum of the longest and shortest side of a box
/// </summary>
/// <param name="box">Dimensions of the box</param>
/// <returns>Sum of the longest and shortest side</returns>
protected static int SumOfLongestAndShortestSides(IMeasuredBox box)
{
// TODO
return -1;
}
}