# 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.database_driver: 'pdo_sqlsrv'
    app.cc_database: CC
    app.vanguard_database: Vanguard
    app.sales_database: Sales
    app.customer_care_database: CustomerCareApp
    app.timezone: 'America/Phoenix'

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.
    app.jwt.encoder:
        class: App\Encoder\JWTEncoder
        arguments:
            $key: '%env(JWT_PASSPHRASE)%'
            $ttl: 1296000

    # 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\State\UserStateProcessor:
        bind:
            $decorated: '@api_platform.doctrine.orm.state.persist_processor'
# I will deprecate this service in 3.1
    App\Service\DatabaseCredential:
        arguments:
            $host: '%app.database_host%'
            $dbname: '%app.cc_database%'
            $user: '%app.database_username%'
            $password: '%app.database_password%'
            $port: '%app.database_port%'
            $googleCode: '%app.google_map_code%'
            $phoneServer: '%app.phone_server%'
            $marketingServer: '%app.marketing_server%'
            $vanguardApiServer: '%app.vanguard_api_server%'
            $vanguardJwtToken: '%app.vanguard_jwt_token%'
            $websocketServer: '%app.websocket_server%'
            $originSite: '%app.origin_site%'
    App\Service\SendDataWebSocketServer:
    # This service will be used to get credentials    
    App\Service\Credentials:
        arguments:
            $host: '%app.database_host%'
            $dbname: '%app.cc_database%'
            $user: '%app.database_username%'
            $password: '%app.database_password%'
            $port: '%app.database_port%'
            $googleCode: '%app.google_map_code%'
            $phoneServer: '%app.phone_server%'
            $marketingServer: '%app.marketing_server%'
            $vanguardApiServer: '%app.vanguard_api_server%'
            $vanguardJwtToken: '%app.vanguard_jwt_token%'
            $websocketServer: '%app.websocket_server%'
            $originSite: '%app.origin_site%'
    App\OpenApi\OpenApiFactory:
        decorates: 'api_platform.openapi.factory'
        arguments: [ '@App\OpenApi\OpenApiFactory.inner' ]
        autoconfigure: false
    League\Flysystem\FilesystemAdapter: '@League\Flysystem\AwsS3V3\AwsS3V3Adapter'
    Aws\S3\S3ClientInterface: '@Aws\S3\S3Client'
    League\Flysystem\Filesystem:
    League\Flysystem\AwsS3V3\AwsS3V3Adapter:
        arguments:
            $bucket: '%app.s3.bucket%'
            $prefix: '%app.s3.prefix%'

    Aws\S3\S3Client:
        arguments:
            $args:
                region: '%app.s3.region%'
                credentials:
                    key: '%app.s3.key%'
                    secret: '%app.s3.secret%'

when@prod:
    parameters:
        app.google_map_code: 'AIzaSyAYDl-_WbNRSkl8L8zY5B0BMh8WUmGAoYc' #php
        app.is_dev_server: false
        app.database_host: 66.210.253.162 #10.10.1.175 #207.38.65.7   10.10.1.18 10.10.1.88
        app.database_username: TempestSQLAuth
        app.database_password: Ddsffss5gf-3434df4-dsjjhWW!fg-75
        app.database_port: 1433
        app.phone_server: phones.bulwarksc.com
        app.marketing_server: marketingauth.bulwarkpestcontrol.com
        app.vanguard_api_server: vanguardapi.bulwarkpestcontrol.com
        app.vanguard_jwt_token: ''
        app.websocket_server: 'https://test.tem-pest.com:3030'
        app.origin_site: 'https://vue.tem-pest.com'
        app.s3.key: 'AKIAUST2ROZ6E3WGZHFZ'
        app.s3.secret: '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'
        app.s3.bucket: 'assets.bulwarkpest.com'
        app.s3.region: 'us-west-2'
        app.s3.prefix: ''
when@test:
    parameters:
        app.google_map_code: 'AIzaSyAYDl-_WbNRSkl8L8zY5B0BMh8WUmGAoYc' #php
        app.is_dev_server: true
        app.database_host: vsqltest.bulwarkcorp.com #10.10.1.175 #207.38.65.7   10.10.1.18 10.10.1.88
        app.database_username: tempest
        app.database_password: amT.TGAsX8EYF5?^
        app.database_port: 1433
        app.phone_server: phones.bulwarksc.com
        app.marketing_server: marketingauth.bulwarkpestcontrol.com
        app.vanguard_api_server: vanguardapitest.bulwarkpestcontrol.com
        app.vanguard_jwt_token: ''
        app.websocket_server: 'https://test.tem-pest.com:3030'
        app.origin_site: 'https://test.tem-pest.com'
        app.s3.key: 'AKIAUST2ROZ6E3WGZHFZ'
        app.s3.secret: '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'
        app.s3.bucket: 'assets.bulwarkpest.com'
        app.s3.region: 'us-west-2'
        app.s3.prefix: 'test'
when@dev:
    parameters:
        app.google_map_code: 'AIzaSyAYDl-_WbNRSkl8L8zY5B0BMh8WUmGAoYc' #php
        app.is_dev_server: true
        app.database_host: 172.16.0.18 #172.16.0.18   10.10.1.18 10.10.1.88
        app.database_username: TempestSQLAuth
        app.database_password: Ddsffss5gf-3434df4-dsjjhWW!fg-75
        app.database_port: 1433
        app.phone_server: phones.bulwarksc.com
        app.marketing_server: marketingauth.bulwarkpestcontrol.com
        app.vanguard_api_server: vanguardapi.bulwarkpestcontrol.com
        app.vanguard_jwt_token: ''
        app.websocket_server: 'https://test.tem-pest.com:3030'
        app.origin_site: 'https://test.tem-pest.com'
        app.s3.key: 'AKIAUST2ROZ6E3WGZHFZ'
        app.s3.secret: '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'
        app.s3.bucket: 'assets.bulwarkpest.com'
        app.s3.region: 'us-west-2'
        app.s3.prefix: 'test'
