Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Moral Accounts #373

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 69 additions & 0 deletions cuenca/cuenca_validations.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
import datetime as dt
from typing import List, Optional

Check warning on line 2 in cuenca/cuenca_validations.py

View check run for this annotation

Codecov / codecov/patch

cuenca/cuenca_validations.py#L1-L2

Added lines #L1 - L2 were not covered by tests

from cuenca_validations.types import Address, CurpField, PhoneNumber, Rfc
from pydantic import BaseModel, EmailStr

Check warning on line 5 in cuenca/cuenca_validations.py

View check run for this annotation

Codecov / codecov/patch

cuenca/cuenca_validations.py#L4-L5

Added lines #L4 - L5 were not covered by tests


class BusinessDetails(BaseModel):
business_description: str
account_usage_description: str

Check warning on line 10 in cuenca/cuenca_validations.py

View check run for this annotation

Codecov / codecov/patch

cuenca/cuenca_validations.py#L8-L10

Added lines #L8 - L10 were not covered by tests


class TransactionalProfile(BaseModel):
currency: str
monthly_amount: str
recipients_num: int
payers_num: int
internal_transfers_amount: int
internal_transfers_num: int
spei_transfers_amount: int
spei_transfers_num: int

Check warning on line 21 in cuenca/cuenca_validations.py

View check run for this annotation

Codecov / codecov/patch

cuenca/cuenca_validations.py#L13-L21

Added lines #L13 - L21 were not covered by tests


class LicenseDetails(BaseModel):
license_required: bool
supervisory_entity: Optional[str] = None
license_type: Optional[str] = None
license_date: Optional[dt.date] = None

Check warning on line 28 in cuenca/cuenca_validations.py

View check run for this annotation

Codecov / codecov/patch

cuenca/cuenca_validations.py#L24-L28

Added lines #L24 - L28 were not covered by tests


class AuditDetails(BaseModel):
has_audit: bool
audit_provider: Optional[str] = None
audit_date: Optional[dt.date] = None
audit_comments: Optional[str] = None

Check warning on line 35 in cuenca/cuenca_validations.py

View check run for this annotation

Codecov / codecov/patch

cuenca/cuenca_validations.py#L31-L35

Added lines #L31 - L35 were not covered by tests


class VulnerableActivityDetails(BaseModel):
is_vulnerable_activity: bool
has_sat_register: bool = None
sat_registered_date: Optional[dt.date] = None
is_in_compliance: Optional[bool] = None

Check warning on line 42 in cuenca/cuenca_validations.py

View check run for this annotation

Codecov / codecov/patch

cuenca/cuenca_validations.py#L38-L42

Added lines #L38 - L42 were not covered by tests


class PhysicalPerson(BaseModel):

Check warning on line 45 in cuenca/cuenca_validations.py

View check run for this annotation

Codecov / codecov/patch

cuenca/cuenca_validations.py#L45

Added line #L45 was not covered by tests
# Usar curp_validation?
names: str
first_surname: str
second_surname: Optional[str] = None
curp: CurpField
rfc: Rfc

Check warning on line 51 in cuenca/cuenca_validations.py

View check run for this annotation

Codecov / codecov/patch

cuenca/cuenca_validations.py#L47-L51

Added lines #L47 - L51 were not covered by tests


class LegalRepresentative(PhysicalPerson):
job: str
phone_number: Optional[PhoneNumber]
email_address: Optional[EmailStr]
address: Optional[Address]

Check warning on line 58 in cuenca/cuenca_validations.py

View check run for this annotation

Codecov / codecov/patch

cuenca/cuenca_validations.py#L54-L58

Added lines #L54 - L58 were not covered by tests


class ShareholderPhysical(PhysicalPerson):
percentage: str

Check warning on line 62 in cuenca/cuenca_validations.py

View check run for this annotation

Codecov / codecov/patch

cuenca/cuenca_validations.py#L61-L62

Added lines #L61 - L62 were not covered by tests


class ShareholderMoral(BaseModel):
name: str
percentage: str
shareholders: List[ShareholderPhysical]
legal_representatives: List[LegalRepresentative]

Check warning on line 69 in cuenca/cuenca_validations.py

View check run for this annotation

Codecov / codecov/patch

cuenca/cuenca_validations.py#L65-L69

Added lines #L65 - L69 were not covered by tests
61 changes: 61 additions & 0 deletions cuenca/resources/partner_users.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
import datetime as dt
from typing import ClassVar, List, Optional

Check warning on line 2 in cuenca/resources/partner_users.py

View check run for this annotation

Codecov / codecov/patch

cuenca/resources/partner_users.py#L1-L2

