Open shaunickmistry opened 1 year ago
I doubt this is a 'new' format. We've had a discussion in #6 about this. I agree that we could open the doors for storing the 'E' as well.
In that case, I would propose to add the E as part of the 'CH' regex, and make sure that we add it in https://github.com/ralphje/django-internationalflavor/blob/master/internationalflavor/vat_number/validators.py#L22 when it is not there.
I don't think it is really a new country code, or do you think otherwise?
Thanks @ralphje! I've updated the PR so that the E is part of the 'CH' regex as you suggested.
In terms of the VATNumberCleaner, my proposal would be to not add it there so that we can still support and store both CH and CHE formats. As in practice we're seeing both formats being used and it would be good to store them as the user intends. What do you think?
I believe a single source form in the database is best. We can allow the user to submit any of them, but in principle only store one version, and display one of them.
I believe with or without the E makes no difference in terms of interpretation, so I strongly believe we should not save it in both formats.
I'm not sure if this repo is still supported, but my organisation has a fork which we would like to stop supporting individually and instead support this public repo.
As a part of this, we have recently added some support for the Swiss VAT format CHE-XXXXXXXXX and wanted to see if there was an appetite to add that here too?