1
0
Fork 0
mirror of https://github.com/maybe-finance/maybe.git synced 2025-08-02 20:15:22 +02:00

Clarify backend data pipeline naming concepts (importers, processors, materializers, calculators, and syncers) (#2255)
Some checks are pending
Publish Docker image / ci (push) Waiting to run
Publish Docker image / Build docker image (push) Blocked by required conditions

* Rename MarketDataSyncer to MarketDataImporter

* Materializers

* Importers

* More reference replacements
This commit is contained in:
Zach Gollwitzer 2025-05-17 16:37:16 -04:00 committed by GitHub
parent b8903d0980
commit 10f255a9a9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
18 changed files with 165 additions and 163 deletions

View file

@ -1,7 +1,7 @@
require "test_helper"
require "ostruct"
class Account::MarketDataSyncerTest < ActiveSupport::TestCase
class Account::MarketDataImporterTest < ActiveSupport::TestCase
include ProviderTestHelper
PROVIDER_BUFFER = 5.days
@ -32,7 +32,7 @@ class Account::MarketDataSyncerTest < ActiveSupport::TestCase
accountable: Depository.new
)
# Seed a rate for the first required day so that the syncer only needs the next day forward
# Seed a rate for the first required day so that the importer only needs the next day forward
existing_date = account.start_date
ExchangeRate.create!(from_currency: "CAD", to_currency: "USD", date: existing_date, rate: 2.0)
@ -49,7 +49,7 @@ class Account::MarketDataSyncerTest < ActiveSupport::TestCase
]))
before = ExchangeRate.count
Account::MarketDataSyncer.new(account).sync_market_data
Account::MarketDataImporter.new(account).import_all
after = ExchangeRate.count
assert_operator after, :>, before, "Should insert at least one new exchange-rate row"
@ -100,7 +100,7 @@ class Account::MarketDataSyncerTest < ActiveSupport::TestCase
# Ignore exchange-rate calls for this test
@provider.stubs(:fetch_exchange_rates).returns(provider_success_response([]))
Account::MarketDataSyncer.new(account).sync_market_data
Account::MarketDataImporter.new(account).import_all
assert_equal 1, Security::Price.where(security: security, date: trade_date).count
end