<?php

namespace App\Filters;

use Closure;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Collection;
use Mtc\MercuryDataModels\Filters\IsFilter;

/**
 * Round-trips the postcode search radius through `selections` so the
 * frontend can rebuild its store from the API response. The actual geo
 * filtering is performed by PostcodeFilter, which reads `distance` from
 * the request directly — this class intentionally does no querying.
 */
class DistanceFilter extends IsFilter
{
    public function applyFilter($query, array $selection = []): void
    {
    }

    public function getResults(Closure $product_filtering, int $limit, array $selections = []): Collection
    {
        return collect();
    }

    public function getModel(): string
    {
        return '';
    }

    public function title(): string
    {
        return 'Distance';
    }

    public function modelSlug(Model $model): string
    {
        return '';
    }

    public function getSelectionName($selection): string
    {
        return 'Within ' . (int) $selection . ' miles';
    }
}
