Commit Graph

268 Commits

Author SHA1 Message Date
Elisiário Couto
34e793c75c feat: Add comprehensive test suite with 46 passing tests
- Add pytest configuration in pyproject.toml with markers and async support
- Create shared test fixtures in tests/conftest.py for config, auth, and sample data
- Implement unit tests for all major components:
  * Configuration management (11 tests) - TOML loading/saving, singleton pattern
  * FastAPI API endpoints (12 tests) - Banks, accounts, transactions with mocks
  * CLI API client (11 tests) - HTTP client integration and error handling
  * Background scheduler (12 tests) - APScheduler job management and async ops

- Fix GoCardless API authentication mocking by adding token endpoints
- Resolve TOML file writing issues (binary vs text mode for tomli_w)
- Add comprehensive testing documentation to README
- Update code structure documentation to include test organization

Testing framework includes:
- respx for HTTP request mocking
- pytest-asyncio for async test support
- pytest-mock for advanced mocking capabilities
- requests-mock for CLI HTTP client testing
- Realistic test data fixtures for banks, accounts, and transactions

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-09 19:39:11 +01:00
Elisiário Couto
4018b263f2 docs: Update README for new web architecture
Major README overhaul to reflect the transformation to web-ready architecture:

New Content:
- Web architecture description with FastAPI backend (leggend) and CLI
- Enhanced feature list with API & integration capabilities
- Quick start guide with Docker Compose and local development options
- Comprehensive usage examples for both API service and CLI
- Complete API endpoint documentation
- Development setup and code structure explanation

Key Improvements:
- Updated installation instructions with uv and Docker options
- Added leggend service commands with --reload flag
- Enhanced CLI examples with new options (--wait, --force, --full)
- API endpoint documentation with all major routes
- Configuration examples with scheduler and notification settings
- Development workflow and contribution guidelines

The README now accurately represents the current v0.6.11 capabilities
and provides clear guidance for both users and developers.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-09 19:39:11 +01:00
Elisiário Couto
f0fee4fd82 fix: Implement proper GoCardless authentication and add dev features
Authentication Fixes:
- Implement proper async GoCardless token management in leggend service
- Add automatic token refresh and creation for expired/missing tokens
- Unify auth.json storage path between CLI and API (~/.config/leggen/)
- Fix 401 Unauthorized errors when accessing GoCardless API

Development Enhancements:
- Add --reload flag to leggend for automatic file watching and restart
- Add --host and --port options for flexible service binding
- Include both leggend/ and leggen/ directories in reload watching
- Improve development workflow with hot reloading

Configuration Consistency:
- Standardize config path to ~/.config/leggen/config.toml for both CLI and API
- Ensure auth.json is stored in same location as main config
- Add httpx dependency for async HTTP requests in leggend service

Verified working: leggen status command successfully authenticates
and retrieves bank/account data via leggend API service.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-09 19:39:11 +01:00
Elisiário Couto
91f53b35b1 feat: Transform to web architecture with FastAPI backend
This major update transforms leggen from CLI-only to a web-ready
architecture while maintaining full CLI compatibility.

New Features:
- FastAPI backend service (leggend) with comprehensive REST API
- Background job scheduler with configurable cron (replaces Ofelia)
- All CLI commands refactored to use API endpoints
- Docker configuration updated for new services
- API client with health checks and error handling

