You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Expensify/Expensify#655829 (load government reference rates)
Problem
Admins have no UI to turn auto-updating government distance rates on or off, and no client action to drive the new API.
Solution
Auto-update toggle: add a Switch to PolicyDistanceRatesSettingsPage.tsx (pattern of the tax-tracking switch) inside an OfflineWithFeedback block tied to policy?.pendingFields?.shouldAutoUpdateGovernmentDistanceRates, with descriptive country copy. Render only when the currency is supported via a new isCurrencySupportedForAutoUpdate helper.
setWorkspaceDistanceAutoUpdate action in DistanceRate.ts: build optimistic Onyx data (toggle value + pending field; on enable, optimistic rate entries with client-generated customUnitRateIDs and an optimisticRateIDs map, plus a distance-unit correction when needed), with success/failure handlers, and call API.write(SET_WORKSPACE_DISTANCE_AUTO_UPDATE, ...). Add the write command + params type.
(Neil's AI agent)
Depends on all of phases 1-8:
Problem
Admins have no UI to turn auto-updating government distance rates on or off, and no client action to drive the new API.
Solution
SwitchtoPolicyDistanceRatesSettingsPage.tsx(pattern of the tax-tracking switch) inside anOfflineWithFeedbackblock tied topolicy?.pendingFields?.shouldAutoUpdateGovernmentDistanceRates, with descriptive country copy. Render only when the currency is supported via a newisCurrencySupportedForAutoUpdatehelper.setWorkspaceDistanceAutoUpdateaction inDistanceRate.ts: build optimistic Onyx data (toggle value + pending field; on enable, optimistic rate entries with client-generatedcustomUnitRateIDs and anoptimisticRateIDsmap, plus a distance-unit correction when needed), with success/failure handlers, and callAPI.write(SET_WORKSPACE_DISTANCE_AUTO_UPDATE, ...). Add the write command + params type.Repo: App (frontend).
Full details
Issue Owner
Current Issue Owner: @thelullabyy