Giter Club home page Giter Club logo

canadian-sales-tax-calculator's Introduction

canadian-sales-tax-calculator

REST API implemented using FastAPI for calculating Canadian Sales Tax based on province

Setup using DOCKER

If you have Docker & Docker-Compose installed on your system

git clone https://github.com/sarbjit87/canadian-sales-tax-calculator.git

docker-compose up -d --build

Visit http://127.0.0.1:8002/docs/ for the API documentation

API Documentation

API Endpoint HTTP Method Result
/get-province-codes/ GET Returns the code for all the provinces, e.g. ON for Ontario
/get-tax-rate/all/ GET Returns the tax-rate (GST, PST, Total-Tax) for all the provinces
/get-tax-rate/{province-code}/ GET Returns the tax-rate (GST, PST, Total-Tax) for the individual province
/get-tax/ POST Returns the tax on the total price for individual province

e.g. /get-tax/ with the request-body as

{
  "price": 10.54,
  "province": "QC"
}
curl -X POST "http://127.0.0.1:8002/get-tax/" -H "accept: application/json" -H "Content-Type: application/json" -d "{\"price\":10.54,\"province\":\"QC\"}"

will return

{
  "price": 10.54,
  "province": "QC",
  "total_tax_percentage": 14.975,
  "gst": 5,
  "pst": 9.975,
  "tax_amount": 1.58,
  "price_with_tax": 12.12
}

Source for tax-rates

Tax-rates are copied/referenced from the website https://canadabusiness.ca/government/taxes-gst-hst/federal-tax-information/overview-of-charging-and-collecting-sales-tax/?it=eng/page/2651/

DISCLAIMER

THE CODE IS BEING PROVIDED FOR INFORMATIONAL PURPOSES ONLY.

USE ON YOUR OWN RISK. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER OR CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES

THIS REPO IS RELEASED WITH NO WARRANTY AT ALL.

canadian-sales-tax-calculator's People

Contributors

sarbjit87 avatar dependabot[bot] avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.