Commit Graph

106 Commits

Author SHA1 Message Date
Ovidiu U
c935903614 feat: strip FuelFinder to layout shell, wire sub-components 2026-04-08 08:48:15 +01:00
Ovidiu U
bce5aa72c8 feat: extract fuel.map component and wire Leaflet to map-update browser event 2026-04-08 08:46:33 +01:00
Ovidiu U
0809a5340b feat: extract fuel.recommendation Livewire component 2026-04-08 08:46:16 +01:00
Ovidiu U
c4f5fd042b fix: remove dead search property, simplify empty state message 2026-04-07 22:04:15 +01:00
Ovidiu U
a576ef6b4a feat: extract fuel.station-list Livewire component
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-07 22:02:08 +01:00
Ovidiu U
266051c52b fix: use required rule for sort property (non-nullable string) 2026-04-07 22:00:38 +01:00
Ovidiu U
0b289c8ec2 feat: extract fuel.search Livewire component with stations-found dispatch
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-07 21:58:01 +01:00
Ovidiu U
0b26c4c257 fix: convert avg_price from pence to pounds before linear regression calculation
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
2026-04-07 14:51:14 +01:00
Ovidiu U
6a80c11f38 feat: add LLM prediction providers with structured output support
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
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-07 14:42:44 +01:00
Ovidiu U
e9612666e3 feat: wire FuelFinder to home route, replacing static homepage 2026-04-07 14:38:03 +01:00
Ovidiu U
6d6def18f1 feat: add FuelFinder Livewire component
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-07 14:32:45 +01:00
Ovidiu U
5bc6ca720c feat: add price classification enum and reliable sort option
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
2026-04-06 09:58:45 +01:00
Ovidiu U
cef21a4f0f feat: include search lat/lng in station API meta response 2026-04-06 09:37:39 +01:00
Ovidiu U
dce2bd6e50 feat: auto-reload results when fuel type, sort, or radius changes 2026-04-05 20:50:18 +01:00
Ovidiu U
d4d532000d fix: align sort validation with API (nullable) 2026-04-05 20:48:21 +01:00
Ovidiu U
fa94bb537b feat: add sort option to station search form 2026-04-05 20:48:00 +01:00
Ovidiu U
cd9d833e44 feat: default fuel type to petrol 2026-04-05 20:46:25 +01:00
Ovidiu U
eed6ef9c81 fix: guard cache hit with instanceof to handle stale LocationResult entries 2026-04-05 20:45:28 +01:00
Ovidiu U
a11f0ba186 fix: increase postcode field max length to allow city/town names 2026-04-05 20:43:33 +01:00
Ovidiu U
f05a617af0 fix: use app.api_secret_key for self-API calls, handle ConnectionException 2026-04-05 20:41:23 +01:00
Ovidiu U
130576c9ba feat: implement StationSearch Livewire component 2026-04-05 20:28:15 +01:00
Ovidiu U
7e1a000e2a feat: add API key authentication middleware
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
Adds `VerifyApiKey` middleware to validate `X-Api-Key` header against `app.api_secret_key` config. Returns 403 if key is missing or invalid.
2026-04-05 20:27:57 +01:00
Ovidiu U
6176359d1f feat: add updated and brand sort options to /api/stations endpoint
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 validation to accept `sort=updated` and `sort=brand`. Updates StationController to use match expression with dedicated closures: 'updated' sorts by price_effective_at descending (newest first), 'brand' sorts alphabetically by brand_name, with existing price and distance options.
2026-04-05 19:52:20 +01:00
Ovidiu U
6249ed8fe2 refactor: add Enum labels, fix indentation, and add URL links to StatsOverviewWidget
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
Adds `label()` methods to TrendDirection and PredictionSource enums for cleaner display. Fixes mixed tab/space indentation in StatsOverviewWidget. Links all stats cards to their respective Filament resources (searches, stations, oil-predictions, api-logs). Documents BrentPriceChartWidget's manual registration.
2026-04-05 19:52:12 +01:00
Ovidiu U
4f57c97015 docs: add comprehensive API reference documentation
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
Adds complete API reference (api-reference.md) covering all endpoints: /api/stations (nearby search with postcode/lat+lng), /api/stats/searches (aggregated search stats), /api/prediction (7-day price forecast with multi-signal breakdown), and auth routes (register/login/logout/me). Includes request/response examples, error shapes, fuel type aliases, and signal structure details. Also removes unused AccountWidget from admin panel, disables BrentPriceChartWidget discovery, and adds searches stat to StatsOverviewWidget.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-05 19:34:32 +01:00
Ovidiu U
7101ed3550 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>
2026-04-05 19:10:25 +01:00
Ovidiu U
3ccdc28763 prediction with context
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
2026-04-05 17:08:16 +01:00
Ovidiu U
0bea50b843 feat: add GET /api/stats/searches endpoint
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-04 19:28:41 +01:00
Ovidiu U
8bd43ee9e4 feat: add GET /api/stations nearby stations endpoint with haversine query and search logging
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-04 19:27:55 +01:00
Ovidiu U
cf6a1369d4 feat: add GET /api/prediction endpoint
Implements PredictionRequest (fuel_type validation with ValueError→ValidationException), PredictionController delegating to NationalFuelPredictionService, and 5 feature tests. Also fixes LEAST() MySQL-only function to a CASE WHEN expression for SQLite test compatibility.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-04 19:26:48 +01:00
Ovidiu U
1c548eae87 feat: add NationalFuelPredictionService with trend, day-of-week, brand-behaviour, and stickiness signals
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-04 19:13:00 +01:00
Ovidiu U
a30dbdfbba feat: install Sanctum, scaffold api.php, add FuelType::fromAlias()
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-04 19:10:05 +01:00
Ovidiu U
c815597a98 feat: add searches table, model, and factory for API search logging
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-04 19:09:19 +01:00
Ovidiu U
c2c16c928b feat: add UserResource with is_admin toggle and delete
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
User management resource with editable is_admin field, postcode support,
admin filter, and inline delete action. Includes list and edit pages.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-04 18:31:55 +01:00
Ovidiu U
fb4c413926 feat: add generateLlmPredictionWithContext with web search geopolitical context
- New method uses web_search_20260209 server-side tool so Claude fetches
  48h of oil/geopolitical news autonomously before predicting direction
