From b24148e7a6b9036315cea2ee9a72e6bc50842080 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felipe=20L=C3=B3pez?= Date: Mon, 30 Oct 2023 14:10:09 -0600 Subject: [PATCH] rename validator property --- speid/tasks/transactions.py | 6 +++--- speid/validations/queries.py | 2 +- tests/tasks/test_transactions.py | 10 +++++----- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/speid/tasks/transactions.py b/speid/tasks/transactions.py index 212be7b1..c00937f8 100644 --- a/speid/tasks/transactions.py +++ b/speid/tasks/transactions.py @@ -160,9 +160,9 @@ def check_deposits_status(deposit: Dict) -> None: # Si no existe en los registros se obtiene de STP y se intenta con 3 fechas # operativas próximas a la fecha que el cliente nos proporcionó fechas_operacion = [ - get_next_business_day(req.fecha_deposito), - get_prior_business_day(req.fecha_deposito), - get_next_business_day(req.fecha_deposito + dt.timedelta(days=1)), + get_next_business_day(req.fecha_operacion), + get_prior_business_day(req.fecha_operacion), + get_next_business_day(req.fecha_operacion + dt.timedelta(days=1)), ] for fecha_operacion in fechas_operacion: diff --git a/speid/validations/queries.py b/speid/validations/queries.py index 2e20469d..66f16b0e 100644 --- a/speid/validations/queries.py +++ b/speid/validations/queries.py @@ -7,4 +7,4 @@ class DepositStatusQuery(BaseModel): clave_rastreo: str cuenta_beneficiario: Clabe - fecha_deposito: dt.date + fecha_operacion: dt.date diff --git a/tests/tasks/test_transactions.py b/tests/tasks/test_transactions.py index 6e70659b..5d8e5e68 100644 --- a/tests/tasks/test_transactions.py +++ b/tests/tasks/test_transactions.py @@ -420,14 +420,14 @@ def test_check_existing_deposit(mock_send_task) -> None: req = dict( clave_rastreo='Test162467872', cuenta_beneficiario='646180157018877012', - fecha_deposito='2023-08-28', + fecha_operacion='2023-08-28', ) check_deposits_status(req) transaction = Transaction.objects.get(clave_rastreo=req['clave_rastreo']) assert transaction assert transaction.cuenta_beneficiario == req['cuenta_beneficiario'] assert transaction.fecha_operacion.date() == dt.date.fromisoformat( - req['fecha_deposito'] + req['fecha_operacion'] ) assert transaction.estado is Estado.succeeded mock_send_task.assert_called_once() @@ -439,7 +439,7 @@ def test_check_not_existing_deposit(mock_send_task) -> None: req = dict( clave_rastreo='FOOBARBAZ', cuenta_beneficiario='646180157018877012', - fecha_deposito='2023-08-28', + fecha_operacion='2023-08-28', ) check_deposits_status(req) with pytest.raises(DoesNotExist): @@ -453,7 +453,7 @@ def test_check_refunded_deposit(mock_send_task): req = dict( clave_rastreo='Test162467872', cuenta_beneficiario='646180157018877012', - fecha_deposito='2023-08-28', + fecha_operacion='2023-08-28', ) check_deposits_status(req) with pytest.raises(DoesNotExist): @@ -476,7 +476,7 @@ def test_retry_incoming_transaction( req = dict( clave_rastreo=default_income_transaction['ClaveRastreo'], cuenta_beneficiario=default_income_transaction['CuentaBeneficiario'], - fecha_deposito=( + fecha_operacion=( f'{fecha_operacion[0:4]}-' f'{fecha_operacion[4:6]}-{fecha_operacion[6:]}' ),