# This file is the entry point to configure your own services.
# Files in the packages/ subdirectory configure your dependencies.

# 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:
    profile_pictures_directory: '%kernel.project_dir%/public/uploads/profile_pictures'
    app_deep_link_url: '%env(default::APP_DEEP_LINK_URL)%'
    account_deletion_contact_email: '%env(default::ACCOUNT_DELETION_CONTACT_EMAIL)%'
    mailer_from_email: '%env(default::MAILER_FROM_EMAIL)%'
    microsoft_graph_tenant_id: '%env(default::MICROSOFT_GRAPH_TENANT_ID)%'
    microsoft_graph_client_id: '%env(default::MICROSOFT_GRAPH_CLIENT_ID)%'
    microsoft_graph_client_secret: '%env(default::MICROSOFT_GRAPH_CLIENT_SECRET)%'
    microsoft_graph_mailbox: '%env(default::MICROSOFT_GRAPH_MAILBOX)%'
    microsoft_graph_mailer_name: '%env(default::MICROSOFT_GRAPH_MAILER_NAME)%'

services:
    # 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/'

    Symfony\Component\Mailer\MailerInterface: '@App\Service\MicrosoftGraphMailer'

    App\Service\MicrosoftGraphMailer:
        arguments:
            $tenantId: '%microsoft_graph_tenant_id%'
            $clientId: '%microsoft_graph_client_id%'
            $clientSecret: '%microsoft_graph_client_secret%'
            $mailbox: '%microsoft_graph_mailbox%'
            $displayName: '%microsoft_graph_mailer_name%'
            $mailerLogger: '@monolog.logger.mailer'

    App\Command\TestMailCommand:
        arguments:
            $mailerFromEmail: '%mailer_from_email%'

    App\Controller\Admin\SystemController:
        arguments:
            $mailerFromEmail: '%mailer_from_email%'

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