cuenca-validations 2.1.5.dev4__py3-none-any.whl → 2.1.5.dev6__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.
@@ -46,7 +46,7 @@ __all__ = [
46
46
  'KYCFile',
47
47
  'KYCFileType',
48
48
  'KYCValidationRequest',
49
- 'KYCVerificationUpdateRequest',
49
+ 'KYCValidationSource',
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
+ KYCValidationSource,
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
- tos = 'tos'
251
+
252
+
253
+ class KYCValidationSource(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
+ KYCValidationSource,
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,9 +423,11 @@ 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=-1, le=4)]] = Field(
426
+ required_level: Optional[int] = Field(
452
427
  None,
453
- description='Maximum level a User can reach. ' 'Defined by platform',
428
+ ge=1,
429
+ le=3,
430
+ description='Maximum level a User can reach. Defined by platform',
454
431
  )
455
432
  phone_verification_id: Optional[str] = Field(
456
433
  None,
@@ -623,10 +600,6 @@ class LimitedWalletRequest(BaseRequest):
623
600
  allowed_rfc: Optional[Rfc] = None
624
601
 
625
602
 
626
- class KYCVerificationUpdateRequest(BaseRequest):
627
- curp: Curp
628
-
629
-
630
603
  class PlatformRequest(BaseModel):
631
604
  name: str
632
605
  rfc: Optional[str] = None
@@ -648,8 +621,8 @@ class WebhookRequest(BaseModel):
648
621
 
649
622
  class KYCValidationRequest(BaseRequest):
650
623
  user_id: str
624
+ source_type: KYCValidationSource
651
625
  force: bool = False
652
- documents: list[KYCFile] = []
653
626
 
654
627
 
655
628
  class BankAccountValidationRequest(BaseModel):
@@ -1 +1 @@
1
- __version__ = '2.1.5.dev4'
1
+ __version__ = '2.1.5.dev6'
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cuenca_validations
3
- Version: 2.1.5.dev4
3
+ Version: 2.1.5.dev6
4
4
  Summary: Cuenca common validations
5
5
  Home-page: https://github.com/cuenca-mx/cuenca-validations
6
6
  Author: Cuenca
@@ -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=vkrrbxTqNBCiWkVGSHCSIpu2bzyE1yysxhcX187vJzk,27
8
- cuenca_validations/types/__init__.py,sha256=8fiuz26oYQT2DriQ7sbD740yFJergVhB1OYoUGETB5A,4783
7
+ cuenca_validations/version.py,sha256=bhTMBpYCEuhFnR28TbW22MGWTEbof55Q981jXWP3ybE,27
8
+ cuenca_validations/types/__init__.py,sha256=UNb7auBcD0qp-x9TX7TNNj8IKo7uaI7xHaf9PYmaziY,4765
9
9
  cuenca_validations/types/card.py,sha256=UGzz8NTFAverUmdUKAK1oGHnOnjSNTpIRUm93vKSSGY,1295
10
- cuenca_validations/types/enums.py,sha256=47lvhRmmOwsoXBI6JiH0QCiLabqsBpYOZqHJxV3xVak,18887
10
+ cuenca_validations/types/enums.py,sha256=oPzB44JuOqtJs_wAuwkJm4i5JJvw0wl4hqTORGomj7Q,18963
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=wSfTn4CzR2SLYauf98yXbHwVWGT95bt6bLJcbV0L0b8,22039
18
- cuenca_validations-2.1.5.dev4.dist-info/licenses/LICENSE,sha256=wR76FmxBbfnQpwELkkE5iMF8sFIafEMgXLTE4N4WPTc,1063
17
+ cuenca_validations/types/requests.py,sha256=LV724BesZ_yqVDkPAay1iYxBD2sPIbP_8PfaMxO25Kk,21198
18
+ cuenca_validations-2.1.5.dev6.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=LGZmZhvsTDWr3Pm_Oxe6tEOjMpDbUEobDUGj3NREdXg,20053
25
- cuenca_validations-2.1.5.dev4.dist-info/METADATA,sha256=RGgpGy5lkEtQE_cgTkiadYJvYJZhq9Z0hIrMFSNVF0E,1599
26
- cuenca_validations-2.1.5.dev4.dist-info/WHEEL,sha256=L0N565qmK-3nM2eBoMNFszYJ_MTx03_tQ0CQu1bHLYo,91
27
- cuenca_validations-2.1.5.dev4.dist-info/top_level.txt,sha256=4233xdOs2HtuT-GFRjcDcwK0IwdwvWdczOtk0fPB6Gw,25
28
- cuenca_validations-2.1.5.dev4.dist-info/RECORD,,
24
+ tests/test_types.py,sha256=K_YNFz0Kac3k8fJNeXuYGkL1hjXDQu084jCX6xEMEE4,19348
25
+ cuenca_validations-2.1.5.dev6.dist-info/METADATA,sha256=Oecyub6K7U91em2ILg1pjgXymUbbo792vNBmZ_ZmYsM,1599
26
+ cuenca_validations-2.1.5.dev6.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
27
+ cuenca_validations-2.1.5.dev6.dist-info/top_level.txt,sha256=4233xdOs2HtuT-GFRjcDcwK0IwdwvWdczOtk0fPB6Gw,25
28
+ cuenca_validations-2.1.5.dev6.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (78.0.1)
2
+ Generator: setuptools (78.1.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
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
- )