<?php

namespace Modules\PurchaseRequisition\Entities;

use Illuminate\Database\Eloquent\Model;
use App\PurchaseLine;

class PrPurchaseChange extends Model
{
    protected $table = 'pr_purchase_changes';

    protected $fillable = [
        'pr_purchase_share_id',
        'purchase_line_id',
        'original_qty',
        'original_price',
        'requested_qty',
        'requested_price',
        'supplier_note',
        'status',
        'admin_note',
    ];

    public function share()
    {
        return $this->belongsTo(PrPurchaseShare::class, 'pr_purchase_share_id');
    }

    public function purchaseLine()
    {
        return $this->belongsTo(PurchaseLine::class, 'purchase_line_id');
    }
}
