feat(devices): add ResetStatsRequest/ResetStatsResult models
Missed from the previous Reset Stats commit — these are the
request/response schemas for POST /devices/{id}/reset-stats.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -226,3 +226,39 @@ class DeviceUserInfo(BaseModel):
|
|||||||
class DeviceUsersResponse(BaseModel):
|
class DeviceUsersResponse(BaseModel):
|
||||||
users: List[DeviceUserInfo]
|
users: List[DeviceUserInfo]
|
||||||
total: int
|
total: int
|
||||||
|
|
||||||
|
|
||||||
|
class ResetStatsRequest(BaseModel):
|
||||||
|
"""Which categories of QA/bench test data to clear before shipping a
|
||||||
|
device to a customer. Each flag is independent — callers check only the
|
||||||
|
boxes they want. device_stats (Firestore) and current_alerts both default
|
||||||
|
to False since they need extra care (current_alerts especially — see
|
||||||
|
ResetStatsResult.current_alerts note)."""
|
||||||
|
bell_stats: bool = False # Firestore device_stats: totalHammerStrikes, perBellStrikes
|
||||||
|
playback_stats: bool = False # Firestore device_stats: totalPlaybacks, totalWarningsGiven
|
||||||
|
device_logs: bool = False # Postgres device_logs
|
||||||
|
heartbeats: bool = False # Postgres heartbeats
|
||||||
|
commands: bool = False # Postgres commands
|
||||||
|
boot_events: bool = False # Postgres device_boot_events (console-side history)
|
||||||
|
alert_history: bool = False # Postgres device_alert_events
|
||||||
|
ping_samples: bool = False # Postgres device_ping_samples
|
||||||
|
diagnostics_reports: bool = False # Postgres device_diagnostics_reports
|
||||||
|
reports: bool = False # Postgres device_reports (control/reports history, e.g. bell_overload)
|
||||||
|
current_alerts: bool = False # Postgres device_alerts (LIVE state — opt-in only)
|
||||||
|
|
||||||
|
|
||||||
|
class ResetStatsResult(BaseModel):
|
||||||
|
"""Per-category outcome. Postgres/Firestore categories always run
|
||||||
|
(device connectivity doesn't matter); counts are rows deleted, or null
|
||||||
|
for categories that weren't requested."""
|
||||||
|
bell_stats: Optional[bool] = None
|
||||||
|
playback_stats: Optional[bool] = None
|
||||||
|
device_logs: Optional[int] = None
|
||||||
|
heartbeats: Optional[int] = None
|
||||||
|
commands: Optional[int] = None
|
||||||
|
boot_events: Optional[int] = None
|
||||||
|
alert_history: Optional[int] = None
|
||||||
|
ping_samples: Optional[int] = None
|
||||||
|
diagnostics_reports: Optional[int] = None
|
||||||
|
reports: Optional[int] = None
|
||||||
|
current_alerts: Optional[int] = None
|
||||||
|
|||||||
Reference in New Issue
Block a user