Remove plaid initialiser (#317)

* Remove plaid initialiser

The initializer can be safely removed because:
  - Config is lazily loaded via Provider::Registry
  - reload_configuration is called after settings updates
  - All calling code handles nil configs gracefully
  - Initial nil state is fine - config loads on first use

* Fix for missing config

* Actually don't pollute application.rb

* Add currency loading for balances

* Fix race condition on lazy load

* Allow loans to be imported in lunch flow also

* Fix currency processor
This commit is contained in:
soky srm
2025-11-12 16:01:19 +01:00
committed by GitHub
parent fad241c416
commit e8f935bc6f
14 changed files with 134 additions and 27 deletions

View File

@@ -1,6 +1,7 @@
require "digest/md5"
class LunchflowEntry::Processor
include CurrencyNormalizable
# lunchflow_transaction is the raw hash fetched from Lunchflow API and converted to JSONB
# Transaction structure: { id, accountId, amount, currency, date, merchant, description }
def initialize(lunchflow_transaction, lunchflow_account:)
@@ -122,7 +123,11 @@ class LunchflowEntry::Processor
end
def currency
data[:currency].presence || account&.currency || "USD"
parse_currency(data[:currency]) || account&.currency || "USD"
end
def log_invalid_currency(currency_value)
Rails.logger.warn("Invalid currency code '#{currency_value}' in LunchFlow transaction #{external_id}, falling back to account currency")
end
def date