<?php

namespace App\Models;

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

class Indicator extends Model
{
    use SoftDeletes;

    protected $table = 'indicators';
    protected $primaryKey = 'indicator_id';
    protected $fillable = ['unit_id', 'indicator_category_id', 'name', 'description', 'type', 'icon'];

    public function indicator_category()
    {
        return $this->belongsTo(IndicatorCategory::class, 'indicator_category_id', 'indicator_category_id');
    }

    public function unit()
    {
        return $this->belongsTo(Unit::class, 'unit_id', 'unit_id');
    }
}
