Repository navigation
Copy UK fuel-band rates with their reclaimable fraction and check it for the lightning bolt #104309
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
MelvinBot
wants to merge
7
commits into
main
Choose a base branch
from
claude-ukFuelBandGovernmentRates
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+447
−93
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
7c90d4d
Copy UK fuel-band rates with their reclaimable fraction and compare i…
MelvinBot edc5108
Simplify the fuel-band rate check
MelvinBot c214308
Merge branch 'main' into claude-ukFuelBandGovernmentRates
MelvinBot 6c73f98
Copy the standard UK rate to tax-tracking workspaces until fuel bands…
MelvinBot d6692eb
Merge remote-tracking branch 'origin/main' into claude-ukFuelBandGove…
MelvinBot 78aa342
Merge remote-tracking branch 'origin/main' into claude-ukFuelBandGove…
MelvinBot 59957bb
Copy government rates optimistically on single-country currency chang…
MelvinBot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1156,29 +1156,19 @@ function clearPolicyRequireMapOrGPSErrors(policyID: string) { | |
| * Turns government rate auto-update on or off for a workspace. The rate copying, unit correction and missing `customUnit` | ||
| * behavior are documented on buildOnyxDataForGovernmentRateAutoUpdate, which provides the Onyx data used here. | ||
| */ | ||
| function setWorkspaceDistanceAutoUpdate( | ||
| policyID: string, | ||
| customUnit: CustomUnit | undefined, | ||
| shouldAutoUpdateGovernmentDistanceRates: boolean, | ||
| governmentMileageRates: GovernmentMileageRate[], | ||
| outputCurrency: string | undefined, | ||
| countryCode?: string, | ||
| previousAutoUpdateEnabled?: boolean, | ||
| previousCountryCode?: string, | ||
| ) { | ||
| function setWorkspaceDistanceAutoUpdate(policy: Policy, shouldAutoUpdateGovernmentDistanceRates: boolean, governmentMileageRates: GovernmentMileageRate[], countryCode?: string) { | ||
| const {optimisticRateIDs, onyxData} = buildOnyxDataForGovernmentRateAutoUpdate( | ||
| policyID, | ||
| customUnit, | ||
| policy, | ||
| shouldAutoUpdateGovernmentDistanceRates, | ||
| governmentMileageRates, | ||
| outputCurrency, | ||
| policy.outputCurrency, | ||
| countryCode, | ||
| previousAutoUpdateEnabled, | ||
| previousCountryCode, | ||
| !!policy.shouldAutoUpdateGovernmentDistanceRates, | ||
| policy.autoUpdateGovernmentRateCountry, | ||
|
Comment on lines
1160
to
+1167
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. NAB: I have the same non-blocking comment now on this function instead of |
||
| ); | ||
|
|
||
| const parameters: SetWorkspaceDistanceAutoUpdateParams = { | ||
| policyID, | ||
| policyID: policy.id, | ||
| shouldAutoUpdateGovernmentDistanceRates, | ||
| ...(Object.keys(optimisticRateIDs).length > 0 ? {optimisticRateIDs: JSON.stringify(optimisticRateIDs)} : {}), | ||
| ...(countryCode ? {countryCode} : {}), | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Neil's AI agent, human reviewed)
I noticed the server and the App disagreed on when a copied rate inherits
enabled. So I updated the issue description (and the backend spec) with a clearer rule. We're aligning the backend (Auth #25931) and the frontend on it.The behavior we want:
enabledfrom the previous rate in its series, in every country. An admin who disables a government rate opts out of it from then on. This part already works.Example for one band:
Today, an admin who edits
GB_PETROL_UP_TO_1400_2026-06-01to their own amount and disables it gets the September band added disabled, even though they never opted out of the government rate.Please also update the builder's doc comment ("matching the server's copy") and the note in the PR description.