<?php

declare(strict_types=1);

namespace App\Models;

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

class Promo extends Model
{
    protected $fillable = ['name', 'type', 'value', 'min_purchase', 'product_id', 'is_active'];

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

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