cuenca 2.1.8.dev2__py3-none-any.whl → 2.1.9__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/users.py CHANGED
@@ -9,7 +9,6 @@ from cuenca_validations.types import (
9
9
  PhoneNumber,
10
10
  SATRegimeCode,
11
11
  TOSAgreement,
12
- TOSRequest,
13
12
  UserQuery,
14
13
  UserRequest,
15
14
  UserStatus,
@@ -17,7 +16,7 @@ from cuenca_validations.types import (
17
16
  )
18
17
  from cuenca_validations.types.enums import Country, Gender, State
19
18
  from cuenca_validations.types.general import SerializableHttpUrl
20
- from cuenca_validations.types.identities import Curp
19
+ from cuenca_validations.types.identities import AddressRequest, Curp
21
20
  from pydantic import ConfigDict, EmailStr, Field
22
21
 
23
22
  from ..http import Session, session as global_session
@@ -107,29 +106,19 @@ class User(Creatable, Retrievable, Updateable, Queryable):
107
106
  def create(
108
107
  cls,
109
108
  curp: Curp,
110
- phone_number: Optional[PhoneNumber] = None,
111
- email_address: Optional[EmailStr] = None,
112
109
  profession: Optional[str] = None,
113
- address: Optional[Address] = None,
110
+ address: Optional[AddressRequest] = None,
114
111
  email_verification_id: Optional[str] = None,
115
112
  phone_verification_id: Optional[str] = None,
116
- status: Optional[UserStatus] = None,
117
- required_level: Optional[int] = None,
118
- terms_of_service: Optional[TOSRequest] = None,
119
113
  *,
120
114
  session: Session = global_session,
121
115
  ) -> 'User':
122
116
  req = UserRequest(
123
117
  curp=curp,
124
- phone_number=phone_number,
125
- email_address=email_address,
126
118
  profession=profession,
127
119
  address=address,
128
120
  email_verification_id=email_verification_id,
129
121
  phone_verification_id=phone_verification_id,
130
- required_level=required_level,
131
- status=status,
132
- terms_of_service=terms_of_service,
133
122
  )
134
123
  return cls._create(session=session, **req.model_dump())
135
124
 
@@ -137,39 +126,34 @@ class User(Creatable, Retrievable, Updateable, Queryable):
137
126
  def update(
138
127
  cls,
139
128
  user_id: str,
140
- phone_number: Optional[PhoneNumber] = None,
141
- email_address: Optional[str] = None,
142
129
  profession: Optional[str] = None,
143
- address: Optional[Address] = None,
130
+ address: Optional[AddressRequest] = None,
144
131
  beneficiaries: Optional[list[Beneficiary]] = None,
145
132
  govt_id: Optional[KYCFile] = None,
146
133
  proof_of_address: Optional[KYCFile] = None,
147
134
  proof_of_life: Optional[KYCFile] = None,
148
- terms_of_service: Optional[TOSRequest] = None,
149
- verification_id: Optional[str] = None,
150
135
  status: Optional[UserStatus] = None,
151
136
  email_verification_id: Optional[str] = None,
152
137
  phone_verification_id: Optional[str] = None,
153
138
  curp_document: Optional[SerializableHttpUrl] = None,
154
139
  fiscal_regime_code: Optional[SATRegimeCode] = None,
140
+ pronouns: Optional[str] = None,
155
141
  *,
156
142
  session: Session = global_session,
157
143
  ) -> 'User':
158
144
  request = UserUpdateRequest(
159
- phone_number=phone_number,
160
- email_address=email_address,
161
145
  profession=profession,
162
146
  address=address,
163
147
  beneficiaries=beneficiaries,
164
148
  govt_id=govt_id,
165
149
  proof_of_address=proof_of_address,
166
150
  proof_of_life=proof_of_life,
167
- terms_of_service=terms_of_service,
168
- verification_id=verification_id,
151
+ status=status,
169
152
  email_verification_id=email_verification_id,
170
153
  phone_verification_id=phone_verification_id,
171
154
  curp_document=curp_document,
172
- status=status,
155
+ fiscal_regime_code=fiscal_regime_code,
156
+ pronouns=pronouns,
173
157
  )
174
158
  return cls._update(id=user_id, **request.model_dump(), session=session)
175
159
 
cuenca/version.py CHANGED
@@ -1,3 +1,3 @@
1
- __version__ = '2.1.8.dev2'
1
+ __version__ = '2.1.9'
2
2
  CLIENT_VERSION = __version__
3
3
  API_VERSION = '2020-03-19'
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cuenca
3
- Version: 2.1.8.dev2
3
+ Version: 2.1.9
4
4
  Summary: Cuenca API Client
5
5
  Home-page: https://github.com/cuenca-mx/cuenca-python
6
6
  Author: Cuenca
@@ -2,7 +2,7 @@ cuenca/__init__.py,sha256=R_PNGTPbmivdWfiE5qAFQE-gsw0AOB4cw4W6DWpF-KY,1978
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=1pMeHzDUuU2sU9clGFaSP4AckYQ6yTM2eUWMTfl-C3Y,83
5
+ cuenca/version.py,sha256=BI7KyxLxNiZTz-3Y-QSwbdKe-A3x9bK3VV0iaP4qtcg,78
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=uBp3dzTwPTY62Dx8o9bPCtNJ6OeHKNRoTsUc2RQL5uA,3452
@@ -47,15 +47,15 @@ cuenca/resources/user_credentials.py,sha256=glpxUa5-aYhgJ1ZG1g_c1PAWaQ9eEWP01lau
47
47
  cuenca/resources/user_events.py,sha256=L57v7clStwxyJX2vwe-357uRTrzeQglDpCCgXRg7v9Y,728
48
48
  cuenca/resources/user_lists_validation.py,sha256=UrInfZRUVd4nODBIBOTH8ALEZ3pvdYS2_xfFR7UeNrc,1595
49
49
  cuenca/resources/user_logins.py,sha256=KDauv2c5BJUR-C5ZeIjAPsv-8VH11BhoT-wCU9KgrwY,1542
50
- cuenca/resources/users.py,sha256=INmMtdUA3NUA1AEBzUeGF_jV6K7uSNjgNp_uaXDlBDA,6455
50
+ cuenca/resources/users.py,sha256=Ab24cxidonJKlZblyRoLZPsVjYbZj7uh-oOYtPdz4sk,5775
51
51
  cuenca/resources/users_tos_agreements.py,sha256=bZiVuobGfLlxwlIyoiA9Izdo4KiUlxJyBffp9Y2NYYU,1250
52
52
  cuenca/resources/verifications.py,sha256=c90Pyd20EXLA5Wy0C1RABxjjivMB--q6yu6uK-R8aNA,1607
53
53
  cuenca/resources/wallet_transactions.py,sha256=8ePZI3-GaEd658GPYizAfHK9GVwlkt1r95-mEb7T3Jg,1030
54
54
  cuenca/resources/webhooks.py,sha256=bGjuvkSP3GXo4Q6v8iZ40Md8xc4AQrEmAD3r40VJqxM,392
55
55
  cuenca/resources/whatsapp_transfers.py,sha256=YSL606FBOMGKjhyKK5TiF0di96zdDKoiVtjiz_Zl_ZI,902
56
- cuenca-2.1.8.dev2.dist-info/licenses/LICENSE,sha256=aWv5PmUiAcNENEAdghcVQSeU56pXJHWexJYgklK9XLg,1063
56
+ cuenca-2.1.9.dist-info/licenses/LICENSE,sha256=aWv5PmUiAcNENEAdghcVQSeU56pXJHWexJYgklK9XLg,1063
57
57
  tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
58
- tests/conftest.py,sha256=O8GhZPxJenGV_O-DMoXGl3xJImkHBOuXYV3DJDGngzc,1904
58
+ tests/conftest.py,sha256=0tgOjjZOitOvFcYU6GRJ29ySdFmDAM3FX8ZGKjJj3Ac,1828
59
59
  tests/test_cuenca.py,sha256=aeha_utz9YiHQg6eJK2PB7g66pVUYFi9U6pYMGXDKvk,1628
60
60
  tests/test_jwt.py,sha256=dY5m4LigM-inqePyYOmdIHoOBmGx0WcfxlKnJEdsF70,1205
61
61
  tests/http/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -94,20 +94,20 @@ tests/resources/test_questionnaires.py,sha256=Sl8YHXgL42xiijUncycOUzGu5MtI3jEnhA
94
94
  tests/resources/test_resources.py,sha256=rTcfjZOxujOJXjfqvOV6TPpYl8lae4bgbZj4jTAWm_o,170
95
95
  tests/resources/test_savings.py,sha256=2qlGo9Qy_bqwYfMmjf9OsPIPVWRb6zlkzaMgg5RWElk,1127
96
96
  tests/resources/test_service_providers.py,sha256=yhjTvRdVaTpwEHLVtvX8OD6bMef2W9wUI8MRwLY-i64,563
97
- tests/resources/test_sessions.py,sha256=t9ljOiTbtrkpf_zh15LomK_JkJJDy8q8SdiVLw2pZ2k,1275
97
+ tests/resources/test_sessions.py,sha256=iuRYfn8QVKp_JAbfkvnAuuVnaWSNoDhutpUkMd8SUgQ,1284
98
98
  tests/resources/test_statements.py,sha256=e9S_yn5kD6M8IpfpRmIOJ0Y6aggBkYWQxynY6P7Q7nI,370
99
99
  tests/resources/test_transfers.py,sha256=bW3igYOdYPDiZtLr8WVIYwfP-dV4sdJ9pbaXFps2ac8,4161
100
100
  tests/resources/test_user_credentials.py,sha256=pJkIMIN4yMkj7AlaBMjI-e2O1YIoFWAh4r9C489GT7s,815
101
101
  tests/resources/test_user_events.py,sha256=aPTyrEVF7jBD8-UQZeVOLbUmj9sni0JRCYgootmaQ8c,292
102
102
  tests/resources/test_user_lists_validation.py,sha256=sZkjCYkySbWtOxM9NVSzZHaoOhXS7N0XD4buD3dke5E,1196
103
103
  tests/resources/test_user_logins.py,sha256=YLIZiFsR9tBv1fNH-lIpIMtvGY_7NHGQpMBFVuEFj6c,988
104
- tests/resources/test_users.py,sha256=op6c6uTweJQtD8OkE_vUUxTMqIC2UrncTwt-B6YO0Qc,3256
104
+ tests/resources/test_users.py,sha256=y-w90swBPJewQppNtgBzZUB1VVtA-gYUlpXRZT98B_c,3127
105
105
  tests/resources/test_users_tos_agreements.py,sha256=s4Gt36KLi3fjVtVzV9vhi6VF94QzbB_Ut0HDj9Zvj7Q,272
106
106
  tests/resources/test_verifications.py,sha256=bBXR-pkmrs-_MekKo9iJS4TDkSyqZ65crsrcqVZs4FQ,1591
107
107
  tests/resources/test_wallet_transactions.py,sha256=_L2hjPHT4FwwhxksUoaoVHwFFYOGWfF4ScCbk0kb7Hw,3945
108
108
  tests/resources/test_webhooks.py,sha256=nYCqAnlNJcMJKRHhgoHOWTQnFLWQHHvFyY8GVCxGTD8,328
109
109
  tests/resources/test_whatsapp_transfers.py,sha256=4Dmrsbytx7LRrLQo9M8TAL7cGKJufPStkp51UdRCnYU,1030
110
- cuenca-2.1.8.dev2.dist-info/METADATA,sha256=quPz8j0g-jllB0UtFtYQHo7BTHCRitlKqx775YiA46o,4988
111
- cuenca-2.1.8.dev2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
112
- cuenca-2.1.8.dev2.dist-info/top_level.txt,sha256=5h3K7XJTmJniDloPq4sIJHni_xLw-Uoc6ZJ5mcw_lZY,13
113
- cuenca-2.1.8.dev2.dist-info/RECORD,,
110
+ cuenca-2.1.9.dist-info/METADATA,sha256=dQlv6qbrH5BLMCLRZEgd01ntOf_vq-rGf027nxm1umM,4983
111
+ cuenca-2.1.9.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
112
+ cuenca-2.1.9.dist-info/top_level.txt,sha256=5h3K7XJTmJniDloPq4sIJHni_xLw-Uoc6ZJ5mcw_lZY,13
113
+ cuenca-2.1.9.dist-info/RECORD,,
tests/conftest.py CHANGED
@@ -36,8 +36,8 @@ def curp_validation_request() -> dict:
36
36
  names='José',
37
37
  first_surname='López',
38
38
  second_surname='Hernández',
39
- date_of_birth=dt.date(1966, 6, 6),
40
- state_of_birth=State.DF,
39
+ date_of_birth=dt.date(1996, 6, 21),
40
+ state_of_birth=State.GR,
41
41
  country_of_birth=Country.MX,
42
42
  gender=Gender.male,
43
43
  )
