Repository navigation
fix(isVAT): validate the TR (VKN) check digit - #2960
Open
bahriy-dev wants to merge 1 commit into
Open
bahriy-dev wants to merge 1 commit into
bahriy-dev wants to merge 1 commit into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2960 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 114 114
Lines 2599 2609 +10
Branches 658 661 +3
=========================================
+ Hits 2599 2609 +10 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
isVAT(str, 'TR')currently accepts any 10-digit string. The Turkish tax number (Vergi Kimlik Numarası, VKN) has a check digit, so numbers such as1234567891or9876543210should be rejected.This keeps the existing format (optional
TRprefix + 10 digits) and adds the check digit calculation. The existing valid test values still pass; new invalid cases fail onmasterand pass with this change.I also ran the implementation against the 200 VKNs in python-stdnum's test file; all of them validate.
References:
Checklist