mirror of
https://github.com/koloideal/DutyLog.git
synced 2026-06-10 10:25:29 +03:00
update
This commit is contained in:
@@ -8,6 +8,9 @@ from dutylog.infrastructure.database.dao.users_dao import UsersDAO
|
||||
from dutylog.infrastructure.database.dao.hours_transactions_dao import (
|
||||
HoursTransactionsDAO,
|
||||
)
|
||||
from dutylog.infrastructure.database.dao.room_hours_transactions_dao import (
|
||||
RoomHoursTransactionsDAO,
|
||||
)
|
||||
from dutylog.infrastructure.database.dao.rooms_dao import RoomsDAO
|
||||
from dutylog.infrastructure.database.dao.residents_dao import ResidentsDAO
|
||||
from dutylog.infrastructure.database.dao.floors_dao import FloorsDAO
|
||||
@@ -20,6 +23,9 @@ from dutylog.infrastructure.database.repositories.users_repository import (
|
||||
from dutylog.infrastructure.database.repositories.hours_transactions_repository import (
|
||||
HoursTransactionsRepository,
|
||||
)
|
||||
from dutylog.infrastructure.database.repositories.room_hours_transactions_repository import (
|
||||
RoomHoursTransactionsRepository,
|
||||
)
|
||||
from dutylog.infrastructure.database.repositories.rooms_repository import (
|
||||
RoomsRepository,
|
||||
)
|
||||
@@ -70,6 +76,10 @@ class DAOProvider(Provider):
|
||||
def get_hours_transactions_dao(self, session: AsyncSession) -> HoursTransactionsDAO:
|
||||
return HoursTransactionsDAO(session)
|
||||
|
||||
@provide(scope=Scope.REQUEST)
|
||||
def get_room_hours_transactions_dao(self, session: AsyncSession) -> RoomHoursTransactionsDAO:
|
||||
return RoomHoursTransactionsDAO(session)
|
||||
|
||||
@provide(scope=Scope.REQUEST)
|
||||
def get_rooms_dao(self, session: AsyncSession) -> RoomsDAO:
|
||||
return RoomsDAO(session)
|
||||
@@ -100,6 +110,14 @@ class RepositoryProvider(Provider):
|
||||
) -> HoursTransactionsRepository:
|
||||
return HoursTransactionsRepository(transactions_dao, residents_dao)
|
||||
|
||||
@provide(scope=Scope.REQUEST)
|
||||
def get_room_hours_transactions_repository(
|
||||
self,
|
||||
transactions_dao: RoomHoursTransactionsDAO,
|
||||
rooms_dao: RoomsDAO,
|
||||
) -> RoomHoursTransactionsRepository:
|
||||
return RoomHoursTransactionsRepository(transactions_dao, rooms_dao)
|
||||
|
||||
@provide(scope=Scope.REQUEST)
|
||||
def get_rooms_repository(self, rooms_dao: RoomsDAO) -> RoomsRepository:
|
||||
return RoomsRepository(rooms_dao)
|
||||
|
||||
Reference in New Issue
Block a user