cuenca 2.1.2.dev1__py3-none-any.whl → 2.1.3.dev0__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/resources/identities.py +2 -0
- cuenca/resources/user_lists_validation.py +12 -0
- cuenca/resources/users.py +8 -0
- cuenca/version.py +1 -1
- {cuenca-2.1.2.dev1.dist-info → cuenca-2.1.3.dev0.dist-info}/METADATA +1 -1
- {cuenca-2.1.2.dev1.dist-info → cuenca-2.1.3.dev0.dist-info}/RECORD +10 -12
- tests/resources/test_user_lists_validation.py +14 -0
- cuenca/resources/terms_of_services.py +0 -18
- cuenca/resources/user_tos_agreements.py +0 -21
- {cuenca-2.1.2.dev1.dist-info → cuenca-2.1.3.dev0.dist-info}/LICENSE +0 -0
- {cuenca-2.1.2.dev1.dist-info → cuenca-2.1.3.dev0.dist-info}/WHEEL +0 -0
- {cuenca-2.1.2.dev1.dist-info → cuenca-2.1.3.dev0.dist-info}/top_level.txt +0 -0
cuenca/resources/identities.py
CHANGED
|
@@ -7,6 +7,7 @@ from cuenca_validations.types import (
|
|
|
7
7
|
IdentityQuery,
|
|
8
8
|
KYCFile,
|
|
9
9
|
State,
|
|
10
|
+
TOSAgreement,
|
|
10
11
|
UserStatus,
|
|
11
12
|
VerificationStatus,
|
|
12
13
|
)
|
|
@@ -30,6 +31,7 @@ class Identity(Retrievable, Queryable):
|
|
|
30
31
|
state_of_birth: Optional[State] = None
|
|
31
32
|
country_of_birth: Optional[str] = None
|
|
32
33
|
status: Optional[UserStatus] = None
|
|
34
|
+
tos_agreement: Optional[TOSAgreement] = None
|
|
33
35
|
blacklist_validation_status: Optional[VerificationStatus] = None
|
|
34
36
|
address: Optional[Address] = None
|
|
35
37
|
govt_id: Optional[KYCFile] = None
|
|
@@ -17,6 +17,18 @@ class UserListsValidation(Creatable, Retrievable):
|
|
|
17
17
|
curp: Optional[Curp] = None
|
|
18
18
|
account_number: Optional[str] = None
|
|
19
19
|
status: Optional[VerificationStatus] = None
|
|
20
|
+
response: Optional[dict] = None
|
|
21
|
+
|
|
22
|
+
@property
|
|
23
|
+
def ppe_matches(self) -> list[dict]:
|
|
24
|
+
if not self.response or 'persons' not in self.response:
|
|
25
|
+
return []
|
|
26
|
+
|
|
27
|
+
return [
|
|
28
|
+
person
|
|
29
|
+
for person in self.response['persons']
|
|
30
|
+
if person.get('lista') == 'PPE'
|
|
31
|
+
]
|
|
20
32
|
|
|
21
33
|
@classmethod
|
|
22
34
|
def create(
|
cuenca/resources/users.py
CHANGED
|
@@ -7,6 +7,8 @@ from cuenca_validations.types import (
|
|
|
7
7
|
Beneficiary,
|
|
8
8
|
KYCFile,
|
|
9
9
|
PhoneNumber,
|
|
10
|
+
TOSAgreement,
|
|
11
|
+
TOSRequest,
|
|
10
12
|
UserQuery,
|
|
11
13
|
UserRequest,
|
|
12
14
|
UserStatus,
|
|
@@ -39,6 +41,7 @@ class User(Creatable, Retrievable, Updateable, Queryable):
|
|
|
39
41
|
phone_number: Optional[PhoneNumber] = None
|
|
40
42
|
email_address: Optional[EmailStr] = None
|
|
41
43
|
profession: Optional[str] = None
|
|
44
|
+
terms_of_service: Optional[TOSAgreement] = None
|
|
42
45
|
status: Optional[UserStatus] = None
|
|
43
46
|
address: Optional[Address] = None
|
|
44
47
|
govt_id: Optional[KYCFile] = Field(
|
|
@@ -84,6 +87,7 @@ class User(Creatable, Retrievable, Updateable, Queryable):
|
|
|
84
87
|
'phone_number': '+525511223344',
|
|
85
88
|
'email_address': 'user@example.com',
|
|
86
89
|
'profession': 'engineer',
|
|
90
|
+
'terms_of_service': TOSAgreement.schema().get('example'),
|
|
87
91
|
'status': 'active',
|
|
88
92
|
'address': Address.schema().get('example'),
|
|
89
93
|
'govt_id': KYCFile.schema().get('example'),
|
|
@@ -109,6 +113,7 @@ class User(Creatable, Retrievable, Updateable, Queryable):
|
|
|
109
113
|
phone_verification_id: Optional[str] = None,
|
|
110
114
|
status: Optional[UserStatus] = None,
|
|
111
115
|
required_level: Optional[int] = None,
|
|
116
|
+
terms_of_service: Optional[TOSRequest] = None,
|
|
112
117
|
*,
|
|
113
118
|
session: Session = global_session,
|
|
114
119
|
) -> 'User':
|
|
@@ -122,6 +127,7 @@ class User(Creatable, Retrievable, Updateable, Queryable):
|
|
|
122
127
|
phone_verification_id=phone_verification_id,
|
|
123
128
|
required_level=required_level,
|
|
124
129
|
status=status,
|
|
130
|
+
terms_of_service=terms_of_service,
|
|
125
131
|
)
|
|
126
132
|
return cls._create(session=session, **req.model_dump())
|
|
127
133
|
|
|
@@ -137,6 +143,7 @@ class User(Creatable, Retrievable, Updateable, Queryable):
|
|
|
137
143
|
govt_id: Optional[KYCFile] = None,
|
|
138
144
|
proof_of_address: Optional[KYCFile] = None,
|
|
139
145
|
proof_of_life: Optional[KYCFile] = None,
|
|
146
|
+
terms_of_service: Optional[TOSRequest] = None,
|
|
140
147
|
verification_id: Optional[str] = None,
|
|
141
148
|
status: Optional[UserStatus] = None,
|
|
142
149
|
email_verification_id: Optional[str] = None,
|
|
@@ -154,6 +161,7 @@ class User(Creatable, Retrievable, Updateable, Queryable):
|
|
|
154
161
|
govt_id=govt_id,
|
|
155
162
|
proof_of_address=proof_of_address,
|
|
156
163
|
proof_of_life=proof_of_life,
|
|
164
|
+
terms_of_service=terms_of_service,
|
|
157
165
|
verification_id=verification_id,
|
|
158
166
|
email_verification_id=email_verification_id,
|
|
159
167
|
phone_verification_id=phone_verification_id,
|
cuenca/version.py
CHANGED
|
@@ -2,7 +2,7 @@ cuenca/__init__.py,sha256=KQOScdvJ-rAsCugliTHsrxnV2A2hCLVpKnwaJpv3qO0,1790
|
|
|
2
2
|
cuenca/exc.py,sha256=r_lL03-JS0AsXw71wuNbiwNYLHNDagM56tRxpYyK6Lw,601
|
|
3
3
|
cuenca/jwt.py,sha256=plB2ttHPZnL0xq3gqubw_Jjtj1QYG2E5bk99N3cn5zg,1502
|
|
4
4
|
cuenca/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
5
|
-
cuenca/version.py,sha256=
|
|
5
|
+
cuenca/version.py,sha256=F-DvvBvW0iPE1kC1N8-6xR5xQ8ETXLDSh1E2_XhunBM,83
|
|
6
6
|
cuenca/http/__init__.py,sha256=V5TG6Ro9d3VY7umzcbtanmvHlGkv-k71H0tqrdMyH-s,49
|
|
7
7
|
cuenca/http/client.py,sha256=psXJiSgd3SUSJ5jwvhdBWsVMNadenG353BNVXdh7HMY,4168
|
|
8
8
|
cuenca/resources/__init__.py,sha256=hD0V8_D3DV4aRZSR7hYrrQ-qRXvlVBxilnIEPa4H9nw,3082
|
|
@@ -24,7 +24,7 @@ cuenca/resources/deposits.py,sha256=8FINQJ3c0Zg8FAq7e1JZu9i8G40fX-Kmawhl7Ouxpx4,
|
|
|
24
24
|
cuenca/resources/endpoints.py,sha256=AhrG8O6-6rtjtA9Ll98nmxq7xxiLkrKHR7XXZ59PGSs,3235
|
|
25
25
|
cuenca/resources/file_batches.py,sha256=2Fsmz8ryOjvLn3dpsyR0G2iS0zNVR4ajovNkaMZaHaM,786
|
|
26
26
|
cuenca/resources/files.py,sha256=WZYRo76fIGXNXk2HzA252dSdIdA4bl3EjB6q0bb6BFg,1837
|
|
27
|
-
cuenca/resources/identities.py,sha256=
|
|
27
|
+
cuenca/resources/identities.py,sha256=IdL495eTjx_2gDRxM9oG_QmDNOwaY7Nv9gzqeZu_Wdk,1092
|
|
28
28
|
cuenca/resources/identity_events.py,sha256=K1G6IEGlw6n482nZhBo_CJNBdpKFCO6duMQr5y9k4x8,374
|
|
29
29
|
cuenca/resources/jwt_tokens.py,sha256=NSFLMcWKPZLcVR6g8X-RIQ9e4i7VDoQvrkp3GLiapEc,952
|
|
30
30
|
cuenca/resources/kyc_validations.py,sha256=1G_dr6e1mpLUlqT9RmBgiC06eh0vQjMzosM5w3ZCQoE,1322
|
|
@@ -39,14 +39,12 @@ cuenca/resources/savings.py,sha256=3DBP1ygxhcScDpLvAQS_fF5chljyDTz4xwnltI0LCAg,1
|
|
|
39
39
|
cuenca/resources/service_providers.py,sha256=x-FNcyiUkdUsNCGudyLGYDbRkD2jPj8-T8U3IumxTVQ,310
|
|
40
40
|
cuenca/resources/sessions.py,sha256=lWphgjG9SZl81ik7c9tuAI6OE4JUOF0ZfRBvmf4vwyQ,1764
|
|
41
41
|
cuenca/resources/statements.py,sha256=PqMvhoE9cvBneXjaS7w4JnTzYdDakkCkbdNYrd7b8LI,282
|
|
42
|
-
cuenca/resources/terms_of_services.py,sha256=8Od1xYqMaW20R7zSO19Z4q5M2sMnV9pg2l2qxHsMjXY,462
|
|
43
42
|
cuenca/resources/transfers.py,sha256=v742SAGUIZfvYHfCNtk0hSm2uyhMGh00RbHIIJiqLzQ,3201
|
|
44
43
|
cuenca/resources/user_credentials.py,sha256=glpxUa5-aYhgJ1ZG1g_c1PAWaQ9eEWP01lauBaccSQQ,1356
|
|
45
44
|
cuenca/resources/user_events.py,sha256=L57v7clStwxyJX2vwe-357uRTrzeQglDpCCgXRg7v9Y,728
|
|
46
|
-
cuenca/resources/user_lists_validation.py,sha256=
|
|
45
|
+
cuenca/resources/user_lists_validation.py,sha256=UrInfZRUVd4nODBIBOTH8ALEZ3pvdYS2_xfFR7UeNrc,1595
|
|
47
46
|
cuenca/resources/user_logins.py,sha256=KDauv2c5BJUR-C5ZeIjAPsv-8VH11BhoT-wCU9KgrwY,1542
|
|
48
|
-
cuenca/resources/
|
|
49
|
-
cuenca/resources/users.py,sha256=YZBqQTHx5e_5OxRaH10V0gboRqf5bEnE5P--xhHU0zc,5957
|
|
47
|
+
cuenca/resources/users.py,sha256=3qb0-_3KBQCooqFUrknQ28ywU2v7s4JMudrd65z5Q-0,6321
|
|
50
48
|
cuenca/resources/verifications.py,sha256=YyvSh5IpiJ02lHK8k-guTwoHSFoaMYSFk1aC2tPi7n0,1680
|
|
51
49
|
cuenca/resources/wallet_transactions.py,sha256=8ePZI3-GaEd658GPYizAfHK9GVwlkt1r95-mEb7T3Jg,1030
|
|
52
50
|
cuenca/resources/webhooks.py,sha256=bGjuvkSP3GXo4Q6v8iZ40Md8xc4AQrEmAD3r40VJqxM,392
|
|
@@ -94,15 +92,15 @@ tests/resources/test_statements.py,sha256=e9S_yn5kD6M8IpfpRmIOJ0Y6aggBkYWQxynY6P
|
|
|
94
92
|
tests/resources/test_transfers.py,sha256=bW3igYOdYPDiZtLr8WVIYwfP-dV4sdJ9pbaXFps2ac8,4161
|
|
95
93
|
tests/resources/test_user_credentials.py,sha256=pJkIMIN4yMkj7AlaBMjI-e2O1YIoFWAh4r9C489GT7s,815
|
|
96
94
|
tests/resources/test_user_events.py,sha256=aPTyrEVF7jBD8-UQZeVOLbUmj9sni0JRCYgootmaQ8c,292
|
|
97
|
-
tests/resources/test_user_lists_validation.py,sha256
|
|
95
|
+
tests/resources/test_user_lists_validation.py,sha256=sZkjCYkySbWtOxM9NVSzZHaoOhXS7N0XD4buD3dke5E,1196
|
|
98
96
|
tests/resources/test_user_logins.py,sha256=YLIZiFsR9tBv1fNH-lIpIMtvGY_7NHGQpMBFVuEFj6c,988
|
|
99
97
|
tests/resources/test_users.py,sha256=AkUvk4Jdg4mM3dxvYR17jlc_z3WslIH1OLDqNDoTcc4,3223
|
|
100
98
|
tests/resources/test_verifications.py,sha256=yyL-bdryQU3MvqnmAgnnzGG9t7UTxWwPiVu-cDSCjl4,1647
|
|
101
99
|
tests/resources/test_wallet_transactions.py,sha256=_L2hjPHT4FwwhxksUoaoVHwFFYOGWfF4ScCbk0kb7Hw,3945
|
|
102
100
|
tests/resources/test_webhooks.py,sha256=nYCqAnlNJcMJKRHhgoHOWTQnFLWQHHvFyY8GVCxGTD8,328
|
|
103
101
|
tests/resources/test_whatsapp_transfers.py,sha256=4Dmrsbytx7LRrLQo9M8TAL7cGKJufPStkp51UdRCnYU,1030
|
|
104
|
-
cuenca-2.1.
|
|
105
|
-
cuenca-2.1.
|
|
106
|
-
cuenca-2.1.
|
|
107
|
-
cuenca-2.1.
|
|
108
|
-
cuenca-2.1.
|
|
102
|
+
cuenca-2.1.3.dev0.dist-info/LICENSE,sha256=aWv5PmUiAcNENEAdghcVQSeU56pXJHWexJYgklK9XLg,1063
|
|
103
|
+
cuenca-2.1.3.dev0.dist-info/METADATA,sha256=BUyXAkz7TqGzbBsDfkoKn3mYt-zPr3et699D9v6DL_Y,4966
|
|
104
|
+
cuenca-2.1.3.dev0.dist-info/WHEEL,sha256=52BFRY2Up02UkjOa29eZOS2VxUrpPORXg1pkohGGUS8,91
|
|
105
|
+
cuenca-2.1.3.dev0.dist-info/top_level.txt,sha256=5h3K7XJTmJniDloPq4sIJHni_xLw-Uoc6ZJ5mcw_lZY,13
|
|
106
|
+
cuenca-2.1.3.dev0.dist-info/RECORD,,
|
|
@@ -5,10 +5,24 @@ from cuenca.exc import CuencaResponseException
|
|
|
5
5
|
from cuenca.resources import UserListsValidation
|
|
6
6
|
|
|
7
7
|
|
|
8
|
+
@pytest.mark.vcr
|
|
9
|
+
def test_create_user_validation_with_response():
|
|
10
|
+
user_validation = UserListsValidation.create(
|
|
11
|
+
curp='LOBR810330HTCPLM05',
|
|
12
|
+
names='José Ramón',
|
|
13
|
+
first_surname='López',
|
|
14
|
+
second_surname='Beltrán',
|
|
15
|
+
)
|
|
16
|
+
assert user_validation.status == VerificationStatus.rejected
|
|
17
|
+
assert len(user_validation.ppe_matches) == 1
|
|
18
|
+
assert user_validation.ppe_matches[0]['parentesco'] == 'HIJO'
|
|
19
|
+
|
|
20
|
+
|
|
8
21
|
@pytest.mark.vcr
|
|
9
22
|
def test_create_user_validation(user_lists_request):
|
|
10
23
|
user_validation = UserListsValidation.create(**user_lists_request)
|
|
11
24
|
assert user_validation.status == VerificationStatus.succeeded
|
|
25
|
+
assert len(user_validation.ppe_matches) == 0
|
|
12
26
|
assert user_validation.id
|
|
13
27
|
|
|
14
28
|
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import datetime as dt
|
|
2
|
-
from typing import ClassVar
|
|
3
|
-
|
|
4
|
-
from cuenca_validations.types import TermsOfService as TermsOfServiceEnum
|
|
5
|
-
from cuenca_validations.types.general import SerializableHttpUrl
|
|
6
|
-
|
|
7
|
-
from .base import Queryable, Retrievable
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
class TermsOfService(Retrievable, Queryable):
|
|
11
|
-
_resource: ClassVar = 'terms_of_services'
|
|
12
|
-
|
|
13
|
-
id: str
|
|
14
|
-
is_active: bool
|
|
15
|
-
created_at: dt.datetime
|
|
16
|
-
type: TermsOfServiceEnum
|
|
17
|
-
version: str
|
|
18
|
-
uri: SerializableHttpUrl
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import datetime as dt
|
|
2
|
-
from typing import ClassVar
|
|
3
|
-
|
|
4
|
-
from cuenca_validations.types import TermsOfService
|
|
5
|
-
from cuenca_validations.types.general import SerializableHttpUrl
|
|
6
|
-
|
|
7
|
-
from .base import Creatable, Queryable, Retrievable
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
class UserTOSAgreement(Creatable, Retrievable, Queryable):
|
|
11
|
-
_resource: ClassVar = 'user_tos_agreements'
|
|
12
|
-
|
|
13
|
-
id: str
|
|
14
|
-
created_at: dt.datetime
|
|
15
|
-
user_id: str
|
|
16
|
-
type: TermsOfService
|
|
17
|
-
version: str
|
|
18
|
-
ip: str
|
|
19
|
-
location: str
|
|
20
|
-
hash: str
|
|
21
|
-
url: SerializableHttpUrl
|
|
File without changes
|
|
File without changes
|
|
File without changes
|