From f71ec6775c9269a1aaa0fb4cb8c207e3204bd2b5 Mon Sep 17 00:00:00 2001 From: Alex Viquez Date: Fri, 14 Oct 2022 15:16:53 -0500 Subject: [PATCH] adding dni number and ocr number (#105) * adding dni number * ocr_number * version --- mati/types/enums.py | 20 ++++++++++++++++++++ mati/version.py | 2 +- tests/resources/test_verifications.py | 2 ++ 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/mati/types/enums.py b/mati/types/enums.py index d5086fb..a2c21a0 100644 --- a/mati/types/enums.py +++ b/mati/types/enums.py @@ -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: diff --git a/mati/version.py b/mati/version.py index 0d8c2aa..f9ab40d 100644 --- a/mati/version.py +++ b/mati/version.py @@ -1 +1 @@ -__version__ = '2.0.1' # pragma: no cover +__version__ = '2.0.2' # pragma: no cover diff --git a/tests/resources/test_verifications.py b/tests/resources/test_verifications.py index f6651d8..911f621 100644 --- a/tests/resources/test_verifications.py +++ b/tests/resources/test_verifications.py @@ -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