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
+4
View File
@@ -26,6 +26,10 @@ class AssetSummaryService
public function buildForCustomer(int $customerId, int $ownerType, bool $includeInactiveProducts = false): array
{
if ($customerId > 0 && $ownerType > 0) {
$this->walletBalanceService->absorbMismatchedOwnerTypeBalances($customerId, $ownerType);
}
$catalogQuery = Product::query()->with('file');
if (!$includeInactiveProducts) {
$catalogQuery->where('active', 1);