<?php

namespace App\Models\Orders;

use Illuminate\Database\Eloquent\Model;

class SaleCommits extends Model
{
    protected $table = 'sale_commits';
    protected $fillable = [
        'order_id',
        'order_item_id',
        'user_id',
        'channel_id',
        'commit'
    ];

    public function order()
    {
        return $this->belongsTo(SalesOrder::class);
    }
    public function orderItem()
    {
        return $this->hasMany(SalesOrderDetail::class,'order_item_id','id');
    }
    public function channel()
    {
        return $this->belongsTo(SalesChannel::class,'channel_id');
    }
    public function user()
    {
        return $this->belongsTo('App\Models\User','user_id');
    }
}
