Skip to content

refactor: DI/repository pattern and remove legacy UnitOfWork (#37)#142

Open
VECTORG99 wants to merge 1 commit into
mainfrom
feat/37-repository-pattern
Open

refactor: DI/repository pattern and remove legacy UnitOfWork (#37)#142
VECTORG99 wants to merge 1 commit into
mainfrom
feat/37-repository-pattern

Conversation

@VECTORG99

Copy link
Copy Markdown
Collaborator

DI / Repository Pattern (#37)

Changes

  • api/repositories.py (NEW) — SQL Repository base class + concrete GoalRepository, ProgressRepository, ContentRepository with automatic session management
  • api/services/embedding_service.py — Uses ContentRepository instead of direct session queries, accepts Session via dependency injection
  • api/services/goal_service.py — Uses GoalRepository, ProgressRepository for persistence
  • api/services/gamification_engine.py — Uses GoalRepository, ProgressRepository via constructor injection
  • api/services/github_service.py — Makes AsyncSession explicit (session: AsyncSession = Depends(get_session))
  • api/services/skill_tree.py — Uses ContentRepository for DB access
  • api/services/tag_graph.py — Uses ContentRepository for DB access
  • api/services/personal_streak_service.py — Uses ContentRepository for DB access
  • api/services/unit_of_work.py (DELETED) — Legacy UoW replaced by explicit repo injection

Closes #37

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

refactor: Inversión de Dependencias (DI) y Patrón Repositorio en FastAPI

1 participant