<?php

declare(strict_types=1);

namespace App\Nova\Metrics;

use App\Models\Screening;
use Laravel\Nova\Http\Requests\NovaRequest;
use Laravel\Nova\Metrics\Trend;

final class ScreeningsTrend extends Trend
{
    public ?int $cacheFor = null;

    public function calculate(NovaRequest $request): mixed
    {
        return $this->countByDays($request, Screening::class);
    }

    public function name(): string
    {
        return 'Screenings';
    }

    public function ranges(): array
    {
        return [
            30 => '30 Days',
            60 => '60 Days',
            90 => '90 Days',
        ];
    }
}
