<?php

namespace App\Models;

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

class RedeemRestaurant extends Model
{
    use HasFactory;
    protected $table = 'redeem_restaurant';

    protected $fillable = [
        'iam_principal_xid',
        'manage_restaurants_xid',
        'is_active',
        'is_redeem',
        'count',
        'redeem_date',
        'is_redeemption_undone',
        'redeemption_undone_date',
        'created_at',
        'updated_at'
    ];

    public function restaurant()
    {
        return $this->belongsTo(ManageRestaurant::class,'manage_restaurants_xid', 'id');
    }

    public function customer()
    {
        return $this->belongsTo(IamPrincipal::class,'iam_principal_xid', 'id');
    }


}
