<?php

namespace App\Policies;

use App\Models\Patient;
use App\Models\User;

class PatientPolicy
{
    public function viewAny(User $user): bool
    {
        return (bool) $user->company_id;
    }

    public function view(User $user, Patient $patient): bool
    {
        return $user->company_id === $patient->company_id;
    }

    public function create(User $user): bool
    {
        return (bool) $user->company_id;
    }

    public function update(User $user, Patient $patient): bool
    {
        return $user->company_id === $patient->company_id;
    }

    public function delete(User $user, Patient $patient): bool
    {
        return $user->company_id === $patient->company_id;
    }
}
