# 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/configuration.html#application-related-configuration
imports:
    - { resource: openings.yaml }

parameters:
    system_version: '1.10.1'
    upload_folder: '%kernel.project_dir%/usr'
    sender_email: '%env(resolve:SENDER_EMAIL)%'
    sender_name: 'Sport43'
    default_config: !php/const App\Project\SkiConfig::NAME
    mailchimp.enable: '%env(resolve:ENABLE_MAILCHIMP)%'
    mailchimp.api_url: 'https://us7.api.mailchimp.com/3.0'
    mailchimp.api_key: '16e90bf9345967897174529164346526-us7'
    mailchimp.audience_id: '55754599a3'
    export_limit:
        xls: 1000
    consent_files:
        parent: '%upload_folder%/admin/szuloi-nyilatkozat.pdf'
        teacher: '%upload_folder%/admin/tanari-nyilatkozat.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'
            - '../src/Tests/'

    # controllers are imported separately to make sure services can be injected
    # as action arguments even if you don't extend any base controller class
    App\Controller\:
        resource: '../src/Controller/'
        tags: ['controller.service_arguments']

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

    App\Doctrine\Gateway\CrudGatewayFactory:
        public: true
        arguments:
          ['@doctrine', '@app.criteria_processors']

    app.crud_gateway_factory:
        alias: App\Doctrine\Gateway\CrudGatewayFactory
        public: true

    app.criteria_processors:
        class: 'App\Doctrine\Criteria\DelegatingCriteriaProcessor'
        factory: '@App\Doctrine\Criteria\CriteriaProcessors'
        public: true

    Colibree\Action\ActionRegistry:
        public: true
        factory: ['App\AppActionRegistry', 'create']
        arguments:
          ['@App\AppActionType']

    App\Notification\SenderHelper:
        arguments:
            - "%sender_name%"
            - "%sender_email%"

    app.notifier:
        alias: App\Notification\AppNotifier
        public: true

    App\User\Integration\WarnLockedUserOnResettingListener:
      class: App\User\Integration\WarnLockedUserOnResettingListener
      tags: [kernel.event_listener]
      arguments:
          - "@router"

    App\User\Mailchimp\MailchimpListener:
        class: App\User\Mailchimp\MailchimpListener
        tags: [ kernel.event_listener ]
        arguments:
            - "%mailchimp.enable%"
            - "%mailchimp.api_key%"
            - "%mailchimp.api_url%"
            - "%mailchimp.audience_id%"
            - "@monolog.logger"

    App\Appointment\NotifyOfAppointmentCompletion\NotifyOfAppointmentCompletionListener:
        class: App\Appointment\NotifyOfAppointmentCompletion\NotifyOfAppointmentCompletionListener
        tags: [ kernel.event_listener ]
        arguments:
            - "@app.notifier"
            - '@App\Doctrine\Gateway\CrudGatewayFactory'

    App\Project\Gateway\ConfigSessionInterface:
        class: App\Project\ConfigSession
        public: true
        arguments:
            - "@session"
            - "@app.configs"
            - "%default_config%"

    app.config.session:
        alias: App\Project\Gateway\ConfigSessionInterface
        public: true

    App\File\FileManager:
        class: App\File\Gateway\FileManager

    app.configs:
        class: ArrayIterator
        public: true
        arguments:
            - [
                "@App\\Project\\SkiConfig",
                "@App\\Project\\ClimbConfig",
                "@App\\Project\\CharLiftConfig",
#                "@App\\Project\\FolkDanceConfig",
                "@App\\Project\\IceSkateConfig",
                "@App\\Project\\DrySkiConfig",
                "@App\\Project\\ScooterConfig",
                "@App\\Project\\SkateConfig",
                "@App\\Project\\RollSkateConfig",
                "@App\\Project\\RowConfig",
                "@App\\Project\\BikeConfig",
                "@App\\Project\\WakeboardConfig",
#                "@App\\Project\\CultureConfig",
#                "@App\\Project\\CultureHalmiConfig",
#                "@App\\Project\\CulturePauerConfig",
#                "@App\\Project\\CultureFaurConfig",
#                "@App\\Project\\CultureLandfallConfig",
#                "@App\\Project\\CultureCsakiConfig",
#                "@App\\Project\\CultureBodaConfig",
#                "@App\\Project\\CultureReveszConfig"
            ]

