Skip to content

Commit 3e6b2f7

Browse files
kevintang513claude
andcommitted
fix transaction status logic inversion
Corrected inverted logic in createTransaction where payments were marked as pending and requests as complete. Changed condition from isRequestTransaction to isPayment to properly handle balance transfers and status updates. Fixes: Unit tests transactions.test.ts Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
1 parent afd619e commit 3e6b2f7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

backend/database.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -546,7 +546,7 @@ export const createTransaction = (
546546
const savedTransaction = saveTransaction(transaction);
547547

548548
// if payment, debit sender's balance for payment amount
549-
if (isRequestTransaction(transaction)) {
549+
if (isPayment(transaction)) {
550550
debitPayAppBalance(sender, transaction);
551551
creditPayAppBalance(receiver, transaction);
552552
updateTransactionById(transaction.id, {

0 commit comments

Comments
 (0)