feat: add postcode resolution to /api/stations and Filament SearchResource
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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user