# 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:
    pdf_files_directory: '%kernel.project_dir%/var/pdf_files'
    logos_directory: '%kernel.project_dir%/public/logos'
    upload_directory: '%kernel.project_dir%/public/uploads/invoices'
    temp_directory: '%kernel.project_dir%/public/uploads/temp'
    google_vision_credentials: '%env(GOOGLE_APPLICATION_CREDENTIALS)%'
    invoice_directory: '%kernel.project_dir%/public/uploads/invoices'

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/'
        exclude:
            - '../src/DependencyInjection/'
            - '../src/Entity/'
            - '../src/Kernel.php'
        
    App\Security\UserChecker:
        tags: ['security.user_checker']
        
    App\Service\GoogleMapsService:
        arguments:
            $client: '@Symfony\Contracts\HttpClient\HttpClientInterface'
            $distanceApiKey: '%env(GMAPS_API_KEY)%'
            $placesApiKey: '%env(GOOGLE_API_KEY)%'

    translation.loader.yaml:
        class: Symfony\Component\Translation\Loader\YamlFileLoader
        arguments: ['%kernel.project_dir%/translations']
        tags:
            - { name: translation.loader, alias: translation.loader.yaml }

    App\Service\ImportPDFService:
        arguments:
            $entityManager: '@doctrine.orm.entity_manager'
            $params: '@parameter_bag'
        
    App\Service\OpenAiService:
        arguments:
            $client: '@Symfony\Contracts\HttpClient\HttpClientInterface'
            $facturApiKey: '%env(OPENAI_API_KEY)%'  # Le bon nom de variable d'environnement

    App\Service\GoogleVisionService:
        arguments:
            $credentialsPath: '%google_vision_credentials%'
            
    App\Twig\CustomExtension:
        tags: [twig.extension]
    # add more service definitions when explicit configuration is needed
    # please note that last definitions always *replace* previous ones
    App\Entity\Salarie: ~

    App\Entity\VehiculeEntreprise:
        autowire: true
        autoconfigure: true

    App\Command\:
        resource: '../src/Command'
        tags: ['console.command']

    App\Service\ImapService:
        arguments:
            $imapDsn: '%env(IMAP_DSN)%'


twig:
    globals:
        google_api_key: '%env(GOOGLE_API_KEY)%'