<?php

namespace App\Policies;

use App\Models\Lead;
use App\Models\User;

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

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

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

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

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