Open zadigus opened 5 years ago
We could make up a jenkins job that would poll every day the vatlayer api which would then automatically update the database table containing the vat rates. The service is already wrapped by mirumee/django-prices-vatlayer. It'd be enough to protect a setVatRate
mutation with the relevant permission and run it automatically on a jenkins job. The Rex could then get the list of vat rates displayed somewhere on his dashboard.
It is useless to get the ACCESS KEY for the vatlayer api as Switzerland is not supported. We can, however, use the underlying django models used in this documentation. It is therefore not possible to automate a job that updates the rates in our database.
The vat rates are defined in django_prices_vatlayer.models.VAT
and django_prices_vatlayer.models.RateTypes
. The initial values of the vat rates are filled up by our migration step shopozor.migrations.0011_product_vat_rate.py
.
This is related to shopozor/saleor-backend#96.
Depending on the Product, the VAT might be different. However, most of the time, it has the same default value (e.g. currently 2.5% for edible products in Switzerland). The Rex needs to be able to define that value by means of a GraphQL API call. In the admin panel, the Producers would then be able to specify that VAT by either accepting the default value or providing their own.
The Rex will adapt VAT through a user interface addressed by this issue.