Exemplo n.º 1
0
        public async Task <TaxResponse> GetTax(TaxRequest taxRequest)
        {
            var taxSetupResult = await _taxRepository.GetTax(taxRequest);

            var taxAmount = TaxRuleFactory.GetTaxRule(taxRequest.municipalityName)?.ApplyRule(taxSetupResult);

            return(new TaxResponse
            {
                municipilityName = taxRequest?.municipalityName,
                taxRate = taxAmount,
                message = !taxSetupResult.Any() ? "No result found." : String.Empty
            });
        }