feat: implement account linking and management system

Add comprehensive account linking functionality to automatically match bank accounts to Firefly III accounts, with manual override options. This includes:

- New LinkStore module for persistent storage of account links with auto-linking based on IBAN matching
- Extended adapter traits with inspection methods (list_accounts, get_account_status, etc.) and discover_accounts for account discovery
- Integration of linking into sync logic to automatically discover and link accounts before syncing transactions
- CLI commands for managing account links (list, create, etc.)
- Updated README with new features and usage examples

This enables users to easily manage account mappings between sources and destinations, reducing manual configuration and improving sync reliability.
This commit is contained in:
2025-11-22 18:29:18 +00:00
parent c8c07af9a1
commit b85c366176
10 changed files with 819 additions and 88 deletions

View File

@@ -11,6 +11,7 @@ A robust command-line tool to synchronize bank transactions between various sour
- **Reliable Operation**: Continues working even when some accounts need attention
- **Safe Preview Mode**: Test changes before applying them to your finances
- **Rate Limit Aware**: Works within API limits to ensure consistent access
- **Flexible Account Linking**: Automatically match bank accounts to Firefly III accounts, with manual override options
## 🚀 Quick Start
@@ -43,6 +44,10 @@ cargo run -p banks2ff -- sync gocardless firefly --start 2023-01-01 --end 2023-0
cargo run -p banks2ff -- sources
cargo run -p banks2ff -- destinations
# Manage account links
cargo run -p banks2ff -- accounts link list
cargo run -p banks2ff -- accounts link create <source_account> <dest_account>
# Additional inspection commands available in future releases
```
@@ -53,8 +58,9 @@ Banks2FF uses a structured command-line interface with the following commands:
- `sync <SOURCE> <DESTINATION>` - Synchronize transactions between source and destination
- `sources` - List all available source types
- `destinations` - List all available destination types
- `accounts link` - Manage account links between sources and destinations
Additional inspection commands (accounts, transactions, status) will be available in future releases.
Additional inspection commands (accounts list/status, transactions, status) will be available in future releases.
Use `cargo run -p banks2ff -- --help` for detailed command information.
@@ -62,7 +68,7 @@ Use `cargo run -p banks2ff -- --help` for detailed command information.
Banks2FF automatically:
1. Connects to your bank accounts via GoCardless
2. Finds matching accounts in your Firefly III instance
2. Discovers and links accounts between GoCardless and Firefly III (with auto-matching and manual options)
3. Downloads new transactions since your last sync
4. Adds them to Firefly III (avoiding duplicates)
5. Handles errors gracefully - keeps working even if some accounts have issues
@@ -81,7 +87,7 @@ The cache requires `BANKS2FF_CACHE_KEY` to be set in your `.env` file for secure
## 🔧 Troubleshooting
- **Unknown source/destination?** Use `sources` and `destinations` commands to see what's available
- **Account not syncing?** Check that the IBAN matches between GoCardless and Firefly III
- **Account not syncing?** Check that the IBAN matches between GoCardless and Firefly III, or use `accounts link` to create manual links
- **Missing transactions?** The tool syncs from the last transaction date forward
- **Rate limited?** The tool automatically handles API limits and retries appropriately