Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
:toc: macro :toc-title: :toclevels: 99
http://ac9c6f8e39fc311e7933702bb3bd0e5d-153786183.us-west-2.elb.amazonaws.com/docs/swagger[api reference] | https://todo[monitoring]
QA: https://rpm.newrelic.com/accounts/1410690/applications/72100340[monitoring]
toc::[]
The ms-taxes
microservice is responsible for maintaining tax rates and applying trivial rules. For example some Canadian provinces work with a single sales tax that combines federal and provincial rates called the "Harmonized Sales Tax" or HST. ms-taxes
takes care of this. However more involved rules like Quebec's compound taxation pre January 1 2013 are not handled. This is probably a missing feature. Refer to the first TODO below.
❯ http "http://ac9c6f8e39fc311e7933702bb3bd0e5d-153786183.us-west-2.elb.amazonaws.com/rates?country=ca®ion=qc"
HTTP/1.1 200 OK
Access-Control-Allow-Origin: *
Connection: keep-alive
Content-Length: 97
Date: Mon, 25 Sep 2017 03:01:12 GMT
content-type: application/json; charset=utf-8
{
"combinatedRate": 0.14975,
"rates": [
{
"amount": 0.05,
"name": "gst"
},
{
"amount": 0.09975,
"name": "pst"
}
]
}
❯ http "http://ac9c6f8e39fc311e7933702bb3bd0e5d-153786183.us-west-2.elb.amazonaws.com/rates?country=ca®ion=on"
HTTP/1.1 200 OK
Access-Control-Allow-Origin: *
Connection: keep-alive
Content-Length: 62
Date: Mon, 25 Sep 2017 03:00:33 GMT
content-type: application/json; charset=utf-8
{
"combinatedRate": 0.13,
"rates": [
{
"amount": 0.13,
"name": "hst"
}
]
}
Although SSENSE does not collect sales tax in every country (or even every region in countries that it does collect federal tax), the client does not need to know this. The client need only provide a well formed country and region combination, and ms-taxes
will return tax rates data. As SSENSE ceases to/begins to collect taxes in varying regions or countries, the client should not have to change.
These are TODOs for the next engineering squad that works on this microservice.
. The current model only returns rates but does not handle applying them to a price. This means it falls onto the caller to know how to apply tax rates. In the above example about Quebec compound sales tax, the client would need to know this! It is currently envisioned that a parent aggregation layer (e.g. ag-fees
) will sit in front of ms-taxes
and ms-duties
and coordinate their correct usage. Perhaps this layer could contain the knowledge of how to apply tax rates. Otherwise the API interface of ms-taxes
must be significantly refactored to:
.. require the client price
param
.. calculate the amount to pay for each applicable tax rate
. Validate the tax rates of some countries since it is inconsistent between the database and HQM service result. It includes: Australia, China, Puerto Rico and Russia. Some comments can be found in TestData.ts
.
. The quality of this micro-service is draft level, having gone through only a partial sprint of work from engineers unfamiliar with the conventions used in this project. We think another few days of refinement is necessary, and feel uncomfortable not being explicit about this.
. Get the test coverage higher.
FAQs
Tax Microservice
The npm package ms-taxes receives a total of 0 weekly downloads. As such, ms-taxes popularity was classified as not popular.
We found that ms-taxes demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.