<?php

namespace App\Models;

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

class Solution extends Model
{
    use HasFactory;

    protected $fillable = [
        'name',
        'nb_panneaux',
        'short_description',
        'full_description',
        'potentiel_economie',
        'recommended',
        'solution_group_id',
        'is_active',
    ];

    protected $casts = [
        'nb_panneaux' => 'integer',
        'potentiel_economie' => 'integer',
        'recommended' => 'boolean',
        'is_active' => 'boolean',
        'solution_group_id' => 'integer',
    ];

    public function solutionGroup() :BelongsTo
    {
        return $this->belongsTo(SolutionGroup::class);
    }
}
