saimarpaka / TaxServiceCalculationApp

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

TaxServiceCalculationApp

Class diagram of the project image

Documentation : Goal: - To be able to use Different implementations of ITaxCalculator, depending on the customer

  • Requirements
    • Create a common interface "ITaxCalculator" , which provides the following 2 methods

      1. GetTaxRatesForLocation
      2. GetCalculatedTaxesForOrder
    • Create the TaxCalculatorService and implement ITaxCalculator interface

    • Create the LoggingTaxCalculatorClient and implement ITaxCalculator interface

      • This class is responsible for logging the requests, and responses of ITaxCalculator injected clients
    • Create the TaxJarCalculatorClient with the following requirements

      • Implement ITaxCalculator interface
      • Inject TaxJarRequestBuilder
        • The responsibility of this class is to handle building of the RestRequests
      • Inject RestClient
      • Handle the response of the requests made by the concrete implementations of ITaxCalculatorInterface
    • Create the TaxJarRequestBuilder for TaxJarCalculatorClient class, whose responsibilities are as follows

    • Create the RequestBuilder for TaxJarRequestBuilder class, whose responsibilites are as follows

      • CreateGetRestRequest
      • CreatePostRestRequest
      • Add authentication headers to the created requests using the IAuthenticationProvider
    • Create TaxJarAuthenticationProvider by implementing the IAuthenticationProvider interface

      • Inject the apiToken to this class, by construction injection, by getting the apiToken from a secure storage like Azure KeyVault(not implemented for this instance)
      • Add the "Authorization" header as "Bearer {apiToken}" for the RestRequest

About


Languages

Language:C# 100.0%