<?php

return [

    /*
    |--------------------------------------------------------------------------
    | Decision engine v2
    |--------------------------------------------------------------------------
    |
    | Combined hour + day + lagged affiliate verdict. Toggle with
    | CAMPAIGN_DECISION_ENGINE_V2 in .env only. Tune everything else here.
    |
    */

    'engine_enabled' => (bool) env('CAMPAIGN_DECISION_ENGINE_V2', true),

    'engine_version' => 'v2',

    'monitor' => [
        'max_platform_staleness_hours' => 2,
        'internal_reporting_lag_days' => 2,
        'hour_windows' => [3, 5, 7],
        'day_windows' => [1, 3, 7, 15, 14, 30],
        'primary_outcome_window_days' => 7,
    ],

    'defaults' => [
        'target_roas' => 2.0,
        'minimum_roas' => 1.2,
        'target_cpa' => 50.0,
        'maximum_cpa' => 75.0,
        'minimum_spend' => 25.0,
        'minimum_clicks' => 20,
        'minimum_orders' => 1.0,
        'good_cost_per_result' => 2.0,
        'acceptable_cost_per_result' => 4.0,
        'zero_click_spend_floor' => 10.0,
        'max_cpc' => 2.0,
        'learning_period_days' => 3,
        'learning_stuck_days' => 7,
        'max_test_spend' => 40.0,
        'meta_weekly_optimization_events' => 50,
        'min_ad_spend_to_judge' => 10.0,
        'tracking_gate_spend_multiplier' => 2.0,
        'ad_too_early_spend' => 20.0,
        'ad_too_early_impressions' => 1000,
        'ad_fatigue_frequency_retargeting' => 3.0,
        'ad_fatigue_frequency_prospecting' => 2.0,
        'ad_fatigue_ctr_drop' => 0.30,
        'retargeting_small_pool_reach' => 5000,
        'saturation_cpm_lift' => 0.15,
        'saturation_reach_flat' => 0.10,
        'not_delivering_max_spend_7d' => 5.0,
        'not_delivering_max_impressions_7d' => 100,
        'scale_up_percentage' => 10,
        'decrease_budget_percentage' => 10,
        'maximum_daily_budget_increase_percent' => 20,
        'maximum_daily_budget_decrease_percent' => 20,
        'cooldown_period_days' => 3,
    ],

    'marketing' => [
        'weak_ctr' => 0.008,
        'strong_ctr' => 0.015,
        'min_impressions_for_ctr' => 500,
        'min_clicks_to_judge_page' => 8,
    ],

    'platforms' => [
        'meta' => [],
        'google' => [],
        'linkedin' => [],
    ],

];
