<?php

namespace App\Models;

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

class PetCertificate extends Model
{
    use SoftDeletes;

    protected $table = 'pet_certificates';
    protected $primaryKey = 'PC_Id';

    protected $fillable = [
        'Reference_Id',
        'PR_Id',
        'CM_Id',
        'Certificate_No',
        'Issue_Date',
        'Expiry_Date'
    ];

    // Relations
    public function pet()
    {
        return $this->belongsTo(PetRegistration::class, 'PR_Id', 'PR_Id');
    }

    public function certificateMaster()
    {
        return $this->belongsTo(CertificateMaster::class, 'CM_Id', 'CM_Id');
    }
}