- Prompt uses raw prices only — no pre-computed EWMA indicators
- pause_turn loop handles server-side search continuation (up to 5 iters)
- generatePrediction() now tries context method first, falls back to
  generateLlmPrediction(), then EWMA
- Default model updated to claude-sonnet-4-6

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-04 15:32:53 +01:00
Ovidiu U
1d2eb12e83 feat: add StatsOverviewWidget to admin dashboard
Four-stat overview widget (users, stations, oil prediction, API errors)
with 30s polling registered on the admin panel dashboard.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-04 14:31:02 +01:00
Ovidiu U
a3288955d8 fix: use IconEntry for boolean fields in StationResource infolist 2026-04-04 14:28:51 +01:00
Ovidiu U
52dc225b3d feat: add StationResource with poll action and view page
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-04 14:27:22 +01:00
Ovidiu U
b2cc3ee0ff feat: add BrentPriceResource with 30-day line chart widget
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-04 14:23:57 +01:00
Ovidiu U
d936175090 feat: add OilPredictionResource with run-prediction header action
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-04 14:20:51 +01:00
Ovidiu U
d602c8bde4 feat: add UserResource with is_admin toggle and delete
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-04 14:17:50 +01:00
Ovidiu U
9998a3e1c8 fix: improve errors_only filter and add view page test
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-04 14:14:35 +01:00
Ovidiu U
a8fb275793 feat: add ApiLogResource with filters and view page
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-04 14:09:32 +01:00
Ovidiu U
99b0ce480b feat: add PollFuelPricesJob queued job 2026-04-04 14:04:45 +01:00
Ovidiu U
cf187f9721 feat: add HasFactory and factories for ApiLog, BrentPrice, PricePrediction
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-04 13:59:55 +01:00
Ovidiu U
efba3cbfd6 feat: configure admin panel with authGuard and widget setup 2026-04-04 13:57:23 +01:00
Ovidiu U
a0e74f2363 feat: reorganize Filament into multi-panel structure and add is_admin cast
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
- Move Filament resources, pages, and widgets into Admin namespace subdirectories
- Remove default panel and login method calls from AdminPanelProvider
- Add is_admin boolean cast to User model
2026-04-04 13:50:49 +01:00
Ovidiu U
d5fb7f85bd feat: add Filament admin panel with migrations and design spec
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
- Add AdminPanelProvider mounting panel at `/admin` with `is_admin` auth guard
- Add `is_admin` boolean column to users table
- Add brent_prices and price_predictions tables with appropriate indexes
- Add comprehensive admin design spec covering resources, dashboard, navigation, and build order
- Configure default panel with amber primary color and standard middleware stack
- Add compiled Filament assets (actions.js, app.css)
2026-04-04 13:40:56 +01:00
Ovidiu U
e532cc1208 feat: add PostcodeService and price validation with DB constraints
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
- Add PostcodeService to resolve UK postcodes, outcodes, and place names to coordinates via postcodes.io API with 30-day caching
- Add LocationResult value object for resolved location data
- Add per-fuel-type price validation (80p-1050p range) to FuelPriceService with warning logs for out-of-range prices
- Change price_pence column from unsignedSmallInteger to unsignedMediumInteger in station_prices tables
- Add CHECK constraints (5000-50000 range) on price_pence columns as database-level guard
- Improve error handling in PollFuelPrices command with file/line/trace output
- Add tests for PostcodeService covering full postcodes, outcodes, place names, caching, and error handling
- Add test for price validation range checks

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-04 12:40:43 +01:00
Ovidiu U
097f1b0529 apilogs
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
2026-04-04 08:41:21 +01:00