<?php

declare(strict_types=1);

use Illuminate\Support\Facades\Route;
use Kylin\RiskEngine\Http\Controllers\RiskEngineController;

/**
 * 风控引擎 API 路由
 *
 * 所有路由需通过 auth:sanctum 鉴权。
 * 法律合规：依据等保 2.0 8.1.4.1，风控配置访问需权限控制。
 */
Route::prefix('kylin/risk-engine')
    ->middleware(['auth:sanctum'])
    ->group(function () {
        // 风险评估
        Route::post('/evaluate', [RiskEngineController::class, 'evaluate']);
        Route::get('/cached-score', [RiskEngineController::class, 'cachedScore']);

        // 人脸复核
        Route::post('/face/verify', [RiskEngineController::class, 'faceVerify']);
        Route::get('/face/status', [RiskEngineController::class, 'faceStatus']);

        // 黑白名单管理
        Route::get('/list', [RiskEngineController::class, 'listQuery']);
        Route::post('/list', [RiskEngineController::class, 'listCreate']);
        Route::delete('/list/{id}', [RiskEngineController::class, 'listDelete']);
    });
