fix: Handle TD1 embedded document check digits in optional1 for non-compliant documents like PRT and BEL IDs#70
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #70 +/- ##
==========================================
+ Coverage 88.66% 89.35% +0.69%
==========================================
Files 48 48
Lines 450 451 +1
Branches 123 122 -1
==========================================
+ Hits 399 403 +4
+ Misses 51 48 -3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
The title of the PR is a bit misleading here. We are already handling check digits which are in the optional field, but this is about how the check digit of the document number is calculated, specifically how the input of the check digit calculation is constructed.
I found a PRADO example which indeed has other logic for computing the check digit: https://www.consilium.europa.eu/prado/en/BEL-BO-03003/index.html
Can you use this one instead of your custom built one for the unit test?
The logic you added in parseDocumentNumberCheckDigit SGTM. Could you add a comment there on the part you added that it handles older non-compliant documents like PRT and BEL IDs. A reference to https://www.icao.int/sites/default/files/publications/DocSeries/9303_p11_cons_en.pdf page 88 to support that would also be useful for future reference.
…ompliant documents like PRT and BEL IDs Some TD1 issuers embed the document number check digit inside optional1 when the check-digit slot is `<`. This update validates the embedded digit against the concatenated document number + optional prefix before falling back to the ICAO-style separator variant. This is related to cheminfo#66.
8a5475d to
f89e4b7
Compare
Some TD1 issuers embed the document number check digit inside optional1 when the check-digit slot is
<. This update validates the embedded digit against the concatenated document number + optional prefix before falling back to the ICAO-style separator variant.Notes:
This is related to #66.