fix bug 4

This commit is contained in:
2026-07-16 17:29:18 +03:30
parent 69538226d2
commit 67762e2a0e
3 changed files with 123 additions and 24 deletions
@@ -507,6 +507,15 @@ class WalletController extends Controller
], 422);
}
$requestValue = (float) $data['wallets'][$key]['value'];
if (Controller::isCountBasedProduct(Controller::productUnitPayload($walletProduct))) {
if (abs($requestValue - round($requestValue)) > 0.000001) {
return response()->json([
'message' => "برای {$walletProduct['title']} فقط تعداد صحیح مجاز است"
], 422);
}
$data['wallets'][$key]['value'] = (int) round($requestValue);
}
$data['wallets'][$key]['wallet_interface'] = new WalletInterface(auth('customer')->id(), auth('customer')->user()->type, null, $effectiveProductId);
}