<?php
/**
 * BOAFO Application Configuration
 */

// Application
define('APP_NAME', 'BOAFO');
define('APP_FULL_NAME', 'Mentorship & University Transition Support System');
define('APP_VERSION', '1.0.0');
define('APP_URL', 'http://localhost/BOAFO/public');
define('APP_ENV', 'development'); // 'production' in live

// Paths
define('BASE_PATH', dirname(__DIR__));
define('LOG_PATH', BASE_PATH . '/logs');
if (!is_dir(LOG_PATH)) {
    mkdir(LOG_PATH, 0777, true);
}

// JaaS Config
require_once __DIR__ . '/jaas.php';
define('APP_PATH', BASE_PATH . '/app');
define('PUBLIC_PATH', BASE_PATH . '/public');
define('UPLOAD_PATH', PUBLIC_PATH . '/assets/uploads');
define('UPLOAD_URL', APP_URL . '/assets/uploads');

// Upload limits
define('MAX_FILE_SIZE', 5 * 1024 * 1024); // 5MB
define('ALLOWED_IMAGE_TYPES', ['image/jpeg', 'image/png', 'image/gif', 'image/webp']);
define('ALLOWED_DOC_TYPES', ['application/pdf', 'application/msword',
    'application/vnd.openxmlformats-officedocument.wordprocessingml.document']);

// Session
define('SESSION_LIFETIME', 7200); // 2 hours
define('SESSION_NAME', 'BOAFO_SESSION');

// Pagination
define('ITEMS_PER_PAGE', 12);

// Roles
define('ROLE_ADMIN',   'admin');
define('ROLE_STUDENT', 'student');
define('ROLE_MENTOR',  'mentor');
define('ROLE_TUTOR',   'tutor');

// WASSCE Grade Points
define('WASSCE_GRADES', [
    'A1' => 1, 'B2' => 2, 'B3' => 3,
    'C4' => 4, 'C5' => 5, 'C6' => 6,
    'D7' => 7, 'E8' => 8, 'F9' => 9
]);

// AI Engine Weights
define('AI_MENTOR_WEIGHTS', [
    'university' => 0.30,
    'program'    => 0.30,
    'career'     => 0.20,
    'region'     => 0.10,
    'available'  => 0.10,
]);

define('AI_SCHOLARSHIP_WEIGHTS', [
    'grade'      => 0.40,
    'eligibility'=> 0.30,
    'competition'=> 0.20,
    'documents'  => 0.10,
]);

define('AI_ADMISSION_WEIGHTS', [
    'subjects'   => 0.50,
    'aggregate'  => 0.30,
    'program'    => 0.20,
]);

// Error reporting
if (APP_ENV === 'development') {
    ini_set('display_errors', 1);
    error_reporting(E_ALL);
} else {
    ini_set('display_errors', 0);
    error_reporting(0);
}