@@ -48,17 +48,15 @@ def curp_validation_request() -> dict:
48
48
  def user_request() -> dict:
49
49
  user_dict = dict(
50
50
  curp='LOHJ660606HDFPRS02',
51
- phone_number='+525511223344',
52
- email_address='jose@test.com',
53
51
  profession=Profession.empleado,
54
52
  address=dict(
55
53
  street='calle 1',
56
54
  ext_number='2',
57
55
  int_number='3',
58
- postal_code_id='PC2ygq9j2bS9-9tsuVawzErA',
56
+ postal_code_id='PCLo4hi65YTKaAnph27E_2SQ',
59
57
  ),
60
- phone_verification_id='VERdkuqOCjSA2PSS-VCj7HhQ',
61
- email_verification_id='VERppwdqsQSAQFFF-CDsWD8s',
58
+ phone_verification_id='VEJlFhtVOgQMG5EpkThHL5Tg',
59
+ email_verification_id='VE_r7hBIlaSfe2pEOvMtBEog',
62
60
  )
63
61
  return user_dict
64
62
 
@@ -1,5 +1,5 @@
1
1
  import pytest
2
- from cuenca_validations.types import SessionType
2
+ from cuenca_validations.types import Profession, SessionType
3
3
  from pydantic import ValidationError
