<?php

namespace App\Models;

use App\Models\BaseModel;

class ItemPriceLevel extends BaseModel
{
    protected $table = 'item_price_levels';

    protected $fillable = [
        'company_id','item_id','price_level_id','currency_id','unit_price','effective_date'
    ];

    protected $casts = [
        'unit_price'     => 'decimal:6',
        'effective_date' => 'date',
    ];

    public function company()    { return $this->belongsTo(Company::class); }
    public function item()       { return $this->belongsTo(Item::class); }
    public function priceLevel() { return $this->belongsTo(PriceLevel::class); }
    public function currency()   { return $this->belongsTo(Currency::class); }
}
