From 77cc00f7617dde16b43cdc111812852b945be93c Mon Sep 17 00:00:00 2001 From: rogeliolopez Date: Fri, 9 Feb 2024 16:10:36 -0600 Subject: [PATCH 1/4] moral accounts --- cuenca_validations/types/enums.py | 5 ++ cuenca_validations/types/morals.py | 74 ++++++++++++++++++++++++++++ cuenca_validations/types/requests.py | 45 +++++++++++++++++ cuenca_validations/version.py | 2 +- 4 files changed, 125 insertions(+), 1 deletion(-) create mode 100644 cuenca_validations/types/morals.py diff --git a/cuenca_validations/types/enums.py b/cuenca_validations/types/enums.py index 7dbcb7df..5b830b50 100644 --- a/cuenca_validations/types/enums.py +++ b/cuenca_validations/types/enums.py @@ -608,6 +608,11 @@ class WebhookEvent(str, Enum): bank_account_update = 'bank_account.update' +class UserType(str, Enum): + physical = 'physical' + moral = 'moral' + + class VerificationType(str, Enum): phone = 'phone' email = 'email' diff --git a/cuenca_validations/types/morals.py b/cuenca_validations/types/morals.py new file mode 100644 index 00000000..7112a2b4 --- /dev/null +++ b/cuenca_validations/types/morals.py @@ -0,0 +1,74 @@ +import datetime as dt +from typing import List, Optional + +from pydantic import BaseModel, EmailStr + +from cuenca_validations.types import Address, CurpField, PhoneNumber, Rfc + + +class BusinessDetails(BaseModel): + business_description: str + account_usage_description: str + + +class TransactionalProfileServices(BaseModel): + spei_transfers_num: int + spei_transfers_amount: int + internal_transfers_num: int + internal_transfers_amount: int + + +class TransactionalProfile(BaseModel): + currency: str + monthly_amount: int + payers_num: int + recipients_num: int + deposits: Optional[TransactionalProfileServices] = None + withdrawal: Optional[TransactionalProfileServices] = None + + +class LicenseDetails(BaseModel): + license_required: bool + supervisory_entity: Optional[str] = None + license_type: Optional[str] = None + license_date: Optional[dt.date] = None + + +class AuditDetails(BaseModel): + has_audit: bool + audit_provider: Optional[str] = None + audit_date: Optional[dt.date] = None + audit_comments: Optional[str] = None + + +class VulnerableActivityDetails(BaseModel): + is_vulnerable_activity: bool + has_sat_register: Optional[bool] = None + sat_registered_date: Optional[dt.date] = None + is_in_compliance: Optional[bool] = None + + +class PhysicalPerson(BaseModel): + names: str + first_surname: str + second_surname: Optional[str] = None + curp: Optional[CurpField] = None + rfc: Optional[Rfc] = None + + +class LegalRepresentative(PhysicalPerson): + job: str + phone_number: PhoneNumber + email_address: EmailStr + address: Address + + +class ShareholderPhysical(PhysicalPerson): + share_capital: int + + +class Shareholder(BaseModel): + name: str + percentage: int + shareholders: List[ShareholderPhysical] + legal_representatives: List[LegalRepresentative] diff --git a/cuenca_validations/types/requests.py b/cuenca_validations/types/requests.py index 7a324d26..63c2cac2 100644 --- a/cuenca_validations/types/requests.py +++ b/cuenca_validations/types/requests.py @@ -62,6 +62,15 @@ Rfc, TOSAgreement, ) +from .morals import ( + AuditDetails, + BusinessDetails, + LegalRepresentative, + LicenseDetails, + Shareholder, + TransactionalProfile, + VulnerableActivityDetails, +) class BaseRequest(BaseModel): @@ -703,3 +712,39 @@ class QuestionnairesRequest(BaseModel): user_id: str token: str form_id: str + + +class PartnerRequest(BaseRequest): + legal_name: str + business_name: str + nationality: Country + incorporation_date: dt.date + folio: str + rfc: Rfc + documentation_url: str + web_site: str + phone_number: PhoneNumber + email_address: EmailStr + address: Address + + +class PartnerUpdateRequest(BaseRequest): + legal_name: Optional[str] = None + business_name: Optional[str] = None + nationality: Optional[Country] = None + incorporation_date: Optional[dt.date] = None + folio: Optional[str] = None + rfc: Optional[Rfc] = None + documentation_url: Optional[str] = None + web_site: Optional[str] = None + phone_number: Optional[PhoneNumber] = None + email_address: Optional[EmailStr] = None + address: Optional[Address] = None + business_details: Optional[BusinessDetails] = None + transactional_profile: Optional[TransactionalProfile] = None + external_account: Optional[Clabe] = None + license: Optional[LicenseDetails] = None + audit: Optional[AuditDetails] = None + vulnerable_activity: Optional[VulnerableActivityDetails] = None + legal_representatives: Optional[List[LegalRepresentative]] = None + shareholders: Optional[List[Shareholder]] = None diff --git a/cuenca_validations/version.py b/cuenca_validations/version.py index 53e865c4..dac1c75d 100644 --- a/cuenca_validations/version.py +++ b/cuenca_validations/version.py @@ -1 +1 @@ -__version__ = '0.11.25' +__version__ = '0.11.26.dev0' From 5a3739b6dec175d144091f75bde3075a7dc596da Mon Sep 17 00:00:00 2001 From: rogeliolopez Date: Fri, 9 Feb 2024 16:19:26 -0600 Subject: [PATCH 2/4] imports --- cuenca_validations/types/__init__.py | 4 ++++ cuenca_validations/version.py | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/cuenca_validations/types/__init__.py b/cuenca_validations/types/__init__.py index 796a71cf..58f7fd83 100644 --- a/cuenca_validations/types/__init__.py +++ b/cuenca_validations/types/__init__.py @@ -91,6 +91,7 @@ 'UserUpdateRequest', 'UserRequest', 'UserStatus', + 'UserType', 'VerificationAttemptRequest', 'VerificationErrors', 'VerificationRequest', @@ -142,6 +143,7 @@ TransferNetwork, UserCardNotification, UserStatus, + UserType, VerificationStatus, VerificationType, WalletTransactionType, @@ -200,6 +202,8 @@ KYCValidationRequest, KYCVerificationUpdateRequest, LimitedWalletRequest, + PartnerRequest, + PartnerUpdateRequest, PlatformRequest, QuestionnairesRequest, SavingRequest, diff --git a/cuenca_validations/version.py b/cuenca_validations/version.py index dac1c75d..ddfe9068 100644 --- a/cuenca_validations/version.py +++ b/cuenca_validations/version.py @@ -1 +1 @@ -__version__ = '0.11.26.dev0' +__version__ = '0.11.26.dev1' From 24bd9737445d02987dea8c682d8b6c0789cf2470 Mon Sep 17 00:00:00 2001 From: rogeliolopez Date: Fri, 9 Feb 2024 16:21:13 -0600 Subject: [PATCH 3/4] lint --- cuenca_validations/types/__init__.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cuenca_validations/types/__init__.py b/cuenca_validations/types/__init__.py index 58f7fd83..2303b908 100644 --- a/cuenca_validations/types/__init__.py +++ b/cuenca_validations/types/__init__.py @@ -50,6 +50,8 @@ 'Language', 'LimitedWalletRequest', 'PageSize', + 'PartnerRequest', + 'PartnerUpdateRequest', 'PaymentCardNumber', 'PhoneNumber', 'PlatformRequest', From 153dac1cdc09cf927c06dc0f1065f9eeeef8c5b0 Mon Sep 17 00:00:00 2001 From: rogeliolopez Date: Fri, 9 Feb 2024 19:02:43 -0600 Subject: [PATCH 4/4] version --- cuenca_validations/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cuenca_validations/version.py b/cuenca_validations/version.py index ddfe9068..9457d093 100644 --- a/cuenca_validations/version.py +++ b/cuenca_validations/version.py @@ -1 +1 @@ -__version__ = '0.11.26.dev1' +__version__ = '0.11.26'