Sync SMS panel with SuperAdmin and mirror local wallet/logs.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-08-05 22:24:35 +03:30
co-authored by Cursor
parent c6b1478b21
commit 62d83a5bfd
4 changed files with 485 additions and 68 deletions
@@ -146,6 +146,27 @@ class SmsGatewayService
'parts' => $parts,
'source' => $source,
]);
return;
}
// Parallel period: mirror balance + local send log/ledger from SuperAdmin.
try {
$this->walletService->mirrorConsumeFromSuperAdmin(
$to,
$text,
$parts,
$providerName,
$source,
$isAlert,
(int) ($consumed['balanceRials'] ?? 0),
(int) ($consumed['costRials'] ?? 0),
(int) ($consumed['pricePerPartRials'] ?? 0)
);
} catch (\Throwable $e) {
Log::warning('SmsGateway: local mirror after SuperAdmin consume failed', [
'error' => $e->getMessage(),
]);
}
return;