stats4sd / aec_portfolio

A proof of concept for the AEC Consortium Project Management / Assessment System
GNU General Public License v3.0
0 stars 0 forks source link

[BUG] Exchange rate not found when creating initiative #107

Closed dan-tang-ssd closed 1 year ago

dan-tang-ssd commented 1 year ago

Describe the bug Exchange rate not found when creating initiative

To Reproduce Create initiative > Fill in project start date > Enter currency and budget > Click "Get Exchange Rate" button

Expected behavior Exchange rate will be showed

Screenshots image

dan-tang-ssd commented 1 year ago

This one is fixed.

Root cause: New program deployed to live env on 2023-07-03, but currencies and exchange rates database records not existed in live database.

Solution: Import currencies and exchange rates records to live database.

Please note that now we have exchange rates records from 2023-01-01 to 2023-06-29. I am going to retrieve more historical exchange rates records in local env first. I will add them to live env after checking.

Screen shot: image

dan-tang-ssd commented 1 year ago

Additional details:

@dave-mills , I have also updated .env file for adding free currency API key.

I tried to retrieve exchange rates records for year 2023 from free currency API on live env before. But there are only 825 records retrieved for each day. Suppose there are 1089 records (33 * 33 = 1089) per day.

To pay safe, I executed exchange rate seeder file in local env, then export exchange rates table to mysqldump file and import it into live db.

I am now getting historical exchange rate data for year 2022 in local env. I will update status by adding new comment in this GitHub issue.

By the way, does the free currency API support to get exchange rates data for a specific date? After getting the initial set of exchange rate data, we will need to run a daily schedule job to get yesterday exchange rate data.

dan-tang-ssd commented 1 year ago

I have successfully finished retrieving exchange rate data for year 2022, 2021, 2020, 2019 in local env. 1089 (33 * 33) records retrieved for each day.

P.S. I have removed the duplicated records for year-01-01.

I exported one year records to mysqldump file, then import it to live env. Now we have exchange rate data from 2019-01-01 to 2023-06-29 in live env.

Not quite sure why there were only 825 records retrieved in live env this morning. Perhaps the job is not fully completed? Or there is something wrong in free currency API. Um... not worth spending time to deep dive, as we only need to retrieve the complete historical data once only.