<?php

declare(strict_types=1);

namespace App\Enums;

use Filament\Support\Contracts\HasLabel;

enum UserRole: string implements HasLabel
{
    /** A customer. The default, and the one with no admin access. */
    case Artist = 'artist';

    /** Studio staff: full run of the admin panel. */
    case Admin = 'admin';

    /**
     * Reserved. Engineers do not have a panel yet; the role exists so that
     * adding their rota view later needs no migration and no backfill.
     */
    case Engineer = 'engineer';

    public function canAccessAdminPanel(): bool
    {
        return $this === self::Admin;
    }

    public function getLabel(): string
    {
        return match ($this) {
            self::Artist => 'Artist',
            self::Admin => 'Studio admin',
            self::Engineer => 'Engineer',
        };
    }
}
