<?php

namespace App\Console\Commands;

use App\Domain\Document\Services\DocumentService;
use Illuminate\Console\Command;

class ExpireDocuments extends Command
{
    protected $signature = 'documents:expire';
    protected $description = 'انتهاء صلاحية المستندات';

    public function handle(DocumentService $service): int
    {
        $count = $service->checkAndExpireDocuments();

        $this->info("تم إنهاء صلاحية {$count} مستند(ات).");

        return self::SUCCESS;
    }
}
