<?php

namespace App\Models\Orders;

use Illuminate\Database\Eloquent\Model;
use App\Models\Dependencies\Dependencies;

class SalesSeparated extends Model
{
    protected $table = 'sales_separate_stock';
    protected $fillable = [
        'order_id',
        'order_item_id',
        'separate',
        'shop',
        'body_ov'
    ];

    public function order()
    {
        return $this->belongsTo(SalesOrder::class,'order_id','id');
    }

    public function orderItem()
    {
        return $this->hasManyTo(SalesOrderDetail::class);
    }
    public function log()
    {
        return $this->hasMany(SalesSeparatedLog::class);
    }

    public function storeCol()
    {
        return $this->belongsTo(Dependencies::class, 'shop', 'dependency');
    }
}
