<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class ProviderProductMapping extends Model
{
    protected $guarded = [];

    protected function casts(): array
    {
        return [
            'required_fields' => 'array',
            'settings' => 'array',
            'is_active' => 'boolean',
            'codes_per_order' => 'integer',
        ];
    }

    public function provider()
    {
        return $this->belongsTo(Provider::class);
    }

    public function productVariant()
    {
        return $this->belongsTo(ProductVariant::class);
    }
}
