Skip to content

[Due for payment 2026-09-25] Add a shared helper to select a distance rate when the policy changes #100557

Description

@neil-marcellini

(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 OwnerCurrent Issue Owner: @truph01

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

InternalRequires API changes or must be handled by Expensify staffReviewingHas a PR in reviewWeeklyKSv2

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions