<?php

namespace App\Console\Commands;

use App\Models\User;
use Illuminate\Console\Attributes\Description;
use Illuminate\Console\Attributes\Signature;
use Illuminate\Console\Command;

#[Signature('app:recalculate-achivements')]
#[Description('Recalculate achievements for all users')]
class RecalculateAchievements extends Command
{
    public function handle(): void
    {
        $users = User::all();
        foreach ($users as $user) {
            $user->calculateAchievements();
        }
    }
}
