2025-04-01 07:21:54 -04:00
|
|
|
module Provider::SecurityConcept
|
2025-03-17 11:54:53 -04:00
|
|
|
extend ActiveSupport::Concern
|
|
|
|
|
2025-05-22 09:45:08 -05:00
|
|
|
Security = Data.define(:symbol, :name, :logo_url, :exchange_operating_mic, :country_code)
|
2025-05-16 14:17:56 -04:00
|
|
|
SecurityInfo = Data.define(:symbol, :name, :links, :logo_url, :description, :kind, :exchange_operating_mic)
|
|
|
|
Price = Data.define(:symbol, :date, :price, :currency, :exchange_operating_mic)
|
2025-04-01 07:21:54 -04:00
|
|
|
|
2025-03-17 11:54:53 -04:00
|
|
|
def search_securities(symbol, country_code: nil, exchange_operating_mic: nil)
|
|
|
|
raise NotImplementedError, "Subclasses must implement #search_securities"
|
|
|
|
end
|
|
|
|
|
2025-05-16 14:17:56 -04:00
|
|
|
def fetch_security_info(symbol:, exchange_operating_mic:)
|
2025-03-17 11:54:53 -04:00
|
|
|
raise NotImplementedError, "Subclasses must implement #fetch_security_info"
|
|
|
|
end
|
|
|
|
|
2025-05-16 14:17:56 -04:00
|
|
|
def fetch_security_price(symbol:, exchange_operating_mic:, date:)
|
2025-03-17 11:54:53 -04:00
|
|
|
raise NotImplementedError, "Subclasses must implement #fetch_security_price"
|
|
|
|
end
|
|
|
|
|
2025-05-16 14:17:56 -04:00
|
|
|
def fetch_security_prices(symbol:, exchange_operating_mic:, start_date:, end_date:)
|
2025-03-17 11:54:53 -04:00
|
|
|
raise NotImplementedError, "Subclasses must implement #fetch_security_prices"
|
|
|
|
end
|
|
|
|
end
|