refactor: add service layer architecture with Pydantic validation

- Add services layer (PartyService, ScheduleService, ProductService, ServiceCenterService)
- Add ServiceProvider for dependency injection
- Add Pydantic input validation on all MCP tools
- Add thread-safety to TrytonSettings with double-checked locking
- Update tests to mock ServiceProvider instead of direct client calls
- Add pydantic dependency
This commit is contained in:
2026-03-14 22:12:33 -05:00
parent 6154b83455
commit 861f5030f4
13 changed files with 545 additions and 199 deletions

View File

@@ -8,6 +8,7 @@ dependencies = [
"fastmcp[tasks]>=3.1.0",
"sabatron-tryton-rpc-client>=7.4.0",
"python-dotenv>=1.0.0",
"pydantic>=2.0.0",
]
[project.optional-dependencies]