cuenca-validations 2.1.7.dev4__py3-none-any.whl → 2.1.7.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.
@@ -40,7 +40,6 @@ from ..types.enums import (
40
40
  TrackDataMethod,
41
41
  TransactionTokenValidationStatus,
42
42
  UserCardNotification,
43
- UserStatus,
44
43
  VerificationType,
45
44
  WalletTransactionType,
46
45
  WebhookEvent,
@@ -72,7 +71,6 @@ from .identities import (
72
71
  Password,
73
72
  PhoneNumber,
74
73
  Rfc,
75
- TOSAgreement,
76
74
  )
77
75
  from .morals import (
78
76
  AuditDetails,
@@ -429,10 +427,6 @@ class UserRequest(BaseModel):
429
427
  ...,
430
428
  description='ID of previously validated email verification',
431
429
  )
432
- tos_agreement: UserTOSAgreementRequest = Field(
433
- ...,
434
- description='TOS agreement for the user'
435
- )
436
430
 
437
431
  model_config = ConfigDict(
438
432
  json_schema_extra={
@@ -483,8 +477,8 @@ class UserUpdateRequest(BaseModel):
483
477
  def beneficiary_percentage(
484
478
  cls, beneficiaries: Optional[list[Beneficiary]] = None
485
479
  ):
486
- if beneficiaries and sum(b.percentage for b in beneficiaries) > 100:
487
- raise ValueError('The total percentage is more than 100.')
480
+ if beneficiaries and sum(b.percentage for b in beneficiaries) != 100:
481
+ raise ValueError('The total percentage should be 100%')
488
482
  return beneficiaries
489
483
 
490
484
 
@@ -1 +1 @@
1
- __version__ = '2.1.7.dev4'
1
+ __version__ = '2.1.7.dev6'
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cuenca_validations
3
- Version: 2.1.7.dev4
3
+ Version: 2.1.7.dev6
4
4
  Summary: Cuenca common validations
5
5
  Home-page: https://github.com/cuenca-mx/cuenca-validations
6
6
  Author: Cuenca
@@ -4,7 +4,7 @@ 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=ck89QLn3S8rsaizuO5zSjxxyLjWWS4VkJ9vid2nZBH0,27
7
+ cuenca_validations/version.py,sha256=xNYuWD95tiTllFVfWM7FmDp_XLbRZ6ABQ89u9YqAhXw,27
8
8
  cuenca_validations/types/__init__.py,sha256=1xGfD2tlFsPlhIy-T7BZPs-vvEgDoc6ZW2iXFLbyQpM,4799
9
9
  cuenca_validations/types/card.py,sha256=UGzz8NTFAverUmdUKAK1oGHnOnjSNTpIRUm93vKSSGY,1295
10
10
  cuenca_validations/types/enums.py,sha256=o2XmufNIBhx88KDVARnpoXqLkyXVP89XMW0DDPDH9NI,19424
@@ -14,15 +14,15 @@ cuenca_validations/types/helpers.py,sha256=6rHUhwoQ7jJZtGcW3LX-W5ZDl42PWE1RoBpGm
14
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=Z2G-nZNjYUlNKZ80wevAff7LmewgiBFM43yzMhKdzxc,20526
18
- cuenca_validations-2.1.7.dev4.dist-info/licenses/LICENSE,sha256=wR76FmxBbfnQpwELkkE5iMF8sFIafEMgXLTE4N4WPTc,1063
17
+ cuenca_validations/types/requests.py,sha256=SdLE0N-3bRNVUQRQ2IWtShjR8Iok_Ev818o9UbcraTU,20370
18
+ cuenca_validations-2.1.7.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=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,,
24
+ tests/test_types.py,sha256=TimSUqe0YX83qIzo7p6XUy8YYuf19a7M3iPkVKw0iMg,19203
25
+ cuenca_validations-2.1.7.dev6.dist-info/METADATA,sha256=bN1iprUBHlSHDDvjNOOo9I-l8_fZN207JIm9Jkwvp-w,1599
26
+ cuenca_validations-2.1.7.dev6.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
27
+ cuenca_validations-2.1.7.dev6.dist-info/top_level.txt,sha256=4233xdOs2HtuT-GFRjcDcwK0IwdwvWdczOtk0fPB6Gw,25
28
+ cuenca_validations-2.1.7.dev6.dist-info/RECORD,,
tests/test_types.py CHANGED
@@ -320,6 +320,10 @@ def test_user_request():
320
320
  ),
321
321
  phone_verification_id='VE12345678',
322
322
  email_verification_id='VE0987654321',
323
+ tos_agreement=dict(
324
+ tos_id='TOS123',
325
+ location=dict(latitude=19.4326, longitude=-99.1332),
326
+ ),
323
327
  )
324
328
  assert UserRequest(**request).model_dump() == request
325
329
 
@@ -428,7 +432,7 @@ def test_user_update_request():
428
432
  birth_date=dt.date(2020, 1, 1).isoformat(),
429
433
  phone_number='+525555555555',
430
434
  user_relationship='brother',
431
- percentage=50,
435
+ percentage=100,
432
436
  ),
433
437
  ]
434
438
  assert UserUpdateRequest(**request)
@@ -449,10 +453,11 @@ def test_user_update_request():
449
453
  percentage=51,
450
454
  ),
451
455
  ]
452
- with pytest.raises(ValueError) as v:
456
+ with pytest.raises(ValidationError) as v:
453
457
  UserUpdateRequest(**request)
454
458
 
455
- assert 'The total percentage is more than 100.' in str(v)
459
+ assert 'The total percentage should be 100%' in str(v)
460
+ request.pop('beneficiaries')
456
461
 
457
462
  tos_request = dict(
458
463
  terms_of_service=dict(
@@ -483,12 +488,6 @@ def test_user_update_request():
483
488
  )
484
489
  UserUpdateRequest(**kyc_request)
485
490
 
486
- # chagning to invalid request
487
- tos_request['terms_of_service']['ip'] = 'not valid ip'
488
- with pytest.raises(ValueError) as v:
489
- UserUpdateRequest(**tos_request)
490
- assert 'not valid ip' in str(v.value)
491
-
492
491
 
493
492
  def test_session_request():
494
493
  data = dict(