<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Laravel\Scout\Searchable;

class Action extends Model
{
    /** @use HasFactory<\Database\Factories\ActionFactory> */
    use HasFactory;

    use Searchable;

    protected $fillable = ['name', 'color_tag', 'segment_id'];

    public function decisions(): BelongsToMany
    {
        return $this->belongsToMany(\App\Models\Decision::class);
    }

    public function segment(): BelongsTo
    {
        return $this->belongsTo(\App\Models\Segment::class);
    }

    public function activities(): HasMany
    {
        return $this->hasMany(\App\Models\Activity::class);
    }
}
