fix(config): Add Pydantic validation and fix telegram config field mappings.

* Add Pydantic models for configuration validation in leggen/models/config.py
* Fix telegram config field aliases (api-key -> token, chat-id -> chat_id)
* Update config.py to use Pydantic validation with proper error handling
* Fix TOML serialization by excluding None values with exclude_none=True
* Update notification service to use correct telegram field names
* Enhance notification service with actual Discord/Telegram implementations
* Fix all failing configuration tests to work with Pydantic validation
* Add pydantic dependency to pyproject.toml

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Elisiário Couto
2025-09-14 20:28:18 +01:00
committed by Elisiário Couto
parent 990d0295b3
commit 2c6e099596
6 changed files with 236 additions and 26 deletions

2
uv.lock generated
View File

@@ -229,6 +229,7 @@ dependencies = [
{ name = "fastapi" },
{ name = "httpx" },
{ name = "loguru" },
{ name = "pydantic" },
{ name = "requests" },
{ name = "tabulate" },
{ name = "tomli-w" },
@@ -257,6 +258,7 @@ requires-dist = [
{ name = "fastapi", specifier = ">=0.104.0,<1" },
{ name = "httpx", specifier = ">=0.28.1" },
{ name = "loguru", specifier = ">=0.7.2,<0.8" },
{ name = "pydantic", specifier = ">=2.0.0,<3" },
{ name = "requests", specifier = ">=2.31.0,<3" },
{ name = "tabulate", specifier = ">=0.9.0,<0.10" },
{ name = "tomli-w", specifier = ">=1.0.0,<2" },