# 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/configuration.html#application-related-configuration
parameters:
  locale: "fr"

imports:
  - { resource: images.yaml }
  - { resource: mass.yaml }

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.
    public:
      false # Allows optimizing the container by removing unused services; this also means
      # fetching services directly from the container via $container->get() won't work.
      # The best practice is to be explicit about your dependencies anyway.

  # cache
  app.simple_cache:
    class: Symfony\Component\Cache\Simple\Psr6Cache
    arguments: ["@app.cache.mobicoop"]

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

  # SERIALIZER
  'App\Serializer\ApiNormalizer':
    arguments:
      $badgeImageUri: "%env(string:GAMIFICATION_BADGE_IMAGE_URI)%"
      $gamificationActive: "%env(bool:GAMIFICATION_ACTIVE)%"
      $gratuityActive: "%env(bool:GRATUITY_CAMPAIGN_ACTIVE)%"
    decorates: "api_platform.jsonld.normalizer.item"

  'App\Serializer\GratuityNotificationNormalizer':
    arguments:
      $baseUri: "%env(string:BASE_URI)%"

  # EVENT LISTENERS

  'App\EventListener\DeserializeListener':
    tags:
      - {
          name: "kernel.event_listener",
          event: "kernel.request",
          method: "onKernelRequest",
          priority: 2,
        }
    # Autoconfiguration must be disabled to set a custom priority
    autoconfigure: false
    decorates: "api_platform.listener.request.deserialize"
    arguments:
      $decorated: '@App\EventListener\DeserializeListener.inner'

  # Authentication success listener (classic login)
  mobicoop.event.authentication_success_listener:
    class: App\Security\LoginAuthenticator
    tags:
      - {
          name: kernel.event_listener,
          event: lexik_jwt_authentication.on_authentication_success,
          method: onAuthenticationSuccessResponse,
        }

  # JWT Event Listener
  mobicoop.event.jwt_created_listener:
    class: App\Security\EventListener\JWTCreatedListener
    tags:
      - {
          name: kernel.event_listener,
          event: lexik_jwt_authentication.on_jwt_created,
          method: onJWTCreated,
        }

  geocoder_factory:
    class: 'App\Geography\Service\Geocoder\GeocoderFactory'
    arguments:
      $uri: "%env(string:GEOCODER_URI)%"
      $type: "%env(string:GEOCODER_TYPE)%"
      $maxResultsByType: "%env(int:GEOCODER_MAX_RESULTS_BY_TYPE)%"
      $maxResultsByGeocoder: "%env(int:GEOCODER_MAX_RESULTS_BY_GEOCODER)%"

  # Article Load Listener
  mobicoop.article.article_load_listener:
    class: App\Article\EventListener\ArticleLoadListener
    tags:
      - { name: doctrine.event_listener, event: postLoad }
  mobicoop.article.section_load_listener:
    class: App\Article\EventListener\SectionLoadListener
    tags:
      - { name: doctrine.event_listener, event: postLoad }
  mobicoop.article.paragraph_load_listener:
    class: App\Article\EventListener\ParagraphLoadListener
    tags:
      - { name: doctrine.event_listener, event: postLoad }

  # Direction Load Listener
  mobicoop.direction.direction_load_listener:
    class: App\Geography\EventListener\DirectionLoadListener
    arguments: ['@App\Geography\Service\GeoTools'] # GeoTools injected to compute CO2
    tags:
      - { name: doctrine.event_listener, event: postLoad }

  # Address Load Listener
  mobicoop.address.address_load_listener:
    class: App\Geography\EventListener\AddressLoadListener
    arguments: ['@App\Geography\Service\GeoTools'] # GeoTools injected for displayLabel
    tags:
      - { name: doctrine.event_listener, event: postLoad }

  # Campaign Load Listener
  mobicoop.campaign.campaign_load_listener:
    class: App\MassCommunication\EventListener\CampaignLoadListener
    tags:
      - { name: doctrine.event_listener, event: postLoad }

  # Community User Save Listener
  mobicoop.community_user.community_user_save_listener:
    class: App\Community\EventListener\CommunityUserSaveListener
    arguments: ["@request_stack"]
    tags:
      - { name: doctrine.event_listener, event: postPersist }
      - { name: doctrine.event_listener, event: postUpdate }

  # Community Load Listener
  mobicoop.community.community_load_listener:
    class: App\Community\EventListener\CommunityLoadListener
    arguments:
      $avatarDefault: "%env(string:AVATAR_DEFAULT)%"
    tags:
      - { name: doctrine.event_listener, event: postLoad }

  # Event Load Listener
  mobicoop.event.event_load_listener:
    class: App\Event\EventListener\EventLoadListener
    arguments:
      $avatarDefault: "%env(string:AVATAR_DEFAULT)%"
    tags:
      - { name: doctrine.event_listener, event: postLoad }

  # User Load Listener
  mobicoop.user.user_load_listener:
    class: App\User\EventListener\UserLoadListener
    arguments:
      $params:
        avatarSizes: "%env(string:AVATAR_SIZES)%"
        avatarDefaultFolder: "%env(string:AVATAR_DEFAULT_FOLDER)%"
        userReview: "%env(bool:USER_REVIEW)%"
        identityValidation: "%env(bool:USER_IDENTITY_VALIDATION)%"
        minAgeToDrive: "%env(int:USER_MIN_AGE_TO_DRIVE)%"
    tags:
      - { name: doctrine.event_listener, event: postLoad }

  mobicoop.geography.territory_event_listener:
    class: App\Geography\EventListener\TerritoryEventListener
    tags:
      - { name: doctrine.event_listener, event: onSchemaAlterTableRemoveColumn }
      - { name: doctrine.event_listener, event: onSchemaAlterTableAddColumn }

  # Kernel response
  # mobicoop.kernel.response:
  # class: App\EventListener\KernelResponseListener
  # tags:
  # - { name: kernel.event_listener, event: kernel.response, method: onKernelResponse }

  # CONTROLLERS AND SERVICES

  # Article
  App\Article\Controller\:
    resource: "../src/Article/Controller"
    tags: ["controller.service_arguments"]

  App\Article\Service\ArticleManager:
    arguments:
      $articleFeed: "%env(string:ARTICLE_FEED)%"
      $articleFeedNumber: "%env(int:ARTICLE_FEED_NUMBER)%"
      $articleIframeMaxWidth: "%env(int:ARTICLE_IFRAME_MAX_WIDTH)%"
      $articleIframeMaxHeight: "%env(int:ARTICLE_IFRAME_MAX_HEIGHT)%"

  # Auth
  App\Auth\Controller\:
    resource: "../src/Auth/Controller"
    tags: ["controller.service_arguments"]

  App\Auth\Service\AuthManager:
    arguments:
      $modules: "%env(json:file:resolve:MODULES_AUTHORIZED)%"

  # Carpool
  App\Carpool\Controller\:
    resource: "../src/Carpool/Controller"
    tags: ["controller.service_arguments"]

  'App\Carpool\Filter\LocalityFilter':
    # Uncomment only if autoconfiguration isn't enabled
    #tags: [ 'api_platform.filter' ]

  App\Carpool\Service\AntiFraudManager:
    arguments:
      $params:
        active: "%env(bool:ANTIFRAUD_ACTIVE)%"
        distanceMinCheck: "%env(int:ANTIFRAUD_DISTANCE_MIN_CHECK)%"
        nbCarpoolsMax: "%env(int:ANTIFRAUD_NB_CARPOOLS_MAX)%"
    tags:
      - { name: monolog.logger, channel: carpool }

  App\Carpool\Service\AskManager:
    arguments:
      $paymentActive: "%env(string:PAYMENT_ACTIVE)%"
    tags:
      - { name: monolog.logger, channel: carpool }

  App\Carpool\Service\AdManager:
    arguments:
      $geocoderFactory: "@geocoder_factory"
      $params:
        defaultMarginDuration: "%env(int:CARPOOL_MARGIN_DURATION)%"
        defaultSeatsDriver: "%env(int:CARPOOL_DEFAULT_SEATS_DRIVER)%"
        defaultSeatsPassenger: "%env(int:CARPOOL_DEFAULT_SEATS_PASSENGER)%"
        carpoolProofDistance: "%env(int:CARPOOL_PROOF_DISTANCE)%"
        paymentActive: "%env(string:PAYMENT_ACTIVE)%"
        matcherCustomization: "%env(bool:MATCHER_CUSTOMIZATION)%"
        defaultCarpoolTimezone: "%env(string:CARPOOL_TIMEZONE)%"
    tags:
      - { name: monolog.logger, channel: carpool }

  App\Carpool\Service\MatchingManager:
    arguments:
      $repository: '@App\Carpool\Repository\MatchingRepository'

  App\Carpool\Service\MyAdManager:
    arguments:
      $paymentActive: "%env(string:PAYMENT_ACTIVE)%"
      $carpoolDisplayFieldsOrder: "%env(json:CARPOOL_DISPLAY_FIELDS_ORDER)%"
      $userMinAgeToDrive: "%env(int:USER_MIN_AGE_TO_DRIVE)%"

  App\Carpool\Service\ProofManager:
    arguments:
      $geocoderFactory: "@geocoder_factory"
      $provider: "%env(string:CARPOOL_PROOF_PROVIDER)%"
      $duration: "%env(int:CARPOOL_PROOF_RANGE_DURATION)%"
      $minIdentityDistance: "%env(int:CARPOOL_PROOF_MIN_IDENTITY_DISTANCE)%"
    tags:
      - { name: monolog.logger, channel: carpool_proof }

  App\Carpool\Service\DynamicManager:
    arguments:
      $geocoderFactory: "@geocoder_factory"
      $params:
        defaultSeatsDriver: "%env(int:CARPOOL_DEFAULT_SEATS_DRIVER)%"
        defaultSeatsPassenger: "%env(int:CARPOOL_DEFAULT_SEATS_PASSENGER)%"
        dynamicProofDistance: "%env(int:DYNAMIC_CARPOOL_PROOF_DISTANCE)%"
        dynamicReachedDistance: "%env(int:DYNAMIC_CARPOOL_REACHED_DISTANCE)%"
        dynamicDestinationDistance: "%env(int:DYNAMIC_CARPOOL_DESTINATION_DISTANCE)%"
        dynamicMaxSpeed: "%env(int:DYNAMIC_CARPOOL_MAX_SPEED)%"
        dynamicEnableMaxSpeed: "%env(bool:DYNAMIC_CARPOOL_ENABLE_MAX_SPEED)%"
        dynamicTimezone: "%env(string:DYNAMIC_TIMEZONE)%"
    tags:
      - { name: monolog.logger, channel: carpool_dynamic }

  App\Carpool\Service\ProposalManager:
    arguments:
      $geocoderFactory: "@geocoder_factory"
      $params:
        defaultRole: "%env(int:CARPOOL_ROLE)%"
        defaultType: "%env(int:CARPOOL_TYPE)%"
        defaultUseTime: "%env(bool:CARPOOL_USE_TIME)%"
        defaultStrictDate: "%env(bool:CARPOOL_STRICT_DATE)%"
        defaultStrictPunctual: "%env(bool:CARPOOL_STRICT_PUNCTUAL)%"
        defaultStrictRegular: "%env(bool:CARPOOL_STRICT_REGULAR)%"
        defaultMarginDuration: "%env(int:CARPOOL_MARGIN_DURATION)%"
        defaultRegularLifeTime: "%env(int:CARPOOL_REGULAR_LIFETIME)%"
        defaultAnyRouteAsPassenger: "%env(bool:CARPOOL_ANY_ROUTE_PASSENGER)%"
        defaultPriceKm: "%env(float:CARPOOL_PRICE)%"
        batchTemp: "%env(resolve:SIG_GEOROUTER_BATCH_TEMP)%"
        matcherCustomization: "%env(bool:MATCHER_CUSTOMIZATION)%"
    tags:
      - { name: monolog.logger, channel: carpool }

  App\Carpool\Service\ProposalMatcher:
    arguments:
      $params:
        dynamicMaxPendingTime: "%env(int:DYNAMIC_CARPOOL_MAX_PENDING_TIME)%"
        importChunkSize: "%env(int:IMPORT_PROPOSALS_CHUNK_SIZE)%"
        importBatchMatchSize: "%env(int:IMPORT_PROPOSALS_BATCH_MATCH_SIZE)%"
        maxDetourDistancePercent: "%env(int:ALGORITHM_MAX_DETOUR_DISTANCE_PERCENT)%"
        maxDetourDurationPercent: "%env(int:ALGORITHM_MAX_DETOUR_DURATION_PERCENT)%"
        minCommonDistanceCheck: "%env(int:ALGORITHM_MIN_COMMON_DISTANCE_CHECK)%"
        minCommonDistancePercent: "%env(int:ALGORITHM_MIN_COMMON_DISTANCE_PERCENT)%"
        userMinAgeToDrive: "%env(int:USER_MIN_AGE_TO_DRIVE)%"
    tags:
      - { name: monolog.logger, channel: carpool }

  App\Carpool\Repository\ProposalRepository:
    arguments:
      $params:
        bearingRange: "%env(int:ALGORITHM_BEARING_RANGE)%"
        useBearing: "%env(bool:ALGORITHM_USE_BEARING)%"
        useBbox: "%env(bool:ALGORITHM_USE_BBOX)%"
        usePassengerProportion: "%env(bool:ALGORITHM_USE_PASSENGER_PROPORTION)%"
        useDistance: "%env(bool:ALGORITHM_USE_DISTANCE)%"
        passengerProportion: "%env(float:ALGORITHM_PASSENGER_PROPORTION)%"
        maxDistancePunctual: "%env(float:ALGORITHM_MAX_DISTANCE_PUNCTUAL)%"
        maxDistanceRegular: "%env(float:ALGORITHM_MAX_DISTANCE_REGULAR)%"
        distanceRatio: "%env(int:ALGORITHM_DISTANCE_RATIO)%"
    tags:
      - { name: monolog.logger, channel: carpool }

  App\Carpool\Service\CarpoolExportManager:
    arguments:
      $carpoolExportUri: "%env(string:CARPOOL_EXPORT_URI)%"
      $carpoolExportPath: "%env(string:CARPOOL_EXPORT_FILE_PATH)%"
      $carpoolExportPlatformName: "%env(string:CARPOOL_EXPORT_APP_NAME)%"
      $paymentActive: "%env(string:PAYMENT_ACTIVE)%"

  App\Carpool\Service\ResultManager:
    arguments:
      $userReview: "%env(bool:USER_REVIEW)%"
      $carpoolNoticeableDetourDurationPercent: "%env(int:CARPOOL_NOTICEABLE_DETOUR_DURATION_PERCENT)%"
      $carpoolNoticeableDetourDistancePercent: "%env(int:CARPOOL_NOTICEABLE_DETOUR_DISTANCE_PERCENT)%"
      $carpoolDisplayFieldsOrder: "%env(json:CARPOOL_DISPLAY_FIELDS_ORDER)%"

  App\Carpool\Repository\CarpoolProofRepository:
    arguments:
      $carpoolProofErroCheckLimit: "%env(int:CARPOOL_PROOF_ERROR_CHECK_LIMIT)%"

  # CarpoolStandard
  App\CarpoolStandard\Service\CarpoolStandardProvider:
    arguments:
      $provider: "%env(string:CARPOOL_STANDARD_PROVIDER)%"
      $apiKey: "%env(string:CARPOOL_STANDARD_API_KEY)%"
      $baseUri: "%env(string:CARPOOL_STANDARD_BASE_URI)%"
  App\Communication\EventSubscriber\BookingSubscriber:
    arguments:
      $operatorIdentifier: "%env(string:CARPOOL_STANDARD_OPERATOR_IDENTIFIER)%"
  App\CarpoolStandard\Service\CarpoolStandardManager:
    arguments:
      $apiKey: "%env(string:CARPOOL_STANDARD_API_KEY)%"

  # Commands
  App\Command\CarpoolAskPostedRelaunch1Command:
    tags:
      - {
          name: "console.command",
          command: "app:commands:carpool-ask-posted-relaunch1",
        }
  App\Command\CarpoolAskPostedRelaunch2Command:
    tags:
      - {
          name: "console.command",
          command: "app:commands:carpool-ask-posted-relaunch2",
        }
  App\Command\CommunicationInternalMessageReceivedRelaunch1Command:
    tags:
      - {
          name: "console.command",
          command: "app:commands:communication-internal-message-received-relaunch1",
        }
  App\Command\CommunicationInternalMessageReceivedRelaunch2Command:
    tags:
      - {
          name: "console.command",
          command: "app:commands:communication-internal-message-received-relaunch2",
        }
  App\Command\InactiveAdRelaunchCommand:
    tags:
      - {
          name: "console.command",
          command: "app:commands:inactive-ad-relaunch",
        }
  App\Command\InciteToPublishFirstAdCommand:
    tags:
      - {
          name: "console.command",
          command: "app:commands:incite-to-publish-first-ad",
        }
  App\Command\NoActivityRelaunch1Command:
    tags:
      - {
          name: "console.command",
          command: "app:commands:no-activity-relaunch1",
        }
  App\Command\NoActivityRelaunch2Command:
    tags:
      - {
          name: "console.command",
          command: "app:commands:no-activity-relaunch2",
        }
  App\Command\Command\OpenSslEncryptStringCommand:
    tags:
      - { name: "console.command", command: "app:commands:openssl:encrypt" }
    arguments:
      $secret: "%env(string:APP_SECRET)%"
  App\Command\Command\OpenSslDecryptStringCommand:
    tags:
      - { name: "console.command", command: "app:commands:openssl:decrypt" }
    arguments:
      $secret: "%env(string:APP_SECRET)%"
  App\Command\ProposalWillExpireCommand:
    tags:
      - {
          name: "console.command",
          command: "app:commands:proposal-will-expire",
        }
  App\Command\SendBoosterCommand:
    tags:
      - { name: "console.command", command: "app:commands:send-booster" }
  App\Command\SendWelcomeEmailCommand:
    tags:
      - { name: "console.command", command: "app:commands:send-welcome-email" }

  App\Command\Command\ExecuteCommandsCommand:
    arguments:
      $schedule: "%env(json:file:resolve:AUTOMATED_COMMANDS)%"

  # Communication
  App\Communication\Command\PushNotifyToCertifiedJourneyCommand:
    arguments:
      $interval: "%env(int:PUSH_JOURNEY_CERTIFY_INTERVAL)%"
    tags:
      - { name: "console.command", command: "app:notify:journey-certify" }

  App\Communication\Service\PushToCertifiedJourney\PushToCertifiedJourneyManager:
    arguments:
      $timeMargin: "%env(int:PUSH_CARPOOL_START_TIME_MARGIN)%"
      $serverUtcTimeDiff: "%env(int:SERVER_UTC_TIME_DIFF)%"

  App\Communication\Controller\:
    resource: "../src/Communication/Controller"
    arguments:
      $params:
        smsUsername: "%env(string:SMS_USERNAME)%"
        smsPassword: "%env(string:SMS_PASSWORD)%"
        smsSender: "%env(string:SMS_SENDER)%"
    tags: ["controller.service_arguments"]

  App\Communication\Service\ContactManager:
    arguments:
      $contactItems: "%env(json:file:resolve:CONTACT_ITEMS)%"

  App\Communication\Service\NotificationManager:
    arguments:
      $communicationFolder: "%env(resolve:COMMUNICATION_FOLDER)%"
      $altCommunicationFolder: "%env(resolve:ALT_COMMUNICATION_FOLDER)%"
      $emailTemplatePath: "%env(resolve:COMMUNICATION_TEMPLATE_EMAIL_PATH)%%env(resolve:NOTIFICATION_TEMPLATE_EMAIL_PATH)%"
      $emailTitleTemplatePath: "%env(resolve:COMMUNICATION_TEMPLATE_EMAIL_PATH)%%env(resolve:NOTIFICATION_TITLE_TEMPLATE_EMAIL_PATH)%"
      $pushTemplatePath: "%env(resolve:COMMUNICATION_TEMPLATE_PUSH_PATH)%%env(resolve:NOTIFICATION_TEMPLATE_PUSH_PATH)%"
      $pushTitleTemplatePath: "%env(resolve:COMMUNICATION_TEMPLATE_PUSH_PATH)%%env(resolve:NOTIFICATION_TITLE_TEMPLATE_PUSH_PATH)%"
      $smsTemplatePath: "%env(resolve:COMMUNICATION_TEMPLATE_SMS_PATH)%%env(resolve:NOTIFICATION_TEMPLATE_SMS_PATH)%"
      $enabled: "%env(bool:resolve:NOTIFICATION_ENABLED)%"
      $mailsEnabled: "%env(bool:resolve:NOTIFICATION_MAIL_ENABLED)%"
      $smsEnabled: "%env(bool:resolve:NOTIFICATION_SMS_ENABLED)%"
      $pushEnabled: "%env(bool:resolve:NOTIFICATION_PUSH_ENABLED)%"
      $structureLogoUri: "%env(string:STRUCTURE_LOGO_URI)%"
      $defaultCarpoolTimezone: "%env(string:CARPOOL_TIMEZONE)%"
    tags:
      - { name: monolog.logger, channel: notification }

  App\Communication\Service\EmailManager:
    arguments:
      $emailSender: "%env(resolve:MAILER_SENDER)%"
      $emailSenderName: "%env(resolve:MAILER_SENDER_NAME)%"
      $emailReplyTo: "%env(resolve:MAILER_REPLYTO)%"
      $emailReplyToName: "%env(resolve:MAILER_REPLYTO_NAME)%"
      $emailAdditionalHeaders: "%env(resolve:MAILER_ADDITIONAL_HEADERS)%"
    tags:
      - { name: monolog.logger, channel: communication }

  App\Communication\Service\InternalMessageManager:
    arguments:
      $storeReadDate: "%env(bool:MESSAGES_STORE_READ_DATE)%"
    tags:
      - { name: monolog.logger, channel: communication }

  App\Communication\Service\PushManager:
    arguments:
      $pushProvider: "%env(resolve:PUSH_PROVIDER)%"
      $serviceAccount: "%env(resolve:PUSH_SERVICE_ACCOUNT)%"
    tags:
      - { name: monolog.logger, channel: communication }

  App\Communication\Service\SmsManager:
    arguments:
      $smsProvider: "%env(resolve:SMS_PROVIDER)%"
      $username: "%env(resolve:SMS_USERNAME)%"
      $password: "%env(resolve:SMS_PASSWORD)%"
      $sender: "%env(resolve:SMS_SENDER)%"
    tags:
      - { name: monolog.logger, channel: communication }

  App\Communication\EntityListener\RecipientListener:
    tags:
      - { name: doctrine.orm.entity_listener, lazy: true } # lazy set to true to avoid doctrine UnitOfWork error on insert

  App\Communication\EventSubscriber\ContactSubscriber:
    arguments:
      $communicationFolder: "%env(resolve:COMMUNICATION_FOLDER)%"
      $emailTemplatePath: "%env(resolve:COMMUNICATION_TEMPLATE_EMAIL_PATH)%%env(resolve:NOTIFICATION_TEMPLATE_EMAIL_PATH)%"
      $platformName: "%env(string:EMAILS_PLATFORM_NAME)%"

  App\Communication\EventSubscriber\UserSubscriber:
    arguments:
      $notificationSsoRegistration: "%env(bool:NOTIFICATION_SSO_REGISTRATION)%"
      $rzpUri: "%env(string:RZP_API_URI)%"
      $rzpLogin: "%env(string:RZP_API_LOGIN)%"
      $rzpPassword: "%env(string:RZP_API_PASSWORD)%"

  App\Communication\Service\ReportManager:
    arguments:
      $communicationFolder: "%env(resolve:COMMUNICATION_FOLDER)%"
      $emailTemplatePath: "%env(resolve:COMMUNICATION_TEMPLATE_EMAIL_PATH)%%env(resolve:NOTIFICATION_TEMPLATE_EMAIL_PATH)%"
      $emailTitleTemplatePath: "%env(resolve:COMMUNICATION_TEMPLATE_EMAIL_PATH)%%env(resolve:NOTIFICATION_TITLE_TEMPLATE_EMAIL_PATH)%"

  # Community
  App\Community\Controller\:
    resource: "../src/Community/Controller"
    tags: ["controller.service_arguments"]

  App\Community\DataProvider\MCommunityCollectionDataProvider:
    arguments:
      $collectionFilters: !tagged api_platform.doctrine.orm.query_extension.collection

  App\Community\Service\CommunityManager:
    arguments:
      $securityPath: "%env(string:COMMUNITY_SECURITY_PATH)%"
    tags:
      - { name: monolog.logger, channel: community }

  App\Community\Repository\CommunityUserRepository:
    arguments:
      $collectionExtensions: !tagged api_platform.doctrine.orm.query_extension.collection
      $communityNbLastUser: "%env(int:COMMUNITY_NB_LAST_USERS)%"

  App\Community\Admin\Controller\:
    resource: "../src/Community/Admin/Controller"
    tags: ["controller.service_arguments"]

  'App\Community\Admin\DataProvider\CommunityUserCampaignAssociateCollectionDataProvider':
    arguments:
      $collectionExtensions: !tagged api_platform.doctrine.orm.query_extension.collection

  'App\Community\Admin\DataProvider\CommunityUserCampaignSendCollectionDataProvider':
    arguments:
      $collectionExtensions: !tagged api_platform.doctrine.orm.query_extension.collection

  # Consumption feedback
  App\User\DataProvider\ConsumptionFeedbackDataProvider:
    arguments:
      $active: "%env(bool:CONSUMPTION_FEEDBACK_ACTIVE)%"
      $provider: "%env(string:CONSUMPTION_FEEDBACK_PROVIDER)%"
      $appId: "%env(string:CONSUMPTION_FEEDBACK_APP_ID)%"
      $baseUrlAuth: "%env(string:CONSUMPTION_FEEDBACK_AUTH_BASE_URL)%"
      $baseUrl: "%env(string:CONSUMPTION_FEEDBACK_BASE_URL)%"
      $clientId: "%env(string:CONSUMPTION_FEEDBACK_CLIENTID)%"
      $clientSecret: "%env(string:CONSUMPTION_FEEDBACK_CLIENT_SECRET)%"
      $apiKey: "%env(string:CONSUMPTION_FEEDBACK_APIKEY)%"
    tags:
      - { name: monolog.logger, channel: consumptionFeedback }

  # Editorial
  'App\Editorial\Admin\DataProvider\EditorialCollectionDataProvider':
    arguments:
      $collectionExtensions: !tagged api_platform.doctrine.orm.query_extension.collection

  App\Editorial\EntityListener\EditorialListener:
    arguments:
      $editorialRepository: '@App\Editorial\Repository\EditorialRepository'
      $dataUri: "%env(string:DATA_URI)%"
    tags:
      - { name: doctrine.orm.entity_listener, event: postPersist, lazy: true } # lazy set to true to avoid doctrine UnitOfWork error on insert
      - { name: doctrine.orm.entity_listener, event: postUpdate, lazy: true } # lazy set to true to avoid doctrine UnitOfWork error on insert
      - { name: doctrine.orm.entity_listener, event: postLoad, lazy: true } # lazy set to true to avoid doctrine UnitOfWork error on insert

  # Event
  App\Event\Controller\:
    resource: "../src/Event/Controller"
    tags: ["controller.service_arguments"]
  App\Event\DataProvider\EventCollectionDataProvider:
    arguments:
      $collectionFilters: !tagged api_platform.doctrine.orm.query_extension.collection
  App\Event\Service\EventManager:
    arguments:
      $eventProvider: "%env(resolve:EVENT_PROVIDER)%"
      $eventProviderApiKey: "%env(resolve:EVENT_PROVIDER_API_KEY)%"
      $eventProviderProjectId: "%env(resolve:EVENT_PROVIDER_PROJECT_ID)%"
      $eventProviderSelectionId: "%env(resolve:EVENT_PROVIDER_SELECTION_ID)%"
      $eventProviderServerUrl: "%env(string:EVENT_PROVIDER_SERVER_URL)%"
  App\Event\Command\EventImportCommand:
    arguments:
      $eventProviderType: "%env(string:EVENT_PROVIDER_TYPE)%"
      $eventImportEnabled: "%env(bool:EVENT_IMPORT_ENABLED)%"

  App\Event\Admin\DataProvider\EventCollectionDataProvider:
    arguments:
      $collectionFilters: !tagged api_platform.doctrine.orm.query_extension.collection

  App\EventSubscriber\RequestSubscriber:
    tags:
      - { name: "kernel.event_subscriber" }

  # External Connection
  App\ExternalJourney\Service\ExternalConnectionManager:
    arguments:
      $operator: "%env(json:file:resolve:RDEX_OPERATOR)%"
      $providers: "%env(json:file:resolve:RDEX_PROVIDERS)%"

  # External Journey
  App\ExternalJourney\Service\ExternalJourneyManager:
    arguments:
      $operator: "%env(json:file:resolve:RDEX_OPERATOR)%"
      $clients: "%env(json:file:resolve:RDEX_CLIENTS)%"
      $providers: "%env(json:file:resolve:RDEX_PROVIDERS)%"

  App\ExternalJourney\Service\JourneySearcher:
    arguments:
      $providers: "%env(json:file:resolve:RDEX_PROVIDERS)%"

  # Fixtures Basic
  App\DataFixtures\BasicFixtures:
    arguments:
      $fixturesEnabled: "%env(bool:FIXTURES_ENABLED)%"
      $fixturesClearBase: "%env(bool:FIXTURES_CLEAR_BASE)%"
      $fixturesBasic: "%env(bool:FIXTURES_BASIC)%"

  # Fixtures Solidary
  App\DataFixtures\SolidaryFixtures:
    arguments:
      $fixturesEnabled: "%env(bool:FIXTURES_ENABLED)%"
      $fixturesClearBase: "%env(bool:FIXTURES_CLEAR_BASE)%"
      $fixturesSolidary: "%env(bool:FIXTURES_SOLIDARY)%"

  App\DataFixtures\Service\BasicFixturesManager:
    arguments:
      $geocoderFactory: "@geocoder_factory"
      $fixturesBasic: "%env(bool:FIXTURES_BASIC)%"

  App\DataFixtures\Service\SolidaryFixturesManager:
    arguments:
      $fixturesSolidary: "%env(bool:FIXTURES_SOLIDARY)%"

  # Gamification
  mobicoop.gamification.badge_load_listener:
    class: App\Gamification\EventListener\BadgeLoadListener
    tags:
      - { name: doctrine.event_listener, event: postLoad }
  mobicoop.gamification.gamification_action_load_listener:
    class: App\Gamification\EventListener\GamificationActionLoadListener
    tags:
      - { name: doctrine.event_listener, event: postLoad }
  App\Gamification\EventSubscriber\LogSubscriber:
    arguments:
      $gamificationActive: "%env(bool:GAMIFICATION_ACTIVE)%"
  App\Gamification\Service\BadgesBoardManager:
    arguments:
      $badgeImageUri: "%env(string:GAMIFICATION_BADGE_IMAGE_URI)%"
  App\Gamification\Service\GamificationManager:
    arguments:
      $badgeImageUri: "%env(string:GAMIFICATION_BADGE_IMAGE_URI)%"
  App\Gamification\Service\RetroactivelyRewardService:
    tags:
      - { name: monolog.logger, channel: gamification }

  # Geocoder; alias to allow this type to be autowired
  Geocoder\Plugin\PluginProvider: "@bazinga_geocoder.provider.chain"

  # Georouter, add prioritization
  Georouter.query_data_plugin:
    class: Geocoder\Plugin\Plugin\QueryDataPlugin
    arguments:
      - "%env(json:SIG_GEOCODER_PRIORITIZE_COORDINATES)%"
  # Geography
  App\Geography\Controller\:
    resource: "../src/Geography/Controller"
    tags: ["controller.service_arguments"]

  App\Geography\EventSubscriber\CarpoolSubscriber:
    arguments:
      $directory: "%env(resolve:ASYNC_GEO_TEMP)%"

  App\Geography\Service\AddressManager:
    tags:
      - { name: monolog.logger, channel: geography }

  App\Geography\Service\GeoRouter:
    arguments:
      $uri: "%env(resolve:SIG_GEOROUTER_URI)%"
      $type: "%env(resolve:SIG_GEOROUTER_TYPE)%"
      $batchScriptPath: "%env(resolve:SIG_GEOROUTER_BATCH_SCRIPT_PATH)%"
      $batchScriptArgs: "%env(resolve:SIG_GEOROUTER_BATCH_SCRIPT_ARGS)%"
      $batchTemp: "%env(resolve:SIG_GEOROUTER_BATCH_TEMP)%"
    tags:
      - { name: monolog.logger, channel: georouter }

  App\Geography\Service\GeoTools:
    arguments:
      $params:
        displayCountry: "%env(resolve:DISPLAY_COUNTRY)%"
        displayRegion: "%env(resolve:DISPLAY_REGION)%"
        displaySubRegion: "%env(resolve:DISPLAY_SUBREGION)%"
        displayLocality: "%env(resolve:DISPLAY_LOCALITY)%"
        displayPostalCode: "%env(resolve:DISPLAY_POSTALCODE)%"
        displayStreetAddress: "%env(resolve:DISPLAY_STREETADDRESS)%"
        displayVenue: "%env(resolve:DISPLAY_VENUE)%"
        displayRelayPoint: "%env(resolve:DISPLAY_RELAY_POINT)%"
        displayNamed: "%env(resolve:DISPLAY_NAMED)%"
        displayEvent: "%env(resolve:DISPLAY_EVENT)%"
        displaySeparator: "%env(resolve:DISPLAY_SEPARATOR)%"

  App\Geography\Service\GeoSearcher:
    arguments:
      $iconPath: "%env(resolve:GEOCOMPLETE_ICONS_PATH)%"
      $dataPath: "%env(resolve:DATA_URI)%"
      $defaultSigResultNumber: "%env(resolve:GEOCOMPLETE_SIG_DEFAULT_RESULTS)%"
      $defaultSigReturnedResultNumber: "%env(resolve:GEOCOMPLETE_SIG_RETURNED_RESULTS)%"
      $defaultNamedResultNumber: "%env(resolve:GEOCOMPLETE_NAMED_DEFAULT_RESULTS)%"
      $defaultRelayPointResultNumber: "%env(resolve:GEOCOMPLETE_RELAY_POINTS_DEFAULT_RESULTS)%"
      $defaultEventResultNumber: "%env(resolve:GEOCOMPLETE_EVENTS_DEFAULT_RESULTS)%"
      $geoDataFixes: "%env(json:file:resolve:SIG_GEOCODER_FIXER_DATA)%"
      $distanceOrder: "%env(bool:SIG_GEOCODER_PRIORITIZE_ORDER)%"
      $sigPrioritizeCoordinates: "%env(json:SIG_GEOCODER_PRIORITIZE_COORDINATES)%"
      $sigPrioritizeRegion: "%env(string:SIG_GEOCODER_PRIORITIZE_REGION)%"
      $sigShowVenues: "%env(bool:SIG_GEOCODER_SHOW_VENUES)%"

  App\Geography\Service\PointSearcher:
    arguments:
      $geocoderFactory: "@geocoder_factory"
      $maxRelayPointResults: "%env(int:POINT_SEARCHER_RELAY_POINT_MAX_RESULTS)%"
      $maxEventResults: "%env(int:POINT_SEARCHER_EVENT_MAX_RESULTS)%"
      $maxUserResults: "%env(int:POINT_SEARCHER_USER_MAX_RESULTS)%"
      $prioritizeCentroid: "%env(json:POINT_SEARCHER_PRIORITIZE_CENTROID)%"
      $prioritizeBox: "%env(json:POINT_SEARCHER_PRIORITIZE_BOX)%"
      $prioritizeRegion: "%env(string:POINT_SEARCHER_PRIORITIZE_REGION)%"
      $restrictCountry: "%env(string:POINT_SEARCHER_RESTRICT_COUNTRY)%"
      $exclusionTypes: "%env(json:POINT_SEARCHER_EXCLUSION_TYPES)%"
      $relayPointParams: "%env(json:POINT_SEARCHER_RELAY_POINT_PARAMETERS)%"
      $fixerData: "%env(json:file:resolve:POINT_SEARCHER_FIXER_DATA)%"
      $fixerEnabled: "%env(bool:POINT_SEARCHER_FIXER_ENABLE)%"

  App\Geography\Service\AddressTerritoryLinkChecker:
    arguments:
      $batchTemp: "%env(resolve:SIG_GEOROUTER_BATCH_TEMP)%"
    tags:
      - { name: monolog.logger, channel: geography }

  App\Geography\Service\TerritoryManager:
    arguments:
      $batchTemp: "%env(resolve:SIG_GEOROUTER_BATCH_TEMP)%"
    tags:
      - { name: monolog.logger, channel: geography }

  # Gratuity
  App\Gratuity:
    tags:
      - { name: monolog.logger, channel: gratuity }

  App\Gratuity\Service\GratuityCampaignManager:
    arguments:
      $gratuityCampaignActive: "%env(bool:GRATUITY_CAMPAIGN_ACTIVE)%"
    tags:
      - { name: monolog.logger, channel: gratuity }

  App\Gratuity\EventSubscriber\LogSubscriber:
    arguments:
      $gratuityActive: "%env(bool:GRATUITY_CAMPAIGN_ACTIVE)%"

  App\Gratuity\EventSubscriber\ActionSubscriber:
    arguments:
      $gratuityActive: "%env(bool:GRATUITY_CAMPAIGN_ACTIVE)%"

  App\Stats\Admin\Service\AnalyticManager:
    arguments:
      $params: "%env(json:file:resolve:ANALYTICS_PARAMETERS)%"

  # Incentive
  App\Incentive\Service\EecProviderManager:
    arguments:
      $eecIncentiveProvider: "%env(string:EEC_INCENTIVE_PROVIDER)%"

  # Image
  App\Image\Controller\:
    resource: "../src/Image/Controller"
    tags: ["controller.service_arguments"]

  App\Image\Admin\Controller\:
    resource: "../src/Image/Admin/Controller"
    tags: ["controller.service_arguments"]

  App\Image\EntityListener\ImageListener:
    arguments: ['@App\Image\Service\ImageManager']
    tags:
      - { name: doctrine.orm.entity_listener, lazy: true } # lazy set to true to avoid doctrine UnitOfWork error on insert

  App\Image\EntityListener\IconListener:
    arguments:
      $types: "%images%"
      $dataUri: "%env(string:DATA_URI)%"
    tags:
      - { name: doctrine.orm.entity_listener, lazy: true } # lazy set to true to avoid doctrine UnitOfWork error on insert

  App\Image\Service\ImageManager:
    arguments:
      $types: "%images%"
      $dataUri: "%env(string:DATA_URI)%"
    tags:
      - { name: monolog.logger, channel: maintenance }

  # Import
  App\Import\Controller\:
    resource: "../src/Import/Controller"
    tags: ["controller.service_arguments"]

  App\Import\Admin\Controller\:
    resource: "../src/Import/Admin/Controller"
    tags: ["controller.service_arguments"]

  App\Import\Service\ImportManager:
    arguments:
      $timeLimit: "%env(int:IMPORT_TIME_LIMIT)%"
      $memoryLimit: "%env(int:IMPORT_MEMORY_LIMIT)%"
      $sqlLog: "%env(bool:IMPORT_SQL_LOG)%"
      $directionsBatch: "%env(int:IMPORT_USERS_DIRECTIONS_BATCH_SIZE)%"

  App\Import\Service\FakeManager:
    tags:
      - { name: monolog.logger, channel: faker }

  App\Import\Admin\Controller\ImportEventsAction:
    arguments:
      $eventProviderServerIP: "%env(string:EVENT_PROVIDER_SERVER_IP)%"
      $eventRemoteFilePath: "%env(string:EVENT_REMOTE_FILE_PATH)%"
      $eventFtpLogin: "%env(string:EVENT_FTP_LOGIN)%"
      $eventFtpPassword: "%env(string:EVENT_FTP_PASWORD)%"
      $eventProvider: "%env(string:EVENT_PROVIDER)%"

  # INCENTIVE

  App\Incentive\Command\SubscriptionsVerificationCommand:
    tags:
      - {
          name: "console.command",
          command: "app:incentive:subscriptions-verification",
        }

  App\Incentive\Command\SubscriptionVerificationCommand:
    tags:
      - {
          name: "console.command",
          command: "app:incentive:subscription-verify",
        }

  App\Incentive\Command\ResetSubscriptionCommand:
    tags:
      - { name: "console.command", command: "app:incentive:subscription-reset" }

  App\Incentive\Command\SubscriptionCommitCommand:
    tags:
      - {
          name: "console.command",
          command: "app:incentive:subscription-commit",
        }

  App\Incentive\Command\SubscriptionUpdateCommand:
    tags:
      - {
          name: "console.command",
          command: "app:incentive:subscription-update",
        }

  App\Incentive\Command\JourneyRecoveryCommand:
    tags:
      - { name: "console.command", command: "app:incentive:journeys-recovery" }

  App\Incentive\Command\SubscriptionTimestampsTokenCommand:
    tags:
      - {
          name: "console.command",
          command: "app:incentive:subscription-mobTimestampsToken",
        }

  App\Incentive\Controller\IncentivesController:
    tags:
      - controller.service_arguments

  App\Incentive\Controller\EECTimestamps:
    tags:
      - controller.service_arguments

  App\Incentive\Controller\Subscription\LdSubscriptionCommit:
    tags:
      - controller.service_arguments

  App\Incentive\Controller\Subscription\LdSubscriptionUpdate:
    tags:
      - controller.service_arguments

  App\Incentive\Controller\Subscription\SdSubscriptionCommit:
    tags:
      - controller.service_arguments

  App\Incentive\Controller\Subscription\SdSubscriptionUpdate:
    tags:
      - controller.service_arguments

  App\Incentive\Controller\Subscription\UserSubscriptions:
    tags:
      - controller.service_arguments

  App\Incentive\Controller\TimestampController:
    tags:
      - controller.service_arguments

  App\Carpool\Command\CarpoolProofSendHistory:
    tags:
      - { name: "console.command", command: "app:carpool:proof-send-history" }

  App\Incentive\Command\VersionTransitionalPeriodCommand:
    tags:
      - {
          name: "console.command",
          command: app:incentive:subscription-transitional-period",
        }

  App\Incentive\Repository\LongDistanceSubscriptionRepository:
    arguments:
      $deadline: "%env(int:EEC_JOURNEY_DECLARATION_DEADLINE)%"
  App\Incentive\Repository\ShortDistanceSubscriptionRepository:
    arguments:
      $deadline: "%env(int:EEC_JOURNEY_DECLARATION_DEADLINE)%"

  App\Incentive\Service\LoggerService:
    arguments:
      $globalForcingLogs: "%env(bool:EEC_FORCING_LOGS)%"
    tags:
      - { name: monolog.logger, channel: incentive_subscription }

  App\Incentive\Service\Manager\AuthManager:
    tags:
      - { name: monolog.logger, channel: incentive_subscription }

  App\Incentive\Service\Manager\InstanceManager:
    arguments:
      $eecServiveConfiguration: "%env(json:file:resolve:EEC_SERVICE)%"
      $carpoolProofPrefix: "%env(string:CARPOOL_PROOF_PREFIX)%"

  App\Incentive\Service\Manager\SubscriptionManager:
    arguments:
      $eecSendWarningIncompleteProfile: "%env(bool:EEC_SEND_WARNING_INCOMPLETE_PROFILE)%"
      $eecSendWarningIncompleteProfileTime: "%env(int:EEC_SEND_WARNING_INCOMPLETE_PROFILE_TIME)%"
    tags:
      - { name: monolog.logger, channel: incentive_subscription }

  App\Incentive\Service\Manager\TimestampTokenManager:
    tags:
      - { name: monolog.logger, channel: incentive_subscription }

  App\Incentive\Service\Validation\SubscriptionValidation:
    arguments:
      $deadline: "%env(int:EEC_JOURNEY_DECLARATION_DEADLINE)%"

  # Journey
  App\Journey\Service\JourneyManager:
    arguments:
      $popularJourneyMaxNumber: "%env(int:POPULAR_JOURNEY_MAX_NUMBER)%"
      $popularJourneyHomeMaxNumber: "%env(int:POPULAR_JOURNEY_HOME_MAX_NUMBER)%"
      $popularJourneyMinOccurences: "%env(int:POPULAR_JOURNEY_MINIMAL_OCCURENCES)%"
      $defaultCarpoolTimezone: "%env(string:CARPOOL_TIMEZONE)%"

  App\Journey\Repository\JourneyRepository:
    arguments:
      $collectionExtensions: !tagged api_platform.doctrine.orm.query_extension.collection

  # Translation
  App\I18n\Service\LanguageManager:
    arguments:
      $defaultLanguage: "%env(int:DEFAULT_LANGUAGE)%"

  # Mass Communication
  App\MassCommunication\Controller\:
    resource: "../src/MassCommunication/Controller"
    tags: ["controller.service_arguments"]

  App\MassCommunication\Service\CampaignManager:
    arguments:
      $mailerProvider: "%env(string:MASS_MAILER_PROVIDER)%"
      $mailerApiUrl: "%env(string:MASS_MAILER_API_URL)%"
      $mailerClientName: "%env(string:MASS_MAILER_CLIENT_NAME)%"
      $mailerClientId: "%env(string:MASS_MAILER_CLIENT_ID)%"
      $mailerClientTemplateId: "%env(string:MASS_MAILER_CLIENT_TEMPLATE_ID)%"
      $mailerReplyTo: "%env(string:MASS_MAILER_REPLYTO)%"
      $mailerSenderEmail: "%env(string:MASS_MAILER_SENDER_EMAIL)%"
      $mailerSenderName: "%env(string:MASS_MAILER_SENDER_NAME)%"
      $mailerDomain: "%env(string:MASS_MAILER_DOMAIN)%"
      $mailerIp: "%env(string:MASS_MAILER_IP)%"
      $smsProvider: "%env(string:MASS_SMS_PROVIDER)%"
      $mailerApiKey: "%env(string:MASS_MAILER_API_KEY)%"
      $mailTemplate: "%env(string:MASS_MAILER_BASE_TEMPLATE)%"

  App\MassCommunication\Admin\Service\CampaignManager:
    arguments:
      $mailTemplate: "%env(string:MASS_MAILER_BASE_TEMPLATE)%"
      $mailerProvider: "%env(string:MASS_MAILER_PROVIDER)%"
      $mailerProviderIpRange1: "%env(json:MASS_MAILER_PROVIDER_IPRANGE1)%"
      $mailerProviderIpRange2: "%env(json:MASS_MAILER_PROVIDER_IPRANGE2)%"
      $mailerApiKey: "%env(string:MASS_MAILER_API_KEY)%"
      $mailerClientName: "%env(string:MASS_MAILER_CLIENT_NAME)%"
      $mailerClientId: "%env(int:MASS_MAILER_CLIENT_ID)%"
      $mailerClientTemplateId: "%env(string:MASS_MAILER_CLIENT_TEMPLATE_ID)%"
      $mailerReplyTo: "%env(string:MASS_MAILER_REPLYTO)%"
      $mailerSenderEmail: "%env(string:MASS_MAILER_SENDER_EMAIL)%"
      $mailerSenderName: "%env(string:MASS_MAILER_SENDER_NAME)%"
      $mailerDomain: "%env(string:MASS_MAILER_DOMAIN)%"
      $mailerIp: "%env(string:MASS_MAILER_IP)%"
      $smsProvider: "%env(string:MASS_SMS_PROVIDER)%"

  # Match
  App\Match\Controller\:
    resource: "../src/Match/Controller"
    tags: ["controller.service_arguments"]

  App\Match\Service\GeoMatcher:
    tags:
      - { name: monolog.logger, channel: geomatcher }

  App\Match\Service\MassComputeManager:
    arguments:
      $roundTripCompute: "%env(bool:MOBIMATCH_ROUNDTRIP_COMPUTE)%"
      $aberrantCoefficient: "%env(int:MOBIMATCH_ABERRANT_COEFFICIENT)%"
      $kilometerPrice: "%env(float:MOBIMATCH_KILOMETER_PRICE)%"
    tags:
      - { name: monolog.logger, channel: mass }

  App\Match\Service\MassImportManager:
    arguments:
      $geocoderFactory: "@geocoder_factory"
      $params: "%mass%"
      $prioritizeCentroid: "%env(json:POINT_SEARCHER_PRIORITIZE_CENTROID)%"
      $prioritizeBox: "%env(json:POINT_SEARCHER_PRIORITIZE_BOX)%"
      $prioritizeRegion: "%env(string:POINT_SEARCHER_PRIORITIZE_REGION)%"
      $restrictCountry: "%env(string:POINT_SEARCHER_RESTRICT_COUNTRY)%"
      $exclusionTypes: "%env(json:POINT_SEARCHER_EXCLUSION_TYPES)%"
    tags:
      - { name: monolog.logger, channel: mass }

  App\Match\Service\MassMigrateManager:
    arguments:
      $params:
        chat: "%env(int:CARPOOL_DEFAULT_CHAT)%"
        music: "%env(int:CARPOOL_DEFAULT_MUSIC)%"
        smoke: "%env(bool:CARPOOL_DEFAULT_SMOKE)%"
    tags:
      - { name: monolog.logger, channel: mass }

  App\Match\Service\MassPublicTransportPotentialManager:
    arguments:
      $params:
        ptMaxConnections: "%env(int:MOBIMATCH_PT_MAXIMAL_CONNECTIONS)%"
        ptMaxDistanceWalkFromHome: "%env(int:MOBIMATCH_PT_MAXIMUM_DISTANCE_WALK_FROM_HOME)%"
        ptMaxDistanceWalkFromWork: "%env(int:MOBIMATCH_PT_MAXIMUM_DISTANCE_WALK_FROM_WORK)%"
        ptMaxNbCarDuration: "%env(int:MOBIMATCH_PT_MAXIMUM_NB_CAR_DURATION)%"
        roundTripCompute: "%env(bool:MOBIMATCH_ROUNDTRIP_COMPUTE)%"
        carpoolTimezone: "%env(string:CARPOOL_TIMEZONE)%"
    tags:
      - { name: monolog.logger, channel: mass }

  App\DataProvider\Entity\MobicoopMatcherProvider:
    arguments:
      $uri: "%env(string:MATCHER_URI)%"
      $apiKey: "%env(string:MATCHER_API_KEY)%"
    tags:
      - { name: monolog.logger, channel: matcherV3 }

  App\DataProvider\Service\RpcApiManager:
    arguments:
      $prefix: "%env(string:CARPOOL_PROOF_PREFIX)%"
      $rpcApiVersion: "%env(string:RPC_API_VERSION)%"
      $token: "%env(string:CARPOOL_PROOF_TOKEN)%"
      $uri: "%env(string:CARPOOL_PROOF_URI)%"

  App\DataProvider\Service\RPCv3\Tools:
    arguments:
      $phoneNumberTruncLength: "%env(int:CARPOOL_PROOF_PHONE_TRUNC_LENGTH)%"
      $prefix: "%env(string:CARPOOL_PROOF_PREFIX)%"
      $secret: "%env(string:APP_SECRET)%"

  App\Carpool\Service\MobicoopMatcher\MobicoopMatcherMatchingBuilder:
    arguments:
      $maxDetourDistancePercent: "%env(int:ALGORITHM_MAX_DETOUR_DISTANCE_PERCENT)%"
      $maxDetourDurationPercent: "%env(int:ALGORITHM_MAX_DETOUR_DURATION_PERCENT)%"
    tags:
      - { name: monolog.logger, channel: matcherV3 }

  RPCChecker:
    class: App\Monitor\Infrastructure\RPCChecker
    arguments:
      $rpcUri: "%env(string:CARPOOL_PROOF_URI)%"
      $rpcToken: "%env(string:CARPOOL_PROOF_TOKEN)%"
      $rpcPrefix: "%env(string:CARPOOL_PROOF_PREFIX)%"

  App\Monitor\Core\Application\Service\ProofChecker:
    arguments:
      $rpcChecker: "@RPCChecker"

  NotificationAbuseChecker:
    class: App\Monitor\Infrastructure\NotificationAbuseChecker

  App\Monitor\Core\Application\Service\NotificationAbuseChecker:
    arguments:
      $notificationAbuseChecker: "@NotificationAbuseChecker"

  # Payment
  App\Payment\Command\UnpaidReminderCommand:
    tags:
      - { name: "console.command", command: "app:payment:unpaid-reminder" }

  App\Payment\Controller\:
    resource: "../src/Payment/Controller"
    tags: ["controller.service_arguments"]

  App\Payment\Service\PaymentDataProvider:
    arguments:
      $paymentActive: "%env(string:PAYMENT_ACTIVE)%"
      $paymentProvider: "%env(string:PAYMENT_PROVIDER)%"
      $clientId: "%env(string:PAYMENT_CLIENTID)%"
      $apikey: "%env(string:PAYMENT_APIKEY)%"
      $sandBoxMode: "%env(bool:PAYMENT_SANDBOX_MODE)%"
      $defaultCurrency: "%env(string:PAYMENT_DEFAULT_CURRENCY)%"
      $platformName: "%env(string:PAYMENT_PLATFORM_NAME)%"
      $validationDocsPath: "%env(resolve:PAYMENT_VALIDATION_DOCS_PATH)%"
      $baseUri: "%env(string:BASE_URI)%"
      $baseMobileUri: "%env(string:BASE_MOBILE_URI)%"

  App\Payment\Service\PaymentManager:
    arguments:
      $paymentActive: "%env(string:PAYMENT_ACTIVE)%"
      $paymentProviderService: "%env(string:PAYMENT_PROVIDER)%"
      $securityTokenActive: "%env(bool:PAYMENT_SECURITY_TOKEN_ACTIVE)%"
      $securityToken: "%env(string:PAYMENT_SECURITY_TOKEN)%"
      $validationDocsPath: "%env(resolve:PAYMENT_VALIDATION_DOCS_PATH)%"
      $validationDocsAuthorizedExtensions: "%env(json:VALIDATION_DOC_AUTHORIZED_EXTENTIONS)%"
      $exportPath: "%env(resolve:PAYMENT_EXPORT_PATH)%"
      $defaultCarpoolTimezone: "%env(string:CARPOOL_TIMEZONE)%"

  App\Payment\Service\BankTransfer\:
    resource: "../src/Payment/Service/BankTransfer/*"
    tags:
      - { name: monolog.logger, channel: bank_transfer }

  App\Payment\Service\BankTransfer\BankTransferEmitterValidator:
    arguments:
      $paymentActive: "%env(string:PAYMENT_ACTIVE)%"
      $holderId: "%env(string:BANK_TRANSFER_HOLDER_ID)%"
    tags:
      - { name: monolog.logger, channel: bank_transfer }

  App\Payment\Service\BankTransfer\BankTransfersSummarizer:
    arguments:
      $communicationFolder: "%env(resolve:COMMUNICATION_FOLDER)%"
      $emailTemplatePath: "%env(resolve:COMMUNICATION_TEMPLATE_EMAIL_PATH)%%env(resolve:NOTIFICATION_TEMPLATE_EMAIL_PATH)%"
      $emailTitleTemplatePath: "%env(resolve:COMMUNICATION_TEMPLATE_EMAIL_PATH)%%env(resolve:NOTIFICATION_TITLE_TEMPLATE_EMAIL_PATH)%"
      $emailRecipients: "%env(json:BANK_TRANSFER_REPORT_EMAIL)%"
    tags:
      - { name: monolog.logger, channel: bank_transfer }

  App\Payment\Service\Transaction\TransactionsSummarizer:
    arguments:
      $platformName: "%env(string:PAYMENT_PLATFORM_NAME)%"
      $communicationFolder: "%env(resolve:COMMUNICATION_FOLDER)%"
      $emailTemplatePath: "%env(resolve:COMMUNICATION_TEMPLATE_EMAIL_PATH)%%env(resolve:NOTIFICATION_TEMPLATE_EMAIL_PATH)%"
      $emailTitleTemplatePath: "%env(resolve:COMMUNICATION_TEMPLATE_EMAIL_PATH)%%env(resolve:NOTIFICATION_TITLE_TEMPLATE_EMAIL_PATH)%"
      $emailRecipient: "%env(string:PAYMENT_ACCOUNTANT_EMAIL)%"

  App\Payment\Service\UnpaidReminderManager:
    arguments:
      $reminderDelays: "%env(json:PAYMENT_UNPAID_REMINDER_DELAYS)%"

  App\Payment\Command\GetWalletTransactionCommand:
    arguments:
      $paymentAccountantWalletId: "%env(string:PAYMENT_ACCOUNTANT_WALLET_ID)%"

  # Price
  App\Price\Controller\:
    resource: "../src/Price/Controller"
    tags: ["controller.service_arguments"]

  # Public transport
  App\PublicTransport\Service\PTDataProvider:
    arguments:
      $params:
        ptProviders: "%env(json:file:resolve:PT_PROVIDERS)%"

  # Rdex
  App\Rdex\Controller\:
    resource: "../src/Rdex/Controller"
    tags: ["controller.service_arguments"]

  App\Rdex\Service\RdexManager:
    arguments:
      $clients: "%env(json:file:resolve:RDEX_CLIENTS)%"
      $operator: "%env(json:file:resolve:RDEX_OPERATOR)%"
      $defaultMarginDuration: "%env(int:CARPOOL_MARGIN_DURATION)%"

  # RelayPoint
  App\RelayPoint\Service\RelayPointMapManager:
    arguments:
      $dataPath: "%env(resolve:DATA_URI)%"

  App\RelayPoint\EntityListener\RelayPointTypeListener:
    arguments:
      $dataUri: "%env(string:DATA_URI)%"
    tags:
      - { name: doctrine.orm.entity_listener, lazy: true } # lazy set to true to avoid doctrine UnitOfWork error on insert
  App\RelayPoint\Repository\RelayPointRepository:
    arguments:
      $collectionExtensions: !tagged api_platform.doctrine.orm.query_extension.collection

  App\RelayPoint\Admin\DataProvider\RelayPointCollectionDataProvider:
    arguments:
      $collectionExtensions: !tagged api_platform.doctrine.orm.query_extension.collection

  # Solidary
  App\Solidary\Controller\:
    resource: "../src/Solidary/Controller"
    tags: ["controller.service_arguments"]

  App\Solidary\Admin\Controller\:
    resource: "../src/Solidary/Admin/Controller"
    tags: ["controller.service_arguments"]

  App\Solidary\EventSubscriber\SolidarySubscriber:
    arguments:
      $isOperatorNotificationAllowed: "%env(bool:resolve:SOLIDARY_ON_DEMAND_CREATE_NOTIFY_MANAGER)%"

  App\Solidary\Service\SolidaryMatcher:
    arguments:
      $params:
        solidaryMMinRangeTime: "%env(string:SOLIDARY_M_MIN_RANGE_TIME)%"
        solidaryMMaxRangeTime: "%env(string:SOLIDARY_M_MAX_RANGE_TIME)%"
        solidaryAMinRangeTime: "%env(string:SOLIDARY_A_MIN_RANGE_TIME)%"
        solidaryAMaxRangeTime: "%env(string:SOLIDARY_A_MAX_RANGE_TIME)%"
        solidaryEMinRangeTime: "%env(string:SOLIDARY_E_MIN_RANGE_TIME)%"
        solidaryEMaxRangeTime: "%env(string:SOLIDARY_E_MAX_RANGE_TIME)%"

  App\Solidary\Service\SolidaryContactManager:
    arguments:
      $notificationsEnabled: "%env(bool:resolve:NOTIFICATION_ENABLED)%"

  App\Solidary\Service\SolidaryUserManager:
    arguments:
      $params:
        chat: "%env(int:CARPOOL_DEFAULT_CHAT)%"
        music: "%env(int:CARPOOL_DEFAULT_MUSIC)%"
        smoke: "%env(bool:CARPOOL_DEFAULT_SMOKE)%"

  'App\Solidary\Admin\DataProvider\SolidaryCollectionDataProvider':
    arguments:
      $collectionExtensions: !tagged api_platform.doctrine.orm.query_extension.collection

  'App\Solidary\Admin\DataProvider\SolidaryBeneficiaryCollectionDataProvider':
    arguments:
      $collectionExtensions: !tagged api_platform.doctrine.orm.query_extension.collection

  'App\Solidary\Admin\DataProvider\SolidaryVolunteerCollectionDataProvider':
    arguments:
      $collectionExtensions: !tagged api_platform.doctrine.orm.query_extension.collection

  App\Solidary\Admin\Service\SolidaryManager:
    tags:
      - { name: monolog.logger, channel: solidary }

  App\Solidary\Admin\Service\SolidaryBeneficiaryManager:
    arguments:
      $fileFolder: "%env(string:SOLIDARY_FILE_FOLDER)%"

  App\Solidary\Admin\Service\SolidaryVolunteerManager:
    arguments:
      $fileFolder: "%env(string:SOLIDARY_FILE_FOLDER)%"

  # User
  App\User\Admin\Service\UserManager:
    arguments:
      $chat: "%env(int:CARPOOL_DEFAULT_CHAT)%"
      $music: "%env(int:CARPOOL_DEFAULT_MUSIC)%"
      $smoke: "%env(bool:CARPOOL_DEFAULT_SMOKE)%"
      $rzpUri: "%env(string:RZP_API_URI)%"
      $rzpLogin: "%env(string:RZP_API_LOGIN)%"
      $rzpPassword: "%env(string:RZP_API_PASSWORD)%"
      $userDelegateEmailBase: "%env(string:USER_DELEGATE_EMAIL_BASE)%"

  App\User\Admin\Service\KibanaLoginManager:
    arguments:
      $loginsAdmin: "%env(json:KIBANA_LOGINS_ADMIN)%"
      $loginsCommunityManager: "%env(json:KIBANA_LOGINS_COMMUNITY_MANAGER)%"
      $loginsSolidaryOperator: "%env(json:KIBANA_LOGINS_SOLIDARY_OPERATOR)%"

  App\User\Controller\:
    resource: "../src/User/Controller"
    tags: ["controller.service_arguments"]

  'App\User\DataProvider\UserSearchCollectionDataProvider':
    arguments:
      $collectionExtensions: !tagged api_platform.doctrine.orm.query_extension.collection

  'App\User\Admin\DataProvider\UserCampaignAssociateCollectionDataProvider':
    arguments:
      $collectionExtensions: !tagged api_platform.doctrine.orm.query_extension.collection

  'App\User\Admin\DataProvider\UserDeleteCollectionDataProvider':
    arguments:
      $collectionExtensions: !tagged api_platform.doctrine.orm.query_extension.collection

  'App\User\Admin\DataProvider\UserCampaignSendCollectionDataProvider':
    arguments:
      $collectionExtensions: !tagged api_platform.doctrine.orm.query_extension.collection

  'App\User\Filter\HomeAddressTerritoryFilter':
    # Uncomment only if autoconfiguration isn't enabled
    #tags: [ 'api_platform.filter' ]

  App\User\Service\UserAutoDeleter:
    arguments:
      $active: "%env(bool:USER_AUTO_DELETE_AFTER_INACTIVITY)%"
      $period: "%env(int:USER_AUTO_DELETE_PERIOD)%"
    tags:
      - { name: monolog.logger, channel: user_auto_delete }

  App\User\Service\HitchhickerIncompleteRegistrationRelauncher:
    arguments:
      $active: "%env(bool:HITCHHICKER_INCOMPLETE_REGISTRATION_RELAUNCHER_ACTIVE)%"
    tags:
      - {
          name: monolog.logger,
          channel: hitchhicker_incomplete_registration_relauncher,
        }

  App\User\Service\IdentityProofManager:
    arguments:
      $uploadPath: "%kernel.project_dir%/public/upload/users/proofs/"
      $urlPath: "%env(string:DATA_URI)%users/proofs/"

  App\User\Service\UserManager:
    arguments:
      $chat: "%env(int:CARPOOL_DEFAULT_CHAT)%"
      $music: "%env(int:CARPOOL_DEFAULT_MUSIC)%"
      $smoke: "%env(bool:CARPOOL_DEFAULT_SMOKE)%"
      $fakeFirstMail: "%env(string:FAKE_FIRST_MAIL)%"
      $fakeFirstToken: "%env(string:FAKE_FIRST_TOKEN)%"
      $domains: "%env(json:file:resolve:REGISTER_DOMAIN)%"
      $profile:
        maxMessagesForAnswerRate: "%env(int:USER_MAX_MESSAGES_FOR_ANSWER_RATE)%"
        experiencedTag: "%env(bool:USER_EXPERIENCED_TAG)%"
        experiencedTagMinCarpools: "%env(int:USER_EXPERIENCED_TAG_MIN_CARPOOLS)%"
        experiencedTagMinAnswerPct: "%env(int:USER_EXPERIENCED_TAG_MIN_ANSWER_PCT)%"
        experiencedTagMinAnswerPctDefault: "%env(int:USER_EXPERIENCED_TAG_MIN_ANSWER_PCT_DEFAULT)%"
        userReview: "%env(bool:USER_REVIEW)%"
      $passwordTokenValidity: "%env(int:PASSWORD_TOKEN_VALIDITY)%"
      $paymentActive: "%env(string:PAYMENT_ACTIVE)%"
      $userMinAge: "%env(int:USER_MIN_AGE)%"
      $carpoolStandardEnabled: "%env(bool:CARPOOL_STANDARD_ENABLED)%"
      $authorizedReferrals: "%env(json:SIGNUP_AUTHORIZED_REFERRALS)%"

  App\User\Interoperability\Service\UserManager:
    arguments:
      $notificationSsoRegistration: "%env(bool:NOTIFICATION_SSO_REGISTRATION)%"

  App\User\Service\UserUnderEighteenManager:
    arguments:
      $defaultCarpoolTimezone: "%env(string:CARPOOL_TIMEZONE)%"

  App\User\Controller\EECSubscription:
    tags:
      - controller.service_arguments
    arguments:
      $ceeSubscriptionProvider: "%env(string:EEC_INCENTIVE_PROVIDER)%"

  App\User\Service\ReviewManager:
    arguments:
      $userReview: "%env(bool:USER_REVIEW)%"

  App\User\Service\SsoManager:
    arguments:
      $ssoServicesActive: "%env(bool:SSO_SERVICES_ACTIVE)%"
      $ssoServices: "%env(json:file:resolve:SSO_SERVICES)%"
      $ssoUseButtonIcon: "%env(bool:SSO_USE_BUTTON_ICON)%"

  App\ExternalJourney\Admin\DataProvider\ExternalJourneyCollectionDataProvider:
    arguments:
      $params:
        avatarSizes: "%env(string:AVATAR_SIZES)%"
        avatarDefaultFolder: "%env(string:AVATAR_DEFAULT_FOLDER)%"

  App\ExternalJourney\Admin\Service\ExternalJourneyManager:
    arguments:
      $operator: "%env(json:file:resolve:RDEX_OPERATOR)%"
      $clients: "%env(json:file:resolve:RDEX_CLIENTS)%"
      $providers: "%env(json:file:resolve:RDEX_PROVIDERS)%"

  App\ExternalJourney\DataProvider\ExternalJourneyCollectionDataProvider:
    arguments:
      $params:
        avatarSizes: "%env(string:AVATAR_SIZES)%"
        avatarDefaultFolder: "%env(string:AVATAR_DEFAULT_FOLDER)%"

  App\User\Admin\DataProvider\UserCollectionDataProvider:
    arguments:
      $collectionExtensions: !tagged api_platform.doctrine.orm.query_extension.collection

  # Utility
  App\Utility\Service\VersionManager:
    arguments:
      $repositoryFile: "%env(string:MOBILE_JSON_REPOSITORY)%"
      $appId: "%env(string:MOBILE_APP_ID)%"

  App\Utility\Entity\CsvMaker\CsvMaker:
    arguments:
      $csvExports: "%env(json:file:resolve:CSV_EXPORTS)%"
    tags:
      - { name: monolog.logger, channel: csvMaker }

  App\Validator\Phone\PhoneValidator:
    arguments:
      $phoneValidationRegions: "%env(json:USER_PHONE_VALIDATION_REGIONS)%"

  # Reminder
  App\UserRelaunch\Command\RelaunchCommand:
    tags:
      - { name: "console.command", command: "app:relaunch:users" }

  App\UserRelaunch\Service\RelaunchManager:
    arguments:
      $notifications: "%env(json:file:resolve:SCHEDULES_REMINDERS)%"
