<?php
/**
 * Global Configuration for:
 * Ringba → Twilio → ServiceDirect Ping/Post
 */

return [

    /* =========================
     * ENVIRONMENT
     * ========================= */
    'environment' => 'live', // test | live


    /* =========================
     * TRAFFIC SOURCE
     * ========================= */
    'traffic_source' => 'meta-facebook',


    /* =========================
     * TWILIO SETTINGS
     * ========================= */
    'twilio' => [
        'voice' => [
            'language' => 'en-US',
            'voice'    => 'alice',
        ],
        'timeouts' => [
            'gather' => 8,   // seconds to wait for ZIP input
            'dial'   => 20,  // seconds to wait for buyer answer
        ],
    ],


    /* =========================
     * SERVICE DIRECT SETTINGS
     * ========================= */
    'servicedirect' => [
        'api_key' => '319DBFFA48',

        'endpoints' => [
            'ping'      => 'https://api.servicedirect.com/partners/request',
            // accept URL is built dynamically as:
            // https://api.servicedirect.com/partners/request/<request_id>/accept
            'post_base' => 'https://api.servicedirect.com/partners/request',
        ],

        // Recommended: avoid non-200 responses breaking any systems
        'suppress_response_codes' => true,

        // Always enforce 90s duration model (as confirmed by Chris)
        'min_duration_seconds' => 90,

        // Required params we ALWAYS send
        'required_params' => [
            'source',
            'caller_id',
        ],
    ],


    /* =========================
     * VERTICAL CONFIGURATION
     * Easy to add more later
     * ========================= */
    'verticals' => [

        'electrician' => [
            'service_category' => 'electrician',
            'fallback_ringba_number' => '+18334043251', // Ringba fallback target
        ],

        'plumbing' => [
            'service_category' => 'plumbing',
            'fallback_ringba_number' => '+18338107023',
        ],

        'water_damage' => [
            'service_category' => 'waterdamagerestoration',
            'fallback_ringba_number' => '+18555074386',
        ],

        'roofing' => [
            'service_category' => 'roofing',
            'fallback_ringba_number' => '+18335011664',
        ],
        'towingservice' => [
            'service_category' => 'towingservice',
            'fallback_ringba_number' => '+18337323513',
        ], 
        'appliancerepair' => [
            'service_category' => 'appliancerepair',
            'fallback_ringba_number' => '+18333994220',
        ],
        'carpetcleaning' => [
            'service_category' => 'carpetcleaning',
            'fallback_ringba_number' => '+18777855019',
        ], 
        'solar' => [
            'service_category' => 'solar',
            'fallback_ringba_number' => '+18334853836',
        ],
        'airconditioning' => [
            'service_category' => 'airconditioning',
            'fallback_ringba_number' => '+18333490518',
        ], 
        'heating' => [
            'service_category' => 'heating',
            'fallback_ringba_number' => '+18334514915',
        ],
        'windowreplacement' => [
            'service_category' => 'windowreplacement',
            'fallback_ringba_number' => '+18335024277',
        ],   
        'remodeling' => [
            'service_category' => 'remodeling',
            'fallback_ringba_number' => '+18338970105',
        ],
        'pestcontrol' => [
            'service_category' => 'pestcontrol',
            'fallback_ringba_number' => '+18333822690',
        ],        
    ],


    /* =========================
     * LOGGING
     * ========================= */
    'logs' => [
        'twilio' => __DIR__ . '/../logs/twilio.log',
        'sd'     => __DIR__ . '/../logs/sd.log',
    ],
];
