<?php

declare(strict_types=1);

return [
    'email' => [
        'from_name' => (string) env('NOTIFY_EMAIL_FROM_NAME', 'Veltrix POS'),
        'from_address' => (string) env('NOTIFY_EMAIL_FROM_ADDRESS', 'no-reply@veltrix.local'),
        'reply_to' => (string) env('NOTIFY_EMAIL_REPLY_TO', ''),
    ],
    'smtp' => [
        'host' => (string) env('SMTP_HOST', ''),
        'port' => max(1, (int) env('SMTP_PORT', 587)),
        'username' => (string) env('SMTP_USERNAME', ''),
        'password' => (string) env('SMTP_PASSWORD', ''),
        'secure' => (string) env('SMTP_SECURE', 'tls'),
        'from_email' => (string) env('SMTP_FROM_EMAIL', ''),
        'from_name' => (string) env('SMTP_FROM_NAME', ''),
    ],
    'whatsapp' => [
        'provider' => (string) env('WHATSAPP_PROVIDER', 'meta'),
        'api_url' => (string) env('WHATSAPP_API_URL', 'https://graph.facebook.com/v20.0'),
        'phone_number_id' => (string) env('WHATSAPP_PHONE_NUMBER_ID', ''),
        'access_token' => (string) env('WHATSAPP_ACCESS_TOKEN', ''),
        'default_country_code' => (string) env('WHATSAPP_DEFAULT_COUNTRY_CODE', '57'),
        'manychat_api_url' => (string) env('MANYCHAT_API_URL', 'https://api.manychat.com'),
        'manychat_access_token' => (string) env('MANYCHAT_ACCESS_TOKEN', ''),
        'manychat_message_tag' => (string) env('MANYCHAT_MESSAGE_TAG', 'ACCOUNT_UPDATE'),
        'manychat_contact_field_id' => (string) env('MANYCHAT_CONTACT_FIELD_ID', ''),
        'template_enabled' => filter_var(env('WHATSAPP_TEMPLATE_ENABLED', false), FILTER_VALIDATE_BOOL),
        'template_language' => (string) env('WHATSAPP_TEMPLATE_LANGUAGE', 'es_CO'),
        'template_name_10d' => (string) env('WHATSAPP_TEMPLATE_NAME_10D', ''),
        'template_name_3d' => (string) env('WHATSAPP_TEMPLATE_NAME_3D', ''),
    ],
    'retry' => [
        'max_attempts' => max(1, (int) env('NOTIFY_MAX_ATTEMPTS', 3)),
        'backoff_minutes' => (string) env('NOTIFY_RETRY_BACKOFF_MINUTES', '5,30,180'),
    ],
    'channels' => [
        'email' => filter_var(env('NOTIFY_CHANNEL_EMAIL', true), FILTER_VALIDATE_BOOL),
        'whatsapp' => filter_var(env('NOTIFY_CHANNEL_WHATSAPP', true), FILTER_VALIDATE_BOOL),
    ],
];
