Repository navigation
[Payment due @jayeshmangwani] Add country selection for EUR auto-update government rates - #101809
Conversation
|
Hey, I noticed you changed If you want to automatically generate translations for other locales, an Expensify employee will have to:
Alternatively, if you are an external contributor, you can run the translation script locally with your own OpenAI API key. To learn more, try running: npx bun ./scripts/generateTranslations.ts --helpTypically, you'd want to translate only what you changed by running |
Codecov Report❌ Looks like you've decreased code coverage for some files. Please write tests to increase, or at least maintain, the existing level of code coverage. See our documentation here for how to interpret this table.
|
9fd6767 to
f54dcc5
Compare
12406a3 to
7fca4f0
Compare
|
@jayeshmangwani @neil-marcellini One of you needs to copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
neil-marcellini
left a comment
There was a problem hiding this comment.
Looking quite good, but a few things to fix. Please add some automated tests since those are required. Unit tests for the added and changed actions are probably fine.
Here's one NAB an AI pointed out which we should fix in a follow up:
The optimistic rate copy never adds rates when a new country is picked.
The server only returns rates for the stored country, and only when the page opens.
So the rates loaded on the client are either empty (no country yet) or the old country's.
The filter correctly prevents copying the wrong country's rates. But offline, the toggle turns on and no rates appear until the device reconnects.
|
🚧 JmillsExpensify has triggered a test Expensify/App build. You can view the workflow run here. |
|
Kicked off an adhoc, though I still need to wait for the Web PRs to hit staging, right? |
This comment has been minimized.
This comment has been minimized.
|
After dismissing the above error, I did see the country selector, but then I got the same error upon saving an EU country. |
|
Trying on another policy I get the same error. |
|
Let me know if I should wait for more Web/Auth PRs |
|
@JmillsExpensify Auth is not deployed yet. After that, Web-E can be merged and deployed and then we'll be able to test this on adhoc builds. |
|
Cool, figured. Thanks for confirming! |
|
I will review again once C+ approves. |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid.movAndroid: mWeb ChromeMweb-chrome.moviOS: HybridAppiOS.moviOS: mWeb Safarimweb-safari.movMacOS: Chrome / Safariweb.mov |
|
@ShridharGoel PR looks good. Just one confirmation on the behavior that might be a bug here: When we toggle on Is this the expected behavior? no-country-pre.mov |
|
🎯 @jayeshmangwani, thanks for reviewing and testing this PR! 🎉 A payment issue will be created for your review once this PR is deployed to production. If payment is not needed (e.g., regression PR review fix etc), react with 👎 to this comment to prevent the payment issue from being created. |
|
I don't think that is expected. |
|
Holding for a little bit for the backend fixes. |
|
That BE fix is deployed so I'll aim to review again today. |
|
That'd be great. We're currently planning on announcing this update next week, as mileage is one of the highlight messages. |
neil-marcellini
left a comment
There was a problem hiding this comment.
(Neil's AI agent)
A few non-blocking comments inline.
|
Good to go thanks. You can fix the non-blocking comments in the follow-up, but I see you're already working on it, so I'll review again and officially approve. I tweaked one thing in the tests and updated it to this.
|
|
@neil-marcellini It's ready again |
|
Thanks for the urgency Shridhar! |
neil-marcellini
left a comment
There was a problem hiding this comment.
Great work thanks!
|
🚧 neil-marcellini has triggered a test Expensify/App build. You can view the workflow run here. |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
🚀 Deployed to staging by https://github.com/neil-marcellini in version: 9.5.6-0 🚀
|
|
A help site update is needed. I opened Docs updates for E/A#101809 Add EUR country selection to government rate auto-updates. This PR adds EUR support and renames the toggle, so these sentences in Set Distance Rates became wrong:
@ShridharGoel, please review the linked help site PR and confirm it reflects the current behavior. Then mark the linked help site PR |
|
🚀 Deployed to production by https://github.com/puneetlath in version: 9.5.6-6 🚀
Bundle Size Analysis (Sentry): |
|
🤖 Payment issue created: #103661 |

Explanation of Change
EUR is shared by several countries with different mileage rates, so the workspace's currency alone cannot pick a country like it does for USD, CAD, GBP, and AUD. This PR adds a
Countryselection for EUR workspaces to theAuto-update government ratesflow:Countryselection page with the seven supported countries (Austria, Belgium, Finland, Germany, Netherlands, Portugal, Spain) instead of writing anything right away.Countryrow shows under the toggle while auto-update is on for an EUR workspace, and the country can be changed from there. Changing the country copies the new country's rates onto the workspace.Distance rates source countryselection page with the seven supported countries. Picking a country applies the currency change and enables auto-update for that country. Going back without choosing leaves the currency unchanged.Countryrow disappears.Countryrow.Depends on the backend changes in https://github.com/Expensify/Auth/pull/24694 and https://github.com/Expensify/Web-Expensify/pull/56338, which need to merge and deploy first.
Fixed Issues
$ https://github.com/Expensify/Expensify/issues/683060
PROPOSAL:
Tests
Auto-update government ratestoggle is visible with the copy "Automatically create new rates when your country publishes new guidance."Countryselection page opens and lists Austria, Belgium, Finland, Germany, Netherlands, Portugal, and Spain.Germany, and tapSave. Verify you return to settings, the toggle is on, theCountryrow showsGermany, and the toggle copy now reads "when Germany publishes new guidance".2004 Germanyrate for €0.30/km was added, and that the distance unit is kilometers.Countryrow, change the country toSpain, and tapSave. Verify theCountryrow showsSpainand a7/17/23 Spainrate for €0.26/km was added.Countryrow appears and the toggle copy still mentions the United States.Distance rates source countrypage opens with the country list. SelectAustriaand tapSave. Verify the currency changes to EUR and theCountryrow showsAustria.Countryrow disappears.Offline tests
Auto-update government ratestoggle on and select a country.Countryrow show the pending state, and that they settle to the selected values once the network connection returns.QA Steps
Same as tests.
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectionAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari