cuenca-validations 2.1.38.dev1__py3-none-any.whl → 2.1.38.dev2__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_validations/types/__init__.py +2 -0
- cuenca_validations/types/general.py +14 -0
- cuenca_validations/types/requests.py +2 -1
- cuenca_validations/version.py +1 -1
- {cuenca_validations-2.1.38.dev1.dist-info → cuenca_validations-2.1.38.dev2.dist-info}/METADATA +1 -1
- {cuenca_validations-2.1.38.dev1.dist-info → cuenca_validations-2.1.38.dev2.dist-info}/RECORD +10 -10
- tests/test_types.py +4 -0
- {cuenca_validations-2.1.38.dev1.dist-info → cuenca_validations-2.1.38.dev2.dist-info}/WHEEL +0 -0
- {cuenca_validations-2.1.38.dev1.dist-info → cuenca_validations-2.1.38.dev2.dist-info}/licenses/LICENSE +0 -0
- {cuenca_validations-2.1.38.dev1.dist-info → cuenca_validations-2.1.38.dev2.dist-info}/top_level.txt +0 -0
|
@@ -8,6 +8,7 @@ __all__ = [
|
|
|
8
8
|
'BalanceEntryQuery',
|
|
9
9
|
'BankAccountValidationQuery',
|
|
10
10
|
'BankAccountValidationRequest',
|
|
11
|
+
'BankCode',
|
|
11
12
|
'PostalCodeQuery',
|
|
12
13
|
'UsersTOSQuery',
|
|
13
14
|
'TOSQuery',
|
|
@@ -177,6 +178,7 @@ from .enums import (
|
|
|
177
178
|
)
|
|
178
179
|
from .files import BatchFileMetadata
|
|
179
180
|
from .general import (
|
|
181
|
+
BankCode,
|
|
180
182
|
JSONEncoder,
|
|
181
183
|
LogConfig,
|
|
182
184
|
SantizedDict,
|
|
@@ -2,6 +2,7 @@ import json
|
|
|
2
2
|
from dataclasses import dataclass
|
|
3
3
|
from typing import Annotated, Any, Optional
|
|
4
4
|
|
|
5
|
+
from clabe import BANK_NAMES
|
|
5
6
|
from pydantic import (
|
|
6
7
|
AfterValidator,
|
|
7
8
|
AnyUrl,
|
|
@@ -41,6 +42,19 @@ NormalizedName = Annotated[
|
|
|
41
42
|
]
|
|
42
43
|
|
|
43
44
|
|
|
45
|
+
def validate_bank_code(bank_code: str) -> str:
|
|
46
|
+
if bank_code not in BANK_NAMES:
|
|
47
|
+
raise ValueError('Not a valid bank code')
|
|
48
|
+
return bank_code
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
BankCode = Annotated[
|
|
52
|
+
str,
|
|
53
|
+
StringConstraints(strip_whitespace=True),
|
|
54
|
+
AfterValidator(validate_bank_code),
|
|
55
|
+
]
|
|
56
|
+
|
|
57
|
+
|
|
44
58
|
class SantizedDict(dict):
|
|
45
59
|
def __init__(self, *args, **kwargs):
|
|
46
60
|
super().__init__(*args, **kwargs)
|
|
@@ -67,6 +67,7 @@ from .card import (
|
|
|
67
67
|
StrictPaymentCardNumber,
|
|
68
68
|
)
|
|
69
69
|
from .general import (
|
|
70
|
+
BankCode,
|
|
70
71
|
LogConfig,
|
|
71
72
|
NonEmptyStr,
|
|
72
73
|
SerializableAnyUrl,
|
|
@@ -328,7 +329,7 @@ class WalletTransactionRequest(BaseRequest):
|
|
|
328
329
|
class FraudFundsTransferRequest(BaseRequest):
|
|
329
330
|
user_id: NonEmptyStr
|
|
330
331
|
clabe: Optional[Clabe] = None
|
|
331
|
-
bank_code: Optional[
|
|
332
|
+
bank_code: Optional[BankCode] = None
|
|
332
333
|
tipo_pago: Optional[FraudFundsTransferTipoPago] = None
|
|
333
334
|
amount: Optional[StrictPositiveInt] = None
|
|
334
335
|
concepto: Optional[NonEmptyStr] = None
|
cuenca_validations/version.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = '2.1.38.
|
|
1
|
+
__version__ = '2.1.38.dev2'
|
{cuenca_validations-2.1.38.dev1.dist-info → cuenca_validations-2.1.38.dev2.dist-info}/RECORD
RENAMED
|
@@ -4,27 +4,27 @@ 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=zXSnU5-EMbQZBD-PfFXgP4Z6G7cm7KFDWXB7Nie6WUk,2682
|
|
7
|
-
cuenca_validations/version.py,sha256=
|
|
8
|
-
cuenca_validations/types/__init__.py,sha256=
|
|
7
|
+
cuenca_validations/version.py,sha256=7q0-xL57DP35yE_ZWFqUudz4RweXMDO779zWULY6jvA,28
|
|
8
|
+
cuenca_validations/types/__init__.py,sha256=MuaKIoDkRyu9zIGpge0B1INHGK8NpIFhyH5ldXb5ADE,5735
|
|
9
9
|
cuenca_validations/types/card.py,sha256=UGzz8NTFAverUmdUKAK1oGHnOnjSNTpIRUm93vKSSGY,1295
|
|
10
10
|
cuenca_validations/types/enums.py,sha256=CBdFbrrw1w-PmBpRekYhN6b0Awqbf2-oxDzHZmvgqY0,20795
|
|
11
11
|
cuenca_validations/types/files.py,sha256=2CszbwF9ytXV9suFFwyDjYG4XxY8UhCjRw3HttVXXNw,269
|
|
12
|
-
cuenca_validations/types/general.py,sha256=
|
|
12
|
+
cuenca_validations/types/general.py,sha256=ldYUnlrzQdPnJ8ADenr_4PCScUwxjRacpsVO1s60Uy0,5928
|
|
13
13
|
cuenca_validations/types/helpers.py,sha256=4veeLZbugHHqZk0ezSim978VhH6Vq8XTrEhe1eE_r3A,1531
|
|
14
14
|
cuenca_validations/types/identities.py,sha256=j2xxh3UYHJe6IbAwr9yNXJkebTth_-g3SUmHeiPez8M,5513
|
|
15
15
|
cuenca_validations/types/morals.py,sha256=davabh5hAnFVQyM7-yCyDaT5ewXnm0cr1BtqDIwzkX8,1833
|
|
16
16
|
cuenca_validations/types/queries.py,sha256=OonJ6CBDR6OF_kTv49AsE3zLEzQPCF4xpSqzSBpQgEs,5795
|
|
17
|
-
cuenca_validations/types/requests.py,sha256=
|
|
18
|
-
cuenca_validations-2.1.38.
|
|
17
|
+
cuenca_validations/types/requests.py,sha256=XeXdiSl7ptZAYK4w9uaPNBj_0V16ymj8MvLVwRfc2Cw,25180
|
|
18
|
+
cuenca_validations-2.1.38.dev2.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=fx2R7y6oQO8XeQzevJe826NuHkBgvtznZicomchB3Gg,899
|
|
23
23
|
tests/test_requests.py,sha256=3XMx2A-BK21g1Exm4RTVm6eKTOzeZH-8FzKJXQmmMmA,4141
|
|
24
24
|
tests/test_statement.py,sha256=IOE0rRRBgBZSJv_FLaETEyn5NzzXKMNTqgjv99GX-68,1436
|
|
25
|
-
tests/test_types.py,sha256=
|
|
25
|
+
tests/test_types.py,sha256=T4CssoCeRJrgOPs9D6YehEXfK_2aFUKecY6xPaougPw,24496
|
|
26
26
|
tests/test_validators.py,sha256=Jjr9gWTT4cRntGiKvQK4fncqx3JkEuTWkKm1VqpRHTs,1829
|
|
27
|
-
cuenca_validations-2.1.38.
|
|
28
|
-
cuenca_validations-2.1.38.
|
|
29
|
-
cuenca_validations-2.1.38.
|
|
30
|
-
cuenca_validations-2.1.38.
|
|
27
|
+
cuenca_validations-2.1.38.dev2.dist-info/METADATA,sha256=iRAK0IQtrdsDQF4hqs8p9sUEr1Qw9IRkisXfZemj75Q,1600
|
|
28
|
+
cuenca_validations-2.1.38.dev2.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
|
|
29
|
+
cuenca_validations-2.1.38.dev2.dist-info/top_level.txt,sha256=4233xdOs2HtuT-GFRjcDcwK0IwdwvWdczOtk0fPB6Gw,25
|
|
30
|
+
cuenca_validations-2.1.38.dev2.dist-info/RECORD,,
|
tests/test_types.py
CHANGED
|
@@ -732,6 +732,10 @@ def test_fraud_funds_transfer_request(data, expected_dump):
|
|
|
732
732
|
dict(user_id='US123', bank_code='40012', tipo_pago=1),
|
|
733
733
|
'Input should be 7, 23 or 24',
|
|
734
734
|
),
|
|
735
|
+
(
|
|
736
|
+
dict(user_id='US123', bank_code='99999', tipo_pago=7),
|
|
737
|
+
'Not a valid bank code',
|
|
738
|
+
),
|
|
735
739
|
],
|
|
736
740
|
)
|
|
737
741
|
def test_fraud_funds_transfer_request_invalid(data, expected_error):
|
|
File without changes
|
|
File without changes
|
{cuenca_validations-2.1.38.dev1.dist-info → cuenca_validations-2.1.38.dev2.dist-info}/top_level.txt
RENAMED
|
File without changes
|