parameters:
#    cl_chill_main.example.class: Chill\MainBundle\Example

imports:
    - ./services/clock.yaml

services:
    _defaults:
        autowire: true
        autoconfigure: true

    Chill\MainBundle\Repository\:
        resource: '../Repository/'

    Chill\MainBundle\Repository\UserACLAwareRepositoryInterface: '@Chill\MainBundle\Repository\UserACLAwareRepository'

    Chill\MainBundle\Serializer\Normalizer\:
        resource: '../Serializer/Normalizer'
        tags:
            - { name: 'serializer.normalizer', priority: 64 }

    Chill\MainBundle\Form\Type\:
        resource: '../Form/Type'
        autoconfigure: true
        autowire: true

    Chill\MainBundle\Doctrine\Event\:
        resource: '../Doctrine/Event/'
        tags:
            - { name: 'doctrine.event_subscriber' }


    # workflow related
    Chill\MainBundle\Workflow\:
        resource: '../Workflow/'
        exclude:
            - '../Workflow/Attachment/AddAttachmentRequestDTO.php'

    Chill\MainBundle\Workflow\EntityWorkflowManager:
        arguments:
            $handlers: !tagged_iterator chill_main.workflow_handler

    # seems to have no alias on symfony 5.4
    Symfony\Component\Mime\BodyRendererInterface:
        alias: 'twig.mime_body_renderer'

    # other stuffes

    chill.main.helper.translatable_string:
        class: Chill\MainBundle\Templating\TranslatableStringHelper

    Chill\MainBundle\Templating\TranslatableStringHelper: '@chill.main.helper.translatable_string'
    Chill\MainBundle\Templating\TranslatableStringHelperInterface: '@Chill\MainBundle\Templating\TranslatableStringHelper'

    chill.main.twig.translatable_string:
        class: Chill\MainBundle\Templating\TranslatableStringTwig
        arguments:
            - "@chill.main.helper.translatable_string"
        calls:
            - [ setContainer, ["@service_container"]]
        tags:
            - { name: twig.extension }

    chill.main.twig.widget:
        class: Chill\MainBundle\Templating\Widget\WidgetRenderingTwig
        arguments:
            - "@event_dispatcher"
        tags:
            - { name: twig.extension }

    chill.main.twig.csv_cell:
        class: Chill\MainBundle\Templating\CSVCellTwig
        tags:
            - { name: twig.extension }

    chill.main.validator.role_scope_scope_presence:
        class: Chill\MainBundle\Validation\Validator\RoleScopeScopePresence
        arguments:
            - "@chill.main.role_provider"
            - "@logger"
            - "@translator"
        tags:
            - { name: validator.constraint_validator, alias: 'role_scope_scope_presence' }

    Chill\MainBundle\Export\ExportManager:
        autoconfigure: true
        autowire: true
        arguments:
            $exports: !tagged_iterator { tag: chill.export, index_by: alias }
            $aggregators: !tagged_iterator { tag: chill.export_aggregator, index_by: alias }
            $filters: !tagged_iterator { tag: chill.export_filter, index_by: alias }
            $formatters: !tagged_iterator { tag: chill.export_formatter, index_by: alias }

    Chill\MainBundle\Security\Resolver\CenterResolverDispatcherInterface: '@Chill\MainBundle\Security\Resolver\CenterResolverDispatcher'

    Chill\MainBundle\Service\:
        resource: '../Service/'
        autowire: true
        autoconfigure: true

    Chill\MainBundle\Cron\:
        resource: '../Cron'
        autowire: true
        autoconfigure: true

    Chill\MainBundle\Cron\CronManager:
        autoconfigure: true
        autowire: true
        lazy: true
        arguments:
            $jobs: !tagged_iterator chill_main.cron_job

    Chill\MainBundle\Service\EntityInfo\ViewEntityInfoManager:
        arguments:
            $vienEntityInfoProviders: !tagged_iterator chill_main.entity_info_provider

    Chill\MainBundle\Action\User\UpdateProfile\UpdateProfileCommandHandler: ~

    Chill\MainBundle\Service\VersionProvider:
        arguments:
            $packageName: 'chill-project/chill-bundles'
