# 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:
    public_directory: '%kernel.project_dir%/public'
    uploads_directory: '%public_directory%'

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.

        bind:               # makes $publicPath available to all services
            $publicPath: '%public_directory%'
            $uploadPath: ''
            $defaultSender:  '%env(MAILER_DEFAULT_SENDER)%'
            $sms_base_url: '%env(SMS_BASE_URL)%'
            $sms_api_key: '%env(SMS_API_KEY)%'
            $sms_sender: '%env(SMS_SENDER)%'
            $send_sms_enabled: '%env(bool:SEND_SMS_ENABLED)%'
            $send_email_enabled: '%env(bool:SEND_EMAIL_ENABLED)%'
            $send_sms_to_externe: '%env(bool:SEND_SMS_TO_EXTERNE)%'
            $sms_externe_list: '%env(json:SMS_EXTERNE_LIST)%'

    # 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/'
        exclude:
            - '../src/DependencyInjection/'
            - '../src/Entity/'
            - '../src/Kernel.php'


    # add more service definitions when explicit configuration is needed
    # please note that last definitions always *replace* previous ones
   
    App\State\UserPasswordHasher:
        bind:
            $processor: '@api_platform.doctrine.orm.state.persist_processor'

    App\EventListener\OperationStatusChangeListener:
        tags:
            - { name: doctrine.event_listener, event: preUpdate }
    
    App\Security\CustomUserProvider:

    App\Processor\AmountProcessor:
        tags: ['api_platform.processor']

    App\EventListener\SecurityHeadersListener:
        tags:
            - { name: kernel.event_listener, event: kernel.response, method: onKernelResponse } # Ajout de l'écouteur de réponse
