Merge pull request 'FIX(wallet): hot fix' (#7) from FIX/gte-in-withdraw into master

Reviewed-on: https://git.mindplus-dev.ir/sahama/wallet/pulls/7
This commit is contained in:
ghasemi 2026-02-09 05:31:42 -05:00
commit 8acf7bc6c1

View file

@ -234,7 +234,7 @@ class Transaction(BaseModel):
raise UnprocessableEntity('not enough balance')
if not payer_is_allowed_negative_balance:
updated = Account.objects.filter(pk=self.payer_account.pk, balance__gt=self.amount).update(balance=F('balance') - self.amount)
updated = Account.objects.filter(pk=self.payer_account.pk, balance__gte=self.amount).update(balance=F('balance') - self.amount)
else:
updated = Account.objects.filter(pk=self.payer_account.pk).update(balance=F('balance') - self.amount)