<?php
declare(strict_types=1);

namespace App\Modules\PlayerAffairs\Models;

use App\Core\Model;

class PlayerDiscipline extends Model
{
    protected static string $table = 'player_disciplines';
    protected static string $primaryKey = 'id';
    protected static bool $timestamps = true;
    protected static bool $softDelete = false;
    protected static bool $autoTrackAuthor = false;

    protected static array $fillable = [
        'player_id',
        'discipline_id',
        'age_group',
        'skill_level',
        'season',
        'status',
        'registered_at',
    ];

    /**
     * Get discipline statuses with Arabic labels.
     */
    public static function getStatuses(): array
    {
        return [
            'active'      => 'فعال',
            'inactive'    => 'غير فعال',
            'transferred' => 'محوّل',
        ];
    }

    /**
     * Get all disciplines for a specific player.
     */
    public static function getForPlayer(int $playerId): array
    {
        return static::query()
            ->where('player_id', '=', $playerId)
            ->orderBy('created_at', 'DESC')
            ->get();
    }
}
