Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

filter invalid deposits #428

Merged
merged 2 commits into from
Nov 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion speid/tasks/transactions.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,13 @@ def apply_missing_deposits(fecha_operacion: dt.date) -> List[str]:
tipo=TipoTransaccion.deposito, fecha_operacion=fecha_operacion
)
claves = {t.clave_rastreo for t in transactions}
missing = [d for d in stp_deposits if d.claveRastreo not in claves]
missing = [
d
for d in stp_deposits
if d.claveRastreo not in claves
and d.tipoPago not in REFUNDS_PAYMENTS_TYPES
and d.estado in STP_VALID_DEPOSITS_STATUSES
]
for orden in missing:
apply_stp_deposit(orden.claveRastreo, fecha_operacion)
return [m.claveRastreo for m in missing]
82 changes: 0 additions & 82 deletions tests/tasks/cassettes/test_task_apply_missing_deposits.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,88 +48,6 @@ interactions:
status:
code: 200
message: OK
- request:
body: '{"empresa": "TAMIZI", "claveRastreo": "PruebaDevolucion1", "tipoOrden":
"R", "fechaOperacion": "20231106", "firma": "UosxA4L6RMJ8UevJw7mYleOCYd+rTKiTRaCv07cbyVnVu0JWBjGuDwaFyTEc3rQzK0VDZrcZEmqhL1d4iuK/tdrd0zmdEpT8HbDGM+frs6KBmVrqYxHDAJZ9FBn/698lHl99aB0BAu46EFoH7nzVqRNj2prAYRRiUfIJbPBB350="}'
headers:
Accept:
- '*/*'
Accept-Encoding:
- gzip, deflate
Connection:
- keep-alive
Content-Length:
- '291'
Content-Type:
- application/json
User-Agent:
- stpmex-python/3.14.0.dev3
method: POST
uri: https://efws-dev.stpmex.com/efws/API/consultaOrden
response:
body:
string: '{"estado":0,"mensaje":"Datos consultados correctamente","respuesta":{"idEF":14643667,"claveRastreo":"PruebaDevolucion1","conceptoPago":"Pago
de prueba","cuentaBeneficiario":"646180157018877012","cuentaOrdenante":"646180117200000019","empresa":"TAMIZI","estado":"TCL","fechaOperacion":20231106,"institucionContraparte":90646,"institucionOperante":90646,"medioEntrega":3,"monto":0.01,"nombreBeneficiario":"Beneficiario","nombreOrdenante":"AXEL
SERNA MANRIQUEZ","nombreCep":null,"rfcCep":"TCU200828RX8","sello":null,"rfcCurpBeneficiario":"ND","referenciaNumerica":1234567,"rfcCurpOrdenante":"HESJ871014NZ5","tipoCuentaBeneficiario":40,"tipoCuentaOrdenante":40,"tipoPago":1,"tsCaptura":1699305268142,"tsLiquidacion":1699305273297,"causaDevolucion":16,"urlCEP":null}}'
headers:
Connection:
- keep-alive
Content-Type:
- application/json
Date:
- Mon, 06 Nov 2023 21:44:37 GMT
Server:
- nginx
Transfer-Encoding:
- chunked
Vary:
- Origin
- Access-Control-Request-Method
- Access-Control-Request-Headers
status:
code: 200
message: OK
- request:
body: '{"empresa": "TAMIZI", "claveRastreo": "PruebaDevolucion2", "tipoOrden":
"R", "fechaOperacion": "20231106", "firma": "UbTfWtykquA0ZkoP43h1w7GyexHAQb73l0DGXieule7GkhkKH5qUcKTHbpXcMT9Cp8BAhCowmcqFjqWsPdc96bLuqf6/6i4yF1bP+UOqGdS8V/8Pf3A99daB5nRz2uShYeymxW5wtwsz2SLRxEZqSySnW0W7jwsfOu1qPVOFT/4="}'
headers:
Accept:
- '*/*'
Accept-Encoding:
- gzip, deflate
Connection:
- keep-alive
Content-Length:
- '291'
Content-Type:
- application/json
User-Agent:
- stpmex-python/3.14.0.dev3
method: POST
uri: https://efws-dev.stpmex.com/efws/API/consultaOrden
response:
body:
string: '{"estado":0,"mensaje":"Datos consultados correctamente","respuesta":{"idEF":14643668,"claveRastreo":"PruebaDevolucion2","conceptoPago":"Pago
de prueba","cuentaBeneficiario":"646180157018877012","cuentaOrdenante":"646180117200000019","empresa":"TAMIZI","estado":"TCL","fechaOperacion":20231106,"institucionContraparte":90646,"institucionOperante":90646,"medioEntrega":3,"monto":10.00,"nombreBeneficiario":"Beneficiario","nombreOrdenante":"AXEL
SERNA MANRIQUEZ","nombreCep":null,"rfcCep":"TCU200828RX8","sello":null,"rfcCurpBeneficiario":"ND","referenciaNumerica":1234567,"rfcCurpOrdenante":"HESJ871014NZ5","tipoCuentaBeneficiario":40,"tipoCuentaOrdenante":40,"tipoPago":1,"tsCaptura":1699305322440,"tsLiquidacion":1699305329288,"causaDevolucion":16,"urlCEP":null}}'
headers:
Connection:
- keep-alive
Content-Type:
- application/json
Date:
- Mon, 06 Nov 2023 21:44:38 GMT
Server:
- nginx
Transfer-Encoding:
- chunked
Vary:
- Origin
- Access-Control-Request-Method
- Access-Control-Request-Headers
status:
code: 200
message: OK
- request:
body: '{"empresa": "TAMIZI", "claveRastreo": "PruebaLiquidacion", "tipoOrden":
"R", "fechaOperacion": "20231106", "firma": "FsSYICoZcp7K5dzh/ZHCYKY4Yhww7xuXcR26A49gl2Ts9eEsu5zinhE8d5D4vv/QW4sErCGQaqSh/E0P2FyrFc31onu/MOlfNMScpQNqpqdyDtOtgSWPiUAnZzJa4FCchEee7ipXXcjrLmYYqMNQ2cxtAjJCRLyj3xh0AwY+OnA="}'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,88 +87,6 @@ interactions:
status:
code: 200
message: OK
- request:
body: '{"empresa": "TAMIZI", "claveRastreo": "PruebaDevolucion1", "tipoOrden":
"R", "fechaOperacion": "20231106", "firma": "UosxA4L6RMJ8UevJw7mYleOCYd+rTKiTRaCv07cbyVnVu0JWBjGuDwaFyTEc3rQzK0VDZrcZEmqhL1d4iuK/tdrd0zmdEpT8HbDGM+frs6KBmVrqYxHDAJZ9FBn/698lHl99aB0BAu46EFoH7nzVqRNj2prAYRRiUfIJbPBB350="}'
headers:
Accept:
- '*/*'
Accept-Encoding:
- gzip, deflate
Connection:
- keep-alive
Content-Length:
- '291'
Content-Type:
- application/json
User-Agent:
- stpmex-python/3.14.0.dev3
method: POST
uri: https://efws-dev.stpmex.com/efws/API/consultaOrden
response:
body:
string: '{"estado":0,"mensaje":"Datos consultados correctamente","respuesta":{"idEF":14643667,"claveRastreo":"PruebaDevolucion1","conceptoPago":"Pago
de prueba","cuentaBeneficiario":"646180157018877012","cuentaOrdenante":"646180117200000019","empresa":"TAMIZI","estado":"TCL","fechaOperacion":20231106,"institucionContraparte":90646,"institucionOperante":90646,"medioEntrega":3,"monto":0.01,"nombreBeneficiario":"Beneficiario","nombreOrdenante":"AXEL
SERNA MANRIQUEZ","nombreCep":null,"rfcCep":"TCU200828RX8","sello":null,"rfcCurpBeneficiario":"ND","referenciaNumerica":1234567,"rfcCurpOrdenante":"HESJ871014NZ5","tipoCuentaBeneficiario":40,"tipoCuentaOrdenante":40,"tipoPago":1,"tsCaptura":1699305268142,"tsLiquidacion":1699305273297,"causaDevolucion":16,"urlCEP":null}}'
headers:
Connection:
- keep-alive
Content-Type:
- application/json
Date:
- Tue, 07 Nov 2023 00:30:30 GMT
Server:
- nginx
Transfer-Encoding:
- chunked
Vary:
- Origin
- Access-Control-Request-Method
- Access-Control-Request-Headers
status:
code: 200
message: OK
- request:
body: '{"empresa": "TAMIZI", "claveRastreo": "PruebaDevolucion2", "tipoOrden":
"R", "fechaOperacion": "20231106", "firma": "UbTfWtykquA0ZkoP43h1w7GyexHAQb73l0DGXieule7GkhkKH5qUcKTHbpXcMT9Cp8BAhCowmcqFjqWsPdc96bLuqf6/6i4yF1bP+UOqGdS8V/8Pf3A99daB5nRz2uShYeymxW5wtwsz2SLRxEZqSySnW0W7jwsfOu1qPVOFT/4="}'
headers:
Accept:
- '*/*'
Accept-Encoding:
- gzip, deflate
Connection:
- keep-alive
Content-Length:
- '291'
Content-Type:
- application/json
User-Agent:
- stpmex-python/3.14.0.dev3
method: POST
uri: https://efws-dev.stpmex.com/efws/API/consultaOrden
response:
body:
string: '{"estado":0,"mensaje":"Datos consultados correctamente","respuesta":{"idEF":14643668,"claveRastreo":"PruebaDevolucion2","conceptoPago":"Pago
de prueba","cuentaBeneficiario":"646180157018877012","cuentaOrdenante":"646180117200000019","empresa":"TAMIZI","estado":"TCL","fechaOperacion":20231106,"institucionContraparte":90646,"institucionOperante":90646,"medioEntrega":3,"monto":10.00,"nombreBeneficiario":"Beneficiario","nombreOrdenante":"AXEL
SERNA MANRIQUEZ","nombreCep":null,"rfcCep":"TCU200828RX8","sello":null,"rfcCurpBeneficiario":"ND","referenciaNumerica":1234567,"rfcCurpOrdenante":"HESJ871014NZ5","tipoCuentaBeneficiario":40,"tipoCuentaOrdenante":40,"tipoPago":1,"tsCaptura":1699305322440,"tsLiquidacion":1699305329288,"causaDevolucion":16,"urlCEP":null}}'
headers:
Connection:
- keep-alive
Content-Type:
- application/json
Date:
- Tue, 07 Nov 2023 00:30:31 GMT
Server:
- nginx
Transfer-Encoding:
- chunked
Vary:
- Origin
- Access-Control-Request-Method
- Access-Control-Request-Headers
status:
code: 200
message: OK
- request:
body: '{"empresa": "TAMIZI", "claveRastreo": "PruebaLiquidacion", "tipoOrden":
"R", "fechaOperacion": "20231106", "firma": "FsSYICoZcp7K5dzh/ZHCYKY4Yhww7xuXcR26A49gl2Ts9eEsu5zinhE8d5D4vv/QW4sErCGQaqSh/E0P2FyrFc31onu/MOlfNMScpQNqpqdyDtOtgSWPiUAnZzJa4FCchEee7ipXXcjrLmYYqMNQ2cxtAjJCRLyj3xh0AwY+OnA="}'
Expand Down
Loading