mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-07-25 08:09:38 +02:00
First pass at security price reference (#1388)
* First pass at security price reference
* Data cleanup
* Synth security fetching does better with a mic_code
* Update test suite
😭
* Update schema.rb
* Update generator.rb
This commit is contained in:
parent
bf695972e4
commit
490f44589e
16 changed files with 155 additions and 88 deletions
|
@ -1,9 +1,19 @@
|
|||
module SecuritiesTestHelper
|
||||
def create_security(ticker, prices:)
|
||||
security = Security.create!(
|
||||
ticker: ticker,
|
||||
exchange_mic: "XNAS"
|
||||
)
|
||||
|
||||
prices.each do |price|
|
||||
Security::Price.create! ticker: ticker, date: price[:date], price: price[:price]
|
||||
Security::Price.create!(
|
||||
security: security,
|
||||
date: price[:date],
|
||||
price: price[:price],
|
||||
currency: "USD"
|
||||
)
|
||||
end
|
||||
|
||||
Security.create! ticker: ticker
|
||||
security
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue