Files
MediaManager/media_manager/notification/dependencies.py
maxDorninger 96cd9a4d01 format files
2025-07-01 18:00:54 +02:00

30 lines
784 B
Python

from typing import Annotated
from fastapi import Depends
from media_manager.database import DbSessionDependency
from media_manager.notification.repository import NotificationRepository
from media_manager.notification.service import NotificationService
def get_notification_repository(
db_session: DbSessionDependency,
) -> NotificationRepository:
return NotificationRepository(db_session)
notification_repository_dep = Annotated[
NotificationRepository, Depends(get_notification_repository)
]
def get_notification_service(
notification_repository: notification_repository_dep,
) -> NotificationService:
return NotificationService(notification_repository)
notification_service_dep = Annotated[
NotificationService, Depends(get_notification_service)
]