<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\SoftDeletes;

class AlertMailRule extends Model
{
    use SoftDeletes;

    protected $fillable = [
        'module',
        'plant',
        'invoice_master_id',
        'rule_name',
        'email',
        'cc_emails',
        'schedule_type',
        'machine_id',
        'created_at',
        'updated_at',
        'created_by',
        'updated_by',
    ];

    public function invoiceMaster(): BelongsTo
    {
        return $this->belongsTo(InvoiceMaster::class);
        //return $this->belongsTo(InvoiceMaster::class, 'invoice_master_id');
    }

    public function machine(): BelongsTo
    {
        return $this->belongsTo(Machine::class);
        //return $this->belongsTo(InvoiceMaster::class, 'invoice_master_id');
    }
}
