<?php

return [
    /*
    | Active driver. 'meta' = WhatsApp Cloud API (recommended for production),
    | 'twilio' = Twilio WhatsApp, 'log' = write to laravel.log (local/dev).
    */
    'driver' => env('WHATSAPP_DRIVER', 'log'),

    'from' => env('WHATSAPP_FROM'), // E.164 sender number

    'meta' => [
        'phone_number_id' => env('WHATSAPP_META_PHONE_NUMBER_ID'),
        'token' => env('WHATSAPP_META_TOKEN'),
        'api_version' => env('WHATSAPP_META_API_VERSION', 'v21.0'),
        'verify_token' => env('WHATSAPP_META_VERIFY_TOKEN'),
        'app_secret' => env('WHATSAPP_META_APP_SECRET'),
    ],

    'twilio' => [
        'sid' => env('TWILIO_SID'),
        'token' => env('TWILIO_TOKEN'),
        'from' => env('TWILIO_WHATSAPP_FROM'), // e.g. whatsapp:+14155238886
    ],

    // Retry policy for failed sends (the retry queue).
    'max_attempts' => env('WHATSAPP_MAX_ATTEMPTS', 4),
    'retry_backoff_minutes' => [1, 10, 60, 360], // per attempt

    // Signed media link lifetime for PDF attachments.
    'media_ttl_minutes' => 30,

    // Quiet hours (clinic-local) — automated sends defer to the next allowed
    // window. Manual sends bypass this.
    'quiet_hours' => ['start' => 21, 'end' => 9], // 21:00–09:00
];
