mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-08-02 20:15:22 +02:00
feat: Add institution details to Plaid items (#1816)
* feat: Add institution details to Plaid items - Fetch and store institution URL, ID, and primary color for Plaid items - Update PlaidItem model to retrieve and save institution metadata - Add new method in Plaid provider to get institution details - Update account logo view to use institution domain for logo generation * Add institution domain method to Account model - Extract institution domain logic from view to Account model - Simplify logo view by using new institution_domain method - Improve code reusability and separation of concerns
This commit is contained in:
parent
df5f4c83fe
commit
7ba9063e04
7 changed files with 46 additions and 6 deletions
|
@ -32,6 +32,11 @@ class Account < ApplicationRecord
|
|||
|
||||
accepts_nested_attributes_for :accountable, update_only: true
|
||||
|
||||
def institution_domain
|
||||
return nil unless plaid_account&.plaid_item&.institution_url.present?
|
||||
URI.parse(plaid_account.plaid_item.institution_url).host.gsub(/^www\./, "")
|
||||
end
|
||||
|
||||
class << self
|
||||
def by_group(period: Period.all, currency: Money.default_currency.iso_code)
|
||||
grouped_accounts = { assets: ValueGroup.new("Assets", currency), liabilities: ValueGroup.new("Liabilities", currency) }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue