<?php

namespace App\Notifications\Push\Cliente\Contextual;

use App\Enums\PushNotificationCategoryEnum;
use App\Enums\PushNotificationTargetEnum;
use App\Models\User;
use App\Notifications\Push\BasePushNotification;
use Illuminate\Database\Eloquent\Collection;

class ContextualVisitaPush extends BasePushNotification
{
    public function label(): string
    {
        return 'cliente_contextual_visita';
    }

    public function title(): string
    {
        return 'Visita marcada?';
    }

    public function body(): string
    {
        return 'Uma diarista pode ajudar hoje.';
    }

    public function target(): PushNotificationTargetEnum
    {
        return PushNotificationTargetEnum::CLIENTE;
    }

    public function category(): PushNotificationCategoryEnum
    {
        return PushNotificationCategoryEnum::CONTEXTUAL;
    }

    public function eligibleUsers(): Collection
    {
        return User::whereHas('client')
            ->where('registration_complete', true)
            ->get();
    }
}
