parameters:
    locale: 'en'
    amazon_s3:
        bucket_name: 'ubikon'
        tmp_dir: '/var/tmp'
    env(MERCURE_PUBLISH_URL): ''
    env(MERCURE_JWT_SECRET): ''

services:
    _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,Entity,Migrations,Tests,Kernel.php}'

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

    ########
    #
    # CUSTOM SERVICES
    #
    ########

    # Get Land Form Controller
    App\Controller\GetLandFormController:
        arguments: [ '@liform.resolver' ]

    # Get Organization Form Controller
    App\Controller\GetOrganizationFormController:
        arguments: [ '@liform.resolver' ]

    # Get TaskFile Form Controller
    App\Controller\GetTaskFileUploadFormController:
        arguments: [ '@liform.resolver' ]

    # Get User Edit Form Controller
    App\Controller\GetUserFormController:
        arguments: [ '@liform.resolver' ]

    # Land listener
    App\EventListener\LandListener:
        tags:
            - { name: doctrine.event_listener, event: prePersist }

    # Offer listener
    App\EventListener\OfferListener:
        tags:
            - { name: doctrine.event_listener, event: prePersist }

    # MediaObject listener
    App\EventListener\MediaObjectListener:
        tags:
            - { name: doctrine.event_listener, event: prePersist }

    # Message listener
    App\EventListener\MessageListener:
        tags:
            - { name: doctrine.event_listener, event: prePersist }
            - { name: doctrine.event_listener, event: postPersist }

    # Offer Request listener
    App\EventListener\OfferRequestListener:
        tags:
            - { name: doctrine.event_listener, event: prePersist }
            - { name: doctrine.event_listener, event: postPersist }

    # Project listener
    App\EventListener\ProjectListener:
        tags:
            - { name: doctrine.event_listener, event: prePersist }
            - { name: doctrine.event_listener, event: postPersist }
            - { name: doctrine.event_listener, event: preUpdate }
            - { name: doctrine.event_listener, event: postUpdate }

    # Property listener
    App\EventListener\PropertyListener:
        tags:
            - { name: doctrine.event_listener, event: prePersist }

    # PropertyItem listener
    App\EventListener\PropertyItemListener:
        tags:
            - { name: doctrine.event_listener, event: prePersist }

    # Task listener
    App\EventListener\TaskListener:
        tags:
            - { name: doctrine.event_listener, event: prePersist }

    # TaskFile listener
    App\EventListener\TaskFileListener:
        tags:
            - { name: doctrine.event_listener, event: prePersist }

    # TaskSignature listener
    App\EventListener\TaskSignatureListener:
        tags:
            - { name: doctrine.event_listener, event: prePersist }

    # User listener
    App\EventListener\UserListener:
        tags:
            - { name: doctrine.event_listener, event: prePersist }

    # Project Type filter
    project_type.boolean_filter:
        parent: 'api_platform.doctrine.orm.boolean_filter'
        arguments: [ { isFormChoice: ~ } ]
        tags:  [ 'api_platform.filter' ]
        autowire: false
        autoconfigure: false
        public: false

    # JWT token customization
    acme_api.event.jwt_created_listener:
        class: App\EventListener\JWTCreatedListener
        tags:
            - { name: kernel.event_listener, event: lexik_jwt_authentication.on_authentication_success, method: onAuthenticationSuccessResponse }