Skip to content

[CFI][FE 3/7] Payment history: billing state badges on the table #101830

Closed

Description

@melvin-bot

Sub-task of [CFI] Add a "View payment history" page with historical billing receipts and monthly user activity.

Goal

Every row in the payment history table carries a billing state badge.

Badge Colour
Paid Green
Cleared Grey
Failed Red
Balance transfer Grey
Disputed Red
Refunded Grey

Scope

  • Derive the state per row. Paid, Cleared, and Failed come from the bill's own record. Refunded, Disputed, and Balance transfer do not — those are separate purchase records that reference the bill they modify, so the state has to be folded onto the parent row before it can be rendered.
  • Build a shared helper (for example src/libs/PaymentHistoryUtils.ts) that returns a normalised row model: state, amount, tax flag, and the linked refund / dispute / transfer record. The table consumes it here and the details page consumes it in FE 4/7. Cover it with fixture-based unit tests.
  • Do not let the badge state gate the row's actions. Classic shows only "View activity" on Failed rows and only "View receipt" on Cleared rows. Here, activity must be reachable on every row including Failed months, and Cleared rows show both. The buttons themselves arrive in FE 5/7 and FE 6/7 — this issue just must not build in the Classic restriction.

Acceptance criteria

  • One badge per row, in the right colour, for all six states.
  • A fully or partially refunded bill shows Refunded.
  • A disputed bill shows Disputed.
  • A balance transfer in either direction shows Balance transfer.
  • Unit tests cover each state, including a bill with both a dispute and a refund attached.

Depends on

FE 2/7 (the table and the extended Onyx type).

Easy to get wrong

  • Rendering the badge as a pre-formatted string. The same states carry dynamic dates, amounts, and emails on the details page (FE 4/7), so the model must expose the state plus its parameters, not a finished label.
  • Missing the partial-refund case, which is a distinct variant from a full refund.

Activity

  1. self-assigned this
    on Sep 25, 2026
  2. dukenv0307 commented on Oct 1, 2026

    @dukenv0307
    Contributor

    Not overdue

  3. dukenv0307 commented on Oct 5, 2026

    @dukenv0307
    Contributor

    Not overdue

  4. trjExpensify commented on Oct 7, 2026

    @trjExpensify
    Contributor

    #102506 for #101829 took care of this the badges, so I think can close this. Asked here.

  5. dukenv0307 commented on Oct 12, 2026

    @dukenv0307
    Contributor

    Not overdue

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

Metadata

Metadata

Labels

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions