예제 #1
0
        public static string GetYearlyApprenticeshipMinimumWage(decimal hoursPerWeek, DateTime possibleStartDate)
        {
            NationalMinimumWageRates wageRange = NationalMinimumWageService.GetHourlyRates(possibleStartDate);

            return
                ($"{FormatWageAmount(WageCalculator.GetYearlyRateFromHourlyRate(wageRange.ApprenticeMinimumWage, hoursPerWeek))}");
        }
예제 #2
0
        public static string GetWeeklyNationalMinimumWageMaximum(decimal hoursPerWeek, DateTime possibleStartDate)
        {
            NationalMinimumWageRates wageRange = NationalMinimumWageService.GetHourlyRates(possibleStartDate);

            string higherRange = FormatWageAmount(wageRange.Over25NationalMinimumWage * hoursPerWeek);

            return($"{higherRange}");
        }
예제 #3
0
        private static string GetYearlyNationalMinimumWage(decimal hoursPerWeek, DateTime possibleStartDate)
        {
            NationalMinimumWageRates wageRange = NationalMinimumWageService.GetHourlyRates(possibleStartDate);

            string lowerRange =
                FormatWageAmount(WageCalculator.GetYearlyRateFromHourlyRate(wageRange.Under18NationalMinimumWage, hoursPerWeek));
            string higherRange =
                FormatWageAmount(WageCalculator.GetYearlyRateFromHourlyRate(wageRange.Over25NationalMinimumWage, hoursPerWeek));

            return($"{lowerRange} to {higherRange}");
        }
        /// <summary>
        ///     Gets the annual rates as at a specified date and hours per week.  If no date specified then will return the
        ///     latest rates. If no hours specified then will use 37.5 hours as a standard week.
        /// </summary>
        /// <param name="dateTime">The specified date for the rates</param>
        /// <param name="hoursPerWeek">The specified hours per week</param>
        /// <returns>The rates as at the specified date or the latest rates if no date specified</returns>
        public static NationalMinimumWageRates GetAnnualRates(DateTime dateTime, decimal hoursPerWeek)
        {
            NationalMinimumWageRates weeklyRates = GetWeeklyRates(dateTime, hoursPerWeek);

            return(new NationalMinimumWageRates
                   (
                       weeklyRates.ValidFrom,
                       weeklyRates.ValidFrom,
                       weeklyRates.ApprenticeMinimumWage * WeeksPerYear,
                       weeklyRates.Under18NationalMinimumWage * WeeksPerYear,
                       weeklyRates.Between18AndUnder21NationalMinimumWage * WeeksPerYear,
                       weeklyRates.Between21AndUnder25NationalMinimumWage * WeeksPerYear,
                       weeklyRates.Over25NationalMinimumWage * WeeksPerYear
                   ));
        }
        /// <summary>
        ///     Gets the weekly rates as at a specified date and hours per week.
        /// </summary>
        /// <param name="dateTime">The specified date for the rates</param>
        /// <param name="hoursPerWeek">The specified hours per week</param>
        /// <returns>The rates as at the specified date or the latest rates if no date specified</returns>
        public static NationalMinimumWageRates GetWeeklyRates(DateTime dateTime, decimal hoursPerWeek)
        {
            NationalMinimumWageRates hourlyRates = nationalMinimumWageRates.Single(r => dateTime >= r.ValidFrom && dateTime < r.ValidTo);

            return(new NationalMinimumWageRates
                   (
                       hourlyRates.ValidFrom,
                       hourlyRates.ValidFrom,
                       hourlyRates.ApprenticeMinimumWage * hoursPerWeek,
                       hourlyRates.Under18NationalMinimumWage * hoursPerWeek,
                       hourlyRates.Between18AndUnder21NationalMinimumWage * hoursPerWeek,
                       hourlyRates.Between21AndUnder25NationalMinimumWage * hoursPerWeek,
                       hourlyRates.Over25NationalMinimumWage * hoursPerWeek
                   ));
        }