cuenca-validations 2.1.46__tar.gz → 2.1.48__tar.gz
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-2.1.46 → cuenca_validations-2.1.48}/PKG-INFO +1 -1
- {cuenca_validations-2.1.46 → cuenca_validations-2.1.48}/cuenca_validations/types/__init__.py +12 -0
- {cuenca_validations-2.1.46 → cuenca_validations-2.1.48}/cuenca_validations/types/enums.py +7 -0
- {cuenca_validations-2.1.46 → cuenca_validations-2.1.48}/cuenca_validations/types/queries.py +5 -0
- {cuenca_validations-2.1.46 → cuenca_validations-2.1.48}/cuenca_validations/types/requests.py +67 -0
- cuenca_validations-2.1.48/cuenca_validations/version.py +1 -0
- {cuenca_validations-2.1.46 → cuenca_validations-2.1.48}/cuenca_validations.egg-info/PKG-INFO +1 -1
- {cuenca_validations-2.1.46 → cuenca_validations-2.1.48}/tests/test_requests.py +41 -0
- cuenca_validations-2.1.46/cuenca_validations/version.py +0 -1
- {cuenca_validations-2.1.46 → cuenca_validations-2.1.48}/LICENSE +0 -0
- {cuenca_validations-2.1.46 → cuenca_validations-2.1.48}/README.md +0 -0
- {cuenca_validations-2.1.46 → cuenca_validations-2.1.48}/cuenca_validations/__init__.py +0 -0
- {cuenca_validations-2.1.46 → cuenca_validations-2.1.48}/cuenca_validations/card_bins.py +0 -0
- {cuenca_validations-2.1.46 → cuenca_validations-2.1.48}/cuenca_validations/errors.py +0 -0
- {cuenca_validations-2.1.46 → cuenca_validations-2.1.48}/cuenca_validations/py.typed +0 -0
- {cuenca_validations-2.1.46 → cuenca_validations-2.1.48}/cuenca_validations/types/card.py +0 -0
- {cuenca_validations-2.1.46 → cuenca_validations-2.1.48}/cuenca_validations/types/files.py +0 -0
- {cuenca_validations-2.1.46 → cuenca_validations-2.1.48}/cuenca_validations/types/general.py +0 -0
- {cuenca_validations-2.1.46 → cuenca_validations-2.1.48}/cuenca_validations/types/helpers.py +0 -0
- {cuenca_validations-2.1.46 → cuenca_validations-2.1.48}/cuenca_validations/types/identities.py +0 -0
- {cuenca_validations-2.1.46 → cuenca_validations-2.1.48}/cuenca_validations/types/morals.py +0 -0
- {cuenca_validations-2.1.46 → cuenca_validations-2.1.48}/cuenca_validations/typing.py +0 -0
- {cuenca_validations-2.1.46 → cuenca_validations-2.1.48}/cuenca_validations/validators.py +0 -0
- {cuenca_validations-2.1.46 → cuenca_validations-2.1.48}/cuenca_validations.egg-info/SOURCES.txt +0 -0
- {cuenca_validations-2.1.46 → cuenca_validations-2.1.48}/cuenca_validations.egg-info/dependency_links.txt +0 -0
- {cuenca_validations-2.1.46 → cuenca_validations-2.1.48}/cuenca_validations.egg-info/requires.txt +0 -0
- {cuenca_validations-2.1.46 → cuenca_validations-2.1.48}/cuenca_validations.egg-info/top_level.txt +0 -0
- {cuenca_validations-2.1.46 → cuenca_validations-2.1.48}/setup.cfg +0 -0
- {cuenca_validations-2.1.46 → cuenca_validations-2.1.48}/setup.py +0 -0
- {cuenca_validations-2.1.46 → cuenca_validations-2.1.48}/tests/__init__.py +0 -0
- {cuenca_validations-2.1.46 → cuenca_validations-2.1.48}/tests/test_card.py +0 -0
- {cuenca_validations-2.1.46 → cuenca_validations-2.1.48}/tests/test_errors.py +0 -0
- {cuenca_validations-2.1.46 → cuenca_validations-2.1.48}/tests/test_helpers.py +0 -0
- {cuenca_validations-2.1.46 → cuenca_validations-2.1.48}/tests/test_statement.py +0 -0
- {cuenca_validations-2.1.46 → cuenca_validations-2.1.48}/tests/test_types.py +0 -0
- {cuenca_validations-2.1.46 → cuenca_validations-2.1.48}/tests/test_validators.py +0 -0
{cuenca_validations-2.1.46 → cuenca_validations-2.1.48}/cuenca_validations/types/__init__.py
RENAMED
|
@@ -67,6 +67,7 @@ __all__ = [
|
|
|
67
67
|
'LegalPersonRequest',
|
|
68
68
|
'LegalPersonUpdateRequest',
|
|
69
69
|
'OperatorLoginRequest',
|
|
70
|
+
'OperatorLoginUpdateRequest',
|
|
70
71
|
'OperatorQuery',
|
|
71
72
|
'OperatorRequest',
|
|
72
73
|
'OperatorRole',
|
|
@@ -82,6 +83,7 @@ __all__ = [
|
|
|
82
83
|
'Profession',
|
|
83
84
|
'QueryParams',
|
|
84
85
|
'ReferencedClabeRequest',
|
|
86
|
+
'RejectTransferOrderRequest',
|
|
85
87
|
'LegalRfc',
|
|
86
88
|
'Rfc',
|
|
87
89
|
'QuestionnairesRequest',
|
|
@@ -106,6 +108,10 @@ __all__ = [
|
|
|
106
108
|
'TransactionQuery',
|
|
107
109
|
'TransactionStatus',
|
|
108
110
|
'TransferNetwork',
|
|
111
|
+
'TransferOrderLineRequest',
|
|
112
|
+
'TransferOrderQuery',
|
|
113
|
+
'TransferOrderRequest',
|
|
114
|
+
'TransferOrderStatus',
|
|
109
115
|
'TransferQuery',
|
|
110
116
|
'TransferRequest',
|
|
111
117
|
'UpdateTransferRequest',
|
|
@@ -184,6 +190,7 @@ from .enums import (
|
|
|
184
190
|
TrackDataMethod,
|
|
185
191
|
TransactionStatus,
|
|
186
192
|
TransferNetwork,
|
|
193
|
+
TransferOrderStatus,
|
|
187
194
|
UserCardNotification,
|
|
188
195
|
UserStatus,
|
|
189
196
|
UserType,
|
|
@@ -238,6 +245,7 @@ from .queries import (
|
|
|
238
245
|
StatementQuery,
|
|
239
246
|
TOSQuery,
|
|
240
247
|
TransactionQuery,
|
|
248
|
+
TransferOrderQuery,
|
|
241
249
|
TransferQuery,
|
|
242
250
|
UserQuery,
|
|
243
251
|
UsersTOSQuery,
|
|
@@ -263,6 +271,7 @@ from .requests import (
|
|
|
263
271
|
LegalPersonUpdateRequest,
|
|
264
272
|
LimitedWalletRequest,
|
|
265
273
|
OperatorLoginRequest,
|
|
274
|
+
OperatorLoginUpdateRequest,
|
|
266
275
|
OperatorRequest,
|
|
267
276
|
OperatorUpdateRequest,
|
|
268
277
|
PartnerRequest,
|
|
@@ -271,11 +280,14 @@ from .requests import (
|
|
|
271
280
|
PlatformRequest,
|
|
272
281
|
QuestionnairesRequest,
|
|
273
282
|
ReferencedClabeRequest,
|
|
283
|
+
RejectTransferOrderRequest,
|
|
274
284
|
SavingRequest,
|
|
275
285
|
SavingUpdateRequest,
|
|
276
286
|
SessionRequest,
|
|
277
287
|
StrictTransferRequest,
|
|
278
288
|
TOSRequest,
|
|
289
|
+
TransferOrderLineRequest,
|
|
290
|
+
TransferOrderRequest,
|
|
279
291
|
TransferRequest,
|
|
280
292
|
UpdateTransferRequest,
|
|
281
293
|
UserCredentialRequest,
|
|
@@ -761,3 +761,10 @@ class OperatorRole(str, Enum):
|
|
|
761
761
|
class OperatorStatus(str, Enum):
|
|
762
762
|
active = 'active'
|
|
763
763
|
deactivated = 'deactivated'
|
|
764
|
+
|
|
765
|
+
|
|
766
|
+
class TransferOrderStatus(str, Enum):
|
|
767
|
+
created = 'created'
|
|
768
|
+
authorized = 'authorized'
|
|
769
|
+
rejected = 'rejected'
|
|
770
|
+
expired = 'expired'
|
|
@@ -25,6 +25,7 @@ from .enums import (
|
|
|
25
25
|
SessionType,
|
|
26
26
|
TermsOfService,
|
|
27
27
|
TransferNetwork,
|
|
28
|
+
TransferOrderStatus,
|
|
28
29
|
UserStatus,
|
|
29
30
|
)
|
|
30
31
|
from .general import NormalizedName
|
|
@@ -233,3 +234,7 @@ class TOSQuery(QueryParams):
|
|
|
233
234
|
|
|
234
235
|
class UsersTOSQuery(QueryParams):
|
|
235
236
|
type: TermsOfService
|
|
237
|
+
|
|
238
|
+
|
|
239
|
+
class TransferOrderQuery(QueryParams):
|
|
240
|
+
status: Optional[TransferOrderStatus] = None
|
{cuenca_validations-2.1.46 → cuenca_validations-2.1.48}/cuenca_validations/types/requests.py
RENAMED
|
@@ -993,6 +993,16 @@ class OperatorLoginRequest(BaseRequest):
|
|
|
993
993
|
return normalize_email(email)
|
|
994
994
|
|
|
995
995
|
|
|
996
|
+
class OperatorLoginUpdateRequest(BaseRequest):
|
|
997
|
+
"""Complete operator login by verifying the emailed OTP code."""
|
|
998
|
+
|
|
999
|
+
code: StrictStr
|
|
1000
|
+
|
|
1001
|
+
model_config = ConfigDict(
|
|
1002
|
+
json_schema_extra={'example': {'code': '123456'}},
|
|
1003
|
+
)
|
|
1004
|
+
|
|
1005
|
+
|
|
996
1006
|
class ReferencedClabeRequest(BaseRequest):
|
|
997
1007
|
legal_person_id: str
|
|
998
1008
|
allowed_curp_rfc: Union[Curp, Rfc]
|
|
@@ -1009,3 +1019,60 @@ class ReferencedClabeRequest(BaseRequest):
|
|
|
1009
1019
|
|
|
1010
1020
|
class PhoneVerificationAssociationRequest(BaseRequest):
|
|
1011
1021
|
verification_id: str
|
|
1022
|
+
|
|
1023
|
+
|
|
1024
|
+
class TransferOrderLineRequest(BaseRequest):
|
|
1025
|
+
account_number: str
|
|
1026
|
+
recipient_name: str
|
|
1027
|
+
amount: int
|
|
1028
|
+
descriptor: str
|
|
1029
|
+
|
|
1030
|
+
model_config = ConfigDict(
|
|
1031
|
+
json_schema_extra={
|
|
1032
|
+
'example': {
|
|
1033
|
+
'account_number': '646180157034181180',
|
|
1034
|
+
'recipient_name': 'Doroteo Arango',
|
|
1035
|
+
'amount': 100_00,
|
|
1036
|
+
'descriptor': 'Mezcal, pulque y tequila',
|
|
1037
|
+
}
|
|
1038
|
+
},
|
|
1039
|
+
)
|
|
1040
|
+
|
|
1041
|
+
|
|
1042
|
+
class TransferOrderRequest(BaseRequest):
|
|
1043
|
+
idempotency_key: str
|
|
1044
|
+
legal_person_id: Optional[str] = None
|
|
1045
|
+
items: list[TransferOrderLineRequest]
|
|
1046
|
+
|
|
1047
|
+
model_config = ConfigDict(
|
|
1048
|
+
json_schema_extra={
|
|
1049
|
+
'example': {
|
|
1050
|
+
'idempotency_key': 'UNIQUE-KEY-003',
|
|
1051
|
+
'legal_person_id': 'USWqY5cvkISJOxHyEKjAKf8w',
|
|
1052
|
+
'items': [
|
|
1053
|
+
{
|
|
1054
|
+
'account_number': '646180157034181180',
|
|
1055
|
+
'recipient_name': 'Doroteo Arango',
|
|
1056
|
+
'amount': 100_00,
|
|
1057
|
+
'descriptor': 'Mezcal, pulque y tequila',
|
|
1058
|
+
}
|
|
1059
|
+
],
|
|
1060
|
+
}
|
|
1061
|
+
},
|
|
1062
|
+
)
|
|
1063
|
+
|
|
1064
|
+
@model_validator(mode='after')
|
|
1065
|
+
def validate_items(self) -> 'TransferOrderRequest':
|
|
1066
|
+
if len(self.items) == 0:
|
|
1067
|
+
raise ValueError('items must not be empty')
|
|
1068
|
+
return self
|
|
1069
|
+
|
|
1070
|
+
|
|
1071
|
+
class RejectTransferOrderRequest(BaseRequest):
|
|
1072
|
+
rejection_reason: str
|
|
1073
|
+
|
|
1074
|
+
model_config = ConfigDict(
|
|
1075
|
+
json_schema_extra={
|
|
1076
|
+
'example': {'rejection_reason': 'Monto incorrecto'},
|
|
1077
|
+
},
|
|
1078
|
+
)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = '2.1.48'
|
|
@@ -10,9 +10,11 @@ from cuenca_validations.types.enums import (
|
|
|
10
10
|
from cuenca_validations.types.queries import OperatorQuery
|
|
11
11
|
from cuenca_validations.types.requests import (
|
|
12
12
|
OperatorLoginRequest,
|
|
13
|
+
OperatorLoginUpdateRequest,
|
|
13
14
|
OperatorRequest,
|
|
14
15
|
OperatorUpdateRequest,
|
|
15
16
|
PasswordResetRequest,
|
|
17
|
+
TransferOrderRequest,
|
|
16
18
|
UpdateTransferRequest,
|
|
17
19
|
UserTOSAgreementRequest,
|
|
18
20
|
UserUpdateRequest,
|
|
@@ -90,6 +92,19 @@ def test_operator_login_request_forbids_extra() -> None:
|
|
|
90
92
|
assert 'Extra inputs are not permitted' in str(ex.value)
|
|
91
93
|
|
|
92
94
|
|
|
95
|
+
def test_operator_login_update_request_valid() -> None:
|
|
96
|
+
req = OperatorLoginUpdateRequest.model_validate({'code': '123456'})
|
|
97
|
+
assert req.code == '123456'
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
def test_operator_login_update_request_forbids_extra() -> None:
|
|
101
|
+
with pytest.raises(ValidationError) as ex:
|
|
102
|
+
OperatorLoginUpdateRequest.model_validate(
|
|
103
|
+
{'code': '123456', 'foo': 'bar'}
|
|
104
|
+
)
|
|
105
|
+
assert 'Extra inputs are not permitted' in str(ex.value)
|
|
106
|
+
|
|
107
|
+
|
|
93
108
|
def test_operator_query_valid() -> None:
|
|
94
109
|
query = OperatorQuery.model_validate({'email': 'maria.lopez@aceros.com'})
|
|
95
110
|
assert str(query.email) == 'maria.lopez@aceros.com'
|
|
@@ -218,3 +233,29 @@ def test_update_transfer_request_forbids_extra() -> None:
|
|
|
218
233
|
{'status': 'succeeded', 'foo': 'bar'}
|
|
219
234
|
)
|
|
220
235
|
assert 'Extra inputs are not permitted' in str(ex.value)
|
|
236
|
+
|
|
237
|
+
|
|
238
|
+
def test_transfer_order_request_shape() -> None:
|
|
239
|
+
line = {
|
|
240
|
+
'account_number': '646180157034181180',
|
|
241
|
+
'recipient_name': 'Doroteo Arango',
|
|
242
|
+
'amount': 100_00,
|
|
243
|
+
'descriptor': 'Mezcal',
|
|
244
|
+
}
|
|
245
|
+
single = TransferOrderRequest.model_validate(
|
|
246
|
+
{'idempotency_key': 'single', 'items': [line]}
|
|
247
|
+
)
|
|
248
|
+
assert single.items is not None
|
|
249
|
+
assert len(single.items) == 1
|
|
250
|
+
batch = TransferOrderRequest.model_validate(
|
|
251
|
+
{'idempotency_key': 'batch', 'items': [line, line]}
|
|
252
|
+
)
|
|
253
|
+
assert batch.items is not None
|
|
254
|
+
assert len(batch.items) == 2
|
|
255
|
+
|
|
256
|
+
with pytest.raises(ValidationError, match='items must not be empty'):
|
|
257
|
+
TransferOrderRequest.model_validate(
|
|
258
|
+
{'idempotency_key': 'empty', 'items': []}
|
|
259
|
+
)
|
|
260
|
+
with pytest.raises(ValidationError):
|
|
261
|
+
TransferOrderRequest.model_validate({'idempotency_key': 'missing'})
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = '2.1.46'
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{cuenca_validations-2.1.46 → cuenca_validations-2.1.48}/cuenca_validations/types/identities.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{cuenca_validations-2.1.46 → cuenca_validations-2.1.48}/cuenca_validations.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
{cuenca_validations-2.1.46 → cuenca_validations-2.1.48}/cuenca_validations.egg-info/requires.txt
RENAMED
|
File without changes
|
{cuenca_validations-2.1.46 → cuenca_validations-2.1.48}/cuenca_validations.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|