mirror of
https://github.com/koloideal/DutyLog.git
synced 2026-06-10 18:35:29 +03:00
update
This commit is contained in:
@@ -6,6 +6,8 @@ from sqlalchemy.ext.asyncio import AsyncEngine, AsyncSession, async_sessionmaker
|
||||
from dutylog.infrastructure.database.config import create_engine, create_session_maker
|
||||
from dutylog.infrastructure.database.dao.users_dao import UsersDAO
|
||||
from dutylog.infrastructure.database.dao.hours_transactions_dao import HoursTransactionsDAO
|
||||
from dutylog.infrastructure.database.repositories.users_repository import UsersRepository
|
||||
from dutylog.infrastructure.database.repositories.hours_transactions_repository import HoursTransactionsRepository
|
||||
from dutylog.infrastructure.utils.config import Config, load_config
|
||||
|
||||
|
||||
@@ -42,3 +44,18 @@ class DAOProvider(Provider):
|
||||
return HoursTransactionsDAO(session)
|
||||
|
||||
|
||||
class RepositoryProvider(Provider):
|
||||
@provide(scope=Scope.REQUEST)
|
||||
def get_users_repository(self, users_dao: UsersDAO) -> UsersRepository:
|
||||
return UsersRepository(users_dao)
|
||||
|
||||
@provide(scope=Scope.REQUEST)
|
||||
def get_hours_transactions_repository(
|
||||
self,
|
||||
transactions_dao: HoursTransactionsDAO,
|
||||
users_dao: UsersDAO,
|
||||
) -> HoursTransactionsRepository:
|
||||
return HoursTransactionsRepository(transactions_dao, users_dao)
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user