(Neil's AI agent)
Part of the frontend tracking issue, which has the full plan and the rate-selection rules.
What
Add DistanceRequestUtils.getRateForPolicyChange({transaction, policy}), the app-side mirror of Auth's rate selection: value + currency + unit match against enabled rates valid for the expense date, then getBestEligibleRateOrPolicyDefault.
The date-range ranking is already implemented in getBestEligibleRate and matches Auth's getBestDistanceCustomUnitRateIDForDate, so this is mostly wiring.
The server is authoritative and the app only mirrors it for optimistic data, so add a comment on both implementations pointing at the other — the same convention getRate already uses.
No callers change in this PR, so it can land any time.
Dependencies
None.
Issue Owner
Current Issue Owner: @truph01
(Neil's AI agent)
Part of the frontend tracking issue, which has the full plan and the rate-selection rules.
What
Add
DistanceRequestUtils.getRateForPolicyChange({transaction, policy}), the app-side mirror of Auth's rate selection: value + currency + unit match against enabled rates valid for the expense date, thengetBestEligibleRateOrPolicyDefault.The date-range ranking is already implemented in
getBestEligibleRateand matches Auth'sgetBestDistanceCustomUnitRateIDForDate, so this is mostly wiring.The server is authoritative and the app only mirrors it for optimistic data, so add a comment on both implementations pointing at the other — the same convention
getRatealready uses.No callers change in this PR, so it can land any time.
Dependencies
None.
Issue Owner
Current Issue Owner: @truph01