# 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:
  app.sinchNumber: '%env(SINCH_NUMBER)%'
  app.servicePlanId: '%env(SERVICE_PLAN_ID)%'
  app.region: '%env(REGION)%'
  app.bearerToken: '%env(BEARER_TOKEN)%'
  app.emailFrom: '%env(EMAIL_FROM)%'
  api_referentiel_url: '%env(API_REFERENTIEL_URL)%'
  secret_key: '%env(SECRET_KEY_URL)%'
  password_reset_url: '%env(PASSWORD_RESET_URL)%'
  qrcode_url: '%env(QRCODE_URL)%'
  verify_email_url: '%env(VERIFY_EMAIL_URL)%'
  jitsi_meeting_url: '%env(JITSI_MEETING_URL)%'
  project_dir: '%kernel.project_dir%/public'
  app_params_directory: '%kernel.project_dir%/config/app_params.yml'
  stripe_secret_key: '%env(STRIPE_SECRET_KEY)%'
  stripe_end_point: '%env(STRIPE_END_POINT)%'
  formes_juridiques_file: '%kernel.project_dir%/public/uploads/referentiel/formes-juridiques.json'
  absolute_upload_invoice: '%kernel.project_dir%/public/uploads/invoices/'
  relative_upload_invoice: '/uploads/invoices/'
  absolute_upload_qrcode: '%kernel.project_dir%/public/uploads/user/qrcode'
  relative_upload_qrcode: '/uploads/user/qrcode'
  relative_modele_import_patient: '/downloads/modele-import-patient.xlsx'
  relative_modele_import_professional: '/downloads/modele-import-professional.xlsx'
  relative_modele_import_establishment: '/downloads/modele-import-etablissement.xlsx'
  absolute_upload_xml_questionnaire: '%kernel.project_dir%/public/uploads/xml/questionnaire'
  relative_upload_xml_questionnaire: '/uploads/xml/questionnaire'
  absolute_upload_xml_test: '%kernel.project_dir%/public/uploads/xml/test'
  relative_upload_xml_test: '/uploads/xml/test'

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'

  App\Service\AppParams:
    arguments:
      $targetDirectory: '%app_params_directory%'
  # add more service definitions when explicit configuration is needed
  # please note that last definitions always *replace* previous ones

  App\Service\StripeService:
    arguments:
      $stripeSecretKey: '%env(STRIPE_SECRET_KEY)%'
  App\Listener\PersistUpdateListener:
    tags:
      - { name: 'doctrine.event_listener', event: 'prePersist', lazy: true }
      - { name: 'doctrine.event_listener', event: 'preUpdate', lazy: true }
      - { name: 'doctrine.event_listener', event: 'postUpdate', lazy: true }
  App\Service\HCaptchaService:
    arguments:
      $hCaptchaSecret: '%env(HCAPTCHA_SECRET)%'
  App\Listener\ExceptionListener:
    tags:
      - { name: kernel.event_listener, event: kernel.exception }
  App\Service\JitsiTokenGenerator:
    arguments:
      $appId: '%env(default::JITSI_APP_ID)%'
      $appSecret: '%env(default::JITSI_APP_SECRET)%'
      $domain: '%env(JITSI_MEETING_URL)%'
