handle katod show insted of gold

This commit is contained in:
2026-06-03 20:24:07 +03:30
parent 4dc6b80ba4
commit 2d4656ed9c
3 changed files with 33 additions and 10 deletions
@@ -123,6 +123,8 @@ class WalletController extends Controller
$record->save();
}
$this->applyMetalTypeTransactionTitle($record);
}
return response()->json($records);
@@ -340,4 +342,17 @@ class WalletController extends Controller
return response()->json(true);
}
private function applyMetalTypeTransactionTitle($record): void
{
$metalLabel = self::metalTypeLabel();
$legacyDepositTitles = ['واریز طلای ابشده', 'واریز طلای آبشده'];
$legacyWithdrawTitles = ['برداشت طلای ابشده', 'برداشت طلای آبشده'];
if (in_array($record->title, $legacyDepositTitles, true)) {
$record->title = "موجودی {$metalLabel}";
} elseif (in_array($record->title, $legacyWithdrawTitles, true)) {
$record->title = "برداشت {$metalLabel}";
}
}
}