<?php

namespace App\Models\Tenant;

use App\Models\Concerns\BelongsToTenant;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Database\Eloquent\SoftDeletes;

class Subcontractor extends Model
{
    use BelongsToTenant, SoftDeletes;

    public const SPECIALTIES = [
        'Turbo', 'Cutie viteze', 'Variator', 'Casetă direcție',
        'PDR', 'Vopsitorie', 'Electronică', 'Injectoare', 'Altele',
    ];

    protected $fillable = [
        'company_id', 'name', 'specialty', 'phone', 'email',
        'rating', 'is_active', 'notes',
    ];

    protected $casts = [
        'is_active' => 'boolean',
    ];

    public function jobs(): HasMany
    {
        return $this->hasMany(SubcontractJob::class);
    }
}
