# yaml-language-server: $schema=../vendor/symfony/dependency-injection/Loader/schema/services.schema.json

# This file is the entry point to configure your own services.
# Files in the packages/ subdirectory configure your dependencies.
# See also https://symfony.com/doc/current/service_container/import.html

# 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:
    green_api.instance_id: '%env(string:GREEN_API_INSTANCE_ID)%'
    green_api.token: '%env(string:GREEN_API_TOKEN)%'
    green_api.base_url: '%env(string:GREEN_API_BASE_URL)%'
    green_api.media_url: '%env(string:GREEN_API_MEDIA_URL)%'
    green_api.verify_ssl: '%env(bool:GREEN_API_VERIFY_SSL)%'
    app.public_base_url: '%env(string:APP_PUBLIC_BASE_URL)%'
    app.public_domain: '%env(string:APP_PUBLIC_DOMAIN)%'
    app.platform_host: '%env(string:APP_PLATFORM_HOST)%'
    app.admin_host: '%env(string:APP_ADMIN_HOST)%'
    app.scheme: '%env(string:APP_SCHEME)%'

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/'

    App\Service\Whatsapp\GreenApiClient:
        arguments:
            $globalInstanceId: '%green_api.instance_id%'
            $globalApiToken: '%green_api.token%'
            $baseUrl: '%green_api.base_url%'
            $mediaUrl: '%green_api.media_url%'
            $verifySsl: '%green_api.verify_ssl%'

    App\Service\Whatsapp\WhatsappNotificationService:
        arguments:
            $projectDir: '%kernel.project_dir%'
            $publicBaseUrl: '%app.public_base_url%'

    App\Service\Tenant\TenantResolver:
        arguments:
            $publicDomain: '%app.public_domain%'
            $adminHost: '%app.platform_host%'

    App\Service\PublicUrlGenerator:
        arguments:
            $publicDomain: '%app.public_domain%'
            $adminHost: '%app.platform_host%'
            $scheme: '%app.scheme%'

    App\Service\Pdf\InscriptionPdfGenerator:
        arguments:
            $projectDir: '%kernel.project_dir%'

    App\Service\Pdf\PdfDocumentBranding:
        arguments:
            $projectDir: '%kernel.project_dir%'

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