Skip to content

Commit

Permalink
Merge pull request #2105 from trade-tariff/HMRC-577-Fix-VEF-January-2…
Browse files Browse the repository at this point in the history
…025-Exchange-Rate

HMRC-577 Update VEF Currency Exchange Rate Code End Date
  • Loading branch information
HWallenberg authored Feb 7, 2025
2 parents 12a6068 + be0ba9b commit d6a23bb
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 8 deletions.
22 changes: 14 additions & 8 deletions db/migrate/20250120112727_update_currency_vef_to_ved.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,21 @@

Sequel.migration do
change do
Sequel::Model.db.run "INSERT INTO exchange_rate_currencies (currency_code, currency_description, spot_rate_required) VALUES ('VED', 'Bolivar Fuerte', true)"
Sequel::Model.db.run "INSERT INTO exchange_rate_currencies (currency_code, currency_description, spot_rate_required)
SELECT 'VED', 'Bolivar Fuerte', true
WHERE NOT EXISTS (SELECT 1 FROM exchange_rate_currencies WHERE currency_code = 'VED')"

ExchangeRateCountryCurrency.where(currency_code: 'VEF').update(validity_end_date: Date.new(2025, 1, 15))
ExchangeRateCountryCurrency.create(
currency_code: 'VED',
country_code: 'VE',
country_description: 'Venezuela',
currency_description: 'Venezuelan Bolívar',
validity_start_date: Date.new(2025, 1, 22),
)

unless ExchangeRateCountryCurrency.where(currency_code: 'VED').first
ExchangeRateCountryCurrency.create(
currency_code: 'VED',
country_code: 'VE',
country_description: 'Venezuela',
currency_description: 'Venezuelan Bolívar',
validity_start_date: Date.new(2025, 1, 22),
)
end
end
end

8 changes: 8 additions & 0 deletions db/migrate/20250207141527_update_currency_vef_end_date.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# frozen_string_literal: true

Sequel.migration do
change do
ExchangeRateCountryCurrency.where(currency_code: 'VEF').update(validity_end_date: Date.new(2025, 1, 31))
end
end

0 comments on commit d6a23bb

Please sign in to comment.