<?php

use Illuminate\Foundation\Inspiring;
use Illuminate\Support\Facades\Artisan;
use Illuminate\Support\Facades\Schedule;
use App\Jobs\CaptureKJCHistoricalDataJob;
use App\Jobs\CapturePKJHistoricalDataJob;

Artisan::command('inspire', function () {
    $this->comment(Inspiring::quote());
})->purpose('Display an inspiring quote');

// Schedule KJC Historical Data Capture to run monthly on the 1st day at 2:00 AM
Schedule::job(new CaptureKJCHistoricalDataJob())
    ->monthlyOn(1, '02:00')
    ->withoutOverlapping()
    ->name('kjc-historical-data-capture');

// Schedule PKJ Historical Data Capture to run monthly on the 1st day at 2:30 AM
Schedule::job(new CapturePKJHistoricalDataJob())
    ->monthlyOn(1, '02:30')
    ->withoutOverlapping()
    ->name('pkj-historical-data-capture');

// Auto-generate weekly KJC reports for Jabatan Arah RAJD every Monday at 3:00 AM
Schedule::command('kjc:auto-generate-weekly-report "Jabatan Arah RAJD"')
    ->weeklyOn(1, '03:00') // Monday at 3:00 AM
    ->withoutOverlapping()
    ->name('kjc-auto-weekly-report');