<?php

namespace App\Models\Product;

use Illuminate\Database\Eloquent\Model;
use App\Models\Agency\Marketplace;
use App\Models\Agency\Currency;

class ProductMarketplacePrice extends Model
{
    protected $table = 'product_marketplace_prices';

    protected $fillable = [
        'product_id',
        'marketplace_id',
        'currency_id',
        'adult_price',
        'child_price',
        'infant_price',
    ];

    protected $casts = [
        'adult_price' => 'decimal:2',
        'child_price' => 'decimal:2',
        'infant_price' => 'decimal:2',
    ];

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

    public function marketplace()
    {
        return $this->belongsTo(Marketplace::class);
    }

    public function currency()
    {
        return $this->belongsTo(Currency::class);
    }
}
