1
0
Fork 0
mirror of https://github.com/maybe-finance/maybe.git synced 2025-08-05 05:25:24 +02:00

Increase specificity of filter when fetching Plaid liabilities

This commit is contained in:
Zach Gollwitzer 2025-05-24 19:16:55 -04:00
parent 03e0230e99
commit 43a403e431
2 changed files with 6 additions and 2 deletions

View file

@ -92,7 +92,10 @@ class PlaidItem::AccountsSnapshot
def can_fetch_liabilities?
plaid_item.supports_product?("liabilities") &&
accounts.any? { |a| [ "credit", "loan" ].include?(a.type) }
accounts.any? do |a|
a.type == "credit" && a.subtype == "credit card" ||
a.type == "loan" && (a.subtype == "mortgage" || a.subtype == "student")
end
end
def liabilities_data