Ejemplo n.º 1
0
        private bool ValidateOrderRequest(Customer customer, OrderRequest order)
        {
            bool productsExist = ValidateProducts(order);

            if (!productsExist)
            {
                return(false);
            }

            var taxes    = calculator.CalculateTaxes(order, customer);
            var discount = calculator.CalculateDiscount(order, customer);

            bool approvalResponse = orderApproval.Approve(new ApproveRequest
            {
                Customer = customer,
                Order    = order,
                Taxes    = taxes,
                Discount = discount
            });

            return(approvalResponse);
        }