# 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:
    anthropic_api_key: '%env(ANTHROPIC_API_KEY)%'
    anthropic_model: '%env(ANTHROPIC_MODEL)%'
    anthropic_max_tokens: '%env(int:ANTHROPIC_MAX_TOKENS)%'
    jwt_access_token_ttl: 900
    stripe_webhook_secret: '%env(STRIPE_WEBHOOK_SECRET)%'

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

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

    App\EventListener\SecurityHeadersListener:
        arguments:
            $environment: '%kernel.environment%'

    App\Service\Upload\BonLivraisonUploadService:
        arguments:
            $projectDir: '%kernel.project_dir%'

    App\Service\Ocr\AnthropicClient:
        arguments:
            $apiKey: '%anthropic_api_key%'
            $model: '%anthropic_model%'
            $maxTokens: '%anthropic_max_tokens%'

    App\Service\Ocr\BonLivraisonExtractorService:
        arguments:
            $projectDir: '%kernel.project_dir%'

    App\Command\BatchImportBlCommand:
        arguments:
            $projectDir: '%kernel.project_dir%'

    App\Security\AuthenticationProviderInterface:
        alias: App\Security\JwtAuthenticationProvider

    App\Security\JwtAuthenticationProvider:
        arguments:
            $jwtAccessTokenTtl: '%jwt_access_token_ttl%'

    App\Service\PushNotificationService:
        arguments:
            $vapidPublicKey: '%env(VAPID_PUBLIC_KEY)%'
            $vapidPrivateKey: '%env(VAPID_PRIVATE_KEY)%'
            $vapidSubject: '%env(VAPID_SUBJECT)%'

    App\Twig\Extension\PushNotificationExtension:
        arguments:
            $vapidPublicKey: '%env(VAPID_PUBLIC_KEY)%'

    App\Service\EInvoicing\PdpClientInterface:
        alias: App\Service\EInvoicing\B2BRouterPdpClient

    App\Service\EInvoicing\B2BRouterPdpClient:
        arguments:
            $apiUrl: '%env(B2BROUTER_API_URL)%'
            $apiKey: '%env(B2BROUTER_API_KEY)%'

    App\MessageHandler\FetchPendingInvoicesHandler:
        arguments:
            $projectDir: '%kernel.project_dir%'

    App\Service\Upload\FactureUploadService:
        arguments:
            $projectDir: '%kernel.project_dir%'

    App\Service\Ocr\FactureExtractorService:
        arguments:
            $projectDir: '%kernel.project_dir%'

    App\Service\SirenApiService:
        arguments:
            $apiUrl: '%env(SIREN_API_URL)%'
            $clientId: '%env(SIREN_API_CLIENT_ID)%'
            $apiSecret: '%env(SIREN_API_SECRET)%'

    App\Service\Stripe\StripeIdentityService:
        arguments:
            $stripeSecretKey: '%env(STRIPE_SECRET_KEY)%'

    App\Service\Stripe\StripeConnectService:
        arguments:
            $stripeSecretKey: '%env(STRIPE_SECRET_KEY)%'
