# yaml-language-server: $schema=../vendor/symfony/dependency-injection/Loader/schema/services.schema.json

# This file is the entry point to configure your own services.
# Files in the packages/ subdirectory configure your dependencies.
# See also https://symfony.com/doc/current/service_container/import.html

# Put parameters here that don't need to change on each machine where the app is deployed
# https://symfony.com/doc/current/best_practices.html#use-parameters-for-application-configuration
parameters:
    theme_name: 'default'
    app.name: 'Webberdoo Starter 2.0'
    app.version: '2.0.0'
    app.mobile_scheme: 'webberdoomobilestarter'
services:
    App\Contract\Account\UserAccountStoreInterface: '@App\Repository\UserRepository'
    App\Contract\Account\PendingEmailChangeStoreInterface: '@App\Repository\PendingEmailChangeRepository'
    App\Service\Account\EmailChangeEmailSenderInterface: '@App\Service\Account\EmailChangeEmailSender'
    App\Service\Account\PasswordResetEmailSenderInterface: '@App\Service\Account\PasswordResetEmailSender'
    App\Service\Security\VerificationEmailSenderInterface: '@App\Service\Security\VerificationEmailSender'
    App\Contract\Admin\EnabledAdministratorStoreInterface: '@App\Repository\UserRepository'
    App\Service\Admin\AdministratorSafetyInterface: '@App\Service\Admin\AdministratorSafetyService'
    App\Service\Settings\RegistrationSettingsProviderInterface: '@App\Service\Settings\SettingsProvider'
    App\Service\Settings\SettingsCacheInterface: '@App\Service\Settings\SettingsCache'
    App\Repository\ApplicationSettingStoreInterface: '@App\Repository\ApplicationSettingRepository'

    # default configuration for services in *this* file
    _defaults:
        autowire: true      # Automatically injects dependencies in your services.
        autoconfigure: true # Automatically registers your services as commands, event subscribers, etc.

    # makes classes in src/ available to be used as services
    # this creates a service per class whose id is the fully-qualified class name
    App\:
        resource: '../src/'

    App\Service\Platform\ApplicationMetadata:
        arguments:
            $version: '%app.version%'

    App\Service\Settings\SettingDefinitionRegistry:
        arguments:
            $fallbackSenderAddress: '%env(APP_MAIL_FROM_ADDRESS)%'
            $fallbackSenderName: '%env(APP_MAIL_FROM_NAME)%'

    App\Service\Settings\SecretSettingCipher:
        arguments:
            $kernelSecret: '%kernel.secret%'

    App\Service\Account\PasswordResetRequestService:
        arguments:
            $passwordResetLimiter: '@limiter.password_reset'

    App\Service\Account\EmailChangeLinkService:
        arguments:
            $secret: '%kernel.secret%'

    App\Service\Account\EmailChangeService:
        arguments:
            $emailChangeLimiter: '@limiter.email_change'
            $emailChangeResendLimiter: '@limiter.email_change_resend'
            $lifetime: '%env(int:APP_EMAIL_CHANGE_TTL)%'

    App\Controller\Security\VerificationController:
        arguments:
            $resendVerificationLimiter: '@limiter.resend_verification'
            $mobileAppScheme: '%app.mobile_scheme%'

    App\Security\Api\ApiTokenGenerator:
        arguments:
            $accessTokenTtl: '%env(int:APP_API_ACCESS_TOKEN_TTL)%'
            $refreshTokenTtl: '%env(int:APP_API_REFRESH_TOKEN_TTL)%'

    App\Service\Api\ApiRateLimiter:
        arguments:
            $apiLoginLimiter: '@limiter.api_login'
            $apiRefreshLimiter: '@limiter.api_refresh'

    App\Service\Sync\SyncRateLimiter:
        arguments:
            $syncPushLimiter: '@limiter.sync_push'
            $syncPullLimiter: '@limiter.sync_pull'

    App\Service\Installer\InstallationFinalizer:
        public: true



    # add more service definitions when explicit configuration is needed
    # please note that last definitions always *replace* previous ones