API Endpoints:
- /api/v1/banks/* - Bank connections and institutions
- /api/v1/accounts/* - Account management and balances
- /api/v1/transactions/* - Transaction retrieval with filtering
- /api/v1/sync/* - Manual sync and scheduler configuration
- /api/v1/notifications/* - Notification settings management

CLI Enhancements:
- New --api-url option and LEGGEND_API_URL environment variable
- Enhanced sync command with --wait and --force options
- Improved transactions command with --full and --limit options
- Automatic fallback and health checking

Breaking Changes:
- compose.yml structure updated (leggend service added)
- Ofelia scheduler removed (internal scheduler used instead)

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-09 19:39:11 +01:00
Elisiário Couto
73d6bd32db fix: Do not install development dependencies. 2025-09-01 22:46:55 +01:00
Elisiário Couto
6b2c19778b chore(ci): Bump version to 0.6.11 0.6.11 2025-02-23 23:32:21 +00:00
Elisiário Couto
355fa5cfb6 fix: Add workdir to dockerfile last stage. 2025-02-23 23:32:12 +00:00
Elisiário Couto
7cf471402b chore(ci): Bump version to 0.6.10 0.6.10 2025-01-14 01:10:57 +00:00
Elisiário Couto
7480094419 fix(ci): Install uv before publishing. 2025-01-14 01:10:53 +00:00
Elisiário Couto
d69bd5d115 chore(ci): Bump version to 0.6.9 0.6.9 2025-01-14 01:07:42 +00:00
Elisiário Couto
ca29d527c9 chore: Setup PyPI Trusted Publishing. 2025-01-14 01:07:35 +00:00
Elisiário Couto
4ed1bf5abe chore(ci): Bump version to 0.6.8 0.6.8 2025-01-13 21:20:27 +00:00
Elisiário Couto
eb73401896 chore: Fix typo in release script. 2025-01-13 21:20:23 +00:00
Elisiário Couto
33006f8f43 chore: Migrate from Poetry to uv, bump dependencies and python version. 2025-01-13 21:12:04 +00:00
Elisiário Couto
6b2cb8a52f chore(ci): Bump version to 0.6.7 0.6.7 2024-09-15 15:53:20 +01:00
Elisiário Couto
75ca7f177f chore: Bump dependencies. 2024-09-15 15:52:58 +01:00
Elisiário Couto
7efbccfc90 fix(notifications/telegram): Escape characters when notifying via Telegram. 2024-09-15 15:52:17 +01:00
Elisiário Couto
e7662bc3dd chore(ci): Bump version to 0.6.6 0.6.6 2024-08-21 16:00:56 +01:00
Elisiário Couto
59346334db chore: Update dependencies, use ruff to format code. 2024-08-21 16:00:09 +01:00
Elisiário Couto
c70a4e5cb8 fix(commands/status): Handle exception when no last_accessed is returned from GoCardless API. 2024-08-21 15:57:44 +01:00
Elisiário Couto
a29bd1ab68 fix(notifications/telegram): Escape parenthesis. 2024-08-21 15:56:06 +01:00
Elisiário Couto
a8fb3ad931 chore(ci): Bump version to 0.6.5 0.6.5 2024-07-05 10:56:27 +01:00
Elisiário Couto
effabf0695 chore: Bump dependencies. 2024-07-05 10:55:40 +01:00
Elisiário Couto
758a3a2257 fix(sync): Continue on account deactivation. 2024-07-05 10:54:24 +01:00
Elisiário Couto
6f5b5dc679 chore(ci): Bump version to 0.6.4 0.6.4 2024-06-07 20:55:01 +01:00
Elisiário Couto
6c44beda67 fix(sync): Correctly calculate days left. 2024-06-07 20:54:58 +01:00
Elisiário Couto
ebe0a2fe86 chore(ci): Bump version to 0.6.3 0.6.3 2024-06-07 20:46:49 +01:00
Elisiário Couto
3cb38e2e9f feat(sync): Correctly calculate days left, based on the default 90 days period. 2024-06-07 20:46:45 +01:00
Elisiário Couto
ad40b2207a chore(ci): Bump version to 0.6.2 0.6.2 2024-06-07 20:30:54 +01:00
Elisiário Couto
9402c2535b fix(sync): Use timezone-aware datetime objects. 2024-06-07 20:30:50 +01:00
Elisiário Couto
e0351a8771 chore(ci): Bump version to 0.6.1 0.6.1 2024-06-07 20:20:38 +01:00
Elisiário Couto
b60ba068cd fix(sync): Get correct parameter for requisition creation time. 2024-06-07 20:20:31 +01:00
Elisiário Couto
70cfe34476 chore(ci): Bump version to 0.6.0 0.6.0 2024-06-07 20:10:07 +01:00
Elisiário Couto
3b1738bae4 feat(sync): Enable expiration notifications. 2024-06-07 20:09:54 +01:00
Elisiário Couto
332d4d51d0 feat(sync): Save account balances in new table. 2024-06-07 19:48:06 +01:00
Elisiário Couto
7672533e86 chore(deps): Update black, ruff and pre-commit to latest versions. 2024-06-07 18:28:33 +01:00
dependabot[bot]
410e600673 chore(deps): Bump the pip group across 1 directory with 3 updates
Bumps the pip group with 3 updates in the / directory: [requests](https://github.com/psf/requests), [pymongo](https://github.com/mongodb/mongo-python-driver) and [idna](https://github.com/kjd/idna).


Updates `requests` from 2.31.0 to 2.32.2
- [Release notes](https://github.com/psf/requests/releases)
- [Changelog](https://github.com/psf/requests/blob/main/HISTORY.md)
- [Commits](https://github.com/psf/requests/compare/v2.31.0...v2.32.2)

Updates `pymongo` from 4.6.2 to 4.6.3
- [Release notes](https://github.com/mongodb/mongo-python-driver/releases)
- [Changelog](https://github.com/mongodb/mongo-python-driver/blob/master/doc/changelog.rst)
- [Commits](https://github.com/mongodb/mongo-python-driver/compare/4.6.2...4.6.3)

Updates `idna` from 3.6 to 3.7
- [Release notes](https://github.com/kjd/idna/releases)
- [Changelog](https://github.com/kjd/idna/blob/master/HISTORY.rst)
- [Commits](https://github.com/kjd/idna/compare/v3.6...v3.7)

---
updated-dependencies:
- dependency-name: requests
  dependency-type: direct:production
  dependency-group: pip
- dependency-name: pymongo
  dependency-type: direct:production
  dependency-group: pip
- dependency-name: idna
  dependency-type: indirect
  dependency-group: pip
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-07 18:26:42 +01:00
Elisiário Couto
798a8f1880 chore(ci): Bump version to 0.5.0 0.5.0 2024-03-29 16:57:33 +00:00
Elisiário Couto
7401ca62d2 feat(notifications): Add support for Telegram notifications. 2024-03-29 16:56:45 +00:00
Elisiário Couto
e46634cf27 chore: Rename docker-compose.yml to compose.yml and remove obsolete 'version' key. 2024-03-28 16:09:54 +00:00
Elisiário Couto
7b48bc080c chore(ci): Bump version to 0.4.0 0.4.0 2024-03-28 15:58:59 +00:00
Elisiário Couto
0cb339366c feat(notifications): Add support for transaction filter and notifications via Discord. 2024-03-28 15:58:16 +00:00
Elisiário Couto
3d36198b06 chore: Update dependencies. 2024-03-28 15:58:16 +00:00
dependabot[bot]
2352ea9e58 chore(deps-dev): Bump black from 24.2.0 to 24.3.0
Bumps [black](https://github.com/psf/black) from 24.2.0 to 24.3.0.
- [Release notes](https://github.com/psf/black/releases)
- [Changelog](https://github.com/psf/black/blob/main/CHANGES.md)
- [Commits](https://github.com/psf/black/compare/24.2.0...24.3.0)

---
updated-dependencies:
- dependency-name: black
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-27 23:15:37 +00:00
Elisiário Couto
b559376116 chore(ci): Bump version to 0.3.0 0.3.0 2024-03-08 00:08:55 +00:00
Elisiário Couto
cb6682ea2e docs: Improve README.md. 2024-03-08 00:08:45 +00:00
Elisiário Couto
6d2f1b7b2f chore: Update dependencies. 2024-03-08 00:08:33 +00:00
Elisiário Couto
fcb0f1edd7 feat(commands): Add new leggen bank delete command to delete a bank connection. 2024-03-08 00:03:11 +00:00
Elisiário Couto
0c8f68adfd feat(commands/bank/add): Add all supported GoCardless country ISO codes. 2024-03-08 00:00:53 +00:00
Elisiário Couto
7f71589af1 chore(ci): Bump version to 0.2.3 0.2.3 2024-03-06 18:34:49 +00:00