cuenca-validations 2.1.5.dev4__py3-none-any.whl → 2.1.5.dev5__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 -2
- cuenca_validations/types/enums.py +6 -2
- cuenca_validations/types/requests.py +3 -32
- cuenca_validations/version.py +1 -1
- {cuenca_validations-2.1.5.dev4.dist-info → cuenca_validations-2.1.5.dev5.dist-info}/METADATA +1 -1
- {cuenca_validations-2.1.5.dev4.dist-info → cuenca_validations-2.1.5.dev5.dist-info}/RECORD +10 -10
- {cuenca_validations-2.1.5.dev4.dist-info → cuenca_validations-2.1.5.dev5.dist-info}/WHEEL +1 -1
- tests/test_types.py +0 -32
- {cuenca_validations-2.1.5.dev4.dist-info → cuenca_validations-2.1.5.dev5.dist-info}/licenses/LICENSE +0 -0
- {cuenca_validations-2.1.5.dev4.dist-info → cuenca_validations-2.1.5.dev5.dist-info}/top_level.txt +0 -0
|
@@ -45,8 +45,8 @@ __all__ = [
|
|
|
45
45
|
'JSONEncoder',
|
|
46
46
|
'KYCFile',
|
|
47
47
|
'KYCFileType',
|
|
48
|
+
'KYCValidationFlow',
|
|
48
49
|
'KYCValidationRequest',
|
|
49
|
-
'KYCVerificationUpdateRequest',
|
|
50
50
|
'Language',
|
|
51
51
|
'LimitedWalletRequest',
|
|
52
52
|
'PartnerRequest',
|
|
@@ -130,6 +130,7 @@ from .enums import (
|
|
|
130
130
|
Gender,
|
|
131
131
|
IssuerNetwork,
|
|
132
132
|
KYCFileType,
|
|
133
|
+
KYCValidationFlow,
|
|
133
134
|
Language,
|
|
134
135
|
PlatformType,
|
|
135
136
|
PosCapability,
|
|
@@ -201,7 +202,6 @@ from .requests import (
|
|
|
201
202
|
FileRequest,
|
|
202
203
|
FileUploadRequest,
|
|
203
204
|
KYCValidationRequest,
|
|
204
|
-
KYCVerificationUpdateRequest,
|
|
205
205
|
LimitedWalletRequest,
|
|
206
206
|
PartnerRequest,
|
|
207
207
|
PartnerUpdateRequest,
|
|
@@ -248,7 +248,11 @@ class KYCFileType(str, Enum):
|
|
|
248
248
|
proof_of_address = 'proof_of_address'
|
|
249
249
|
curp = 'curp'
|
|
250
250
|
signature = 'signature'
|
|
251
|
-
|
|
251
|
+
|
|
252
|
+
|
|
253
|
+
class KYCValidationFlow(str, Enum):
|
|
254
|
+
client = 'client'
|
|
255
|
+
server = 'server'
|
|
252
256
|
|
|
253
257
|
|
|
254
258
|
class Gender(str, Enum):
|
|
@@ -545,6 +549,7 @@ class Country(str, Enum):
|
|
|
545
549
|
ZA = 'ZA' # South Africa
|
|
546
550
|
ZM = 'ZM' # Zambia
|
|
547
551
|
ZW = 'ZW' # Zimbabwe
|
|
552
|
+
XA = 'XA' # Apatrida
|
|
548
553
|
|
|
549
554
|
|
|
550
555
|
class VerificationStatus(str, Enum):
|
|
@@ -649,7 +654,6 @@ class FileExtension(str, Enum):
|
|
|
649
654
|
jpeg = 'jpeg'
|
|
650
655
|
png = 'png'
|
|
651
656
|
pdf = 'pdf'
|
|
652
|
-
html = 'html'
|
|
653
657
|
|
|
654
658
|
|
|
655
659
|
class BankAccountStatus(str, Enum):
|
|
@@ -9,11 +9,9 @@ from pydantic import (
|
|
|
9
9
|
Field,
|
|
10
10
|
StrictStr,
|
|
11
11
|
StringConstraints,
|
|
12
|
-
TypeAdapter,
|
|
13
12
|
field_validator,
|
|
14
13
|
model_validator,
|
|
15
14
|
)
|
|
16
|
-
from pydantic_extra_types.coordinate import Latitude, Longitude
|
|
17
15
|
|
|
18
16
|
from ..types.enums import (
|
|
19
17
|
AuthorizerTransaction,
|
|
@@ -30,6 +28,7 @@ from ..types.enums import (
|
|
|
30
28
|
Gender,
|
|
31
29
|
IssuerNetwork,
|
|
32
30
|
KYCFileType,
|
|
31
|
+
KYCValidationFlow,
|
|
33
32
|
PlatformType,
|
|
34
33
|
PosCapability,
|
|
35
34
|
SavingCategory,
|
|
@@ -404,30 +403,6 @@ class TOSRequest(BaseModel):
|
|
|
404
403
|
ip: Optional[SerializableIPvAnyAddress] = None
|
|
405
404
|
|
|
406
405
|
|
|
407
|
-
class UserTOSAgreementRequest(BaseModel):
|
|
408
|
-
user_id: str
|
|
409
|
-
tos_id: str
|
|
410
|
-
location: str
|
|
411
|
-
|
|
412
|
-
@field_validator('location')
|
|
413
|
-
@classmethod
|
|
414
|
-
def validate_location(cls, value: str) -> str:
|
|
415
|
-
values = value.split(',')
|
|
416
|
-
if len(values) != 3:
|
|
417
|
-
raise ValueError(
|
|
418
|
-
'Must provide exactly 3 values for location: lat,lon,alt'
|
|
419
|
-
)
|
|
420
|
-
try:
|
|
421
|
-
lat, lon, alt = map(float, values)
|
|
422
|
-
TypeAdapter(Latitude).validate_python(lat)
|
|
423
|
-
TypeAdapter(Longitude).validate_python(lon)
|
|
424
|
-
except ValueError:
|
|
425
|
-
raise ValueError(
|
|
426
|
-
'Invalid format. Use lat,lon,alt with float valid values.'
|
|
427
|
-
)
|
|
428
|
-
return value
|
|
429
|
-
|
|
430
|
-
|
|
431
406
|
class UserRequest(BaseModel):
|
|
432
407
|
id: Optional[str] = Field(
|
|
433
408
|
None, description='if you want to create with specific `id`'
|
|
@@ -448,7 +423,7 @@ class UserRequest(BaseModel):
|
|
|
448
423
|
description='Status that the user will have when created. '
|
|
449
424
|
'Defined by platform',
|
|
450
425
|
)
|
|
451
|
-
required_level: Optional[Annotated[int, Field(ge
|
|
426
|
+
required_level: Optional[Annotated[int, Field(ge=1, le=3)]] = Field(
|
|
452
427
|
None,
|
|
453
428
|
description='Maximum level a User can reach. ' 'Defined by platform',
|
|
454
429
|
)
|
|
@@ -623,10 +598,6 @@ class LimitedWalletRequest(BaseRequest):
|
|
|
623
598
|
allowed_rfc: Optional[Rfc] = None
|
|
624
599
|
|
|
625
600
|
|
|
626
|
-
class KYCVerificationUpdateRequest(BaseRequest):
|
|
627
|
-
curp: Curp
|
|
628
|
-
|
|
629
|
-
|
|
630
601
|
class PlatformRequest(BaseModel):
|
|
631
602
|
name: str
|
|
632
603
|
rfc: Optional[str] = None
|
|
@@ -648,8 +619,8 @@ class WebhookRequest(BaseModel):
|
|
|
648
619
|
|
|
649
620
|
class KYCValidationRequest(BaseRequest):
|
|
650
621
|
user_id: str
|
|
622
|
+
validation_flow: KYCValidationFlow
|
|
651
623
|
force: bool = False
|
|
652
|
-
documents: list[KYCFile] = []
|
|
653
624
|
|
|
654
625
|
|
|
655
626
|
class BankAccountValidationRequest(BaseModel):
|
cuenca_validations/version.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = '2.1.5.
|
|
1
|
+
__version__ = '2.1.5.dev5'
|
|
@@ -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=PwqKGR2kGVKTNb5b5F7mfpMY-XGpc5jzNQ449qnq4L0,27
|
|
8
|
+
cuenca_validations/types/__init__.py,sha256=89muaIBhVyU6Euv3j88fqLFOdDzgLeNsXireL4z_tBU,4761
|
|
9
9
|
cuenca_validations/types/card.py,sha256=UGzz8NTFAverUmdUKAK1oGHnOnjSNTpIRUm93vKSSGY,1295
|
|
10
|
-
cuenca_validations/types/enums.py,sha256=
|
|
10
|
+
cuenca_validations/types/enums.py,sha256=Vs381tZXM3EpyTnYRpdFAArvkaD0sV-lFbP6-RO0IXc,18961
|
|
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
14
|
cuenca_validations/types/identities.py,sha256=-TWRDRpmIaCI4nE4hVy1FQtQtlxuErtmEtzJW1FBzec,4956
|
|
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.5.
|
|
17
|
+
cuenca_validations/types/requests.py,sha256=t0rF5goEpoOOXwPbsxvdaER2XuXKTAdMzdGuuMHQE_8,21203
|
|
18
|
+
cuenca_validations-2.1.5.dev5.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.5.
|
|
26
|
-
cuenca_validations-2.1.5.
|
|
27
|
-
cuenca_validations-2.1.5.
|
|
28
|
-
cuenca_validations-2.1.5.
|
|
24
|
+
tests/test_types.py,sha256=K_YNFz0Kac3k8fJNeXuYGkL1hjXDQu084jCX6xEMEE4,19348
|
|
25
|
+
cuenca_validations-2.1.5.dev5.dist-info/METADATA,sha256=rlV52PSIbYijRBNL-e81TUwSMUiqNz7TuYo4dEEE19Y,1599
|
|
26
|
+
cuenca_validations-2.1.5.dev5.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
|
|
27
|
+
cuenca_validations-2.1.5.dev5.dist-info/top_level.txt,sha256=4233xdOs2HtuT-GFRjcDcwK0IwdwvWdczOtk0fPB6Gw,25
|
|
28
|
+
cuenca_validations-2.1.5.dev5.dist-info/RECORD,,
|
tests/test_types.py
CHANGED
|
@@ -43,7 +43,6 @@ from cuenca_validations.types.requests import (
|
|
|
43
43
|
UserCredentialUpdateRequest,
|
|
44
44
|
UserListsRequest,
|
|
45
45
|
UserRequest,
|
|
46
|
-
UserTOSAgreementRequest,
|
|
47
46
|
UserUpdateRequest,
|
|
48
47
|
VerificationAttemptRequest,
|
|
49
48
|
VerificationRequest,
|
|
@@ -708,34 +707,3 @@ def test_log_config(
|
|
|
708
707
|
def test_get_log_config_no_log_config():
|
|
709
708
|
field = FieldInfo(default=None)
|
|
710
709
|
assert get_log_config(field) is None
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
def test_location_validation_valid_format():
|
|
714
|
-
UserTOSAgreementRequest(
|
|
715
|
-
user_id='US123',
|
|
716
|
-
tos_id='TS123',
|
|
717
|
-
location='9.3953792,-99.139584,12',
|
|
718
|
-
)
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
@pytest.mark.parametrize(
|
|
722
|
-
'location',
|
|
723
|
-
[
|
|
724
|
-
('1500,-99.139584,12'),
|
|
725
|
-
('-91,45.1,12'),
|
|
726
|
-
('45,181,12'),
|
|
727
|
-
('45,-181,12'),
|
|
728
|
-
('abc,45,12'),
|
|
729
|
-
('45,abc,12'),
|
|
730
|
-
('45,45,abc'),
|
|
731
|
-
('45,45'),
|
|
732
|
-
('45,45,12,extra'),
|
|
733
|
-
],
|
|
734
|
-
)
|
|
735
|
-
def test_location_validation_invalid_format(location):
|
|
736
|
-
with pytest.raises(ValueError):
|
|
737
|
-
UserTOSAgreementRequest(
|
|
738
|
-
user_id='US123',
|
|
739
|
-
tos_id='TS123',
|
|
740
|
-
location=location,
|
|
741
|
-
)
|
{cuenca_validations-2.1.5.dev4.dist-info → cuenca_validations-2.1.5.dev5.dist-info}/licenses/LICENSE
RENAMED
|
File without changes
|
{cuenca_validations-2.1.5.dev4.dist-info → cuenca_validations-2.1.5.dev5.dist-info}/top_level.txt
RENAMED
|
File without changes
|