cuenca-validations 2.1.7.dev1__py3-none-any.whl → 2.1.7.dev4__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- cuenca_validations/types/__init__.py +2 -0
- cuenca_validations/types/enums.py +16 -0
- cuenca_validations/types/identities.py +2 -9
- cuenca_validations/types/requests.py +17 -31
- cuenca_validations/version.py +1 -1
- {cuenca_validations-2.1.7.dev1.dist-info → cuenca_validations-2.1.7.dev4.dist-info}/METADATA +1 -1
- {cuenca_validations-2.1.7.dev1.dist-info → cuenca_validations-2.1.7.dev4.dist-info}/RECORD +11 -11
- {cuenca_validations-2.1.7.dev1.dist-info → cuenca_validations-2.1.7.dev4.dist-info}/WHEEL +1 -1
- tests/test_types.py +12 -4
- {cuenca_validations-2.1.7.dev1.dist-info → cuenca_validations-2.1.7.dev4.dist-info}/licenses/LICENSE +0 -0
- {cuenca_validations-2.1.7.dev1.dist-info → cuenca_validations-2.1.7.dev4.dist-info}/top_level.txt +0 -0
|
@@ -55,6 +55,7 @@ __all__ = [
|
|
|
55
55
|
'PlatformRequest',
|
|
56
56
|
'PlatformType',
|
|
57
57
|
'PosCapability',
|
|
58
|
+
'Profession',
|
|
58
59
|
'QueryParams',
|
|
59
60
|
'Rfc',
|
|
60
61
|
'QuestionnairesRequest',
|
|
@@ -134,6 +135,7 @@ from .enums import (
|
|
|
134
135
|
Language,
|
|
135
136
|
PlatformType,
|
|
136
137
|
PosCapability,
|
|
138
|
+
Profession,
|
|
137
139
|
SATRegimeCode,
|
|
138
140
|
SavingCategory,
|
|
139
141
|
ServiceProviderCategory,
|
|
@@ -688,3 +688,19 @@ class SATRegimeCode(str, Enum):
|
|
|
688
688
|
ING_PREM = "615" # Régimen de los ingresos por obtención de premios
|
|
689
689
|
AE_PLAT_TEC = "625" # Régimen de las Actividades Empresariales con ingresos a través de Plataformas Tecnológicas # noqa: E501
|
|
690
690
|
RS_CONF = "626" # Régimen Simplificado de Confianza
|
|
691
|
+
|
|
692
|
+
|
|
693
|
+
class Profession(str, Enum):
|
|
694
|
+
arts = 'arts'
|
|
695
|
+
agriculture = 'agriculture'
|
|
696
|
+
commerce = 'commerce'
|
|
697
|
+
student = 'student'
|
|
698
|
+
employee = 'employee'
|
|
699
|
+
entrepreneur = 'entrepreneur'
|
|
700
|
+
homemaker = 'homemaker'
|
|
701
|
+
teacher = 'teacher'
|
|
702
|
+
professional = 'professional'
|
|
703
|
+
public_servant = 'public_servant'
|
|
704
|
+
it_communications = 'it_communications'
|
|
705
|
+
freelancer = 'freelancer'
|
|
706
|
+
skilled_trades = 'skilled_trades'
|
|
@@ -1,14 +1,7 @@
|
|
|
1
1
|
import datetime as dt
|
|
2
|
-
from typing import Annotated,
|
|
2
|
+
from typing import Annotated, Optional
|
|
3
3
|
|
|
4
|
-
from pydantic import
|
|
5
|
-
BaseModel,
|
|
6
|
-
ConfigDict,
|
|
7
|
-
Field,
|
|
8
|
-
SecretStr,
|
|
9
|
-
StringConstraints,
|
|
10
|
-
model_validator,
|
|
11
|
-
)
|
|
4
|
+
from pydantic import BaseModel, ConfigDict, Field, SecretStr, StringConstraints
|
|
12
5
|
from pydantic_extra_types.phone_numbers import PhoneNumber
|
|
13
6
|
|
|
14
7
|
from .enums import Country, KYCFileType, State, VerificationStatus
|
|
@@ -32,6 +32,7 @@ from ..types.enums import (
|
|
|
32
32
|
KYCValidationSource,
|
|
33
33
|
PlatformType,
|
|
34
34
|
PosCapability,
|
|
35
|
+
Profession,
|
|
35
36
|
SavingCategory,
|
|
36
37
|
SessionType,
|
|
37
38
|
State,
|
|
@@ -411,38 +412,28 @@ class UserTOSAgreementRequest(BaseModel):
|
|
|
411
412
|
|
|
412
413
|
class UserRequest(BaseModel):
|
|
413
414
|
curp: Curp = Field(
|
|
414
|
-
description=
|
|
415
|
+
description=(
|
|
416
|
+
'Mexican government ID (18 characters). ' 'Must be pre-validated.'
|
|
417
|
+
)
|
|
418
|
+
)
|
|
419
|
+
|
|
420
|
+
profession: Profession = Field(description='User profession or occupation')
|
|
421
|
+
address: Address = Field(
|
|
422
|
+
description='User residential address information'
|
|
415
423
|
)
|
|
416
|
-
# curp_verification_id: str = Field(
|
|
417
|
-
# ...,
|
|
418
|
-
# description='Previously validated in `curp_validations`',
|
|
419
|
-
# )
|
|
420
|
-
|
|
421
|
-
profession: str = None
|
|
422
|
-
address: Address = None
|
|
423
|
-
# status: Optional[UserStatus] = Field(
|
|
424
|
-
# None,
|
|
425
|
-
# description='Status that the user will have when created. '
|
|
426
|
-
# 'Defined by platform',
|
|
427
|
-
# )
|
|
428
|
-
# required_level: Optional[int] = Field(
|
|
429
|
-
# None,
|
|
430
|
-
# ge=1,
|
|
431
|
-
# le=3,
|
|
432
|
-
# description='Maximum level a User can reach. Defined by platform',
|
|
433
|
-
# )
|
|
434
424
|
phone_verification_id: str = Field(
|
|
435
425
|
...,
|
|
436
|
-
description='
|
|
437
|
-
'resource `verifications`',
|
|
426
|
+
description='ID of previously validated phone verification',
|
|
438
427
|
)
|
|
439
428
|
email_verification_id: str = Field(
|
|
440
429
|
...,
|
|
441
|
-
description='
|
|
442
|
-
|
|
430
|
+
description='ID of previously validated email verification',
|
|
431
|
+
)
|
|
432
|
+
tos_agreement: UserTOSAgreementRequest = Field(
|
|
433
|
+
...,
|
|
434
|
+
description='TOS agreement for the user'
|
|
443
435
|
)
|
|
444
|
-
|
|
445
|
-
# signature: Optional[KYCFile] = None
|
|
436
|
+
|
|
446
437
|
model_config = ConfigDict(
|
|
447
438
|
json_schema_extra={
|
|
448
439
|
'example': {
|
|
@@ -475,9 +466,7 @@ class UserRequest(BaseModel):
|
|
|
475
466
|
|
|
476
467
|
|
|
477
468
|
class UserUpdateRequest(BaseModel):
|
|
478
|
-
|
|
479
|
-
email_address: Optional[EmailStr] = None
|
|
480
|
-
profession: Optional[str] = None
|
|
469
|
+
profession: Optional[Profession] = None
|
|
481
470
|
verification_id: Optional[str] = None
|
|
482
471
|
email_verification_id: Optional[str] = None
|
|
483
472
|
phone_verification_id: Optional[str] = None
|
|
@@ -487,9 +476,6 @@ class UserUpdateRequest(BaseModel):
|
|
|
487
476
|
proof_of_address: Optional[KYCFile] = None
|
|
488
477
|
proof_of_life: Optional[KYCFile] = None
|
|
489
478
|
signature: Optional[KYCFile] = None
|
|
490
|
-
status: Optional[UserStatus] = None
|
|
491
|
-
terms_of_service: Optional[TOSRequest] = None
|
|
492
|
-
platform_terms_of_service: Optional[TOSAgreement] = None
|
|
493
479
|
curp_document_uri: Optional[SerializableHttpUrl] = None
|
|
494
480
|
|
|
495
481
|
@field_validator('beneficiaries')
|
cuenca_validations/version.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = '2.1.7.
|
|
1
|
+
__version__ = '2.1.7.dev4'
|
|
@@ -4,25 +4,25 @@ cuenca_validations/errors.py,sha256=OtM8EgiKqYdz9Hn66AbBO96orL1or7efkyt0vh0Zxbs,
|
|
|
4
4
|
cuenca_validations/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
5
5
|
cuenca_validations/typing.py,sha256=1QCu81IbVZZpyInjyeAuO-nF36gpT5Gi4o6V9PozuOU,204
|
|
6
6
|
cuenca_validations/validators.py,sha256=wzwLnJ4wHggZvqp3mearbFkzvDERGeTNvJkuofQnuMc,1484
|
|
7
|
-
cuenca_validations/version.py,sha256=
|
|
8
|
-
cuenca_validations/types/__init__.py,sha256=
|
|
7
|
+
cuenca_validations/version.py,sha256=ck89QLn3S8rsaizuO5zSjxxyLjWWS4VkJ9vid2nZBH0,27
|
|
8
|
+
cuenca_validations/types/__init__.py,sha256=1xGfD2tlFsPlhIy-T7BZPs-vvEgDoc6ZW2iXFLbyQpM,4799
|
|
9
9
|
cuenca_validations/types/card.py,sha256=UGzz8NTFAverUmdUKAK1oGHnOnjSNTpIRUm93vKSSGY,1295
|
|
10
|
-
cuenca_validations/types/enums.py,sha256=
|
|
10
|
+
cuenca_validations/types/enums.py,sha256=o2XmufNIBhx88KDVARnpoXqLkyXVP89XMW0DDPDH9NI,19424
|
|
11
11
|
cuenca_validations/types/files.py,sha256=2CszbwF9ytXV9suFFwyDjYG4XxY8UhCjRw3HttVXXNw,269
|
|
12
12
|
cuenca_validations/types/general.py,sha256=vJmQBD_Iv_hsxD8x3_Bip-NlYAiE2rmXSPQKj4kTtto,2621
|
|
13
13
|
cuenca_validations/types/helpers.py,sha256=6rHUhwoQ7jJZtGcW3LX-W5ZDl42PWE1RoBpGme7KCkk,610
|
|
14
|
-
cuenca_validations/types/identities.py,sha256=
|
|
14
|
+
cuenca_validations/types/identities.py,sha256=FBpWUwRfy99jBr2Zhuv9gArnnUe12o3A2kbs25i9nwo,4470
|
|
15
15
|
cuenca_validations/types/morals.py,sha256=m8kAedevmwfSPTA9GYe03l7pkgipynwYgKfejyVtnuI,1813
|
|
16
16
|
cuenca_validations/types/queries.py,sha256=KCRx0sPzWDtDDbZysmFGVgANgfqil17EITWaG7tGQ-A,4700
|
|
17
|
-
cuenca_validations/types/requests.py,sha256=
|
|
18
|
-
cuenca_validations-2.1.7.
|
|
17
|
+
cuenca_validations/types/requests.py,sha256=Z2G-nZNjYUlNKZ80wevAff7LmewgiBFM43yzMhKdzxc,20526
|
|
18
|
+
cuenca_validations-2.1.7.dev4.dist-info/licenses/LICENSE,sha256=wR76FmxBbfnQpwELkkE5iMF8sFIafEMgXLTE4N4WPTc,1063
|
|
19
19
|
tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
20
20
|
tests/test_card.py,sha256=QAfRz7e11gWICPnFJZ2tiYgUsFV3C9TwzJXrDnDNXFw,1202
|
|
21
21
|
tests/test_errors.py,sha256=ixiIgEuBuzfsL5p4uCFdF32XqFRtTPF6EVhGJ0keOrI,930
|
|
22
22
|
tests/test_helpers.py,sha256=ubzpi1UXCryLQdgsT_Zm2IX-XE_4L0dnHnhLwH06xK8,748
|
|
23
23
|
tests/test_statement.py,sha256=IOE0rRRBgBZSJv_FLaETEyn5NzzXKMNTqgjv99GX-68,1436
|
|
24
|
-
tests/test_types.py,sha256=
|
|
25
|
-
cuenca_validations-2.1.7.
|
|
26
|
-
cuenca_validations-2.1.7.
|
|
27
|
-
cuenca_validations-2.1.7.
|
|
28
|
-
cuenca_validations-2.1.7.
|
|
24
|
+
tests/test_types.py,sha256=UVcUprRldAfJePMEtu0UqBg0FvJf7v_5neRPlkvA9ew,19252
|
|
25
|
+
cuenca_validations-2.1.7.dev4.dist-info/METADATA,sha256=V8SBYChXuZb-SVYzhCrUZnprO-Ehi0YIG4O9vfV2e3s,1599
|
|
26
|
+
cuenca_validations-2.1.7.dev4.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
27
|
+
cuenca_validations-2.1.7.dev4.dist-info/top_level.txt,sha256=4233xdOs2HtuT-GFRjcDcwK0IwdwvWdczOtk0fPB6Gw,25
|
|
28
|
+
cuenca_validations-2.1.7.dev4.dist-info/RECORD,,
|
tests/test_types.py
CHANGED
|
@@ -10,7 +10,6 @@ from pydantic import AfterValidator, BaseModel, SecretStr, ValidationError
|
|
|
10
10
|
from pydantic.fields import FieldInfo
|
|
11
11
|
|
|
12
12
|
from cuenca_validations.types import (
|
|
13
|
-
Address,
|
|
14
13
|
CardQuery,
|
|
15
14
|
JSONEncoder,
|
|
16
15
|
QueryParams,
|
|
@@ -23,6 +22,7 @@ from cuenca_validations.types import (
|
|
|
23
22
|
from cuenca_validations.types.enums import (
|
|
24
23
|
Country,
|
|
25
24
|
EcommerceIndicator,
|
|
25
|
+
Profession,
|
|
26
26
|
SessionType,
|
|
27
27
|
State,
|
|
28
28
|
)
|
|
@@ -307,7 +307,7 @@ def test_saving_update_request():
|
|
|
307
307
|
def test_user_request():
|
|
308
308
|
request = dict(
|
|
309
309
|
curp='ABCD920604HDFSRN03',
|
|
310
|
-
profession=
|
|
310
|
+
profession=Profession.employee,
|
|
311
311
|
address=dict(
|
|
312
312
|
street='calle 1',
|
|
313
313
|
ext_number='2',
|
|
@@ -439,12 +439,20 @@ def test_user_update_request():
|
|
|
439
439
|
birth_date=dt.date(2020, 1, 1).isoformat(),
|
|
440
440
|
phone_number='+525555555555',
|
|
441
441
|
user_relationship='brother',
|
|
442
|
-
percentage=
|
|
442
|
+
percentage=50,
|
|
443
|
+
),
|
|
444
|
+
dict(
|
|
445
|
+
name='José Pérez',
|
|
446
|
+
birth_date=dt.date(2020, 1, 2).isoformat(),
|
|
447
|
+
phone_number='+525544444444',
|
|
448
|
+
user_relationship='brother',
|
|
449
|
+
percentage=51,
|
|
443
450
|
),
|
|
444
451
|
]
|
|
445
452
|
with pytest.raises(ValueError) as v:
|
|
446
453
|
UserUpdateRequest(**request)
|
|
447
|
-
|
|
454
|
+
|
|
455
|
+
assert 'The total percentage is more than 100.' in str(v)
|
|
448
456
|
|
|
449
457
|
tos_request = dict(
|
|
450
458
|
terms_of_service=dict(
|
{cuenca_validations-2.1.7.dev1.dist-info → cuenca_validations-2.1.7.dev4.dist-info}/licenses/LICENSE
RENAMED
|
File without changes
|
{cuenca_validations-2.1.7.dev1.dist-info → cuenca_validations-2.1.7.dev4.dist-info}/top_level.txt
RENAMED
|
File without changes
|