imports:
    - { resource: 'devkit/claims.yaml' }
    - { resource: 'devkit/deep_linking.yaml' }
    - { resource: 'devkit/users.yaml' }

parameters:
    application_host: '%env(resolve:APP_HOST)%'
    application_env: '%env(resolve:APP_ENV)%'
    application_api_key: '%env(resolve:APP_API_KEY)%'
    application_vendors: '%kernel.project_dir%/vendor/composer/installed.php'
    application_version: '2.4.2'
    container.dumper.inline_factories: true

services:
    _defaults:
        autowire: true
        autoconfigure: true

    App\:
        resource: '../src/*'
        exclude: '../src/{DependencyInjection,Entity,Migrations,Tests,Kernel.php}'

    App\Action\:
        resource: '../src/Action'
        tags: ['controller.service_arguments']

    # API
    App\Security\Api\Provider\ApiKeyProvider:
        arguments:
            - '@parameter_bag'

    App\Security\Api\Firewall\ApiKeyListener:
        arguments:
            - '@security.token_storage'
            - '@security.authentication.manager'
            - '@Psr\Log\LoggerInterface'

    # LTI core dependencies
    OAT\Library\Lti1p3Core\Util\Generator\IdGeneratorInterface:
        class: OAT\Library\Lti1p3Core\Util\Generator\IdGenerator

    OAT\Library\Lti1p3Core\Security\User\UserAuthenticatorInterface:
        class: App\Security\User\UserAuthenticator

    OAT\Library\Lti1p3Core\User\UserIdentityFactoryInterface:
        class: OAT\Library\Lti1p3Core\User\UserIdentityFactory

    # LTI AGS dependencies
    OAT\Library\Lti1p3Ags\Service\LineItem\Client\LineItemServiceClient: ~

    OAT\Library\Lti1p3Ags\Service\Score\Client\ScoreServiceClient: ~

    OAT\Library\Lti1p3Ags\Service\Result\Client\ResultServiceClient: ~

    OAT\Library\Lti1p3Ags\Repository\LineItemRepositoryInterface:
        class: App\Ags\LineItemRepository

    OAT\Library\Lti1p3Ags\Repository\ScoreRepositoryInterface:
        class: App\Ags\ScoreRepository

    OAT\Library\Lti1p3Ags\Repository\ResultRepositoryInterface:
        class: App\Ags\ResultRepository

    OAT\Library\Lti1p3Ags\Service\LineItem\Server\Handler\ListLineItemsServiceServerRequestHandler:
        arguments:
            - '@OAT\Library\Lti1p3Ags\Repository\LineItemRepositoryInterface'

    OAT\Library\Lti1p3Ags\Service\LineItem\Server\Handler\GetLineItemServiceServerRequestHandler:
        arguments:
            - '@OAT\Library\Lti1p3Ags\Repository\LineItemRepositoryInterface'

    OAT\Library\Lti1p3Ags\Service\LineItem\Server\Handler\DeleteLineItemServiceServerRequestHandler:
        arguments:
            - '@OAT\Library\Lti1p3Ags\Repository\LineItemRepositoryInterface'

    OAT\Library\Lti1p3Ags\Service\LineItem\Server\Handler\CreateLineItemServiceServerRequestHandler:
        arguments:
            - '@OAT\Library\Lti1p3Ags\Repository\LineItemRepositoryInterface'

    OAT\Library\Lti1p3Ags\Service\LineItem\Server\Handler\UpdateLineItemServiceServerRequestHandler:
        arguments:
            - '@OAT\Library\Lti1p3Ags\Repository\LineItemRepositoryInterface'

    OAT\Library\Lti1p3Ags\Service\Score\Server\Handler\ScoreServiceServerRequestHandler:
        arguments:
            - '@OAT\Library\Lti1p3Ags\Repository\LineItemRepositoryInterface'
            - '@OAT\Library\Lti1p3Ags\Repository\ScoreRepositoryInterface'

    OAT\Library\Lti1p3Ags\Service\Result\Server\Handler\ResultServiceServerRequestHandler:
        arguments:
            - '@OAT\Library\Lti1p3Ags\Repository\LineItemRepositoryInterface'
            - '@OAT\Library\Lti1p3Ags\Repository\ResultRepositoryInterface'

    app.service.ags_list_line_items_controller:
        class: OAT\Bundle\Lti1p3Bundle\Service\Server\Handler\LtiServiceServerHttpFoundationRequestHandler
        factory: [ '@OAT\Bundle\Lti1p3Bundle\Service\Server\Factory\LtiServiceServerHttpFoundationRequestHandlerFactoryInterface', 'create' ]
        arguments:
            - '@OAT\Library\Lti1p3Ags\Service\LineItem\Server\Handler\ListLineItemsServiceServerRequestHandler'
        tags: [ 'controller.service_arguments' ]

    app.service.ags_get_line_item_controller:
        class: OAT\Bundle\Lti1p3Bundle\Service\Server\Handler\LtiServiceServerHttpFoundationRequestHandler
        factory: [ '@OAT\Bundle\Lti1p3Bundle\Service\Server\Factory\LtiServiceServerHttpFoundationRequestHandlerFactoryInterface', 'create' ]
        arguments:
            - '@OAT\Library\Lti1p3Ags\Service\LineItem\Server\Handler\GetLineItemServiceServerRequestHandler'
        tags: [ 'controller.service_arguments' ]

    app.service.ags_delete_line_item_controller:
        class: OAT\Bundle\Lti1p3Bundle\Service\Server\Handler\LtiServiceServerHttpFoundationRequestHandler
        factory: [ '@OAT\Bundle\Lti1p3Bundle\Service\Server\Factory\LtiServiceServerHttpFoundationRequestHandlerFactoryInterface', 'create' ]
        arguments:
            - '@OAT\Library\Lti1p3Ags\Service\LineItem\Server\Handler\DeleteLineItemServiceServerRequestHandler'
        tags: [ 'controller.service_arguments' ]

    app.service.ags_create_line_item_controller:
        class: OAT\Bundle\Lti1p3Bundle\Service\Server\Handler\LtiServiceServerHttpFoundationRequestHandler
        factory: [ '@OAT\Bundle\Lti1p3Bundle\Service\Server\Factory\LtiServiceServerHttpFoundationRequestHandlerFactoryInterface', 'create' ]
        arguments:
            - '@OAT\Library\Lti1p3Ags\Service\LineItem\Server\Handler\CreateLineItemServiceServerRequestHandler'
        tags: [ 'controller.service_arguments' ]

    app.service.ags_update_line_item_controller:
        class: OAT\Bundle\Lti1p3Bundle\Service\Server\Handler\LtiServiceServerHttpFoundationRequestHandler
        factory: [ '@OAT\Bundle\Lti1p3Bundle\Service\Server\Factory\LtiServiceServerHttpFoundationRequestHandlerFactoryInterface', 'create' ]
        arguments:
            - '@OAT\Library\Lti1p3Ags\Service\LineItem\Server\Handler\UpdateLineItemServiceServerRequestHandler'
        tags: [ 'controller.service_arguments' ]

    app.service.ags_score_controller:
        class: OAT\Bundle\Lti1p3Bundle\Service\Server\Handler\LtiServiceServerHttpFoundationRequestHandler
        factory: [ '@OAT\Bundle\Lti1p3Bundle\Service\Server\Factory\LtiServiceServerHttpFoundationRequestHandlerFactoryInterface', 'create' ]
        arguments:
            - '@OAT\Library\Lti1p3Ags\Service\Score\Server\Handler\ScoreServiceServerRequestHandler'
        tags: [ 'controller.service_arguments' ]

    app.service.ags_result_controller:
        class: OAT\Bundle\Lti1p3Bundle\Service\Server\Handler\LtiServiceServerHttpFoundationRequestHandler
        factory: [ '@OAT\Bundle\Lti1p3Bundle\Service\Server\Factory\LtiServiceServerHttpFoundationRequestHandlerFactoryInterface', 'create' ]
        arguments:
            - '@OAT\Library\Lti1p3Ags\Service\Result\Server\Handler\ResultServiceServerRequestHandler'
        tags: [ 'controller.service_arguments' ]

    # LTI deep linking dependencies
    OAT\Library\Lti1p3DeepLinking\Message\Launch\Builder\DeepLinkingLaunchRequestBuilder: ~

    OAT\Library\Lti1p3DeepLinking\Message\Launch\Builder\DeepLinkingLaunchResponseBuilder: ~

    OAT\Library\Lti1p3DeepLinking\Factory\ResourceCollectionFactoryInterface:
        class: OAT\Library\Lti1p3DeepLinking\Factory\ResourceCollectionFactory

    # LTI proctoring dependencies
    OAT\Library\Lti1p3Proctoring\Service\Client\AcsServiceClient: ~

    OAT\Library\Lti1p3Proctoring\Message\Launch\Builder\StartProctoringLaunchRequestBuilder: ~

    OAT\Library\Lti1p3Proctoring\Message\Launch\Builder\StartAssessmentLaunchRequestBuilder: ~

    OAT\Library\Lti1p3Proctoring\Message\Launch\Builder\EndAssessmentLaunchRequestBuilder: ~

    OAT\Library\Lti1p3Proctoring\Service\Server\Handler\AcsServiceServerRequestHandler:
        arguments:
            - '@App\Proctoring\AcsServiceServerControlProcessor'

    app.service.proctoring_acs_controller:
        class: OAT\Bundle\Lti1p3Bundle\Service\Server\Handler\LtiServiceServerHttpFoundationRequestHandler
        factory: [ '@OAT\Bundle\Lti1p3Bundle\Service\Server\Factory\LtiServiceServerHttpFoundationRequestHandlerFactoryInterface', 'create' ]
        arguments:
            - '@OAT\Library\Lti1p3Proctoring\Service\Server\Handler\AcsServiceServerRequestHandler'
        tags: [ 'controller.service_arguments' ]

    # LTI NRPS dependencies
    OAT\Library\Lti1p3Nrps\Service\Client\MembershipServiceClient: ~

    OAT\Library\Lti1p3Nrps\Factory\Member\MemberFactoryInterface:
        class: OAT\Library\Lti1p3Nrps\Factory\Member\MemberFactory

    OAT\Library\Lti1p3Nrps\Serializer\MembershipSerializerInterface:
        class: OAT\Library\Lti1p3Nrps\Serializer\MembershipSerializer

    OAT\Library\Lti1p3Nrps\Service\Server\Handler\MembershipServiceServerRequestHandler:
        arguments:
            - '@App\Nrps\MembershipServiceServerBuilder'

    app.service.nrps_membership_controller:
        class: OAT\Bundle\Lti1p3Bundle\Service\Server\Handler\LtiServiceServerHttpFoundationRequestHandler
        factory: [ '@OAT\Bundle\Lti1p3Bundle\Service\Server\Factory\LtiServiceServerHttpFoundationRequestHandlerFactoryInterface', 'create' ]
        arguments:
            - '@OAT\Library\Lti1p3Nrps\Service\Server\Handler\MembershipServiceServerRequestHandler'
        tags: [ 'controller.service_arguments' ]

    # LTI basic outcome dependencies
    OAT\Library\Lti1p3BasicOutcome\Service\Client\BasicOutcomeServiceClient: ~

    OAT\Library\Lti1p3BasicOutcome\Service\Server\Handler\BasicOutcomeServiceServerRequestHandler:
        arguments:
            - '@App\BasicOutcome\BasicOutcomeProcessor'

    app.service.basic_outcome_controller:
        class: OAT\Bundle\Lti1p3Bundle\Service\Server\Handler\LtiServiceServerHttpFoundationRequestHandler
        factory: [ '@OAT\Bundle\Lti1p3Bundle\Service\Server\Factory\LtiServiceServerHttpFoundationRequestHandlerFactoryInterface', 'create' ]
        arguments:
            - '@OAT\Library\Lti1p3BasicOutcome\Service\Server\Handler\BasicOutcomeServiceServerRequestHandler'
        tags: [ 'controller.service_arguments' ]

    # LTI submission review dependencies
    OAT\Library\Lti1p3SubmissionReview\Message\Launch\Builder\SubmissionReviewLaunchRequestBuilder: ~