fix(price): read last quote and daily extremes from the active provider

A stray montzar tick landed in the prices table, which stores no source, so
the database_last fallback served a ~168M quote on a shop whose Zaarbox board
was at ~217M. Last price and today's high/low now come from price_sync_logs
filtered by price_provider, the database fallback no longer counts as today's
price, and daily extremes reset when the provider changes.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-08-31 09:45:37 +03:30
co-authored by Cursor
parent 1b73305d6f
commit 142cfd7661
5 changed files with 98 additions and 37 deletions
+1 -3
View File
@@ -2,7 +2,6 @@
namespace App\Services;
use App\Models\Price;
use Illuminate\Support\Facades\Cache;
class LivePriceCacheService
@@ -114,8 +113,7 @@ class LivePriceCacheService
{
$config = app(ConfigService::class);
$display = app(ProductDisplayPriceService::class);
$last = Price::orderByDesc('id')->first();
$base = $last ? (float) $last->price : 0.0;
$base = (float) $display->resolveHistoricalBasePrice();
$provider = $config->priceProvider();
$montzarSource = 0;