feat: update sms units to kilogram transactions notes price source label and trading closed message

This commit is contained in:
2026-11-18 18:25:34 +03:30
parent 0004192cbc
commit 3ce2c48438
19 changed files with 382 additions and 49 deletions
+20 -2
View File
@@ -25,6 +25,7 @@ class ConfigService
'show_home_price_when_closed',
'show_gold_ounce_price',
'trading_hours_by_day',
'closed_message',
];
/**
@@ -634,12 +635,24 @@ class ConfigService
{
// تاریخچهٔ برچسب‌دار همین provider — سقف/کف بدون قاطی شدن با تیک منبع دیگر
$fromLog = $this->providerTodayQuoteExtremes();
if ($fromLog['max'] > 0 && $fromLog['min'] > 0) {
return ['up' => $fromLog['max'], 'down' => $fromLog['min']];
$logMax = $fromLog['max'];
$logMin = $fromLog['min'];
if ($logMax > 1_000_000_000) {
$logMax = (int) round($logMax / 1000);
$logMin = (int) round($logMin / 1000);
}
if ($logMax > 0 && $logMin > 0) {
return ['up' => $logMax, 'down' => $logMin];
}
$up = $this->getInt('up_price', 0);
$down = $this->getInt('down_price', 0);
if ($up > 1_000_000_000) {
$up = (int) round($up / 1000);
}
if ($down > 1_000_000_000) {
$down = (int) round($down / 1000);
}
$candle = PriceCandle::whereDate('date_at', now()->toDateString())->first();
$candleHigh = $candle ? (int) round((float) $candle->high) : 0;
@@ -1098,6 +1111,11 @@ class ConfigService
public function tradingClosedMessage(?Carbon $now = null): string
{
$custom = trim((string) $this->getString('closed_message', ''));
if ($custom !== '') {
return $custom;
}
$now = $now ?? Carbon::now();
$bounds = $this->effectiveTradingBounds($now);