mirror of
https://github.com/we-promise/sure.git
synced 2026-04-20 12:34:12 +00:00
Enhance security information retrieval and handling (#1826)
* Enhance security information retrieval and handling - Add support for operating MIC codes in security info fetching - Update security uniqueness validation to handle unknown securities - Improve security creation and update logic in Plaid investment sync - Update combobox and view components to handle operating MIC codes - Add unknown flag for securities with incomplete information * Update schema.rb * Refactor the need for mic codes * Don't fetch prices unless a security has the necessary mic code * Deduplication * Lint * Update Securities and Plaid Investment Sync - Modify PlaidInvestmentSync to return plaid_security for USD cash - Add non-null constraint to Securities ticker column - Update Securities fixture to use exchange_operating_mic instead of exchange_mic --------- Signed-off-by: Josh Pigford <josh@joshpigford.com>
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
class AddExchangeOperatingMicToSecurities < ActiveRecord::Migration[7.2]
|
||||
def change
|
||||
add_column :securities, :exchange_operating_mic, :string
|
||||
add_index :securities, :exchange_operating_mic
|
||||
end
|
||||
end
|
||||
6
db/migrate/20250207194638_adjust_securities_indexes.rb
Normal file
6
db/migrate/20250207194638_adjust_securities_indexes.rb
Normal file
@@ -0,0 +1,6 @@
|
||||
class AdjustSecuritiesIndexes < ActiveRecord::Migration[7.2]
|
||||
def change
|
||||
remove_index :securities, name: "index_securities_on_ticker_and_exchange_mic"
|
||||
add_index :securities, [ :ticker, :exchange_operating_mic ], unique: true
|
||||
end
|
||||
end
|
||||
5
db/migrate/20250211161238_make_ticker_not_null.rb
Normal file
5
db/migrate/20250211161238_make_ticker_not_null.rb
Normal file
@@ -0,0 +1,5 @@
|
||||
class MakeTickerNotNull < ActiveRecord::Migration[7.2]
|
||||
def change
|
||||
change_column_null :securities, :ticker, false
|
||||
end
|
||||
end
|
||||
8
db/schema.rb
generated
8
db/schema.rb
generated
@@ -10,7 +10,7 @@
|
||||
#
|
||||
# It's strongly recommended that you check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema[7.2].define(version: 2025_02_07_014022) do
|
||||
ActiveRecord::Schema[7.2].define(version: 2025_02_11_161238) do
|
||||
# These are extensions that must be enabled in order to support this database
|
||||
enable_extension "pgcrypto"
|
||||
enable_extension "plpgsql"
|
||||
@@ -542,7 +542,7 @@ ActiveRecord::Schema[7.2].define(version: 2025_02_07_014022) do
|
||||
end
|
||||
|
||||
create_table "securities", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t|
|
||||
t.string "ticker"
|
||||
t.string "ticker", null: false
|
||||
t.string "name"
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
@@ -550,8 +550,10 @@ ActiveRecord::Schema[7.2].define(version: 2025_02_07_014022) do
|
||||
t.string "exchange_mic"
|
||||
t.string "exchange_acronym"
|
||||
t.string "logo_url"
|
||||
t.string "exchange_operating_mic"
|
||||
t.index ["country_code"], name: "index_securities_on_country_code"
|
||||
t.index ["ticker", "exchange_mic"], name: "index_securities_on_ticker_and_exchange_mic", unique: true
|
||||
t.index ["exchange_operating_mic"], name: "index_securities_on_exchange_operating_mic"
|
||||
t.index ["ticker", "exchange_operating_mic"], name: "index_securities_on_ticker_and_exchange_operating_mic", unique: true
|
||||
end
|
||||
|
||||
create_table "security_prices", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t|
|
||||
|
||||
Reference in New Issue
Block a user