<?php

namespace App\Models;

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

class GiftTier extends Model
{
    protected $fillable = ['threshold', 'name', 'description', 'is_active', 'sort_order', 'product_id'];

    protected function casts(): array
    {
        return [
            'threshold'  => 'decimal:2',
            'is_active'  => 'boolean',
            'sort_order' => 'integer',
            'product_id' => 'integer',
        ];
    }

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