<?php

use App\Console\Commands\UpworkSyncWeeklyCommand;
use Illuminate\Foundation\Inspiring;
use Illuminate\Support\Facades\Artisan;
use Illuminate\Support\Facades\Schedule;

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

// ─── Sync Upwork cada domingo a las 02:00 ────────────────────────────────────
// Para activar en producción: agregar `php artisan schedule:run` al cron.
// En dev, probar con: php artisan upwork:sync-weekly
Schedule::command(UpworkSyncWeeklyCommand::class)
    ->weekly()
    ->sundays()
    ->at('02:00')
    ->withoutOverlapping()
    ->runInBackground();
