# config/services.yaml
parameters:
    app.base_url: '%env(APP_URL)%'
    geoip_database_path: '%kernel.project_dir%/geoip/GeoLite2-City.mmdb'

services:
    # default configuration for services in this file
    _defaults:
        autowire: true
        autoconfigure: true

    # makes classes in src/ available to be used as services
    App\:
        resource: '../src/'
        exclude:
            - '../src/DependencyInjection/'
            - '../src/Entity/'
            - '../src/Kernel.php'

    # Configuration du service d'envoi d'emails de commande
    App\Service\OrderMailerService:
        arguments:
            $adminEmail: 'contact@num-ecard.com'
            $fromEmail: 'noreply@num-ecard.com'
            $fromName: 'NUM-ECARD'

    # Configuration du WebhookController Stripe
    App\Controller\WebhookController:
        arguments:
            $stripeSecretKey: '%env(STRIPE_SECRET_KEY)%'
            $webhookSecret: '%env(STRIPE_WEBHOOK_SECRET)%'

    # Configuration du StripeService
    App\Service\StripeService:
        arguments:
            $stripeSecretKey: '%env(STRIPE_SECRET_KEY)%'

    App\Service\WebPushService:
        arguments:
            $vapidPublicKey: '%env(VAPID_PUBLIC_KEY)%'
            $vapidPrivateKey: '%env(VAPID_PRIVATE_KEY)%'
            $vapidSubject: '%env(VAPID_SUBJECT)%'

    # Configuration du BrevoService — gestion contacts marketing + archivage RGPD
    App\Service\BrevoService:
        arguments:
            $apiKey: '%env(BREVO_API_KEY)%'
            $listId: '%env(int:BREVO_LIST_ID)%'

    # Service RGPD — Droit à l'effacement Art. 17 (suppression de compte)
    App\Service\UserDeletionService:
        arguments:
            $uploadDir: '%kernel.project_dir%/public/uploads'
            $brevoService: '@App\Service\BrevoService'

    # Service RGPD — Anonymisation compte suite demande Art. 17 (traitement admin)
    App\Service\UserAnonymizationService:
        arguments:
            $uploadDir: '%kernel.project_dir%/public/uploads'

    # RGPD — Droit à la portabilité Art. 20 — Commande CLI export
    App\Command\ExportUserDataCommand:
        arguments:
            $exportDir: '%kernel.project_dir%/var/exports/rgpd'
            $dataController: 'SAS SANAGENCY — SIREN 932 944 242'

    # RGPD — Droit à la portabilité Art. 20 — Handler Messenger (traitement async)
    App\MessageHandler\ExportUserDataMessageHandler:
        arguments:
            $exportDir: '%kernel.project_dir%/var/exports/rgpd'
            $appName: 'NUM-ECARD'
            $dataController: 'SAS SANAGENCY — SIREN 932 944 242'
