<?php

namespace App\Models;

# use Illuminate\Database\Eloquent\Model;

class Bill extends Model
{
    protected $table = 'bill';

    public function careMonth() {
        return $this->belongsTo(CareMonth::class);
    }

    public function note() {
        return $this->belongsTo(Note::class);
    }

    public function client()
    {
        return $this->hasOne(Client::class, 'id', 'client_id');
    }

    public function hcp() {
        return $this->hasOne(Pro::class, 'id', 'hcp_pro_id');
    }

    public function rmmPro() {
        return $this->hasOne(Pro::class, 'id', 'rmm_pro_id');
    }

    public function ally() {
        return $this->hasOne(Pro::class, 'id', 'na_pro_id');
    }

    public function genericPro() {
        return $this->hasOne(Pro::class, 'id', 'generic_pro_id');
    }

    public function hcpCompany() {
        return $this->hasOne(Company::class, 'id', 'hcp_company_id');
    }

    public function hcpCompanyPro() {
        return $this->hasOne(CompanyPro::class, 'id', 'hcp_company_pro_id');
    }

    public function genericCompanyPro() {
        return $this->hasOne(CompanyPro::class, 'id', 'generic_company_pro_id');
    }

    public function billFlagAcknowledgedByProAdmin() {
        return $this->hasOne(Pro::class, 'id', 'flagged_by_administrator_pro_id');
    }

    public function billFlagAcknowledgedByPro() {
        return $this->hasOne(Pro::class, 'id', 'administrator_flag_acknowledged_by_pro_id');
    }

    public function markedVerifiedBySession() {
        return $this->hasOne(AppSession::class, 'id', 'marked_verified_by_session_id');
    }
}
