From 79d8149f79717d7751f42928357e724543b14f07 Mon Sep 17 00:00:00 2001 From: AlexViquez Date: Wed, 21 Sep 2022 17:48:57 -0500 Subject: [PATCH] draft kyc validations --- cuenca/resources/__init__.py | 3 +++ cuenca/resources/kyc_validations.py | 34 +++++++++++++++++++++++++++++ cuenca/version.py | 2 +- 3 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 cuenca/resources/kyc_validations.py diff --git a/cuenca/resources/__init__.py b/cuenca/resources/__init__.py index cf20178c..ff5a835b 100644 --- a/cuenca/resources/__init__.py +++ b/cuenca/resources/__init__.py @@ -18,6 +18,7 @@ 'FileBatch', 'Identity', 'IdentityEvent', + 'KYCValidations', 'KYCVerification', 'LimitedWallet', 'LoginToken', @@ -55,6 +56,7 @@ from .files import File from .identities import Identity from .identity_events import IdentityEvent +from .kyc_validations import KYCValidations from .kyc_verifications import KYCVerification from .limited_wallets import LimitedWallet from .login_tokens import LoginToken @@ -95,6 +97,7 @@ FileBatch, Identity, IdentityEvent, + KYCValidations, KYCVerification, LimitedWallet, LoginToken, diff --git a/cuenca/resources/kyc_validations.py b/cuenca/resources/kyc_validations.py new file mode 100644 index 00000000..114aaca1 --- /dev/null +++ b/cuenca/resources/kyc_validations.py @@ -0,0 +1,34 @@ +import datetime as dt +from typing import ClassVar, Optional, cast + +from cuenca_validations.types import KYCFile + +from ..http import Session, session as global_session +from .base import Creatable, Retrievable, Updateable + + +class KYCValidation(Creatable, Retrievable): + _resource: ClassVar = 'kyc_verifications' + platform_id: str + created_at: dt.datetime + verification_id: Optional[str] + govt_id: Optional[KYCFile] + proof_of_address: Optional[KYCFile] + proof_of_life: Optional[KYCFile] + + class Config: + schema_extra = { + 'example': { + 'id': 'KVNEUInh69SuKXXmK95sROwQ', + 'platform_id': 'PT8UEv02zBTcymd4Kd3MO6pg', + 'created_at': '2020-05-24T14:15:22Z', + 'verification_id': 'string', + 'govt_id': KYCFile.schema().get('example'), + 'proof_of_address': None, + 'proof_of_life': None, + } + } + + @classmethod + def create(cls, session: Session = global_session) -> 'KYCValidation': + return cast('KYCValidation', cls._create(session=session)) diff --git a/cuenca/version.py b/cuenca/version.py index ddc147c0..b9125253 100644 --- a/cuenca/version.py +++ b/cuenca/version.py @@ -1,3 +1,3 @@ -__version__ = '0.14.5' +__version__ = '0.14.7.dev0' CLIENT_VERSION = __version__ API_VERSION = '2020-03-19'