mirror of
https://github.com/elisiariocouto/leggen.git
synced 2025-12-29 01:39:22 +00:00
Compare commits
36 Commits
5ef319d0f7
...
2025.9.2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
03e16a9b54 | ||
|
|
53e08e8e4b | ||
|
|
84fe79b37b | ||
|
|
1a6578100a | ||
|
|
3270dc4585 | ||
|
|
8fabaf7b86 | ||
|
|
8006e5e1f6 | ||
|
|
5e0b8eb2a4 | ||
|
|
f2e05484dc | ||
|
|
37949a4e1f | ||
|
|
abf39abe74 | ||
|
|
957099786c | ||
|
|
2191fe9066 | ||
|
|
bc947183e3 | ||
|
|
16afa1ed8a | ||
|
|
541cb262ee | ||
|
|
eaaea6e459 | ||
|
|
34501f5f0d | ||
|
|
dcac53d181 | ||
|
|
cb2e70e42d | ||
|
|
417b77539f | ||
|
|
947342e196 | ||
|
|
c5fd26cb3e | ||
|
|
6c8b8ed3cc | ||
|
|
abacfd78c8 | ||
|
|
26487cff89 | ||
|
|
46f3f5c498 | ||
|
|
6bce7eb6be | ||
|
|
155c30559f | ||
|
|
ec8ef8346a | ||
|
|
de3da84dff | ||
|
|
47164e8546 | ||
|
|
34e793c75c | ||
|
|
4018b263f2 | ||
|
|
f0fee4fd82 | ||
|
|
91f53b35b1 |
8
.github/workflows/release.yml
vendored
8
.github/workflows/release.yml
vendored
@@ -62,10 +62,12 @@ jobs:
|
|||||||
registry: ghcr.io
|
registry: ghcr.io
|
||||||
username: ${{ github.repository_owner }}
|
username: ${{ github.repository_owner }}
|
||||||
password: ${{ secrets.GITHUB_TOKEN }}
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
- name: Docker meta backend
|
- name: Docker meta backend
|
||||||
id: meta-backend
|
id: meta-backend
|
||||||
uses: docker/metadata-action@v5
|
uses: docker/metadata-action@v5
|
||||||
with:
|
with:
|
||||||
|
flavor: |
|
||||||
|
latest=false
|
||||||
# list of Docker images to use as base name for tags
|
# list of Docker images to use as base name for tags
|
||||||
images: |
|
images: |
|
||||||
elisiariocouto/leggen
|
elisiariocouto/leggen
|
||||||
@@ -106,10 +108,12 @@ jobs:
|
|||||||
registry: ghcr.io
|
registry: ghcr.io
|
||||||
username: ${{ github.repository_owner }}
|
username: ${{ github.repository_owner }}
|
||||||
password: ${{ secrets.GITHUB_TOKEN }}
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
- name: Docker meta frontend
|
- name: Docker meta frontend
|
||||||
id: meta-frontend
|
id: meta-frontend
|
||||||
uses: docker/metadata-action@v5
|
uses: docker/metadata-action@v5
|
||||||
with:
|
with:
|
||||||
|
flavor: |
|
||||||
|
latest=false
|
||||||
# list of Docker images to use as base name for tags
|
# list of Docker images to use as base name for tags
|
||||||
images: |
|
images: |
|
||||||
elisiariocouto/leggen
|
elisiariocouto/leggen
|
||||||
|
|||||||
@@ -38,4 +38,5 @@
|
|||||||
### General
|
### General
|
||||||
- **Formatting**: ruff for Python, ESLint for TypeScript
|
- **Formatting**: ruff for Python, ESLint for TypeScript
|
||||||
- **Commits**: Use conventional commits, run pre-commit hooks before pushing
|
- **Commits**: Use conventional commits, run pre-commit hooks before pushing
|
||||||
|
- Avoid including specific numbers, counts, or data-dependent information that may become outdated
|
||||||
- **Security**: Never log sensitive data, use environment variables for secrets
|
- **Security**: Never log sensitive data, use environment variables for secrets
|
||||||
|
|||||||
150
CHANGELOG.md
150
CHANGELOG.md
@@ -1,4 +1,154 @@
|
|||||||
|
|
||||||
|
## 2025.9.2 (2025/09/10)
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
- **ci:** Prevent duplicate Docker tags in GitHub Actions ([53e08e8e](https://github.com/elisiariocouto/leggen/commit/53e08e8e4b909b4895b5a447cfbce515893d31a5))
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
- **docker:** Add Docker containerization for React frontend ([84fe79b3](https://github.com/elisiariocouto/leggen/commit/84fe79b37b4f154fa0758f8d037cdba0d166dd3b))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## 2025.9.2 (2025/09/10)
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
- **ci:** Prevent duplicate Docker tags in GitHub Actions ([53e08e8e](https://github.com/elisiariocouto/leggen/commit/53e08e8e4b909b4895b5a447cfbce515893d31a5))
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
- **docker:** Add Docker containerization for React frontend ([84fe79b3](https://github.com/elisiariocouto/leggen/commit/84fe79b37b4f154fa0758f8d037cdba0d166dd3b))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## 2025.9.1 (2025/09/09)
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
- Handle duplicate transactionId values in migration ([8fabaf7b](https://github.com/elisiariocouto/leggen/commit/8fabaf7b86fde921c61266568ecb0403d3102671))
|
||||||
|
|
||||||
|
|
||||||
|
### Miscellaneous Tasks
|
||||||
|
|
||||||
|
- Improve AGENTS.md. ([3270dc45](https://github.com/elisiariocouto/leggen/commit/3270dc4585e6b33d55aef0deecd849753d36fa74))
|
||||||
|
|
||||||
|
|
||||||
|
### Refactor
|
||||||
|
|
||||||
|
- Remove unused hide_missing_ids functionality ([8006e5e1](https://github.com/elisiariocouto/leggen/commit/8006e5e1f6373aae39d3c38068d694e142bc85a5))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## 2025.9.1 (2025/09/09)
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
- Handle duplicate transactionId values in migration ([8fabaf7b](https://github.com/elisiariocouto/leggen/commit/8fabaf7b86fde921c61266568ecb0403d3102671))
|
||||||
|
|
||||||
|
|
||||||
|
### Miscellaneous Tasks
|
||||||
|
|
||||||
|
- Improve AGENTS.md. ([3270dc45](https://github.com/elisiariocouto/leggen/commit/3270dc4585e6b33d55aef0deecd849753d36fa74))
|
||||||
|
|
||||||
|
|
||||||
|
### Refactor
|
||||||
|
|
||||||
|
- Remove unused hide_missing_ids functionality ([8006e5e1](https://github.com/elisiariocouto/leggen/commit/8006e5e1f6373aae39d3c38068d694e142bc85a5))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## 2025.9.0 (2025/09/09)
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
- **cli:** Show transactions without internal ID when using --full. ([46f3f5c4](https://github.com/elisiariocouto/leggen/commit/46f3f5c4984224c3f4b421e1a06dcf44d4f211e0))
|
||||||
|
- Do not install development dependencies. ([73d6bd32](https://github.com/elisiariocouto/leggen/commit/73d6bd32dbc59608ef1472dc65d9e18450f00896))
|
||||||
|
- Implement proper GoCardless authentication and add dev features ([f0fee4fd](https://github.com/elisiariocouto/leggen/commit/f0fee4fd82e1c788614d73fcd0075f5e16976650))
|
||||||
|
- Make internal transcation ID optional. ([6bce7eb6](https://github.com/elisiariocouto/leggen/commit/6bce7eb6be5f9a5286eb27e777fbf83a6b1c5f8d))
|
||||||
|
- Resolve 404 balances endpoint and currency formatting errors ([417b7753](https://github.com/elisiariocouto/leggen/commit/417b77539fc275493d55efb29f92abcea666b210))
|
||||||
|
- Merge account details into balance data to prevent unknown/N/A values ([eaaea6e4](https://github.com/elisiariocouto/leggen/commit/eaaea6e4598e9c81997573e19f4ef1c58ebe320f))
|
||||||
|
- Use account status for balance records instead of hardcoded 'active' ([541cb262](https://github.com/elisiariocouto/leggen/commit/541cb262ee5783eedf2b154c148c28ec89845da5))
|
||||||
|
|
||||||
|
|
||||||
|
### Documentation
|
||||||
|
|
||||||
|
- Update README for new web architecture ([4018b263](https://github.com/elisiariocouto/leggen/commit/4018b263f27c2b59af31428d7a0878280a291c85))
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
- Transform to web architecture with FastAPI backend ([91f53b35](https://github.com/elisiariocouto/leggen/commit/91f53b35b18740869ee9cebfac394db2e12db099))
|
||||||
|
- Add comprehensive test suite with 46 passing tests ([34e793c7](https://github.com/elisiariocouto/leggen/commit/34e793c75c8df1e57ea240b92ccf0843a80c2a14))
|
||||||
|
- Add mypy to pre-commit. ([ec8ef834](https://github.com/elisiariocouto/leggen/commit/ec8ef8346add878f3ff4e8ed928b952d9b5dd584))
|
||||||
|
- Implement database-first architecture to minimize GoCardless API calls ([155c3055](https://github.com/elisiariocouto/leggen/commit/155c30559f4cacd76ef01e50ec29ee436d3f9d56))
|
||||||
|
- Implement dynamic API connection status ([cb2e70e4](https://github.com/elisiariocouto/leggen/commit/cb2e70e42d1122e9c2e5420b095aeb1e55454c24))
|
||||||
|
- Add automatic balance timestamp migration mechanism ([34501f5f](https://github.com/elisiariocouto/leggen/commit/34501f5f0d3b3dff68364b60be77bfb99071b269))
|
||||||
|
- Improve notification filters configuration format ([2191fe90](https://github.com/elisiariocouto/leggen/commit/2191fe906659f4fd22c25b6cb9fbb95c03472f00))
|
||||||
|
- Add notifications view and update branding ([abf39abe](https://github.com/elisiariocouto/leggen/commit/abf39abe74b75d8cb980109fbcbdd940066cc90b))
|
||||||
|
- Make API URL configurable and improve code quality ([37949a4e](https://github.com/elisiariocouto/leggen/commit/37949a4e1f25a2656f6abef75ba942f7b205c130))
|
||||||
|
- Change versioning scheme to calver. ([f2e05484](https://github.com/elisiariocouto/leggen/commit/f2e05484dc688409b6db6bd16858b066d3a16976))
|
||||||
|
|
||||||
|
|
||||||
|
### Miscellaneous Tasks
|
||||||
|
|
||||||
|
- Implement code review suggestions and format code. ([de3da84d](https://github.com/elisiariocouto/leggen/commit/de3da84dffd83e0b232cf76836935a66eb704aee))
|
||||||
|
|
||||||
|
|
||||||
|
### Refactor
|
||||||
|
|
||||||
|
- Remove MongoDB support, simplify to SQLite-only architecture ([47164e85](https://github.com/elisiariocouto/leggen/commit/47164e854600dfcac482449769b1d2e55c842570))
|
||||||
|
- Remove unused amount_threshold and keywords from notification filters ([95709978](https://github.com/elisiariocouto/leggen/commit/957099786cb0e48c9ffbda11b3172ec9fae9ac37))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## 2025.9.0 (2025/09/09)
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
- **cli:** Show transactions without internal ID when using --full. ([46f3f5c4](https://github.com/elisiariocouto/leggen/commit/46f3f5c4984224c3f4b421e1a06dcf44d4f211e0))
|
||||||
|
- Do not install development dependencies. ([73d6bd32](https://github.com/elisiariocouto/leggen/commit/73d6bd32dbc59608ef1472dc65d9e18450f00896))
|
||||||
|
- Implement proper GoCardless authentication and add dev features ([f0fee4fd](https://github.com/elisiariocouto/leggen/commit/f0fee4fd82e1c788614d73fcd0075f5e16976650))
|
||||||
|
- Make internal transcation ID optional. ([6bce7eb6](https://github.com/elisiariocouto/leggen/commit/6bce7eb6be5f9a5286eb27e777fbf83a6b1c5f8d))
|
||||||
|
- Resolve 404 balances endpoint and currency formatting errors ([417b7753](https://github.com/elisiariocouto/leggen/commit/417b77539fc275493d55efb29f92abcea666b210))
|
||||||
|
- Merge account details into balance data to prevent unknown/N/A values ([eaaea6e4](https://github.com/elisiariocouto/leggen/commit/eaaea6e4598e9c81997573e19f4ef1c58ebe320f))
|
||||||
|
- Use account status for balance records instead of hardcoded 'active' ([541cb262](https://github.com/elisiariocouto/leggen/commit/541cb262ee5783eedf2b154c148c28ec89845da5))
|
||||||
|
|
||||||
|
|
||||||
|
### Documentation
|
||||||
|
|
||||||
|
- Update README for new web architecture ([4018b263](https://github.com/elisiariocouto/leggen/commit/4018b263f27c2b59af31428d7a0878280a291c85))
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
- Transform to web architecture with FastAPI backend ([91f53b35](https://github.com/elisiariocouto/leggen/commit/91f53b35b18740869ee9cebfac394db2e12db099))
|
||||||
|
- Add comprehensive test suite with 46 passing tests ([34e793c7](https://github.com/elisiariocouto/leggen/commit/34e793c75c8df1e57ea240b92ccf0843a80c2a14))
|
||||||
|
- Add mypy to pre-commit. ([ec8ef834](https://github.com/elisiariocouto/leggen/commit/ec8ef8346add878f3ff4e8ed928b952d9b5dd584))
|
||||||
|
- Implement database-first architecture to minimize GoCardless API calls ([155c3055](https://github.com/elisiariocouto/leggen/commit/155c30559f4cacd76ef01e50ec29ee436d3f9d56))
|
||||||
|
- Implement dynamic API connection status ([cb2e70e4](https://github.com/elisiariocouto/leggen/commit/cb2e70e42d1122e9c2e5420b095aeb1e55454c24))
|
||||||
|
- Add automatic balance timestamp migration mechanism ([34501f5f](https://github.com/elisiariocouto/leggen/commit/34501f5f0d3b3dff68364b60be77bfb99071b269))
|
||||||
|
- Improve notification filters configuration format ([2191fe90](https://github.com/elisiariocouto/leggen/commit/2191fe906659f4fd22c25b6cb9fbb95c03472f00))
|
||||||
|
- Add notifications view and update branding ([abf39abe](https://github.com/elisiariocouto/leggen/commit/abf39abe74b75d8cb980109fbcbdd940066cc90b))
|
||||||
|
- Make API URL configurable and improve code quality ([37949a4e](https://github.com/elisiariocouto/leggen/commit/37949a4e1f25a2656f6abef75ba942f7b205c130))
|
||||||
|
- Change versioning scheme to calver. ([f2e05484](https://github.com/elisiariocouto/leggen/commit/f2e05484dc688409b6db6bd16858b066d3a16976))
|
||||||
|
|
||||||
|
|
||||||
|
### Miscellaneous Tasks
|
||||||
|
|
||||||
|
- Implement code review suggestions and format code. ([de3da84d](https://github.com/elisiariocouto/leggen/commit/de3da84dffd83e0b232cf76836935a66eb704aee))
|
||||||
|
|
||||||
|
|
||||||
|
### Refactor
|
||||||
|
|
||||||
|
- Remove MongoDB support, simplify to SQLite-only architecture ([47164e85](https://github.com/elisiariocouto/leggen/commit/47164e854600dfcac482449769b1d2e55c842570))
|
||||||
|
- Remove unused amount_threshold and keywords from notification filters ([95709978](https://github.com/elisiariocouto/leggen/commit/957099786cb0e48c9ffbda11b3172ec9fae9ac37))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## 0.6.11 (2025/02/23)
|
## 0.6.11 (2025/02/23)
|
||||||
|
|
||||||
### Bug Fixes
|
### Bug Fixes
|
||||||
|
|||||||
52
README.md
52
README.md
@@ -64,8 +64,8 @@ git clone https://github.com/elisiariocouto/leggen.git
|
|||||||
cd leggen
|
cd leggen
|
||||||
|
|
||||||
# Create your configuration
|
# Create your configuration
|
||||||
mkdir -p leggen && cp config.example.toml leggen/config.toml
|
mkdir -p data && cp config.example.toml data/config.toml
|
||||||
# Edit leggen/config.toml with your GoCardless credentials
|
# Edit data/config.toml with your GoCardless credentials
|
||||||
|
|
||||||
# Start all services (frontend + backend)
|
# Start all services (frontend + backend)
|
||||||
docker compose up -d
|
docker compose up -d
|
||||||
@@ -74,6 +74,31 @@ docker compose up -d
|
|||||||
# API is available at http://localhost:8000
|
# API is available at http://localhost:8000
|
||||||
```
|
```
|
||||||
|
|
||||||
|
#### Production Deployment
|
||||||
|
|
||||||
|
For production deployment using published Docker images:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Clone the repository
|
||||||
|
git clone https://github.com/elisiariocouto/leggen.git
|
||||||
|
cd leggen
|
||||||
|
|
||||||
|
# Create your configuration
|
||||||
|
mkdir -p data && cp config.example.toml data/config.toml
|
||||||
|
# Edit data/config.toml with your GoCardless credentials
|
||||||
|
|
||||||
|
# Start production services
|
||||||
|
docker compose up -d
|
||||||
|
|
||||||
|
# Access the web interface at http://localhost:3000
|
||||||
|
# API is available at http://localhost:8000
|
||||||
|
```
|
||||||
|
|
||||||
|
### Development vs Production
|
||||||
|
|
||||||
|
- **Development**: Use `docker compose -f compose.dev.yml up -d` (builds from source)
|
||||||
|
- **Production**: Use `docker compose up -d` (uses published images)
|
||||||
|
|
||||||
#### Option 2: Local Development
|
#### Option 2: Local Development
|
||||||
For development or local installation:
|
For development or local installation:
|
||||||
|
|
||||||
@@ -90,7 +115,7 @@ uv run leggen --help
|
|||||||
|
|
||||||
### Configuration
|
### Configuration
|
||||||
|
|
||||||
Create a configuration file at `~/.config/leggen/config.toml`:
|
Create a configuration file at `./data/config.toml` (for Docker) or `~/.config/leggen/config.toml` (for local development):
|
||||||
|
|
||||||
```toml
|
```toml
|
||||||
[gocardless]
|
[gocardless]
|
||||||
@@ -188,8 +213,25 @@ leggen status
|
|||||||
|
|
||||||
### Docker Usage
|
### Docker Usage
|
||||||
|
|
||||||
|
#### Development (build from source)
|
||||||
```bash
|
```bash
|
||||||
# Start all services (frontend + backend)
|
# Start development services
|
||||||
|
docker compose -f compose.dev.yml up -d
|
||||||
|
|
||||||
|
# View service status
|
||||||
|
docker compose -f compose.dev.yml ps
|
||||||
|
|
||||||
|
# Check logs
|
||||||
|
docker compose -f compose.dev.yml logs frontend
|
||||||
|
docker compose -f compose.dev.yml logs leggend
|
||||||
|
|
||||||
|
# Stop development services
|
||||||
|
docker compose -f compose.dev.yml down
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Production (use published images)
|
||||||
|
```bash
|
||||||
|
# Start production services
|
||||||
docker compose up -d
|
docker compose up -d
|
||||||
|
|
||||||
# View service status
|
# View service status
|
||||||
@@ -202,7 +244,7 @@ docker compose logs leggend
|
|||||||
# Access the web interface at http://localhost:3000
|
# Access the web interface at http://localhost:3000
|
||||||
# API documentation at http://localhost:8000/docs
|
# API documentation at http://localhost:8000/docs
|
||||||
|
|
||||||
# Stop all services
|
# Stop production services
|
||||||
docker compose down
|
docker compose down
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
25
compose.dev.yml
Normal file
25
compose.dev.yml
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
services:
|
||||||
|
# React frontend service
|
||||||
|
frontend:
|
||||||
|
build:
|
||||||
|
context: ./frontend
|
||||||
|
dockerfile: Dockerfile
|
||||||
|
restart: "unless-stopped"
|
||||||
|
ports:
|
||||||
|
- "127.0.0.1:3000:80"
|
||||||
|
environment:
|
||||||
|
- API_BACKEND_URL=${API_BACKEND_URL:-http://leggend:8000}
|
||||||
|
depends_on:
|
||||||
|
leggend:
|
||||||
|
condition: service_healthy
|
||||||
|
|
||||||
|
# FastAPI backend service
|
||||||
|
leggend:
|
||||||
|
build:
|
||||||
|
context: .
|
||||||
|
dockerfile: Dockerfile
|
||||||
|
restart: "unless-stopped"
|
||||||
|
ports:
|
||||||
|
- "127.0.0.1:8000:8000"
|
||||||
|
volumes:
|
||||||
|
- "./data:/root/.config/leggen"
|
||||||
12
compose.yml
12
compose.yml
@@ -1,25 +1,19 @@
|
|||||||
services:
|
services:
|
||||||
# React frontend service
|
# React frontend service
|
||||||
frontend:
|
frontend:
|
||||||
build:
|
image: ghcr.io/elisiariocouto/leggen:latest-frontend
|
||||||
context: ./frontend
|
|
||||||
dockerfile: Dockerfile
|
|
||||||
restart: "unless-stopped"
|
restart: "unless-stopped"
|
||||||
ports:
|
ports:
|
||||||
- "127.0.0.1:3000:80"
|
- "127.0.0.1:3000:80"
|
||||||
environment:
|
|
||||||
- API_BACKEND_URL=${API_BACKEND_URL:-http://leggend:8000}
|
|
||||||
depends_on:
|
depends_on:
|
||||||
leggend:
|
leggend:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
|
|
||||||
# FastAPI backend service
|
# FastAPI backend service
|
||||||
leggend:
|
leggend:
|
||||||
build:
|
image: ghcr.io/elisiariocouto/leggen:latest
|
||||||
context: .
|
|
||||||
dockerfile: Dockerfile
|
|
||||||
restart: "unless-stopped"
|
restart: "unless-stopped"
|
||||||
ports:
|
ports:
|
||||||
- "127.0.0.1:8000:8000"
|
- "127.0.0.1:8000:8000"
|
||||||
volumes:
|
volumes:
|
||||||
- "./data:/root/.config/leggen"
|
- "./data:/root/.config/leggen" # Configuration and database directory
|
||||||
|
|||||||
30
config.example.toml
Normal file
30
config.example.toml
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
[gocardless]
|
||||||
|
key = "your-api-key"
|
||||||
|
secret = "your-secret-key"
|
||||||
|
url = "https://bankaccountdata.gocardless.com/api/v2"
|
||||||
|
|
||||||
|
[database]
|
||||||
|
sqlite = true
|
||||||
|
|
||||||
|
# Optional: Background sync scheduling
|
||||||
|
[scheduler.sync]
|
||||||
|
enabled = true
|
||||||
|
hour = 3 # 3 AM
|
||||||
|
minute = 0
|
||||||
|
# cron = "0 3 * * *" # Alternative: use cron expression
|
||||||
|
|
||||||
|
# Optional: Discord notifications
|
||||||
|
[notifications.discord]
|
||||||
|
webhook = "https://discord.com/api/webhooks/..."
|
||||||
|
enabled = true
|
||||||
|
|
||||||
|
# Optional: Telegram notifications
|
||||||
|
[notifications.telegram]
|
||||||
|
token = "your-bot-token"
|
||||||
|
chat_id = 12345
|
||||||
|
enabled = true
|
||||||
|
|
||||||
|
# Optional: Transaction filters for notifications
|
||||||
|
[filters]
|
||||||
|
case-insensitive = ["salary", "utility"]
|
||||||
|
case-sensitive = ["SpecificStore"]
|
||||||
@@ -424,6 +424,7 @@ class DatabaseService:
|
|||||||
|
|
||||||
async def _migrate_null_transaction_ids(self):
|
async def _migrate_null_transaction_ids(self):
|
||||||
"""Populate null internalTransactionId fields using transactionId from raw data"""
|
"""Populate null internalTransactionId fields using transactionId from raw data"""
|
||||||
|
import uuid
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
db_path = Path.home() / ".config" / "leggen" / "leggen.db"
|
db_path = Path.home() / ".config" / "leggen" / "leggen.db"
|
||||||
@@ -459,20 +460,38 @@ class DatabaseService:
|
|||||||
# Update in batches
|
# Update in batches
|
||||||
batch_size = 100
|
batch_size = 100
|
||||||
migrated_count = 0
|
migrated_count = 0
|
||||||
|
skipped_duplicates = 0
|
||||||
|
|
||||||
for i in range(0, total_records, batch_size):
|
for i in range(0, total_records, batch_size):
|
||||||
batch = null_records[i : i + batch_size]
|
batch = null_records[i : i + batch_size]
|
||||||
|
|
||||||
for rowid, transaction_id in batch:
|
for rowid, transaction_id in batch:
|
||||||
try:
|
try:
|
||||||
# Update the record with the transactionId from raw data
|
# Check if this transactionId is already used by another record
|
||||||
|
cursor.execute(
|
||||||
|
"SELECT COUNT(*) FROM transactions WHERE internalTransactionId = ?",
|
||||||
|
(str(transaction_id),),
|
||||||
|
)
|
||||||
|
existing_count = cursor.fetchone()[0]
|
||||||
|
|
||||||
|
if existing_count > 0:
|
||||||
|
# Generate a unique ID to avoid constraint violation
|
||||||
|
unique_id = f"{str(transaction_id)}_{uuid.uuid4().hex[:8]}"
|
||||||
|
logger.debug(
|
||||||
|
f"Generated unique ID for duplicate transactionId: {unique_id}"
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
# Use the original transactionId
|
||||||
|
unique_id = str(transaction_id)
|
||||||
|
|
||||||
|
# Update the record
|
||||||
cursor.execute(
|
cursor.execute(
|
||||||
"""
|
"""
|
||||||
UPDATE transactions
|
UPDATE transactions
|
||||||
SET internalTransactionId = ?
|
SET internalTransactionId = ?
|
||||||
WHERE rowid = ?
|
WHERE rowid = ?
|
||||||
""",
|
""",
|
||||||
(str(transaction_id), rowid),
|
(unique_id, rowid),
|
||||||
)
|
)
|
||||||
|
|
||||||
migrated_count += 1
|
migrated_count += 1
|
||||||
@@ -491,6 +510,10 @@ class DatabaseService:
|
|||||||
|
|
||||||
conn.close()
|
conn.close()
|
||||||
logger.info(f"Successfully migrated {migrated_count} transaction records")
|
logger.info(f"Successfully migrated {migrated_count} transaction records")
|
||||||
|
if skipped_duplicates > 0:
|
||||||
|
logger.info(
|
||||||
|
f"Generated unique IDs for {skipped_duplicates} duplicate transactionIds"
|
||||||
|
)
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.error(f"Null transaction IDs migration failed: {e}")
|
logger.error(f"Null transaction IDs migration failed: {e}")
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[project]
|
[project]
|
||||||
name = "leggen"
|
name = "leggen"
|
||||||
version = "0.6.11"
|
version = "2025.9.2"
|
||||||
description = "An Open Banking CLI"
|
description = "An Open Banking CLI"
|
||||||
authors = [{ name = "Elisiário Couto", email = "elisiario@couto.io" }]
|
authors = [{ name = "Elisiário Couto", email = "elisiario@couto.io" }]
|
||||||
requires-python = "~=3.13.0"
|
requires-python = "~=3.13.0"
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
set -ef -o pipefail
|
set -ef -o pipefail
|
||||||
|
|
||||||
@@ -13,23 +13,37 @@ check_command git
|
|||||||
check_command git-cliff
|
check_command git-cliff
|
||||||
check_command uv
|
check_command uv
|
||||||
|
|
||||||
if [ -z "$1" ]; then
|
# Get current date components
|
||||||
echo " > No semver verb specified, run release with <major|minor|patch> parameter."
|
YEAR=$(date +%Y)
|
||||||
exit 1
|
MONTH=$(date +%-m) # %-m removes zero padding
|
||||||
|
|
||||||
|
# Get the latest version for current year and month
|
||||||
|
LATEST_TAG=$(git tag -l "${YEAR}.${MONTH}.*" | sort -V | tail -n 1)
|
||||||
|
|
||||||
|
if [ -z "$LATEST_TAG" ]; then
|
||||||
|
# No version for current year/month exists, start at 0
|
||||||
|
MICRO=0
|
||||||
|
else
|
||||||
|
# Extract micro version and increment
|
||||||
|
MICRO=$(echo "$LATEST_TAG" | cut -d. -f3)
|
||||||
|
MICRO=$((MICRO + 1))
|
||||||
fi
|
fi
|
||||||
|
|
||||||
CURRENT_VERSION=$(uvx poetry version -s)
|
NEXT_VERSION="${YEAR}.${MONTH}.${MICRO}"
|
||||||
|
CURRENT_VERSION=$(uv version --short)
|
||||||
|
|
||||||
echo " > Current version is $CURRENT_VERSION"
|
echo " > Current version is $CURRENT_VERSION"
|
||||||
|
echo " > Setting new version to $NEXT_VERSION"
|
||||||
|
|
||||||
uvx poetry version "$1"
|
# Manually update version in pyproject.toml
|
||||||
NEXT_VERSION=$(uvx poetry version -s)
|
sed -i '' "s/^version = .*/version = \"${NEXT_VERSION}\"/" pyproject.toml
|
||||||
|
|
||||||
echo " > leggen bumped to $NEXT_VERSION"
|
echo " > Version bumped to $NEXT_VERSION"
|
||||||
echo "Updating CHANGELOG.md"
|
echo "Updating CHANGELOG.md"
|
||||||
git-cliff --unreleased --tag "$NEXT_VERSION" --prepend CHANGELOG.md > /dev/null
|
git-cliff --unreleased --tag "$NEXT_VERSION" --prepend CHANGELOG.md > /dev/null
|
||||||
|
|
||||||
echo " > Commiting changes and adding git tag"
|
echo " > Commiting changes and adding git tag"
|
||||||
git add pyproject.toml CHANGELOG.md
|
git add pyproject.toml CHANGELOG.md uv.lock
|
||||||
git commit -m "chore(ci): Bump version to $NEXT_VERSION"
|
git commit -m "chore(ci): Bump version to $NEXT_VERSION"
|
||||||
git tag -a "$NEXT_VERSION" -m "$NEXT_VERSION"
|
git tag -a "$NEXT_VERSION" -m "$NEXT_VERSION"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user