Skip to content

Commit

Permalink
PM (#352)
Browse files Browse the repository at this point in the history
* moral accounts

* imports

* lint

* version
  • Loading branch information
rogelioLpz authored Feb 10, 2024
1 parent f8e7f47 commit 8bed077
Show file tree
Hide file tree
Showing 5 changed files with 131 additions and 1 deletion.
6 changes: 6 additions & 0 deletions cuenca_validations/types/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@
'Language',
'LimitedWalletRequest',
'PageSize',
'PartnerRequest',
'PartnerUpdateRequest',
'PaymentCardNumber',
'PhoneNumber',
'PlatformRequest',
Expand Down Expand Up @@ -91,6 +93,7 @@
'UserUpdateRequest',
'UserRequest',
'UserStatus',
'UserType',
'VerificationAttemptRequest',
'VerificationErrors',
'VerificationRequest',
Expand Down Expand Up @@ -142,6 +145,7 @@
TransferNetwork,
UserCardNotification,
UserStatus,
UserType,
VerificationStatus,
VerificationType,
WalletTransactionType,
Expand Down Expand Up @@ -200,6 +204,8 @@
KYCValidationRequest,
KYCVerificationUpdateRequest,
LimitedWalletRequest,
PartnerRequest,
PartnerUpdateRequest,
PlatformRequest,
QuestionnairesRequest,
SavingRequest,
Expand Down
5 changes: 5 additions & 0 deletions cuenca_validations/types/enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
74 changes: 74 additions & 0 deletions cuenca_validations/types/morals.py
Original file line number Diff line number Diff line change
@@ -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]
45 changes: 45 additions & 0 deletions cuenca_validations/types/requests.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,15 @@
Rfc,
TOSAgreement,
)
from .morals import (
AuditDetails,
BusinessDetails,
LegalRepresentative,
LicenseDetails,
Shareholder,
TransactionalProfile,
VulnerableActivityDetails,
)


class BaseRequest(BaseModel):
Expand Down Expand Up @@ -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
2 changes: 1 addition & 1 deletion cuenca_validations/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '0.11.25'
__version__ = '0.11.26'

0 comments on commit 8bed077

Please sign in to comment.