fix(server): queue tiny Pargar gold wallet documents instead of skipping them

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-08-18 17:57:22 +03:30
co-authored by Cursor
parent e158831fd3
commit 0afa01eea9
3 changed files with 121 additions and 9 deletions
@@ -329,7 +329,7 @@ class PargarInboundController extends Controller
$appCash = (float) ($wallet->cash ?? 0);
$goldDiff = $goldInv - $appGold;
$rialDiff = $rialInv - $appCash;
$hasDiff = abs($goldDiff) >= 0.01 || abs($rialDiff) >= 1;
$hasDiff = PargarSyncService::isWalletDocAmount($goldDiff) || abs($rialDiff) >= 1;
$pendingOutbound = $this->inboundWallet()->hasPendingOutboundToPargar($customer);
@@ -687,7 +687,7 @@ class PargarInboundController extends Controller
$payload = json_decode((string) $log->data, true) ?: [];
$kind = (string) ($payload['kind'] ?? ($log->type === PargarSyncService::TYPE_WALLET_GOLD ? 'gold' : 'cash'));
$signed = (float) ($payload['signed_amount'] ?? $log->amount ?? 0);
if (abs($signed) < ($kind === 'cash' ? 1 : 0.01)) {
if (! PargarSyncService::isWalletDocAmount($signed)) {
$signed = (float) ($log->amount ?? 0);
// اگر علامت نبود، از desc حدس بزن — پیش‌فرض واریز مثبت
if (! isset($payload['signed_amount']) && is_string($log->desc) && str_contains($log->desc, 'برداشت')) {