<?php

namespace App\Models\Equipment;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;

class EquipmentProcess extends Model
{
    protected $table = 'equipment_process';

    protected $fillable = [
        'equipment_id',
        'process_id',
        'is_primary',
    ];

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

    public function equipment(): BelongsTo
    {
        return $this->belongsTo(Equipment::class, 'equipment_id');
    }

    public function process(): BelongsTo
    {
        return $this->belongsTo(\App\Models\Process::class, 'process_id');
    }
}
