<?php

return [
    'version' => 'v1',

    'score' => [
        'minimum' => 300,
        'maximum' => 850,
        'neutral_normalized' => 50,
    ],

    'weights' => [
        'repayment_behaviour' => 40,
        'loan_history' => 20,
        'affordability' => 20,
        'collateral' => 10,
        'profile_completeness' => 5,
        'conduct_flags' => 5,
    ],

    'bands' => [
        'excellent' => [
            'label' => 'Excellent',
            'minimum' => 800,
            'maximum' => 850,
            'risk_level' => 'low',
        ],
        'very_good' => [
            'label' => 'Very Good',
            'minimum' => 740,
            'maximum' => 799,
            'risk_level' => 'low',
        ],
        'good' => [
            'label' => 'Good',
            'minimum' => 670,
            'maximum' => 739,
            'risk_level' => 'moderate',
        ],
        'fair' => [
            'label' => 'Fair',
            'minimum' => 580,
            'maximum' => 669,
            'risk_level' => 'high',
        ],
        'poor' => [
            'label' => 'Poor',
            'minimum' => 300,
            'maximum' => 579,
            'risk_level' => 'very_high',
        ],
    ],

    'thresholds' => [
        'repayment' => [
            'grace_days' => 3,
            'serious_arrears_days' => 30,
            'manual_review_days_overdue' => 90,
        ],
        'affordability' => [
            'debt_service_ratio' => [
                'excellent_max' => 0.20,
                'good_max' => 0.35,
                'fair_max' => 0.50,
            ],
            'outstanding_to_income_ratio' => [
                'excellent_max' => 2.0,
                'good_max' => 4.0,
                'fair_max' => 6.0,
            ],
        ],
        'collateral_coverage_ratio' => [
            'excellent_min' => 1.50,
            'good_min' => 1.20,
            'minimum_acceptable' => 1.00,
        ],
    ],

    'overlays' => [
        'active_blacklist' => [
            'manual_review_required' => true,
            'minimum_risk_level' => 'moderate',
        ],
        'unresolved_write_off' => [
            'manual_review_required' => true,
            'minimum_risk_level' => 'high',
        ],
        'serious_current_arrears' => [
            'days_overdue' => 90,
            'manual_review_required' => true,
            'minimum_risk_level' => 'high',
        ],
        'missing_income_for_affordability' => [
            'manual_review_required' => true,
        ],
    ],

    'confidence' => [
        'high_minimum' => 80,
        'medium_minimum' => 60,
        'thin_file_cap' => 55,
        'missing_income_cap' => 45,
    ],

    'thin_file' => [
        'neutral_component_score' => 50,
        'minimum_completed_installments' => 3,
        'minimum_completed_loans' => 1,
    ],

    'operations' => [
        'stale_after_hours' => 24,
        'refresh_chunk_size' => 100,
        'refresh_schedule_time' => '02:15',
    ],

    // Monitoring thresholds are descriptive alerts only. They never change a score,
    // approval decision, component weight, score band, or overlay rule.
    'monitoring' => [
        'recent_window_days' => 90,
        'minimum_sample_size' => 20,
        'average_score_shift_warning_points' => 25,
        'band_share_shift_warning_percentage_points' => 15,
    ],
];
