feat(schemas): T30 add Pydantic statistics schemas
Add comprehensive Pydantic schemas for statistics management: - UsageStatsCreate: input validation for creating usage stats - UsageStatsResponse: orm_mode response schema - StatsSummary: aggregated statistics with totals and averages - StatsByModel: per-model breakdown with percentages - StatsByDate: daily usage aggregation - DashboardResponse: complete dashboard data structure All schemas use Decimal for cost precision and proper validation. Test: 16 unit tests, 100% coverage on stats.py
This commit is contained in:
@@ -12,6 +12,14 @@ from openrouter_monitor.schemas.auth import (
|
||||
UserRegister,
|
||||
UserResponse,
|
||||
)
|
||||
from openrouter_monitor.schemas.stats import (
|
||||
DashboardResponse,
|
||||
StatsByDate,
|
||||
StatsByModel,
|
||||
StatsSummary,
|
||||
UsageStatsCreate,
|
||||
UsageStatsResponse,
|
||||
)
|
||||
|
||||
__all__ = [
|
||||
"UserRegister",
|
||||
@@ -23,4 +31,10 @@ __all__ = [
|
||||
"ApiKeyUpdate",
|
||||
"ApiKeyResponse",
|
||||
"ApiKeyListResponse",
|
||||
"UsageStatsCreate",
|
||||
"UsageStatsResponse",
|
||||
"StatsSummary",
|
||||
"StatsByModel",
|
||||
"StatsByDate",
|
||||
"DashboardResponse",
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user