26 lines
883 B
C#
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;
|
|
}
|
|
}
|