feat(platform): promote alert events surface

This commit is contained in:
lingniu
2026-07-04 17:58:33 +08:00
parent eb8f15ca18
commit 1235e76c32
11 changed files with 135 additions and 70 deletions

View File

@@ -153,28 +153,33 @@ Returns daily mileage rows and aggregate mileage summary.
### Alert Events
Planned API surface:
Current API surface:
```http
GET /api/alerts/events?keyword=AG18312&severity=warning&status=open&limit=20&offset=0
GET /api/alerts/events/{id}
PATCH /api/alerts/events/{id}
GET /api/alerts/rules
GET /api/alerts/notifications?eventId=xxx&limit=20&offset=0
GET /api/alert-events?keyword=AG18312&protocol=JT808&issueType=NO_SOURCE&limit=20&offset=0
GET /api/alert-events/summary?keyword=AG18312&protocol=JT808&issueType=NO_SOURCE
GET /api/alert-events/notification-plan?keyword=AG18312&protocol=JT808&issueType=NO_SOURCE&limit=20
```
Alert records should be vehicle-first and evidence-backed. Each event should include vehicle identity, issue type, severity, protocol/source when relevant, trigger time, last seen time, current status, evidence links, trace ID if available, and notification state.
`/api/quality/issues`, `/api/quality/summary`, and `/api/quality/notification-plan` remain compatibility aliases. New UI and integrations should use `/api/alert-events*` so the API language matches the vehicle data management center.
Alert event rows are vehicle-first and evidence-backed. Each event includes vehicle identity, issue type, severity, protocol/source when relevant, last seen time, source endpoint, detail, and links generated by the BFF/UI to realtime, trajectory, RAW, mileage, vehicle detail, or notification rule evidence.
Initial alert types:
- `SOURCE_OFFLINE`
- `NO_REALTIME_UPDATE`
- `LOCATION_MISSING`
- `MILEAGE_DIVERGENT`
- `RAW_PARSE_FAILURE`
- `BINDING_MISSING`
- `SOURCE_TIME_DIVERGENT`
- `QUEUE_BACKLOG`
- `NO_SOURCE`
- `VIN_MISSING`
- `LINK_GAP`
- `FIELD_MISSING`
- `CAPACITY_RISK`
Future durable alert records should extend this surface with event IDs, manual status, assignee, acknowledgement, escalation state, and notification logs:
```http
GET /api/alert-events/{id}
PATCH /api/alert-events/{id}
GET /api/alert-events/{id}/notifications?limit=20&offset=0
```
### Online And Completeness Statistics