예제 #1
0
        public Quote ApplyOn(Quote quote)
        {
            var productAmount = quote.ProductAmount;

            return(_productDiscounts.TryGetValue(productAmount.ProductUnit, out var discount)
                ? quote.Apply(discount)
                : quote.Apply(_baseDiscount));
        }
 private static Quote RecalculateQuote(Quote quote, ImmutableDictionary <ProductUnit, Discount> discounts) =>
 discounts.TryGetValue(quote.ProductAmount.ProductUnit, out var discount)
         ? quote.Apply(discount)
         : quote;