<?php

use App\Jobs\PruneOldOperationRunsJob;
use App\Jobs\ReconcileAdapterRunsJob;
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');

Schedule::command('tenantpilot:schedules:dispatch')->everyMinute();
Schedule::command('tenantpilot:directory-groups:dispatch')->everyMinute();

Schedule::job(new PruneOldOperationRunsJob)
    ->daily()
    ->name(PruneOldOperationRunsJob::class)
    ->withoutOverlapping();

Schedule::job(new ReconcileAdapterRunsJob)
    ->everyThirtyMinutes()
    ->name(ReconcileAdapterRunsJob::class)
    ->withoutOverlapping();
