<?php

namespace App\Policies;

use App\Permissions\Modules\Patients;
// use App\Models\Admin Admins;
use Illuminate\Auth\Access\HandlesAuthorization;

class PatientPolicy
{
    use HandlesAuthorization;
    private $class_name='Patient';
    /**
     * Create a new policy instance.
     *
     * @return void
     */
    public function __construct()
    {
        //
    }
    public function add($user)
    {
        return $user->role->havePermission(Patients::PATIENT_ADD);

    }
    public function edit($user)
    {
        return $user->role->havePermission(Patients::PATIENT_EDIT);

    }
    public function list($user)
    {
        return $user->role->havePermission(Patients::PATIENT_VIEW);

    }
    public function details($user)
    {
        return $user->role->havePermission(Patients::PATIENT_FULL_DETAIL);

    }
    public function delete($user)
    {
        return $user->role->havePermission(Patients::PATIENT_DELETE);
    }
    public function detail_overview($user)
    {
        return $user->role->havePermission(Patients::PATIENT_DETAIL_OVERVIEW_TAB);
    }
    public function patient_notes($user)
    {
        return $user->role->havePermission(Patients::PATIENT_DETAIL_NOTES_TAB);
    }
    public function patinet_prescriptions($user)
    {
        return $user->role->havePermission(Patients::PATIENT_DETAIL_PRESCRIPTION_TAB);
    }
    public function patinet_prescriptions_edit($user)
    {
        return $user->role->havePermission(Patients::PATIENT_DETAIL_PRESCRIPTION_EDIT);
    }
    public function patinet_lab_test($user)
    {
        return $user->role->havePermission(Patients::PATIENT_DETAIL_LAB_TEST_TAB);
    }
    public function patinet_profile_tab($user)
    {
        return $user->role->havePermission(Patients::PATIENT_DETAIL_PROFILE_TAB);
    }
}
