docs: contrato de API para P1 y P3
This commit is contained in:
33
API_CONTRACT.md
Normal file
33
API_CONTRACT.md
Normal file
@@ -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 }
|
||||
Reference in New Issue
Block a user