<?php

namespace App\Models;

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

class Agreement extends BaseModel
{
    use HasFactory;
    protected $table = 'agreement';

    const MATERIAL_TYPE_PAPER = 0;
    const MATERIAL_TYPE_ELECTRON = 1;

    const IS_NOTICE_NO = 0;
    const IS_NOTICE_YES = 1;

    const IS_RECEIVE_NO = 0;
    const IS_RECEIVE_YES = 1;

    public function signInfo()
    {
        return $this->hasOne(Collaborator::class, 'id', 'sign_id');
    }

    public function introduceInfo()
    {
        return $this->hasOne(Collaborator::class, 'id', 'introduce_id');
    }

    public function orderInfo(){
        return $this->hasOne(Order::class, 'id', 'order_id');
    }

    public function quotaInfo(){
        return $this->hasOne(Quota::class, 'id', 'quota_id');
    }
}
