Skip to content

Expose ListTransactions via API#43

Merged
jakewan merged 1 commit into
mainfrom
feature/list-transactions-api
Mar 15, 2026
Merged

Expose ListTransactions via API#43
jakewan merged 1 commit into
mainfrom
feature/list-transactions-api

Conversation

@jakewan

@jakewan jakewan commented Mar 15, 2026

Copy link
Copy Markdown
Owner

Overview

The purpose of this change is to wire core.ListTransactions through the full API stack (proto RPC, daemon handler, MCP tool) so that transactions are directly queryable per account. This is an incremental improvement — a mechanical wiring task that exposes existing domain logic through the established API layers. It unblocks #33 (viewing individual transactions) and enables reconciliation against bank statements, which currently requires going through ProjectBalances indirectly.

Changes

  • Proto: Add ListTransactions RPC with ListTransactionsRequest/ListTransactionsResponse messages, reusing the existing Transaction message
  • Daemon: Add ListTransactions handler with account_id validation, delegating to core.ListTransactions and mapping via existing transactionToProto() helper
  • Daemon tests: Integration test covering happy path (create account, record 2 transactions, list and verify count + field mapping) and validation (empty account_id returns error)
  • MCP: Add list_transactions tool with ListTransactionsInput/ListTransactionsOutput structs and handler factory, mapping via existing protoTxnToInfo()
  • MCP tests: BDD-style tests covering empty list, returns recorded transactions, and maps all output fields

Test plan

  • just proto — regenerates without errors
  • just lint — 0 issues across all modules
  • just test — all tests pass (core, daemon, mcp)
  • Manual: use list_transactions MCP tool against running daemon with seed data

🤖 Generated with Claude Code

Wire core.ListTransactions through the full stack so transactions
are directly queryable per account, unblocking #33 and enabling
reconciliation against bank statements.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR exposes the existing core.DB.ListTransactions functionality through the full API stack by adding a new ListTransactions gRPC RPC (proto), implementing it in the daemon server, and surfacing it as an MCP tool with accompanying tests.

Changes:

  • Add ListTransactions RPC plus request/response messages to the proto contract.
  • Implement ListTransactions in the daemon gRPC server with account_id validation and proto mapping.
  • Add MCP list_transactions tool and expand daemon/MCP test coverage for the new API path.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
proto/finch/v1/finch.proto Adds the ListTransactions RPC and messages to the public API contract.
daemon/finchd/server.go Implements the new gRPC handler and maps core transactions to proto.
daemon/server_test.go Adds an integration test for listing transactions and validating empty account_id.
mcp/tools.go Registers and implements the list_transactions MCP tool calling the new RPC.
mcp/tools_test.go Adds MCP tool tests for empty results, non-empty results, and field mapping.

@jakewan jakewan marked this pull request as ready for review March 15, 2026 19:40
@jakewan jakewan merged commit 22e6f34 into main Mar 15, 2026
7 checks passed
@jakewan jakewan deleted the feature/list-transactions-api branch March 15, 2026 19:59
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.

2 participants