<?php

namespace App\Http\Controllers\Api;

use App\Http\Controllers\Controller;

use App\Models\LogProses;
use Illuminate\Http\Request;

class TaskController extends Controller
{
    public static function pencandanganRisiko($tanggal)
    {
        // $jurnal = new JurnalController();

        // $proses = new LogProses();
        // $proses->tanggal = $tanggal;
        // $proses->proses_id = 1;
        // $proses->proses_desc = "Pencadangan Risiko";
        // $proses->start_time = now()->format('Y-m-d H:i:s');

        // $request = new Request([
        //     "tanggal" => $tanggal,
        //     "user" => "system",
        //     "trans_kode" => 98
        // ]);
        // $response = $jurnal->prosesPencadanganResikoV3($request);
        // $response = $response->getData();
        // if ($response->success == true) {
        //     $proses->status = 1;
        //     $proses->status_desc = "Proses Pencadangan Resiko berhasil";
        // } else {
        //     $proses->status = 0;
        //     $proses->status_desc = "Proses Pencadangan Resiko gagal";
        //     $proses->error = $response->error;
        // }

        // $proses->end_time = now()->format('Y-m-d H:i:s');;
        // $proses->save();
        // return $response->success == true;
    }
}
