Skip to content

Commit

Permalink
adding dni number and ocr number (#105)
Browse files Browse the repository at this point in the history
* adding dni number

* ocr_number

* version
  • Loading branch information
alexviquez authored Oct 14, 2022
1 parent 9a4d829 commit f71ec67
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 1 deletion.
20 changes: 20 additions & 0 deletions mati/types/enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,26 @@ def curp(self) -> str:
return self.fields['curp']['value']
return ''

@property
def document_number(self) -> str:
"""
This property fills the dni number direct from the ocr
fields `document_number`
"""
if self.fields and 'document_number' in self.fields:
return self.fields['document_number']['value']
return ''

@property
def ocr_number(self) -> str:
"""
This property fills the number extra direct from the ocr
fields `ocr_number`
"""
if self.fields and 'ocr_number' in self.fields:
return self.fields['ocr_number']['value']
return ''


@dataclass
class LivenessMedia:
Expand Down
2 changes: 1 addition & 1 deletion mati/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '2.0.1' # pragma: no cover
__version__ = '2.0.2' # pragma: no cover
2 changes: 2 additions & 0 deletions tests/resources/test_verifications.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,3 +77,5 @@ def test_retrieve_dni_verification(verification_without_pol):
verification = verification_without_pol
assert not verification.proof_of_life_errors
assert not verification.proof_of_life_document
assert verification.documents[0].document_number == '111'
assert not verification.documents[0].ocr_number

0 comments on commit f71ec67

Please sign in to comment.