using System;
using System.Collections.Generic;
using System.Linq;
using BeWo.Data.Entities;
using BeWo.Service.Plugins;
using BS.Shared.Core;
using BS.Shared.DataContracts;
using BS.Shared.Extensions;
using BS.Shared.Services;

namespace BeWo.Club74
{

	public class DefaultCalculations : Calculations
    {
		public override int GetRoundedDuration(int minuteInterval, decimal durationInMinutes)
		{
			decimal lRoundedDuration = durationInMinutes;

			if (minuteInterval > 0 && durationInMinutes > 5)
			{
				lRoundedDuration = durationInMinutes % minuteInterval != 0
										? durationInMinutes + (minuteInterval - (durationInMinutes % minuteInterval))
										: durationInMinutes;
			}

			return (int)Math.Round(lRoundedDuration, 0, MidpointRounding.AwayFromZero);
		}

		
		
    }
}