Added lines #L1 - L2 were not covered by tests

from clabe import Clabe
from cuenca_validations.types import Address, PhoneNumber, QueryParams
from cuenca_validations.types.enums import Country
from cuenca_validations.types.identities import Rfc
from pydantic import EmailStr

Check warning on line 8 in cuenca/resources/partner_users.py

View check run for this annotation

Codecov / codecov/patch

cuenca/resources/partner_users.py#L4-L8

Added lines #L4 - L8 were not covered by tests

from ..cuenca_validations import (

Check warning on line 10 in cuenca/resources/partner_users.py

View check run for this annotation

Codecov / codecov/patch

cuenca/resources/partner_users.py#L10

Added line #L10 was not covered by tests
AuditDetails,
BusinessDetails,
LegalRepresentative,
LicenseDetails,
ShareholderMoral,
TransactionalProfile,
VulnerableActivityDetails,
)
from .base import Creatable, Queryable, Retrievable, Updateable

Check warning on line 19 in cuenca/resources/partner_users.py

View check run for this annotation

Codecov / codecov/patch

cuenca/resources/partner_users.py#L19

Added line #L19 was not covered by tests


class PartnerUser(Creatable, Retrievable, Updateable, Queryable):
_resource: ClassVar = 'partner_users'
_query_params: ClassVar = QueryParams

Check warning on line 24 in cuenca/resources/partner_users.py

View check run for this annotation

Codecov / codecov/patch

cuenca/resources/partner_users.py#L22-L24

Added lines #L22 - L24 were not covered by tests

created_at: dt.datetime
updated_at: dt.datetime

Check warning on line 27 in cuenca/resources/partner_users.py

View check run for this annotation

Codecov / codecov/patch

cuenca/resources/partner_users.py#L26-L27

Added lines #L26 - L27 were not covered by tests

# 01 - General
legal_name: str
business_name: str
nationality: Country
incorporation_date: dt.date
folio: str
certificate_number: str
rfc: Rfc
documentation_url: str

Check warning on line 37 in cuenca/resources/partner_users.py

View check run for this annotation

Codecov / codecov/patch

cuenca/resources/partner_users.py#L30-L37

Added lines #L30 - L37 were not covered by tests
# 02 - Contacto
web_site: str
phone_number: PhoneNumber
email_address: EmailStr
address: Address

Check warning on line 42 in cuenca/resources/partner_users.py

View check run for this annotation

Codecov / codecov/patch

cuenca/resources/partner_users.py#L39-L42

Added lines #L39 - L42 were not covered by tests
# 03 - Detalles
business_details: Optional[BusinessDetails] = None

Check warning on line 44 in cuenca/resources/partner_users.py

View check run for this annotation

Codecov / codecov/patch

cuenca/resources/partner_users.py#L44

Added line #L44 was not covered by tests
# 04 - Perfil transaccional
transactional_profile: Optional[TransactionalProfile] = None

Check warning on line 46 in cuenca/resources/partner_users.py

View check run for this annotation

Codecov / codecov/patch

cuenca/resources/partner_users.py#L46

Added line #L46 was not covered by tests
# 05 Cuenta externa
external_account: Optional[Clabe] = None

Check warning on line 48 in cuenca/resources/partner_users.py

View check run for this annotation

Codecov / codecov/patch

cuenca/resources/partner_users.py#L48

Added line #L48 was not covered by tests

# Estado regulatorio
# 01 Licencia
license: Optional[LicenseDetails] = None

Check warning on line 52 in cuenca/resources/partner_users.py

View check run for this annotation

Codecov / codecov/patch

cuenca/resources/partner_users.py#L52

Added line #L52 was not covered by tests
# 02 Auditoria
audit: Optional[AuditDetails] = None

Check warning on line 54 in cuenca/resources/partner_users.py

View check run for this annotation

Codecov / codecov/patch

cuenca/resources/partner_users.py#L54

Added line #L54 was not covered by tests
# 03 Manuales y politicas: Son archivos, no pide info
# 04 Actividades vulnearables
vulnerable_activity: Optional[VulnerableActivityDetails] = None

Check warning on line 57 in cuenca/resources/partner_users.py

View check run for this annotation

Codecov / codecov/patch

cuenca/resources/partner_users.py#L57

Added line #L57 was not covered by tests

# Representantes y accionista
legal_representatives: List[LegalRepresentative] = []
shareholders: List[ShareholderMoral] = []

Check warning on line 61 in cuenca/resources/partner_users.py

View check run for this annotation

Codecov / codecov/patch

cuenca/resources/partner_users.py#L60-L61

Added lines #L60 - L61 were not covered by tests
Loading