Пример #1
0
        public static decimal GetRefundableAmount(this Booking booking, DateTime forDate)
        {
            var refundableAmount = booking.Rooms.Sum(room => room.Price.Amount *
                                                     (decimal)room.DeadlineDetails.GetRefundableFraction(forDate));

            return(MoneyRounder.Ceil(refundableAmount, booking.Currency));
        }
Пример #2
0
        public static MoneyAmount GetCancellationPenalty(this Booking booking, DateTime forDate)
        {
            var penalty = booking.TotalPrice - booking.GetRefundableAmount(forDate);

            return(new MoneyAmount(penalty, booking.Currency));
        }