<?php

namespace App\Domains\Catalog\Models;

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

#[Fillable([
    'variant_id',
    'item_attribute_id',
    'value',
])]
class VariantDefinition extends Model
{
    use HasFactory;

    protected $table = 'variant_values';

    /** @return BelongsTo<Variant, $this> */
    public function variant(): BelongsTo
    {
        return $this->belongsTo(Variant::class);
    }

    /** @return BelongsTo<ItemAttribute, $this> */
    public function itemAttribute(): BelongsTo
    {
        return $this->belongsTo(ItemAttribute::class);
    }
}
