<?php

namespace App\Policies;

use App\Models\Visit;
use App\Models\User;

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

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

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

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