<?php

declare(strict_types=1);

namespace App\Nova\Metrics;

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

final class TotalScreenings extends Value
{
    /**
     * Calculate the value of the metric.
     */
    public function calculate(NovaRequest $request): mixed
    {
        return $this->count($request, Screening::class);
    }

    /**
     * Get the displayable name of the metric.
     */
    public function name(): string
    {
        return 'Total Screenings';
    }

    /**
     * Get the ranges available for the metric.
     */
    public function ranges(): array
    {
        return [
            30 => '30 Days',
            60 => '60 Days',
            365 => '365 Days',
            'TODAY' => 'Today',
            'ALL' => 'All Time',
        ];
    }

    /**
     * Determine the amount of time the results should be cached.
     */
    public $cacheFor = null;
}
