Safety — Location Track + Device Alarms
Grouped Device
Safety — Location Track + Device Alarms
Returns GPS location history and device-scoped alarm log in a single response. Triggers two parallel Firestore reads (healthData history + alarms filtered by deviceId).
Replaces individual endpoint: /locationtrack
Adds: device-scoped alarm list (previously only available via the global /api/alarms endpoint).
Response shape:
{
"deviceId": "string",
"locationtrack": {
"deviceId": "string",
"date": "YYYY-MM-DD",
"tracks": [{ "lat": number, "lng": number, "time": "string" }],
"lastLocation": { "lat": number, "lng": number } | null
},
"alarms": [{ "id", "nickname", "deviceId", "type", "time", "location", "content" }]
}
Location sub-fields:
| Field | Type | Description |
|---|---|---|
tracks | array | GPS points — empty while location features are under development |
lastLocation | object|null | Most recent GPS fix, or null |
Alarm fields:
| Field | Type | Description |
|---|---|---|
id | string | Alarm document ID |
type | string | Not worn / Sleep / Heart rate warning |
time | string | Timestamp (IST, YYYY-MM-DD HH:mm:ss) |
content | string | Human-readable description |
GET
Safety — Location Track + Device Alarms