<?php

namespace App\Modules\HR\Employees\Models;

use App\Modules\Admin\Tenancy\Traits\BelongsToTenant;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;

class EmployeeSkill extends Model
{
    use BelongsToTenant;

    protected $fillable = [
        'tenant_id',
        'employee_id',
        'name',
        'level',
        'years_experience',
        'is_certified',
        'notes',
        'created_by',
    ];

    protected function casts(): array
    {
        return [
            'is_certified' => 'boolean',
            'years_experience' => 'integer',
        ];
    }

    public function employee(): BelongsTo
    {
        return $this->belongsTo(Employee::class);
    }
}
