# 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'
            - '../src/Tests/'

    # add more service definitions when explicit configuration is needed
    # please note that last definitions always *replace* previous ones
    
    App\DataFixtures\Providers\HashPasswordProvider:
        tags: [ { name: nelmio_alice.faker.provider } ]

    App\OpenApi\JwtDecorator:
        decorates: 'api_platform.openapi.factory'
        arguments: ['@.inner'] 
    
    App\Serializer\UserContextBuilder:
        decorates: 'api_platform.serializer.context_builder'
        arguments: [ '@App\Serializer\UserContextBuilder.inner' ]
        autoconfigure: false
    
    App\Doctrine\AuthorCreateListener:
        tags: [ doctrine.orm.entity_listener ]
    
    App\Doctrine\BookCreateListener:
        tags: [ doctrine.orm.entity_listener ]
    
    App\Doctrine\UserBookCreateListener:
        tags: [ doctrine.orm.entity_listener ]
    
    App\Doctrine\GroupCreateListener:
        tags: [ doctrine.orm.entity_listener ]
        
    App\Doctrine\GroupInviteCreateListener:
        tags: [ doctrine.orm.entity_listener ]

    App\DataTransformer\InviteInputDataTransformer: ~

    App\Service\PasswordResetMailer:
        arguments:
            - '%env(MAIL_FROM_NO_REPLY)%'
                
    App\Service\PushNotifications\PushNotificationsFirebaseFactory:
        arguments:
            - '%env(FIREBASE_CREDENTIALS_PATH)%'
                
    App\Service\PushNotifications\PushNotificationsFirebase: ~
                
    App\Service\PushNotifications\PushNotificationsInterface: '@App\Service\PushNotifications\PushNotificationsFirebase'
        

    App\Validator\Constraints\ResetTokenIsValidValidator:
        arguments:
            - 60
    
    App\State\ConfirmPasswordResetStateProcessor:
        bind:
            $persistProcessor: '@api_platform.doctrine.orm.state.persist_processor'
            
    App\State\GroupInviteCreateStateProcessor:
        bind:
            $persistProcessor: '@api_platform.doctrine.orm.state.persist_processor'
    
    App\State\GroupInviteAcceptStateProcessor:
        bind:
            $persistProcessor: '@api_platform.doctrine.orm.state.persist_processor'
    
    App\State\GroupInviteRejectStateProcessor:
        bind:
            $persistProcessor: '@api_platform.doctrine.orm.state.persist_processor'
            
    App\State\RequestCreateStateProcessor:
        bind:
            $persistProcessor: '@api_platform.doctrine.orm.state.persist_processor'
            
    App\State\RequestAcceptStateProcessor:
        bind:
            $persistProcessor: '@api_platform.doctrine.orm.state.persist_processor'
            
    App\State\RequestCancelStateProcessor:
        bind:
            $persistProcessor: '@api_platform.doctrine.orm.state.persist_processor'
            
    App\State\RequestLendStateProcessor:
        bind:
            $persistProcessor: '@api_platform.doctrine.orm.state.persist_processor'
            
    App\State\RequestRejectStateProcessor:
        bind:
            $persistProcessor: '@api_platform.doctrine.orm.state.persist_processor'
    
    App\State\RequestReturnStateProcessor:
        bind:
            $persistProcessor: '@api_platform.doctrine.orm.state.persist_processor'
            
    App\State\UserStateProcessor:
        bind:
            $persistProcessor: '@api_platform.doctrine.orm.state.persist_processor'

    App\Service\IsbnSearch\IsbnSearchOpenapi:
        tags: 
            - { name: 'app.isbn.search', priority: 20 }

    App\Service\IsbnSearch\IsbnSearchGoogleBooksApi:
        tags:
            - { name: 'app.isbn.search', priority: 2 }
        
        
