Merge remote-tracking branch 'origin/main' into jps/m7-fix
Browse files- app/integrations/facturacion.py +13 -7
- app/integrations/monitoreo.py +14 -6
- app/integrations/rabbit_consumer.py +21 -3
- app/routers/webhooks.py +49 -6
- tests/test_core_events.py +6 -6
app/integrations/facturacion.py
CHANGED
|
@@ -62,9 +62,6 @@ def notify_cama_lista(cama: Cama, db: Client) -> bool:
|
|
| 62 |
"idPacienteExterno": paciente_id,
|
| 63 |
"timestampEvento": _iso_z(datetime.now(timezone.utc)),
|
| 64 |
}
|
| 65 |
-
ok_rest = _post(
|
| 66 |
-
f"{settings.m7_facturacion_url}/api/v1/webhooks/internacion/cama-lista", payload_rest
|
| 67 |
-
) is not None
|
| 68 |
|
| 69 |
# Payload del evento del Core: exactamente el contrato que confirmó M7 por escrito
|
| 70 |
# (`M7_integration.md`) y que documenta `M6_DISEÑO.md` §7.2 — sin campos extra
|
|
@@ -80,7 +77,16 @@ def notify_cama_lista(cama: Cama, db: Client) -> bool:
|
|
| 80 |
"tipoAlta": cama.alta_tipo,
|
| 81 |
"timestampEvento": _iso_z(datetime.now(timezone.utc)),
|
| 82 |
}
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 62 |
"idPacienteExterno": paciente_id,
|
| 63 |
"timestampEvento": _iso_z(datetime.now(timezone.utc)),
|
| 64 |
}
|
|
|
|
|
|
|
|
|
|
| 65 |
|
| 66 |
# Payload del evento del Core: exactamente el contrato que confirmó M7 por escrito
|
| 67 |
# (`M7_integration.md`) y que documenta `M6_DISEÑO.md` §7.2 — sin campos extra
|
|
|
|
| 77 |
"tipoAlta": cama.alta_tipo,
|
| 78 |
"timestampEvento": _iso_z(datetime.now(timezone.utc)),
|
| 79 |
}
|
| 80 |
+
|
| 81 |
+
# Canal primario: evento via M10 Core (si el event_type_id está configurado).
|
| 82 |
+
# Solo se cae al backup HTTP si el evento falla o no está configurado.
|
| 83 |
+
event_type_id = settings.facturacion_cama_lista_event_type_id
|
| 84 |
+
if event_type_id is not None:
|
| 85 |
+
ok_event = core_events.publish_event(event_type_id, payload_evento, publisher_module="modulo_6")
|
| 86 |
+
if ok_event:
|
| 87 |
+
return True
|
| 88 |
+
|
| 89 |
+
# Backup: REST directo a M7 (fallback/testing manual según M7_integration.md)
|
| 90 |
+
return _post(
|
| 91 |
+
f"{settings.m7_facturacion_url}/api/v1/webhooks/internacion/cama-lista", payload_rest
|
| 92 |
+
) is not None
|
app/integrations/monitoreo.py
CHANGED
|
@@ -21,11 +21,15 @@ def notify_alta(paciente_id: int) -> bool:
|
|
| 21 |
"paciente_id": paciente_id,
|
| 22 |
"timestamp": datetime.now(timezone.utc).isoformat(),
|
| 23 |
}
|
| 24 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
f"{settings.m9_monitoreo_url}/api/v1/webhooks/internacion/alta-monitoreo", payload
|
| 26 |
) is not None
|
| 27 |
-
core_events.publish_event(settings.monitoreo_alta_event_type_id, payload)
|
| 28 |
-
return ok_rest
|
| 29 |
|
| 30 |
|
| 31 |
def notify_baja(paciente_id: int) -> bool:
|
|
@@ -38,8 +42,12 @@ def notify_baja(paciente_id: int) -> bool:
|
|
| 38 |
"paciente_id": paciente_id,
|
| 39 |
"timestamp": datetime.now(timezone.utc).isoformat(),
|
| 40 |
}
|
| 41 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 42 |
f"{settings.m9_monitoreo_url}/api/v1/webhooks/internacion/baja-monitoreo", payload
|
| 43 |
) is not None
|
| 44 |
-
core_events.publish_event(settings.monitoreo_baja_event_type_id, payload)
|
| 45 |
-
return ok_rest
|
|
|
|
| 21 |
"paciente_id": paciente_id,
|
| 22 |
"timestamp": datetime.now(timezone.utc).isoformat(),
|
| 23 |
}
|
| 24 |
+
# Canal primario: evento via M10 Core. Backup HTTP si falla o no está configurado.
|
| 25 |
+
event_type_id = settings.monitoreo_alta_event_type_id
|
| 26 |
+
if event_type_id is not None:
|
| 27 |
+
ok_event = core_events.publish_event(event_type_id, payload)
|
| 28 |
+
if ok_event:
|
| 29 |
+
return True
|
| 30 |
+
return _post(
|
| 31 |
f"{settings.m9_monitoreo_url}/api/v1/webhooks/internacion/alta-monitoreo", payload
|
| 32 |
) is not None
|
|
|
|
|
|
|
| 33 |
|
| 34 |
|
| 35 |
def notify_baja(paciente_id: int) -> bool:
|
|
|
|
| 42 |
"paciente_id": paciente_id,
|
| 43 |
"timestamp": datetime.now(timezone.utc).isoformat(),
|
| 44 |
}
|
| 45 |
+
# Canal primario: evento via M10 Core. Backup HTTP si falla o no está configurado.
|
| 46 |
+
event_type_id = settings.monitoreo_baja_event_type_id
|
| 47 |
+
if event_type_id is not None:
|
| 48 |
+
ok_event = core_events.publish_event(event_type_id, payload)
|
| 49 |
+
if ok_event:
|
| 50 |
+
return True
|
| 51 |
+
return _post(
|
| 52 |
f"{settings.m9_monitoreo_url}/api/v1/webhooks/internacion/baja-monitoreo", payload
|
| 53 |
) is not None
|
|
|
|
|
|
app/integrations/rabbit_consumer.py
CHANGED
|
@@ -93,22 +93,40 @@ async def _on_message(message: aio_pika.abc.AbstractIncomingMessage) -> None:
|
|
| 93 |
payload = json.loads(envelope["payload"])
|
| 94 |
except (json.JSONDecodeError, KeyError, TypeError) as e:
|
| 95 |
logger.error(
|
| 96 |
-
"Mensaje malformado en %s
|
|
|
|
| 97 |
)
|
| 98 |
await message.reject(requeue=False)
|
| 99 |
return
|
| 100 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 101 |
try:
|
| 102 |
dispatch(event_type_name, payload)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 103 |
except Exception:
|
| 104 |
logger.exception(
|
| 105 |
-
"Error procesando %
|
| 106 |
-
event_type_name,
|
| 107 |
)
|
| 108 |
await message.reject(requeue=False)
|
| 109 |
return
|
| 110 |
|
| 111 |
await message.ack()
|
|
|
|
|
|
|
|
|
|
|
|
|
| 112 |
|
| 113 |
|
| 114 |
async def run_consumer() -> None:
|
|
|
|
| 93 |
payload = json.loads(envelope["payload"])
|
| 94 |
except (json.JSONDecodeError, KeyError, TypeError) as e:
|
| 95 |
logger.error(
|
| 96 |
+
"[M10→M6] Mensaje malformado en cola %s — se descarta sin procesar. Error: %s | body_preview=%r",
|
| 97 |
+
settings.internacion_requests_queue, e, message.body[:200],
|
| 98 |
)
|
| 99 |
await message.reject(requeue=False)
|
| 100 |
return
|
| 101 |
|
| 102 |
+
log_id = envelope.get("log_id")
|
| 103 |
+
logger.info(
|
| 104 |
+
"[M10→M6] Evento recibido: event_type=%r log_id=%s cola=%s",
|
| 105 |
+
event_type_name, log_id, settings.internacion_requests_queue,
|
| 106 |
+
)
|
| 107 |
+
|
| 108 |
try:
|
| 109 |
dispatch(event_type_name, payload)
|
| 110 |
+
except KeyError:
|
| 111 |
+
logger.error(
|
| 112 |
+
"[M10→M6] Evento desconocido: event_type=%r log_id=%s — se descarta (sin handler registrado)",
|
| 113 |
+
event_type_name, log_id,
|
| 114 |
+
)
|
| 115 |
+
await message.reject(requeue=False)
|
| 116 |
+
return
|
| 117 |
except Exception:
|
| 118 |
logger.exception(
|
| 119 |
+
"[M10→M6] Error procesando event_type=%r log_id=%s — se descarta (reject sin requeue)",
|
| 120 |
+
event_type_name, log_id,
|
| 121 |
)
|
| 122 |
await message.reject(requeue=False)
|
| 123 |
return
|
| 124 |
|
| 125 |
await message.ack()
|
| 126 |
+
logger.info(
|
| 127 |
+
"[M10→M6] Evento procesado OK: event_type=%r log_id=%s",
|
| 128 |
+
event_type_name, log_id,
|
| 129 |
+
)
|
| 130 |
|
| 131 |
|
| 132 |
async def run_consumer() -> None:
|
app/routers/webhooks.py
CHANGED
|
@@ -1,6 +1,8 @@
|
|
| 1 |
"""
|
| 2 |
Webhooks entrantes: recibe llamadas de M1 (HCE), M2 (Turnos) y M9 (Monitoreo).
|
| 3 |
"""
|
|
|
|
|
|
|
| 4 |
from fastapi import APIRouter, Depends, status
|
| 5 |
from fastapi.responses import JSONResponse
|
| 6 |
from supabase import Client
|
|
@@ -22,6 +24,8 @@ from app.schemas.reserva import (
|
|
| 22 |
)
|
| 23 |
from app.services import solicitud_service, cama_service
|
| 24 |
|
|
|
|
|
|
|
| 25 |
router = APIRouter(prefix="/webhooks", tags=["Webhooks Entrantes"])
|
| 26 |
router_turnos = APIRouter(tags=["Webhooks Entrantes"])
|
| 27 |
|
|
@@ -39,7 +43,13 @@ def recibir_solicitud(
|
|
| 39 |
db: Client = Depends(get_db),
|
| 40 |
user: dict = Depends(get_current_user),
|
| 41 |
):
|
| 42 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 43 |
return {
|
| 44 |
"mensaje": "Solicitud recibida y pendiente de aprobación",
|
| 45 |
"solicitud_id": sol.solicitud_id,
|
|
@@ -58,7 +68,13 @@ def recibir_alta_medica(
|
|
| 58 |
db: Client = Depends(get_db),
|
| 59 |
user: dict = Depends(get_current_user),
|
| 60 |
):
|
| 61 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 62 |
return {
|
| 63 |
"mensaje": "Alta médica procesada. Cama en limpieza.",
|
| 64 |
"cama_id": cama.id,
|
|
@@ -82,7 +98,12 @@ def recibir_cirugia_urgente(
|
|
| 82 |
db: Client = Depends(get_db),
|
| 83 |
user: dict = Depends(get_current_user),
|
| 84 |
):
|
| 85 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 86 |
resp_reserva = ReservaQuirofanoResponse.model_validate(reserva_urgente)
|
| 87 |
|
| 88 |
resp_desplazadas = [
|
|
@@ -111,6 +132,10 @@ def recibir_cirugia_urgente(
|
|
| 111 |
).model_dump(mode="json")
|
| 112 |
|
| 113 |
status_code = status.HTTP_201_CREATED if created else status.HTTP_200_OK
|
|
|
|
|
|
|
|
|
|
|
|
|
| 114 |
return JSONResponse(content=content, status_code=status_code)
|
| 115 |
|
| 116 |
|
|
@@ -128,7 +153,13 @@ def cancelar_reserva_quirofano(
|
|
| 128 |
db: Client = Depends(get_db),
|
| 129 |
user: dict = Depends(get_current_user),
|
| 130 |
):
|
| 131 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 132 |
return CancelacionQuirofanoResponse(
|
| 133 |
mensaje="Reserva de quirófano cancelada correctamente",
|
| 134 |
reserva_id=reserva.id,
|
|
@@ -151,7 +182,13 @@ def recibir_alerta_emergencia(
|
|
| 151 |
db: Client = Depends(get_db),
|
| 152 |
user: dict = Depends(get_current_user),
|
| 153 |
):
|
| 154 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 155 |
return {
|
| 156 |
"mensaje": f"Alerta registrada. Cama {cama.id} en CODIGO_ROJO.",
|
| 157 |
"cama_id": cama.id,
|
|
@@ -170,7 +207,13 @@ def recibir_alerta_resuelta(
|
|
| 170 |
db: Client = Depends(get_db),
|
| 171 |
user: dict = Depends(get_current_user),
|
| 172 |
):
|
| 173 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 174 |
return {
|
| 175 |
"mensaje": f"Alerta resuelta. Cama {cama.id} volvió a estado OCUPADA.",
|
| 176 |
"cama_id": cama.id,
|
|
|
|
| 1 |
"""
|
| 2 |
Webhooks entrantes: recibe llamadas de M1 (HCE), M2 (Turnos) y M9 (Monitoreo).
|
| 3 |
"""
|
| 4 |
+
import logging
|
| 5 |
+
|
| 6 |
from fastapi import APIRouter, Depends, status
|
| 7 |
from fastapi.responses import JSONResponse
|
| 8 |
from supabase import Client
|
|
|
|
| 24 |
)
|
| 25 |
from app.services import solicitud_service, cama_service
|
| 26 |
|
| 27 |
+
logger = logging.getLogger(__name__)
|
| 28 |
+
|
| 29 |
router = APIRouter(prefix="/webhooks", tags=["Webhooks Entrantes"])
|
| 30 |
router_turnos = APIRouter(tags=["Webhooks Entrantes"])
|
| 31 |
|
|
|
|
| 43 |
db: Client = Depends(get_db),
|
| 44 |
user: dict = Depends(get_current_user),
|
| 45 |
):
|
| 46 |
+
logger.info("[M1→M6] Webhook solicitud recibida: paciente_id=%s solicitud_hce_id=%s", data.paciente_id, data.solicitud_hce_id)
|
| 47 |
+
try:
|
| 48 |
+
sol = solicitud_service.recibir_solicitud(db, data)
|
| 49 |
+
except Exception:
|
| 50 |
+
logger.exception("[M1→M6] Error procesando solicitud: paciente_id=%s solicitud_hce_id=%s", data.paciente_id, data.solicitud_hce_id)
|
| 51 |
+
raise
|
| 52 |
+
logger.info("[M1→M6] Solicitud procesada OK: solicitud_id=%s estado=%s", sol.solicitud_id, sol.estado)
|
| 53 |
return {
|
| 54 |
"mensaje": "Solicitud recibida y pendiente de aprobación",
|
| 55 |
"solicitud_id": sol.solicitud_id,
|
|
|
|
| 68 |
db: Client = Depends(get_db),
|
| 69 |
user: dict = Depends(get_current_user),
|
| 70 |
):
|
| 71 |
+
logger.info("[M1→M6] Webhook alta médica recibida: paciente_id=%s", data.paciente_id)
|
| 72 |
+
try:
|
| 73 |
+
cama = solicitud_service.procesar_alta_medica(db, data)
|
| 74 |
+
except Exception:
|
| 75 |
+
logger.exception("[M1→M6] Error procesando alta médica: paciente_id=%s", data.paciente_id)
|
| 76 |
+
raise
|
| 77 |
+
logger.info("[M1→M6] Alta médica procesada OK: cama_id=%s estado=%s", cama.id, cama.estado)
|
| 78 |
return {
|
| 79 |
"mensaje": "Alta médica procesada. Cama en limpieza.",
|
| 80 |
"cama_id": cama.id,
|
|
|
|
| 98 |
db: Client = Depends(get_db),
|
| 99 |
user: dict = Depends(get_current_user),
|
| 100 |
):
|
| 101 |
+
logger.info("[M1→M6] Webhook cirugía urgente recibida: solicitud_hce_id=%s", data.solicitud_urgencia_hce_id)
|
| 102 |
+
try:
|
| 103 |
+
reserva_urgente, reservas_desplazadas, created = cama_service.crear_reserva_urgente(db, data)
|
| 104 |
+
except Exception:
|
| 105 |
+
logger.exception("[M1→M6] Error procesando cirugía urgente: solicitud_hce_id=%s", data.solicitud_urgencia_hce_id)
|
| 106 |
+
raise
|
| 107 |
resp_reserva = ReservaQuirofanoResponse.model_validate(reserva_urgente)
|
| 108 |
|
| 109 |
resp_desplazadas = [
|
|
|
|
| 132 |
).model_dump(mode="json")
|
| 133 |
|
| 134 |
status_code = status.HTTP_201_CREATED if created else status.HTTP_200_OK
|
| 135 |
+
logger.info(
|
| 136 |
+
"[M1→M6] Cirugía urgente procesada OK: solicitud_hce_id=%s created=%s desplazadas=%d status=%d",
|
| 137 |
+
data.solicitud_urgencia_hce_id, created, len(resp_desplazadas), status_code,
|
| 138 |
+
)
|
| 139 |
return JSONResponse(content=content, status_code=status_code)
|
| 140 |
|
| 141 |
|
|
|
|
| 153 |
db: Client = Depends(get_db),
|
| 154 |
user: dict = Depends(get_current_user),
|
| 155 |
):
|
| 156 |
+
logger.info("[M2→M6] Webhook cancelación quirófano recibida: turno_id=%s motivo=%r", turno_id, data.motivo)
|
| 157 |
+
try:
|
| 158 |
+
reserva = solicitud_service.cancelar_reserva_por_turno(db, turno_id, data.motivo)
|
| 159 |
+
except Exception:
|
| 160 |
+
logger.exception("[M2→M6] Error procesando cancelación quirófano: turno_id=%s", turno_id)
|
| 161 |
+
raise
|
| 162 |
+
logger.info("[M2→M6] Cancelación quirófano procesada OK: reserva_id=%s cama_id=%s estado=%s", reserva.id, reserva.cama_id, reserva.estado)
|
| 163 |
return CancelacionQuirofanoResponse(
|
| 164 |
mensaje="Reserva de quirófano cancelada correctamente",
|
| 165 |
reserva_id=reserva.id,
|
|
|
|
| 182 |
db: Client = Depends(get_db),
|
| 183 |
user: dict = Depends(get_current_user),
|
| 184 |
):
|
| 185 |
+
logger.info("[M9→M6] Webhook alerta emergencia recibida: paciente_id=%s", data.paciente_id)
|
| 186 |
+
try:
|
| 187 |
+
cama = solicitud_service.procesar_alerta_emergencia(db, data.paciente_id)
|
| 188 |
+
except Exception:
|
| 189 |
+
logger.exception("[M9→M6] Error procesando alerta emergencia: paciente_id=%s", data.paciente_id)
|
| 190 |
+
raise
|
| 191 |
+
logger.info("[M9→M6] Alerta emergencia procesada OK: cama_id=%s sector=%s → CODIGO_ROJO", cama.id, cama.sector)
|
| 192 |
return {
|
| 193 |
"mensaje": f"Alerta registrada. Cama {cama.id} en CODIGO_ROJO.",
|
| 194 |
"cama_id": cama.id,
|
|
|
|
| 207 |
db: Client = Depends(get_db),
|
| 208 |
user: dict = Depends(get_current_user),
|
| 209 |
):
|
| 210 |
+
logger.info("[M9→M6] Webhook alerta resuelta recibida: paciente_id=%s", data.paciente_id)
|
| 211 |
+
try:
|
| 212 |
+
cama = solicitud_service.procesar_alerta_resuelta(db, data.paciente_id)
|
| 213 |
+
except Exception:
|
| 214 |
+
logger.exception("[M9→M6] Error procesando alerta resuelta: paciente_id=%s", data.paciente_id)
|
| 215 |
+
raise
|
| 216 |
+
logger.info("[M9→M6] Alerta resuelta procesada OK: cama_id=%s CODIGO_ROJO → %s", cama.id, cama.estado)
|
| 217 |
return {
|
| 218 |
"mensaje": f"Alerta resuelta. Cama {cama.id} volvió a estado OCUPADA.",
|
| 219 |
"cama_id": cama.id,
|
tests/test_core_events.py
CHANGED
|
@@ -81,7 +81,8 @@ def test_notify_resultado_solicitud_sigue_llamando_rest_igual_que_antes(monkeypa
|
|
| 81 |
assert event_payload["solicitud_hce_id"] == "HCE-SOL-1"
|
| 82 |
|
| 83 |
|
| 84 |
-
def
|
|
|
|
| 85 |
monkeypatch.setattr(settings, "mock_external_services", False)
|
| 86 |
monkeypatch.setattr(settings, "monitoreo_alta_event_type_id", None)
|
| 87 |
rest_calls = []
|
|
@@ -99,11 +100,11 @@ def test_notify_alta_sigue_llamando_rest_igual_que_antes(monkeypatch):
|
|
| 99 |
|
| 100 |
assert ok is True
|
| 101 |
assert len(rest_calls) == 1
|
| 102 |
-
assert len(publish_calls) ==
|
| 103 |
-
assert publish_calls[0][0] is None
|
| 104 |
|
| 105 |
|
| 106 |
-
def
|
|
|
|
| 107 |
monkeypatch.setattr(settings, "mock_external_services", False)
|
| 108 |
monkeypatch.setattr(settings, "monitoreo_baja_event_type_id", None)
|
| 109 |
rest_calls = []
|
|
@@ -121,8 +122,7 @@ def test_notify_baja_sigue_llamando_rest_igual_que_antes(monkeypatch):
|
|
| 121 |
|
| 122 |
assert ok is True
|
| 123 |
assert len(rest_calls) == 1
|
| 124 |
-
assert len(publish_calls) ==
|
| 125 |
-
assert publish_calls[0][0] is None
|
| 126 |
|
| 127 |
|
| 128 |
def test_notify_cama_lista_sigue_llamando_rest_con_payload_minimo(monkeypatch):
|
|
|
|
| 81 |
assert event_payload["solicitud_hce_id"] == "HCE-SOL-1"
|
| 82 |
|
| 83 |
|
| 84 |
+
def test_notify_alta_sin_event_type_id_usa_rest_como_backup(monkeypatch):
|
| 85 |
+
"""Cuando monitoreo_alta_event_type_id es None, va directo al HTTP sin llamar publish_event."""
|
| 86 |
monkeypatch.setattr(settings, "mock_external_services", False)
|
| 87 |
monkeypatch.setattr(settings, "monitoreo_alta_event_type_id", None)
|
| 88 |
rest_calls = []
|
|
|
|
| 100 |
|
| 101 |
assert ok is True
|
| 102 |
assert len(rest_calls) == 1
|
| 103 |
+
assert len(publish_calls) == 0 # no se llama publish_event cuando event_type_id es None
|
|
|
|
| 104 |
|
| 105 |
|
| 106 |
+
def test_notify_baja_sin_event_type_id_usa_rest_como_backup(monkeypatch):
|
| 107 |
+
"""Cuando monitoreo_baja_event_type_id es None, va directo al HTTP sin llamar publish_event."""
|
| 108 |
monkeypatch.setattr(settings, "mock_external_services", False)
|
| 109 |
monkeypatch.setattr(settings, "monitoreo_baja_event_type_id", None)
|
| 110 |
rest_calls = []
|
|
|
|
| 122 |
|
| 123 |
assert ok is True
|
| 124 |
assert len(rest_calls) == 1
|
| 125 |
+
assert len(publish_calls) == 0 # no se llama publish_event cuando event_type_id es None
|
|
|
|
| 126 |
|
| 127 |
|
| 128 |
def test_notify_cama_lista_sigue_llamando_rest_con_payload_minimo(monkeypatch):
|