fix(wallet): absorb cash left on old owner type

Deposits credited before customer type was set stayed on owner_type 0 and assets ignored them.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-11-14 14:41:24 +03:30
co-authored by Cursor
parent bdf70a4c05
commit 97d1077db6
5 changed files with 108 additions and 0 deletions
@@ -89,6 +89,7 @@ class WalletController extends Controller
$customer = auth('customer')->user();
$customerId = (int) $customer->id;
$ownerType = (int) $customer->type;
$balanceService->absorbMismatchedOwnerTypeBalances($customerId, $ownerType);
$wallets = Wallet::query()
->where('owner', $customerId)