Skip to content

Commit

Permalink
Merge branch 'fix-txnpair-same-account' into 'master'
Browse files Browse the repository at this point in the history
Don't match txn pair if source & dest are the same

Closes #26

See merge request GeorgeHahn/firefly-plaid-connector!18
  • Loading branch information
GeorgeHahn committed Mar 25, 2021
2 parents 17c96c3 + 3569014 commit 2e1a61a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -348,14 +348,15 @@ public async Task SyncOnce()
((t.CategoryId == "21005000" && txn.CategoryId == "21006000") ||
(t.CategoryId == "21006000" && txn.CategoryId == "21005000") ||
(t.CategoryId == "16001000" && txn.CategoryId == "21009000") ||
(t.CategoryId == "21009000" && txn.CategoryId == "16001000"))
(t.CategoryId == "21009000" && txn.CategoryId == "16001000") ||
(t.AccountId != txn.AccountId))
);

if (others != null && others.Count() > 0)
{
if (others.Count() == 1)
{
// Found exactly one matching txn
// Found exactly one matching txn between two different accounts
Console.WriteLine("Found matching txn pair");
transfer_between_two_plaid_accounts(db, txn, others.First());
continue;
Expand Down

0 comments on commit 2e1a61a

Please sign in to comment.