<?php

namespace App\Domain\Identity\Services;

use App\Models\User;

class LoginRedirectService
{
    public function getRedirectRoute(User $user): string
    {
        $role = $user->primaryRole;

        return match ($role?->slug) {
            'parent' => 'guardian.dashboard',
            'trainer', 'head_trainer' => 'trainer.dashboard',
            'receptionist' => 'receptionist.dashboard',
            'accountant' => 'financial.overview',
            'data_entry' => 'participants.list',
            default => 'dashboard',
        };
    }
}
