<?php

namespace App\Models\Design;

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

class DesignModel extends Model
{
    use SoftDeletes;

    protected $table = 'models';

    protected $fillable = [
        'tenant_id', 'code', 'name', 'category_id', 'lifecycle', 'description', 'is_active',
    ];

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

    // 관계: 모델은 여러 버전을 가짐
    public function versions()
    {
        return $this->hasMany(ModelVersion::class, 'model_id');
    }
}
