<?php

namespace App\Console;

use App\Jobs\CleanTransactionOnlineLogJob;
use Illuminate\Console\Scheduling\Schedule;
use Laravel\Lumen\Console\Kernel as ConsoleKernel;

use App\Jobs\WhatsappUnsoldCommodityScanner;
use Faker\Provider\ar_SA\Color;
use Illuminate\Console\Command;

class Kernel extends ConsoleKernel
{
    /**
     * The Artisan commands provided by your application.
     *
     * @var array
     */
    protected $commands = [
        Commands\DailyGadai::class,
        Commands\MigrationOnePercent::class,
        Commands\CawanganDebugConnections::class,
        Commands\ClearCachesAll::class,
        Commands\RestartSupervisor::class,
        Commands\InsertSempornaData::class,
        //Commands\ImportCsv::class,

    ];

    /**
     * Define the application's command schedule.
     *
     * @param  \Illuminate\Console\Scheduling\Schedule  $schedule
     * @return void
     */
    protected function schedule(Schedule $schedule)
    {
        //

        // $schedule->command('gadai:daily')->daily()->timezone('Asia/Kuala_Lumpur')->at('00:00');

        $schedule->job(new WhatsappUnsoldCommodityScanner)->daily()->timezone('Asia/Kuala_Lumpur')->at('00:00');
        
        $schedule->job(new CleanTransactionOnlineLogJob)->monthly()->timezone('Asia/Kuala_Lumpur')->at('00:00');
    }
}
