# 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/App/'
        exclude:
            - '../src/App/DependencyInjection/'
            - '../src/App/Entity/'
            - '../src/App/Kernel.php'

    # Custom namespace
    Zuman\:
        resource: '../src/Zuman/'

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

    Zuman\Application\Service\Api\Trello\TrelloPushAndUpdateCardsService:
        arguments:
            $defaultListId: '%env(TRELLO_API_DEFAULT_LIST_ID)%'
    Zuman\Application\Stopwatch\StopwatchInterface:
        class: Zuman\Infrastructure\Stopwatch\SymfonyStopwatch
    app_http_client:
        class: Symfony\Component\HttpClient\CurlHttpClient
    Zuman\Infrastructure\Client\StelApiHttpClient:
        arguments:
            $httpClient: '@app_http_client'
            $apiUrl: '%env(STEL_API_URL)%'
            $apiKey: '%env(STEL_API_KEY)%'
    Zuman\Infrastructure\Client\TrelloApiHttpClient:
        arguments:
            $httpClient: '@app_http_client'
            $apiUrl: '%env(TRELLO_API_URL)%'
            $apiKey: '%env(TRELLO_API_KEY)%'
            $apiToken: '%env(TRELLO_API_TOKEN)%'

    Zuman\Domain\Model\ApiRequestLog\ApiRequestLogRepository:
        class: Zuman\Infrastructure\Persistence\Doctrine\ApiRequestLog\DoctrineApiRequestLogRepository
    Zuman\Domain\Model\ApiCard\ApiCardRepository:
        class: Zuman\Infrastructure\Persistence\Doctrine\ApiCard\DoctrineApiCardRepository
    Zuman\Domain\Model\ApiWorkOrder\ApiWorkOrderRepository:
        class: Zuman\Infrastructure\Persistence\Doctrine\ApiWorkOrder\DoctrineApiWorkOrderRepository
