alphagov / trade-tariff-backend

Enabling the population and distribution via API of UK Customs tariffs and duties
MIT License
7 stars 6 forks source link

Fix TariffSynchronizer's ChiefUpdate fetching for new year. #56

Closed saulius closed 11 years ago

saulius commented 11 years ago

While working on 2nd and 3rd national measurement units I noticed that we dont' have any CHIEF updates for this year. It appears that CHIEF file update names are formed with leading zeroes. So update for 1st of 2013 is KBT009(13001).txt. This change fixes the issue by removing all missing CHIEF updates for this year so that they could be downloaded and applied again (all of the days actually had update files).

While applying those updates I encountered an issue with TAME deletion, so I applied same fix as for MFCM deletion (see https://github.com/alphagov/trade-tariff-backend/blob/master/lib/chief_transformer/operations/mfcm_delete.rb), so that national measures would still comply to conformance validations.

We need to run:

bundle exec rake tariff:sync:apply

after the update gets deployed.

Lately there have been updates to backend that impact frontend, so frontend needs deployment too.

saulius commented 11 years ago