<?php

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');

// Daily cheque maturity reminders (T+1) — SRS §A6
Schedule::command('cheques:send-reminders')->dailyAt('08:00');

// Transition PENDING cheques past their maturity date to DUE status
Schedule::command('cheques:mark-due')->dailyAt('01:00');

// Flip stock batches past their expiry_date to "expired" so FEFO allocation and
// sales correctly stop offering them — previously only runnable by hand.
Schedule::command('batches:flag-expired')->dailyAt('00:30');

// Weekly, off-peak: delete tenant storage files nothing references anymore
// (replaced logos, deleted products' images, abandoned checkout attachments).
Schedule::command('storage:cleanup-orphans --force')->weeklyOn(0, '02:00');
