1
0
Fork 0
mirror of https://github.com/maybe-finance/maybe.git synced 2025-08-05 13:35:21 +02:00

Stock imports (#1363)

* Initial pass

* Marketstack data provider

* Marketstack data provider

* Refactor a bit
This commit is contained in:
Josh Pigford 2024-10-24 16:36:50 -05:00 committed by GitHub
parent b611dfdf37
commit aa3342b0dc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 187 additions and 1 deletions

View file

@ -0,0 +1,13 @@
class SecuritiesImportJob < ApplicationJob
queue_as :default
def perform(country_code = nil)
exchanges = StockExchange.in_country(country_code)
market_stack_client = Provider::Marketstack.new(ENV["MARKETSTACK_API_KEY"])
exchanges.each do |exchange|
importer = Security::Importer.new(market_stack_client, exchange.mic)
importer.import
end
end
end