Add improvements from security providers to FX providers also (#1445)

* FIX prefer provider rate always

- add debugging also

* Move logic from securities over

* FIXes

* Review fixes

* Update provided.rb

---------

Signed-off-by: soky srm <sokysrm@gmail.com>
This commit is contained in:
soky srm
2026-04-13 00:51:23 +02:00
committed by GitHub
parent 342524847a
commit e40811b1ee
12 changed files with 613 additions and 42 deletions

View File

@@ -0,0 +1,16 @@
class CreateExchangeRatePairs < ActiveRecord::Migration[7.2]
def change
create_table :exchange_rate_pairs, id: :uuid, default: -> { "gen_random_uuid()" } do |t|
t.string :from_currency, null: false
t.string :to_currency, null: false
t.date :first_provider_rate_on
t.string :provider_name
t.timestamps
end
add_index :exchange_rate_pairs,
[ :from_currency, :to_currency ],
unique: true,
name: "index_exchange_rate_pairs_on_pair_unique"
end
end

12
db/schema.rb generated
View File

@@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema[7.2].define(version: 2026_04_11_082125) do
ActiveRecord::Schema[7.2].define(version: 2026_04_12_120000) do
# These are extensions that must be enabled in order to support this database
enable_extension "pgcrypto"
enable_extension "plpgsql"
@@ -551,6 +551,16 @@ ActiveRecord::Schema[7.2].define(version: 2026_04_11_082125) do
t.index ["tags"], name: "index_eval_samples_on_tags", using: :gin
end
create_table "exchange_rate_pairs", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t|
t.string "from_currency", null: false
t.string "to_currency", null: false
t.date "first_provider_rate_on"
t.string "provider_name"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["from_currency", "to_currency"], name: "index_exchange_rate_pairs_on_pair_unique", unique: true
end
create_table "exchange_rates", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t|
t.string "from_currency", null: false
t.string "to_currency", null: false