diff --git a/API_CONTRACT.md b/API_CONTRACT.md new file mode 100644 index 0000000..2df13fe --- /dev/null +++ b/API_CONTRACT.md @@ -0,0 +1,33 @@ +# Notification Service — Contrato de API +Base URL: http://localhost:8001 + +## Para P1 (Backend) +### Avisar que el camión avanzó +POST /internal/position-update +Body: { "routeId": "RUTA-01", "positionId": 2 } +Respuesta: { "status": "ok", "routeId": "RUTA-01", "positionId": 2 } + +## Para P3 (App Android) +### Registrar token FCM del usuario +POST /fcm-token +Body: { "colonia": "Zona Centro", "token": "TOKEN_FCM_DEL_CELULAR" } +Respuesta: { "status": "ok" } + +### Consultar ETA de la ruta del usuario +GET /eta/RUTA-01 +Respuesta: +{ + "routeId": "RUTA-01", + "positionId": 3, + "eta_window": "06:38 – 07:00", + "message": "El camión llegará a tu zona entre las 06:38 y 07:00", + "minutes_approx": 13 +} + +## Para el demo +### Reiniciar todas las rutas +POST /internal/reset + +### Forzar trigger en vivo +POST /internal/demo +Body: { "routeId": "RUTA-01", "positionId": 4 } \ No newline at end of file