mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-07-19 05:09:38 +02:00
22 lines
574 B
Ruby
22 lines
574 B
Ruby
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
|
|
plaid_item.schedule_account_syncs(parent_sync: sync)
|
|
end
|
|
|
|
def perform_post_sync
|
|
# no-op
|
|
end
|
|
end
|