insatller fee

This commit is contained in:
morteza-mortezai
2025-11-26 09:37:16 +03:30
parent 1a98067f1a
commit 7b501107cf
11 changed files with 224 additions and 63 deletions
+6
View File
@@ -18,6 +18,12 @@ module.exports.createRequest = [
res.status(400).json({ msg: 'شما درخواست درحال بررسی دارید' })
} else {
const user = await User.findById(req.user_id)
if (!user) {
return res.status(400).json({ msg: 'کاربر یافت نشد' })
}
if (req.body.amount > user.walletBalance) {
return res.status(400).json({ msg: 'موجودی شما کافی نیست' })
}
if (user.walletBalance >= 50000) {
const data = {
card: req.body.card,