# 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:
    locale: 'en'
    trial_days: 14

    # generating urls in commands
    router.request_context.scheme: '%env(APP_SCHEMA)%'
    router.request_context.host: '%env(APP_HOST)%'

    # urls
    pending_url: '__pending'

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'

    # add more service definitions when explicit configuration is needed
    # please note that last definitions always *replace* previous ones

    App\Command\IncomingMessagesCommand:
        $host: '%env(APP_IMAP_HOST)%'
        $username: '%env(APP_IMAP_USERNAME)%'
        $password: '%env(APP_IMAP_PASSWORD)%'

    App\EventSubscriber\TimezoneSubscriber:
        $timeZoneDatabase: '%env(APP_TIMEZONE_DATABASE)%'
        $timeZoneClient: '%env(APP_TIMEZONE_CLIENT)%'

    App\EventSubscriber\EmailSubscriber:
        $replyName: 'Ledger'
        $replyEmail: '%env(APP_EMAIL_REPLY)%'

    App\EventSubscriber\JWTInvalidSubscriber:
        $jwtCookieName: '%jwt_cookie_name%'

    App\Mercure\JwtTokenProvider:
        $secret: '%env(MERCURE_JWT_SECRET)%'

    App\Service\Mailer:
        $sender: '"Ledger" <%env(APP_EMAIL)%>'

    App\Service\MercureClient:
        $hostname: '%env(APP_HOST)%'

    App\Service\OpenAIClient:
        $apiKey: '%env(APP_OPENAI_API_KEY)%'
        $organization: '%env(APP_OPENAI_ORGANIZATION)%'

    App\Service\SanitizeEntityProperties:
        $pendingUrl: '%pending_url%'

    App\Service\StripeClient:
        $secretKey: '%env(APP_STRIPE_SECRET_KEY)%'
        $signingSecret: '%env(APP_STRIPE_WEBHOOK_SIGNING_SECRET)%'

    App\Service\ZoomClient:
        $clientId: '%env(APP_ZOOM_CLIENT_ID)%'
        $clientSecret: '%env(APP_ZOOM_CLIENT_SECRET)%'

    App\Service\FileUploader:
        public: true
        arguments:
            $s3Bucket: '%env(default::APP_AWS_S3_BUCKET)%'
            $s3BaseUrl: '%env(default::APP_AWS_S3_URL)%'
            $maxFilesize: 500
            $mimeTypesExtensions: 'PNG, GIF, JPEG, JPG, HEIC, WAV, MOV, MP3, MP4, MPEG, WEBM, OGG, TXT, HTML, CSV, RTF, PDF, DOC, DOCX, PPT, PPTX, XLS, XLSX, ZIP, GZ, TTF, OTF, WOFF, WOFF2, or EOT'
            $mimeTypesTypes:
                # images
                - 'image/png'
                - 'image/gif'
                - 'image/jpeg'
                - 'image/jpg'
                - 'image/heic'

                # audio
                - 'audio/wav'
                - 'audio/mp3'
                - 'audio/mp4'
                - 'audio/mpeg'
                - 'audio/webm'
                - 'audio/ogg'

                # videos
                - 'video/quicktime'
                - 'video/mp4'
                - 'video/mpeg'
                - 'video/webm'
                - 'video/ogg'

                # documents
                - 'text/plain'
                - 'text/html'
                - 'text/csv'
                - 'application/rtf'
                - 'application/pdf'

                # word
                - 'application/msword'
                - 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'

                # powerpoint
                - 'application/vnd.ms-powerpoint'
                - 'application/vnd.openxmlformats-officedocument.presentationml.presentation'

                # excel
                - 'application/vnd.ms-excel'
                - 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'

                # zip
                - 'application/zip'
                - 'application/gzip'

                # fonts
                - 'font/ttf'
                - 'application/x-font-ttf'
                - 'font/otf'
                - 'application/x-font-otf'
                - 'application/vnd.ms-opentype'
                - 'font/woff'
                - 'application/font-woff'
                - 'application/x-font-woff'
                - 'font/woff2'
                - 'application/x-font-woff2'
                - 'application/vnd.ms-fontobject'
                - 'font/sfnt'
                - 'application/font-sfnt'

    App\Validator\Constraints\FileUploaderUrlValidator:
        tags:
            - { name: validator.constraint_validator }

    App\Twig\Extension\AppExtension:
        $appScheme: '%env(APP_SCHEMA)%'
        $appHost: '%env(APP_HOST)%'
