Commit Graph

4 Commits

Author SHA1 Message Date
Luca Sacchi Ricciardi
a8095f4df7 feat(schemas): T35 add Pydantic public API schemas
- PublicStatsResponse: summary + period info
- PublicUsageResponse: paginated usage items
- PublicKeyInfo: key metadata with stats (no values!)
- ApiToken schemas: create, response, create-response
- 25 unit tests, 100% coverage
2026-04-07 16:15:22 +02:00
Luca Sacchi Ricciardi
0df1638da8 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
2026-04-07 15:04:49 +02:00
Luca Sacchi Ricciardi
2e4c1bb1e5 feat(schemas): T23 add Pydantic API key schemas
- Add ApiKeyCreate schema with OpenRouter key format validation
- Add ApiKeyUpdate schema for partial updates
- Add ApiKeyResponse schema (excludes key value for security)
- Add ApiKeyListResponse schema for pagination
- Export schemas from __init__.py
- 100% coverage on new module (23 tests)

Refs: T23
2026-04-07 14:28:03 +02:00
Luca Sacchi Ricciardi
02473bc39e feat(schemas): T17 add Pydantic auth schemas
Add authentication schemas for user registration and login:
- UserRegister: email, password (with strength validation), password_confirm
- UserLogin: email, password
- UserResponse: id, email, created_at, is_active (orm_mode=True)
- TokenResponse: access_token, token_type, expires_in
- TokenData: user_id, exp

Includes field validators for password strength and password confirmation matching.

Test coverage: 19 tests for all schemas
2026-04-07 13:52:33 +02:00