<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class Manguera extends Model
{
    use HasFactory;

    protected $table = 'mangueras';
    protected $primaryKey = 'id_manguera';
    public $timestamps = false;

    protected $fillable = [
        'id_cara',
        'id_tipo_combustible',
        'numero_manguera',
        'estado',
    ];

    public function cara()
    {
        return $this->belongsTo(CaraEstacion::class, 'id_cara', 'id_cara');
    }

    public function tipoCombustible()
    {
        return $this->belongsTo(TipoCombustible::class, 'id_tipo_combustible', 'id_tipo_combustible');
    }

    public function registrosSalidas()
    {
        return $this->hasMany(RegistroSalida::class, 'id_manguera', 'id_manguera');
    }
}
