# 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:

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

    # 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']

    app.utils.certificate_creator:
        class: App\Utils\CertificateCreator
        arguments:
            - '@html2pdf_factory'
            - '%kernel.project_dir%'

    App\Utils\CertificateCreator:
        alias: app.utils.certificate_creator

    app.utils.invoice_creator:
        class: App\Utils\InvoiceCreator
        arguments:
            - '@html2pdf_factory'
            - '%kernel.project_dir%'
            - '@app.helper.codetocountryhelper'

    App\Utils\InvoiceCreator:
        alias: app.utils.invoice_creator

    app.helper.hash_helper:
        class: App\Helper\HashHelper
        arguments:
            - '%env(SSO_KEY_LARS)%'

    App\Helper\HashHelper:
        alias: app.helper.hash_helper

    app.utils.mailer:
        class: App\Utils\Mailer
        arguments:
            - '@mailer'
            - '%kernel.project_dir%'
            - '%env(BASE_URL_FRONTEND)%'
            - '@doctrine'

    App\Utils\Mailer:
        alias: app.utils.mailer

    app.utils.mollie:
        class: App\Utils\MollieManager
        arguments:
            - '@doctrine'
            - '%env(BASE_URL_FRONTEND)%'
            - '%env(HSEQDIRECT_BASE_URL_FRONTEND)%'
            - '%env(BASE_URL_API)%'
            - '%env(MOLLIE_API_KEY)%'
            - '%env(MOLLIE_SUBSCRIPTION_AMOUNT)%'
            - '@app.utils.mailer'
            - '%env(MOLLIE_HSEQDIRECT_API_KEY)%'

    App\Utils\MollieManager:
        alias: app.utils.mollie

    App\Utils\SoapPlusport:
        alias: app.utils.soapplusport

    app.utils.soapplusport:
        class: App\Utils\SoapPlusport
        arguments:
            - '@app.utils.certificate_creator'
            - '%env(PLUSPORT_SOAP_URL)%'
            - '%env(resolve:PLUSPORT_SOAP_LOG_DIR)%'

    App\Helper\CodeToCountryHelper:
        alias: app.helper.codetocountryhelper

    app.helper.codetocountryhelper:
        class: App\Helper\CodeToCountryHelper
        arguments:
            - '@doctrine'