<?php

namespace App\Console;

use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
use App\Http\Controllers\Admin\AutoUpdateScheduleController;

class Kernel extends ConsoleKernel
{
   
    protected function schedule(Schedule $schedule)
    {
        // $schedule->command('som:cache');
        // $schedule->command('som:permission');
        // $schedule->command('som:sync-role');
        // $schedule->command('som:deploy');
        $schedule->command('backup:clean',['--disable-notifications'])->dailyAt('23:30')->runInBackground();
        $schedule->command('backup:run', ['--only-db','--disable-notifications'])->dailyAt('23:30')->runInBackground();
        $schedule->call(function(){AutoUpdateScheduleController::Depreciation();})->dailyAt('23:30')->runInBackground();
        $schedule->call(function(){AutoUpdateScheduleController::LoanLossProvision();})->dailyAt('23:30')->runInBackground();
        // 
    }

    protected function commands()
    {
        $this->load(__DIR__.'/Commands');

        require base_path('routes/console.php');
    }
}