<?php

namespace App\Services\Communications;

use App\Enum\Communication\AgentAvailabilityStatus;
use App\Models\Dialler\AgentStatus;

class AgentPresenceService {
    public function isAvailable(int $solicitorId, int $agentId): bool {
        return AgentStatus::query()
            ->where('solicitor_id', $solicitorId)
            ->where('agent_id', $agentId)
            ->where('status', AgentAvailabilityStatus::Available->value)
            ->exists();
    }
}