<?php

namespace App\Services\Forecasting\Features;

use App\Services\Forecasting\Contracts\ForecastFeature;
use App\Services\Forecasting\UkBankHolidays;
use Carbon\CarbonInterface;

/**
 * 1.0 if any UK bank holiday falls in the 7-day window starting at the
 * target Monday; 0.0 otherwise.
 *
 * Captures pre-holiday demand spikes (Easter, summer, Christmas
 * weekend). Pure calendar — no DB read, sourceDates is empty.
 */
final class IsPreBankHoliday implements ForecastFeature
{
    public function name(): string
    {
        return 'is_pre_bank_holiday';
    }

    public function valueFor(CarbonInterface $targetMonday): ?float
    {
        return UkBankHolidays::holidayWithin($targetMonday, 7) ? 1.0 : 0.0;
    }

    public function sourceDates(CarbonInterface $targetMonday): array
    {
        return [];
    }
}
