Skip to content

Debts page shows the last rate segment's APR, not today's #7

Open

Description

@hazeliscoding

The Debts page shows a debt's APR from the last segment of its rate schedule, not the segment in force today. Apr() in src/Mossmint.Desktop/ViewModels/DebtsPage.cs (line 229) reads rates.Segments[^1].

So a card on a 0% intro APR shows the rate that starts after the promotion, and a loan with a scheduled rate change shows the future rate. The export uses rates.SegmentOn(today) (ProfileExport.cs:73), and so do the payoff and loan engines, so the page and the export can disagree for the same debt. The forecast itself isn't affected.

What to do

  • Pass today from Card() into Apr() and use rates.SegmentOn(today).
  • Decide what the page shows when no segment applies yet (SegmentOn returns null before the first one starts).
  • Cards show Buckets[0]'s rate (line 170); check that's still the bucket to show.
  • Consider showing the next change ("0.00% APR, 24.99% from 2027-03-01") when one is scheduled.

Done when

  • The Debts page and the export show the same APR for the same debt and day
  • A test covers a schedule with a future segment

Activity

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

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions