1
0
Fork 0
mirror of https://github.com/maybe-finance/maybe.git synced 2025-07-24 15:49:39 +02:00
Maybe/app/models/plaid_item/syncer.rb

23 lines
574 B
Ruby
Raw Normal View History

class PlaidItem::Syncer
attr_reader :plaid_item
def initialize(plaid_item)
@plaid_item = plaid_item
end
def perform_sync(sync)
# Loads item metadata, accounts, transactions, and other data to our DB
plaid_item.import_latest_plaid_data
# Processes the raw Plaid data and updates internal domain objects
plaid_item.process_accounts
# All data is synced, so we can now run an account sync to calculate historical balances and more
2025-05-26 05:39:14 -04:00
plaid_item.schedule_account_syncs(parent_sync: sync)
end
def perform_post_sync
# no-op
end
end