<?php

namespace App\Models;

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

class AffiliateProductOverride extends Model
{
    use HasFactory;

    protected $fillable = [
        'product_id',
        'commission_rate',
        'enabled',
    ];

    protected $casts = [
        'commission_rate' => 'decimal:2',
        'enabled' => 'boolean',
    ];

    /**
     * Get the product this override applies to.
     */
    public function product()
    {
        return $this->belongsTo(Product::class);
    }
}
