<?php

use App\Models\Log;
use App\Models\Email;
use App\Models\Ticket;
use Illuminate\Foundation\Inspiring;
use Illuminate\Support\Facades\Artisan;

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

// Schedule::call(function () {
//    Email::fetchProcessStoreEmail();
// })->everyMinute();

Schedule::call(function (): void {
    Email::deleteBulkAttachments();
})->daily();

// Schedule::call(function () {
//    Email::deleteBulkMailboxes();
// })->everyMinute();

Schedule::call(function (): void {
    Email::deleteMessagesFromDB();
})->everyTwoHours();

Schedule::call(function (): void {
    Log::deleteLogsFromDB();
})->everyThreeHours();

Schedule::call(function (): void {
    Email::cleanMailbox();
});

Artisan::command('cleanMail', function (): void {
    $this->comment(Email::cleanMailbox());
});

Artisan::command('closeTicket', function (): void {
    $this->comment(Ticket::autoClose());
});
