# 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:
    stripe.secret_key: '%env(default::STRIPE_SECRET_KEY)%'
    stripe.webhook_secret: '%env(default::STRIPE_WEBHOOK_SECRET)%'
    stripe.mock_mode: '%env(bool:STRIPE_MOCK_MODE)%'
    notifications.email_mode_default: 'log'
    notifications.sms_mode_default: 'log'
    notifications.mail_from_default: 'no-reply@procuratio.local'
    notifications.mail_reply_to_default: 'no-reply@procuratio.local'
    notifications.brevo_api_key_default: ''
    notifications.sms_sender_default: 'Procuratio'
    notifications.sms_webhook_url_default: ''
    notifications.sms_webhook_token_default: ''
    notifications.email_mode: '%env(default:notifications.email_mode_default:NOTIFICATIONS_EMAIL_MODE)%'
    notifications.sms_mode: '%env(default:notifications.sms_mode_default:NOTIFICATIONS_SMS_MODE)%'
    notifications.mail_from: '%env(default:notifications.mail_from_default:NOTIFICATIONS_MAIL_FROM)%'
    notifications.mail_reply_to: '%env(default:notifications.mail_reply_to_default:NOTIFICATIONS_MAIL_REPLY_TO)%'
    notifications.brevo_api_key: '%env(default:notifications.brevo_api_key_default:BREVO_API_KEY)%'
    notifications.sms_sender: '%env(default:notifications.sms_sender_default:SMS_SENDER)%'
    notifications.sms_webhook_url: '%env(default:notifications.sms_webhook_url_default:SMS_WEBHOOK_URL)%'
    notifications.sms_webhook_token: '%env(default:notifications.sms_webhook_token_default:SMS_WEBHOOK_TOKEN)%'

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\StripeService:
        arguments:
            $secretKey: '%stripe.secret_key%'
            $mockMode: '%stripe.mock_mode%'

    App\Controller\Api\V1\EcommerceController:
        arguments:
            $stripeWebhookSecret: '%stripe.webhook_secret%'

    App\Service\NotificationGatewayService:
        arguments:
            $emailMode: '%notifications.email_mode%'
            $smsMode: '%notifications.sms_mode%'
            $mailFrom: '%notifications.mail_from%'
            $mailReplyTo: '%notifications.mail_reply_to%'
            $brevoApiKey: '%notifications.brevo_api_key%'
            $smsSender: '%notifications.sms_sender%'
            $smsWebhookUrl: '%notifications.sms_webhook_url%'
            $smsWebhookToken: '%notifications.sms_webhook_token%'


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