Commit Graph

24 Commits

Author SHA1 Message Date
53be083dc0 feat: Speed up account syncing with enhanced caching
Reduce API calls and improve sync performance by caching complete account data from GoCardless and Firefly III. Display account names for clearer identification in the CLI. Separate account and link storage for better data organization and maintainability.
2025-11-27 23:28:13 +01:00
ef0c483ee7 feat: Add full account representations
Having all details available is useful. For Firefly III some fields like
current balance are left out, because they are not strictly account
metadata, but are a result of the transactions in the account.
2025-11-27 22:59:30 +01:00
334f6ce277 fix: Prevent duplicate account links
Before, for each sync run, accounts were re-linked together. That is
incorrect, they should only be linked once.

Furthermore, the account status for Gocardless was incorrect: it always
defaulted to "linked". That is now fixed: it now defaults to "active".
2025-11-27 22:59:29 +01:00
21ef49ee38 fix: Correctly map transactions without counterparty
Before this change, transactions that did not have a counterparty were
not correctly mapped and could not be insterted into Firefly III. That
is not correct: _all_ transactions must be added to Firefly III.

Furthermore, Firefly III already has logic to deal with this, and rules
that can solve it manually as well.
2025-11-27 22:59:29 +01:00
baac50c36a feat: Add CLI table formatting and remove unused inspection methods
- Enhanced CLI output with table formatting for better readability of account and transaction data
- Added new commands to list accounts and view their sync status
- Added new commands to inspect transaction information and cache status
- Cleaned up internal code by removing unused trait methods and implementations
- Updated documentation with examples of new CLI commands

This improves the user experience with clearer CLI output and new inspection capabilities while maintaining code quality.
2025-11-27 22:59:26 +01:00
b85c366176 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.
2025-11-27 21:59:29 +01:00
c8c07af9a1 feat: refactor CLI to subcommands and add dynamic adapter discovery
Introduce structured subcommand architecture for better CLI organization and extensibility.

Implement dynamic adapter discovery and validation system in core module for pluggable sources and destinations.

Extract client initialization logic into dedicated CLI setup module for cleaner separation of concerns.

Update README documentation to reflect new CLI structure and available commands.

Add comprehensive tests for adapter validation and discovery functionality.

Maintain backward compatibility for existing sync command usage.
2025-11-27 21:59:25 +01:00
3d4ace793d Refine development guidelines for improved code quality
Update the development guide to emphasize best practices including updating specifications during work, mandatory code formatting and linting, README updates for user-visible changes, and cleanup of unused code. This fosters consistent, high-quality contributions that enhance the project's reliability and maintainability.
2025-11-27 21:28:09 +01:00
93c1c8d861 Formatting fixes
The result of `cargo fmt`.
2025-11-27 21:24:52 +01:00
508975a086 Fix clippy warnings 2025-11-27 21:24:51 +01:00
53087fa900 Implement encrypted transaction caching for GoCardless adapter
- Reduces GoCardless API calls by up to 99% through intelligent caching of transaction data
- Secure AES-GCM encryption with PBKDF2 key derivation (200k iterations) for at-rest storage
- Automatic range merging and transaction deduplication to minimize storage and API usage
- Cache-first approach with automatic fetching of uncovered date ranges
- Comprehensive test suite with 30 unit tests covering all cache operations and edge cases
- Thread-safe implementation with in-memory caching and encrypted disk persistence

Cache everything Gocardless sends back
2025-11-27 21:24:30 +01:00
1dd251c379 Add input validation for transaction amounts and currencies
- Validate amounts are non-zero and within reasonable bounds (≤1B)
- Validate currency codes are 3 uppercase ASCII letters
- Apply validation to main and foreign amounts/currencies
- Add comprehensive tests for validation logic
- Maintain graceful error handling for invalid data
2025-11-22 15:04:04 +00:00
edacda0d01 Add JJ version control requirement to AGENTS.md 2025-11-22 15:04:04 +00:00
0b2549ddb4 Handle expired agreements and rewrite README
- Implement robust End User Agreement expiry detection and handling
- Add graceful error recovery for failed accounts
- Rewrite README.md to focus on user benefits
- Add documentation guidelines to AGENTS.md
2025-11-22 15:04:04 +00:00
aeb8e9bdcb Mask details in debug traces. 2025-11-22 15:04:04 +00:00
cd000061b4 Implemented debug logging to debug_logs/ 2025-11-22 15:04:04 +00:00
5eba24cb87 Add specs for debug logging. 2025-11-22 15:04:04 +00:00
45c0788a4b Differentiate between human and LLM debugging 2025-11-22 15:04:04 +00:00
9a5c6d0f68 Implement logic 2025-11-22 15:04:04 +00:00
ab81c729c7 Add high-level planning 2025-11-22 15:04:04 +00:00
7d9d3f4501 Re-add Firefly III and GoCardless specs 2025-11-22 15:03:48 +00:00
dfd1918723 Remove old stuff 2025-11-21 23:00:09 +01:00
80849a9eef Fix bug in official Gocardless API definition
The official Gocardless API definition indicates that transactions are
directly output to an array.

Instead, they are wrapped in a transactions key.

This made the code fail to retrieve transactions, because they could not
be correctly serialized.

This is now fixed in the API definition, and the API code is also
regenerated.

Signed-off-by: Jacob Kiers <code@kiers.eu>
2024-10-04 20:34:27 +02:00
f0b8df90b9 Initial commit
This is definitely not functional yet.

Signed-off-by: Jacob Kiers <code@kiers.eu>
2024-10-04 20:31:39 +02:00