feat: add postcode resolution to /api/stations and Filament SearchResource
Some checks failed
linter / quality (push) Has been cancelled
tests / ci (8.3) (push) Has been cancelled
tests / ci (8.4) (push) Has been cancelled
tests / ci (8.5) (push) Has been cancelled

Extends NearbyStationsRequest to accept `postcode` (full or outcode) as an alternative to lat/lng. PostcodeService resolves it via postcodes.io and falls through to coordinates. Also adds SearchResource to the Filament admin panel for viewing logged search activity with fuel type filter and price/distance stats columns. Includes SQLite GREATEST/LEAST function polyfills in AppServiceProvider for test compatibility.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Ovidiu U
2026-04-05 19:10:25 +01:00
parent 3ccdc28763
commit 7101ed3550
15 changed files with 392 additions and 45 deletions

View File

@@ -221,7 +221,7 @@ it('sends web_search tool in the context prediction request', function (): void
Http::assertSent(function ($request) {
$tools = $request->data()['tools'] ?? [];
return collect($tools)->contains(fn ($t) => $t['type'] === 'web_search_20260209');
return collect($tools)->contains(fn ($t) => $t['type'] === 'web_search_20250305');
});
});
@@ -299,7 +299,7 @@ it('uses LLM with context when API key is configured', function (): void {
$prediction = $this->service->generatePrediction();
expect($prediction->source)->toBe(PredictionSource::LlmWithContext)
->and(PricePrediction::count())->toBe(1);
->and(PricePrediction::count())->toBe(2);
});
it('falls back to plain LLM when context method fails', function (): void {
@@ -323,7 +323,7 @@ it('falls back to plain LLM when context method fails', function (): void {
$prediction = $this->service->generatePrediction();
expect($prediction->source)->toBe(PredictionSource::Llm)
->and(PricePrediction::count())->toBe(1);
->and(PricePrediction::count())->toBe(2);
});
it('falls back to EWMA when both LLM methods fail', function (): void {