895d55439bbc2772a7440e4ff78955217ffb657a
Audit item #8. StationController::index was ~100 lines doing the haversine join, in-PHP filter/sort/group, search-row write, and prediction call — well past the "thin orchestrator" line in .claude/rules/architecture.md. - App\Services\StationSearch\SearchCriteria — DTO (lat/lng/fuelType/ radiusKm/sort) - App\Services\StationSearch\SearchResult — DTO (stations, prices summary, reliability counts, prediction payload) - App\Services\StationSearch\StationSearchService::search(criteria, ?user, ?ipHash) — owns the haversine query, the per-row reliability memoisation, sort, count, search-row logging, and the tier-gated prediction. The controller now resolves coordinates, builds a SearchCriteria, calls the service, and shapes the JSON response. Down from 154 → 71 lines. Public API contract unchanged — all 15 StationController tests pass without modification. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The file is empty.
Description
Languages
PHP
60.5%
Vue
14.8%
Blade
14%
HTML
9.2%
JavaScript
1%
Other
0.5%