Stock imports #1363
Reference in New Issue
Block a user
Delete Branch "stock-imports"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Sets the foundation for adding Marketstack as a data provider for non-US stocks.
This is primarily focused on populating the Securities table with all global stocks in the hosted version, but lays the groundwork for pulling prices as well as letting self-hosters only import specific exchanges.
Setup looks good to me!
@@ -0,0 +1,13 @@class SecuritiesImportJob < ApplicationJobFrom a user perspective, my guess is that we're wanting to import by country code correct?
If that's the case, would
country_code = nilbe a better param to pass? That way, we could do something like this in the job and make it 1 job per user:And then just a simple scope on
StockExchange:@@ -0,0 +1,119 @@class Provider::MarketstackLooks like we might be able to consolidate into a
fetch_tickers(exchange_mic: nil)method that covers bothfetch_all_tickersandfetch_exchange_tickers?And then over in importer, would reduce to:
@@ -0,0 +1,119 @@class Provider::MarketstackGood catch1
@@ -0,0 +1,13 @@class SecuritiesImportJob < ApplicationJobGood call. Keeps us from having to arbitrarily map mic codes as well.
@zachgoll Any other changes you'd want made before this gets pushed?
Next PR will be actually setting up appropriate importing based on hosted vs self-hosted. So this on its own doesn't actually make any data additions (just db schema).
@Shpigford yeah I think we're all set for this first step here