4
4
 
5
5
  import cuenca
@@ -35,5 +35,6 @@ def test_session_create(curp_validation_request: dict, user_request: dict):
35
35
 
36
36
  ephimeral_cuenca_session = cuenca.http.Session()
37
37
  ephimeral_cuenca_session.configure(session_token=user_session.id)
38
- user = User.update(user.id, email_address='manu@example.com')
39
- assert user.email_address == 'manu@example.com'
38
+
39
+ user = User.update(user.id, profession=Profession.comercio)
40
+ assert user.profession == Profession.comercio
@@ -2,7 +2,7 @@ import datetime as dt
2
2
 
3
3
  import pytest
4
4
  from cuenca_validations.types import VerificationType
5
- from cuenca_validations.types.enums import Profession
5
+ from cuenca_validations.types.enums import Profession, SATRegimeCode
6
6
 
7
7
  from cuenca import Verification
8
8
  from cuenca.resources import CurpValidation, User
@@ -29,16 +29,10 @@ def test_user_query():
29
29
 
30
30
  @pytest.mark.vcr
31
31
  def test_user_update():
32
- user_id = 'USCM-zlFcNQk6ue4gZ_mTGeQ'
32
+ user_id = 'USPR4JxMuwSG60u2h4gBpB6Q'
33
33
  changes = dict(
34
34
  profession=Profession.sistemas,
35
- phone_number='+525555555555',
36
- govt_id=dict(
37
- type='ine',
38
- uri_front='cuenca.com',
39
- uri_back='cuenca.com',
40
- is_mx=True,
41
- ),
35
+ fiscal_regime_code=SATRegimeCode.INT,
42
36
  )
43
37
  user = User.update(user_id, **changes)
44
38
  assert all(item in user.to_dict().keys() for item in changes.keys())