Skip to content

Expose per-account number on transactions output#2

Open
ItzikEzra wants to merge 1 commit into
arsolutioner:mainfrom
ItzikEzra:feat/expose-account-number
Open

Expose per-account number on transactions output#2
ItzikEzra wants to merge 1 commit into
arsolutioner:mainfrom
ItzikEzra:feat/expose-account-number

Conversation

@ItzikEzra
Copy link
Copy Markdown

@ItzikEzra ItzikEzra commented Apr 21, 2026

Problem

The RiseUp API returns a field on every transaction that identifies which physical card or account billed it — Transaction.accountNumberPiiValue (typically a masked identifier — last 4 digits of a card, or an obfuscated account number). The field is already defined in src/client/types.ts, but the CLI never surfaces it in any command output.

The result: riseup transactions currently tells you that the transaction went through "isracard", but not which Isracard. For households with several cards under the same issuer (common for spouses on the same Isracard umbrella, or a single bank with multiple debit cards), this makes it impossible to answer questions like "how much did I spend vs how much did my partner spend?" from the CLI alone.

The data is one field away from being useful.

Fix

Adds an accountNumber field to the output of commands that list individual transactions:

  • riseup transactions --json — new optional key, emitted only when tx.accountNumberPiiValue is present
  • riseup transactions — new "Account" column in the table
  • riseup unclassified --json — same optional key

Aggregate commands (spending, trends, income) are untouched — they already group or total, so per-transaction account numbers don't apply there.

Backwards compatibility

The JSON change is additive and guarded:

...(tx.accountNumberPiiValue ? { accountNumber: tx.accountNumberPiiValue } : {}),

Consumers that parse the JSON without this key keep working. The table gains a column, which is a breaking change for anyone grepping table rows positionally — this seems unlikely but worth flagging.

Why this is the right shape

  • The field already exists on the type.
  • The semantic matches what source was meant to do — identify where the money came from — but at a finer grain.
  • No new API calls, no new types, no new dependencies.

The RiseUp API returns `Transaction.accountNumberPiiValue` (typed but
unused in the CLI) — the last 4 digits of the card or the account
identifier that billed the transaction.

Without this, the CLI's `source` field only tells you the bank/issuer
("isracard", "leumiBank", etc.), which is ambiguous for a household
where several cards share the same issuer (common for spouses on the
same Isracard umbrella, or a single bank with multiple debit cards).

This adds `accountNumber` to:

- `riseup transactions --json` output (when the field is present)
- `riseup transactions` table output (new "Account" column)
- `riseup unclassified --json` output (when the field is present)

JSON change is additive and guarded by `tx.accountNumberPiiValue ? ...`,
so consumers that parse the JSON keep working unchanged.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant