# 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:
    app.upload_dir_posts: '%kernel.project_dir%/public/uploads/posts/'
    logo_mecene_directory: '%kernel.project_dir%/public/uploads/mecenes/logos/'
    logo_societe_directory: '%kernel.project_dir%/public/uploads/societes/logos/'
    logo_projet_directory: '%kernel.project_dir%/public/uploads/projets/logos/'
    presentation_projet_directory: '%kernel.project_dir%/public/uploads/projets/presentations/'
    app.base_url: '%env(APP_BASE_URL)%'
    app.base_routing_url: '%env(APP_BASE_ROUTING_URL)%'
    app.public_path: '%env(APP_PUBLIC_PATH)%'
    fundup_storage: '%kernel.project_dir%/var/fundup/'
    app.bundle_routes:
        ProjetBundle:
            - '^/projet'
            - '^/tache'
            - '^/ticket'
        CommercialBundle:
            - '^/client'
            - '^/prospect'
            - '^/facture'
            - '^/devis'
            - '^/depenses'
            - '^/produit'
        AdminBundle:
            - '^/societe'
            - '^/user'
            - '^/update'

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'

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

    App\EventListener\SocieteListener:
        public: true
        autowire: true
        autoconfigure: true
        tags:
            - { name: kernel.event_listener, event: kernel.request, priority: 10 }

    App\EventListener\PortailRedirectionListener:
        public: true
        autowire: true
        autoconfigure: true
        tags:
            - { name: kernel.event_listener, event: kernel.controller, method: onKernelController, priority: 15 }

    App\EventListener\RedirectToPublicListener:
        tags:
            - { name: kernel.event_listener, event: kernel.request, priority: 10 }

    App\EventListener\BundleCheckListener:
        tags:
            - { name: kernel.event_listener, event: kernel.request, priority: 10 }

    App\Service\SireneService:
        arguments:
            $apiKey: '%env(INSEE_API_KEY)%'
        
    App\Twig\ModuleExtension:
        tags: ['twig.extension']

    App\Service\FileManagerService:
        arguments:
            $baseDir: '%kernel.project_dir%/var/fundup/'