<?php

namespace App\Http\Controllers\Student;

use App\Http\Controllers\Controller;
use App\Http\Controllers\Api\Student\RecommendationApiController;
use App\Models\RiwayatRekomendasi;

class RecommendationController extends Controller
{
    public function prediction()
    {
        return view('student.prediksi');
    }

    public function result($id)
    {
        $riwayat = RiwayatRekomendasi::findOrFail($id);
        $hasil = RecommendationApiController::formatHasilData($riwayat);

        $labelEkonomi = $hasil['label_ekonomi'];
        $minatUtama = $hasil['minat_utama'];
        $prospekKerja = $hasil['prospek_kerja'];

        return view('student.hasil', compact(
            'riwayat',
            'labelEkonomi',
            'minatUtama',
            'prospekKerja'
        ));
    }
}