<?php

namespace App\Models;

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

class PriceListingMarkup extends Model
{
    use HasFactory;

    protected $table = 'price_listing_markups';

    protected $fillable = [
        'price_listing_setup_id',
        'price_list_name_id',
        'markup_pct'
    ];

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

    public function itemType(): BelongsTo
    {
        return $this->belongsTo(PriceListingSetup::class, 'price_listing_setup_id');
    }
}
