Commit Graph

45 Commits

Author SHA1 Message Date
Ovidiu U
156d925a35 docs: add station search page design spec 2026-04-05 20:17:13 +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
70cb40ff5d 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 19:03:52 +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
cde3a27cff feat: add admin seeder and is_admin factory state
Runs is_admin migration, adds AdminSeeder for the admin user, registers
it in DatabaseSeeder, adds admin() factory state to UserFactory, and
adds AdminAccessTest covering both forbidden and ok cases.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-04 13:54:28 +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
Ovidiu U
9e0aebc729 docs: add apilog design spec 2026-04-04 08:34:56 +01:00
Ovidiu U
ec3ad9130c init
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:23:04 +01:00
Ovidiu U
ada43d222a feat: FuelPriceService station upsert with tagging
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-03 18:53:42 +01:00
Ovidiu U
a83d06d76a feat: FuelPriceService with OAuth token caching
Also extend Pest TestCase to Unit tests and guard MySQL-only migration
DDL (composite PK + PARTITION BY) behind a driver check so in-memory
SQLite tests can run migrations cleanly.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-03 18:52:40 +01:00
Ovidiu U
80a8a9f93b feat: add StationTaggingService with supermarket detection 2026-04-03 18:49:34 +01:00
Ovidiu U
7f153fb08d feat: add Station, StationPrice, StationPriceCurrent, StationPriceArchive models and factories 2026-04-03 18:46:53 +01:00
Ovidiu U
ec3a2bf848 feat: add stations and station prices migrations
Creates stations, station_prices_current, station_prices (monthly-partitioned), and station_prices_archive tables.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-03 18:45:05 +01:00
Ovidiu U
7d5b467084 feat: add FuelType backed enum 2026-04-03 18:28:01 +01:00
Ovidiu U
e39453f4f6 config: add fuel_finder service credentials 2026-04-03 18:27:26 +01:00
Ovidiu U
c8bc2836b6 docs: add fuel API ingestion implementation plan 2026-04-03 18:21:51 +01:00
Ovidiu U
5ad89e977d Add fuel API ingestion and historic storage design spec
Includes verified API authentication flow, correct base URL, all DB
table schemas for stations, current prices, history, and archive.
Fuel types corrected to match live API (B7_STANDARD, B7_PREMIUM).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-03 18:09:50 +01:00
Ovidiu U
02d4c9d888 Add comprehensive project documentation and architecture guidelines
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
Establishes core rules and conventions for the FuelAlert Laravel application: architecture patterns (fat services, thin controllers), database schema with partitioned station_prices table, multi-tier notification system with Vonage and OneSignal, 4-signal scoring engine for fuel price recommendations, Stripe subscription tiers, Livewire classic component structure, and Pest testing standards.
2026-04-03 16:49:19 +01:00
Ovidiu U
c94c4f7beb init
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-03 16:47:05 +01:00
Ovidiu U
8cf504ec3c first commit 2026-04-03 16:45:47 +01:00