from dishka import BaseScope, Provider, Scope, WithParents, provide, provide_all

from template_project.adapters.data_gateways.access_token import DefaultAccessTokenDataGateway
from template_project.adapters.data_gateways.auth_identity import DefaultAuthIdentityDataGateway
from template_project.adapters.data_gateways.key_skills import KeySkillsDataGateway
from template_project.adapters.data_gateways.notification_device import DefaultNotificationDeviceDataGateway
from template_project.adapters.data_gateways.profile import DefaultProfileDataGateway
from template_project.adapters.data_gateways.resume import (
    DefaultResumeDataGateway,
    DefaultResumeEducationDataGateway,
    DefaultResumeExperienceDataGateway,
    DefaultResumePredictionDataGateway,
    DefaultResumeProjectDataGateway,
)
from template_project.adapters.data_gateways.user import DefaultUserDataGateway
from template_project.adapters.data_gateways.vacancy import DefaultVacancyDataGateway
from template_project.adapters.unit_of_work import DefaultUnitOfWork


class DataGatewayProvider(Provider):
    scope: BaseScope | None = Scope.REQUEST

    unit_of_work = provide(WithParents[DefaultUnitOfWork])
    data_gateways = provide_all(
        KeySkillsDataGateway,
        WithParents[DefaultVacancyDataGateway],
        WithParents[DefaultUserDataGateway],
        WithParents[DefaultAccessTokenDataGateway],
        WithParents[DefaultAuthIdentityDataGateway],
        WithParents[DefaultProfileDataGateway],
        WithParents[DefaultNotificationDeviceDataGateway],
        WithParents[DefaultResumeDataGateway],
        WithParents[DefaultResumePredictionDataGateway],
        WithParents[DefaultResumeExperienceDataGateway],
        WithParents[DefaultResumeEducationDataGateway],
        WithParents[DefaultResumeProjectDataGateway],
    )
