mirror of
https://github.com/we-promise/sure.git
synced 2026-04-19 03:54:08 +00:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user