From c421704b12948112c18ff84376187c30f605d116 Mon Sep 17 00:00:00 2001 From: Itzik Ezra <68964966+ItzikEzra@users.noreply.github.com> Date: Tue, 21 Apr 2026 10:31:44 +0300 Subject: [PATCH] feat: expose per-account number on transactions output MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- src/commands/manage.ts | 1 + src/commands/transactions.ts | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/commands/manage.ts b/src/commands/manage.ts index 2426be9..18a9423 100644 --- a/src/commands/manage.ts +++ b/src/commands/manage.ts @@ -241,6 +241,7 @@ export async function unclassifiedAction( businessName: tx.businessName, category: tx.expense, source: tx.source, + ...(tx.accountNumberPiiValue ? { accountNumber: tx.accountNumberPiiValue } : {}), })), ); return; diff --git a/src/commands/transactions.ts b/src/commands/transactions.ts index 7ba9b5a..0849b7d 100644 --- a/src/commands/transactions.ts +++ b/src/commands/transactions.ts @@ -88,6 +88,7 @@ export async function transactionsAction( businessName: tx.businessName, category: tx.expense, source: tx.source, + ...(tx.accountNumberPiiValue ? { accountNumber: tx.accountNumberPiiValue } : {}), isIncome: tx.isIncome, ...(tx.customerComment ? { comment: tx.customerComment } : {}), })), @@ -97,7 +98,7 @@ export async function transactionsAction( // Table output. const table = createTable({ - head: ["Date", "Amount", "Merchant", "Category", "Source"], + head: ["Date", "Amount", "Merchant", "Category", "Source", "Account"], }); for (const tx of transactions) { @@ -109,6 +110,7 @@ export async function transactionsAction( tx.businessName, tx.expense, tx.source, + tx.accountNumberPiiValue ?? "", ]); }