Expose per-account number on transactions output#2
Open
ItzikEzra wants to merge 1 commit into
Open
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 insrc/client/types.ts, but the CLI never surfaces it in any command output.The result:
riseup transactionscurrently 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
accountNumberfield to the output of commands that list individual transactions:riseup transactions --json— new optional key, emitted only whentx.accountNumberPiiValueis presentriseup transactions— new "Account" column in the tableriseup unclassified --json— same optional keyAggregate 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:
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
sourcewas meant to do — identify where the money came from — but at a finer grain.