<?php

namespace App\Models;

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

class ProjectStatus extends Model
{
    use HasFactory;

    protected $fillable = [
        'name',
        'order',
        'is_active',
        'is_billable',
    ];

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

    /**
     * Get the projects for the status.
     */
    public function projects(): HasMany
    {
        return $this->hasMany(Project::class, 'status_id');
    }
}
