# 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.email.mailtrap: false
    # app.email.mailtrap.host: 'smtp.mailtrap.io'
    # app.email.mailtrap.port: 2525
    # app.email.mailtrap.username: 'd213a7751917f4'
    # app.email.mailtrap.password: 'fabfb45904a528'

    # app.email.host: '10.254.14.208'
    # app.email.port: 25
    # app.email.username: 'noresponder@scba.gov.ar'
    # app.email.password: '123456789'
    
    # app.email.sender.mail: 'noresponder@scba.gov.ar'
    # app.email.sender.nombre: 'Consejo de la Magistratura'
    
    # app.paramadjuntos: '%env(APP_RUTA_RIA_ADJUNTOS)%'
    # app.paramadjuntos.poda: '%env(APP_RUTA_PODA_ADJUNTOS)%'
    # app.uploads.files.url: '%env(UPLOADS_FILES_URL)%'

    # app.api.notificaciones.url: '%env(resolve:PATH_SSO_API_NOTIFICACIONES)%'
    app.urlpdf: '%env(URL_PDF)%'

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\LogoutEventListener:
        tags:
            - { name: kernel.event_listener, event: Symfony\Component\Security\Http\Event\LogoutEvent, method: onLogout }

    App\Filter\DNIAplicacionActasFilter:
        tags:
            - { name: sonata.admin.filter.type, alias: dni_aplicacion_actas_filter }
    App\Filter\ApellidosAplicacionActasFilter:
        tags:
            - { name: sonata.admin.filter.type, alias: apellidos_aplicacion_actas_filter }
    App\Filter\NombresAplicacionActasFilter:
        tags:
            - { name: sonata.admin.filter.type, alias: nombres_aplicacion_actas_filter }

    App\OAuth2\ConsejoOauthClient:
        decorates: knpu.oauth2.client.portal_consejo_oauth

    Symfony\Component\Uid\Command\GenerateUlidCommand: ~
    Symfony\Component\Uid\Command\GenerateUuidCommand: ~
    Symfony\Component\Uid\Command\InspectUlidCommand: ~
    Symfony\Component\Uid\Command\InspectUuidCommand: ~

    App\Service\FileExistsExtension:
        $projectDir: '%kernel.project_dir%'

    # the `qipsius.tcpdf` service will be injected when a
    # `Qipsius\TCPDFBundle\Controller\TCPDFController` type-hint is detected
    Qipsius\TCPDFBundle\Controller\TCPDFController: '@qipsius.tcpdf'

    admin.cronograma_aplicacion:
        class: App\Admin\CronogramaAplicacionAdmin
        tags:
            - { name: sonata.admin, model_class: App\Entity\Vacante\CronogramaAplicacion, controller: App\Controller\Vacante\CronogramaAplicacionAdminController, manager_type: orm, group: cronograma, label: Cronograma, default: true}
        calls:
            - [ setTemplate, [edit, cronogramas/edit.html.twig]]
            - [ setTemplate, [crear_multiple, cronogramas/crear_multiple/edit.html.twig]]
            - [ setTemplate, [ver_aptos_multiple, cronogramas/ver_aptos_multiple/show.html.twig]]

    admin.dni_no_permitir_aplicar:
        class: App\Admin\DniNoPermitirAplicarAdmin
        tags:
            - { name: sonata.admin, model_class: App\Entity\Vacante\DniNoPermitirAplicar, controller:  App\Controller\Vacante\DniNoPermitirAplicarAdminController, manager_type: orm, group: cronograma, label: Dni No Aptos, default: true}

    admin.aprobado:
        class: App\Admin\AprobadoAdmin
        tags:
            - { name: sonata.admin, model_class: App\Entity\Aprobados\Aprobado, controller: ~, manager_type: orm, group: aprobados, label: Aprobados }

    admin.acta_aprobados:
        class: App\Admin\ActaAprobadosAdmin
        tags:
            - { name: sonata.admin, model_class: App\Entity\Aprobados\ActaAprobados, controller:  App\Controller\Aprobados\ActaAprobadosAdminController, manager_type: orm, group: acta, label: Acta de Aprobados }
        # calls:
        #     - [addChild, ['@App\Admin\AprobadoAdmin', 'actaOrigen']]
        calls:
            - [ setTemplate, [edit, aprobados/edit.html.twig]]

    admin.aplicacion:
        class: App\Admin\AplicacionAdmin
        tags:
            - { name: sonata.admin, model_class: App\Entity\Vacante\Aplicacion, controller: App\Controller\Vacante\AplicacionAdminController, manager_type: orm, group: aplicacion, label: Aplicaciones }
        calls:
            - [ setTemplate, [show, vacante/sonata/aplicacion/show.html.twig]]
            - [ setTemplate, [edit, vacante/sonata/aplicacion/edit.html.twig]]
        
    admin.aplicacion_actas:
        class: App\Admin\AplicacionActasAdmin
        tags:
            - { name: sonata.admin, model_class: App\Entity\Vacante\AplicacionActas, controller: App\Controller\Vacante\AplicacionActasAdminController, manager_type: orm, group: aplicacion, label: Aplicaciones Actas }
        calls:
            - [ setTemplate, [show, vacante/sonata/aplicacion_actas/show.html.twig]]
            - [ setTemplate, [edit, vacante/sonata/aplicacion_actas/edit.html.twig]]
            
    admin.aplicacion_resumen:
        class: App\Admin\AplicacionResumenAdmin
        tags:
            - { name: sonata.admin, model_class: App\Entity\Vacante\CronogramaAplicacion, controller: App\Controller\Vacante\AplicacionResumenAdminController, manager_type: orm, group: aplicacion, label: Resumen de Aplicaciones }

    admin.aplicacion_union:
        class: App\Admin\AplicacionUnionAdmin
        tags:
            - { name: sonata.admin, model_class: App\Entity\Vacante\Aplicacion, controller: App\Controller\Vacante\AplicacionUnionAdminController, manager_type: orm, group: aplicacion, label: Aplicaciones Unión }
