Introduce service/repository dependency protocols and tests

This commit is contained in:
2026-04-10 19:51:19 +02:00
parent 3b6e39ddad
commit 3371ff8324
8 changed files with 419 additions and 11 deletions

View File

@@ -48,6 +48,8 @@ Reference: `Docs/Refactoring.md` for full analysis of each issue.
- Issue: Routers and higher-level services currently import concrete service modules directly, which prevents clean substitution and dependency override testing.
- Propose: Define protocols or abstract base classes for major services and repositories, then wire concrete implementations through FastAPI dependency providers.
- Test: Add tests that override a service dependency with a fake implementation and verify the router behavior remains correct.
- Status: completed
- Completed: Added service/repository protocols, injected auth/jail services via FastAPI dependencies, and added router tests for dependency overrides.
7. Move operational orchestration out of routers and into service/task layer
- Goal: Keep routers thin and move operational control flow into service or task components.