feat: pagination totals, request logging, data retention

Add shared paginate() helper with total count to all list endpoints.
Add request logging middleware (method, path, status, duration, IP).
Add data retention service with configurable thresholds and CLI command.
This commit is contained in:
user
2026-02-06 09:58:20 +01:00
parent 2456194332
commit c1f580ba16
14 changed files with 380 additions and 34 deletions

View File

@@ -8,7 +8,10 @@ def test_list_sensors_empty(client):
"""Test listing sensors when empty."""
response = client.get('/api/v1/sensors')
assert response.status_code == 200
assert response.json == {'sensors': []}
assert response.json['sensors'] == []
assert response.json['total'] == 0
assert response.json['limit'] == 100
assert response.json['offset'] == 0
def test_get_sensor_not_found(client):