solve bug of numbers

This commit is contained in:
2026-01-07 14:23:36 +03:30
parent 26519969bf
commit 1d6f342ff1
4 changed files with 71 additions and 18 deletions
+11 -11
View File
@@ -148,18 +148,18 @@ const checkNumber = async (_rule: Rule, value: number) => {
if (isBuyP) {
// Skip wallet balance check if gateway is enabled
if (!gatewayP) {
if (!walletCash?.walletInfo?.cash && methodP == 'cash') {
return Promise.reject('موجودی کیف پول ناکافی است')
}
if (!walletCash?.walletInfo?.gold && methodP == 'gold') {
return Promise.reject('موجودی کیف طلا ناکافی است')
}
if (priceP * value > walletCash?.walletInfo?.cash && methodP == 'cash')
return Promise.reject('موجودی کیف پول ناکافی است')
if (amountP * value > walletCash?.walletInfo?.gold && methodP == 'gold')
return Promise.reject('موجودی کیف طلا ناکافی است')
if (!walletCash?.walletInfo?.cash && methodP == 'cash') {
return Promise.reject('موجودی کیف پول ناکافی است')
}
return Promise.resolve()
if (!walletCash?.walletInfo?.gold && methodP == 'gold') {
return Promise.reject('موجودی کیف طلا ناکافی است')
}
if (priceP * value > walletCash?.walletInfo?.cash && methodP == 'cash')
return Promise.reject('موجودی کیف پول ناکافی است')
if (amountP * value > walletCash?.walletInfo?.gold && methodP == 'gold')
return Promise.reject('موجودی کیف طلا ناکافی است')
}
return Promise.resolve()
} else {
if (value > NumP)
return Promise.reject('موجودی محصول ناکافی است')