# 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:
    locale: 'es'
    languages: ['es','en','fr','pt','it','de']

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\EventListener\AuditoriaSubscriber:
        tags:
            - name: 'doctrine.event_subscriber'
              # subscribers can define their priority in case multiple subscribers or listeners are associated
              # to the same event (default priority = 0; higher numbers = listener is run earlier)
              priority: 500

              # you can also restrict listeners to a specific Doctrine connection
              connection: 'default'
    
    App\OAuth2\ConsejoOauthClient:
        decorates: knpu.oauth2.client.portal_consejo_oauth

    admin.toma_examen:
        class: App\Admin\TomaExamenAdmin
        tags:
            - { name: sonata.admin, model_class: App\Entity\Examen\TomaExamen, controller: App\Controller\Examenes\TomaExamenAdminController, manager_type: orm, group: examen, label: Configuración de Examenes }
        calls:
            - [ setTemplate, [edit, examenes/toma_examenes/edit.html.twig]]
            # - [addChild, ['@App\Admin\TomaExamenFecha', 'tomaExamenFecha']]

    admin.toma_examen_fecha:
        class: App\Admin\TomaExamenFechaAdmin
        tags:
            - { name: sonata.admin, model_class: App\Entity\Examen\TomaExamenFecha, controller: App\Controller\Examenes\TomaExamenFechaAdminController, manager_type: orm, group: fecha, label: Gestión de Examinandos, default: true }
        calls:
            - [ setTemplate, [edit, examenes/toma_examenes_fecha/edit.html.twig]]

    admin.sala_examinadora:
        class: App\Admin\SalaExaminadoraAdmin
        tags:
            - { name: sonata.admin, model_class: App\Entity\Examen\SalaExaminadora, controller: ~, manager_type: orm, group: admin, label: SalaExaminadora }

    admin.examinandos:
        class: App\Admin\ExaminandosAdmin
        tags:
            - { name: sonata.admin, model_class: App\Entity\Examen\Examinandos, controller: App\Controller\Examenes\ExaminandosAdminController, manager_type: orm, group: admin, label: Examinandos }
        calls:
            - [ setTemplate, [list, examenes/examinandos/base_list.html.twig]]

    admin.eximiciones:
        class: App\Admin\EximicionesAdmin
        tags:
            - { name: sonata.admin, model_class: App\Entity\Examen\Eximiciones, controller:  App\Controller\Examenes\EximicionesAdminController, manager_type: orm, group: admin, label: Eximiciones }
        calls:
            - [ setTemplate, [list, examenes/eximiciones/base_list.html.twig]]
            - [ setTemplate, [edit, examenes/eximiciones/edit.html.twig]]

    admin.revisiones:
        class: App\Admin\RevisionesAdmin
        tags:
            - { name: sonata.admin, model_class: App\Entity\Examen\Revisiones, controller:  App\Controller\Examenes\RevisionesAdminController, manager_type: orm, group: admin, label: Revisiones }
        calls:
            - [ setTemplate, [list, examenes/revisiones/base_list.html.twig]]
            - [ setTemplate, [edit, examenes/revisiones/edit.html.twig]]

    admin.inscripciones:
        class: App\Admin\InscripcionAdmin
        tags:
            - { name: sonata.admin, model_class: App\Entity\Inscripciones\Inscripcion, controller: ~, manager_type: orm, group: admin, label: Inscripcion }
    
    admin.inscripciones_excepcionales:
        class: App\Admin\InscripcionExcepcionalAdmin
        tags:
            - { name: sonata.admin, model_class: App\Entity\InscripcionesExcepcionales\InscripcionExcepcional, controller: App\Controller\InscripcionesExcepcionales\InscripcionExcepcionalAdminController, manager_type: orm, group: admin, label: Inscripciones Excepcionales }
        calls:
            - [ setTemplate, [edit, inscripcionesExcepcionales/edit.html.twig]]    
            
    admin.convocatorias:
        class: App\Admin\ConvocatoriaAdmin
        tags:
            - { name: sonata.admin, model_class: App\Entity\Convocatorias\Convocatoria, controller: App\Controller\Convocatorias\ConvocatoriaAdminController, manager_type: orm, group: admin, label: Convocatorias }
    
    admin.convocatorias_examen:
        class: App\Admin\ConvocatoriaExamenAdmin
        tags:
            - { name: sonata.admin, model_class: App\Entity\Convocatorias\ConvocatoriaExamen, controller: ~, manager_type: orm, group: admin, label: Listado de Examenes }
    
    admin.academicos:
        class: App\Admin\AcademicoAdmin
        tags:
            - { name: sonata.admin, model_class: App\Entity\Personal\Academico, controller: ~, manager_type: orm, group: admin, label: Academicos }

    admin.examinadores:
        class: App\Admin\ExaminadorAdmin
        tags:
            - { name: sonata.admin, model_class: App\Entity\Personal\Examinador, controller: ~, manager_type: orm, group: admin, label: Examinadores }
        calls:
            - [ setTemplate, [edit, examenes/examinadores/edit.html.twig]]
            
    admin.personas:
        class: App\Admin\PersonaAdmin
        tags:
            - { name: sonata.admin, model_class: App\Entity\BDPersonas\Persona, controller: ~, manager_type: orm, group: admin, label: Personas }
    
    admin.presentacion_antecedentes:
        class: App\Admin\PresentacionAntecedentesAdmin
        tags:
            - { name: sonata.admin, model_class: App\Entity\RIA\PresentacionAntecedentes, controller: ~, manager_type: orm, group: admin, label: Presentacion Antecedentes }

    admin.acta_examen_fecha:
        class: App\Admin\ActaExamenFechaAdmin
        tags:
            - { name: sonata.admin, model_class: App\Entity\Examen\TomaExamenFecha, controller: App\Controller\Examenes\ActaExamenAdminController, manager_type: orm, group: fecha, label: Acta de Examenes }
        calls:
            - [ setTemplate, [presentismo, examenes/acta_examenes_fecha/presentismo/edit.html.twig]]
            - [ setTemplate, [notas, examenes/acta_examenes_fecha/notas/edit.html.twig]]

    admin.resoluciones:
        class: App\Admin\ResolucionesAdmin
        tags:
            - { name: sonata.admin, model_class: App\Entity\Referencia\Resoluciones, controller: ~, manager_type: orm, group: admin, label: Resoluciones }

    admin.configuracion_resolucion:
        class: App\Admin\ConfiguracionResolucionAdmin
        tags:
            - { name: sonata.admin, model_class: App\Entity\Convocatorias\ConfiguracionResolucion, controller: ~, manager_type: orm, group: admin, label: Configuración Resolución }
        calls:
            - [ setTemplate, [edit, convocatorias/configuracion_resolucion/edit.html.twig]]