fix: Resolve all lint warnings and type errors across frontend and backend.

Frontend:
- Memoize pagination object in TransactionsTable to prevent unnecessary re-renders and fix exhaustive-deps warning
- Add optional success and message fields to backup API response types for proper error handling

Backend:
- Add TypedDict for transaction type configuration to improve type safety in generate_sample_db
- Fix unpacking of amount_range with explicit float type hints
- Add explicit type hints for descriptions dictionary and specific_descriptions variable
- Fix sync endpoint return types: get_sync_status returns SyncStatus and sync_now returns SyncResult
- Fix transactions endpoint data type declaration to properly support Union types in PaginatedResponse

All checks now pass:
- Frontend: npm lint and npm build ✓
- Backend: mypy type checking ✓
- Backend: ruff lint on modified files ✓

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

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
Elisiário Couto
2025-12-07 11:27:55 +00:00
committed by Elisiário Couto
parent 966440006a
commit 159cba508e
11 changed files with 66 additions and 58 deletions

View File

@@ -211,10 +211,7 @@ class TestBackupAPI:
assert response.status_code == 200
data = response.json()
assert len(data) == 2
assert (
data[0]["key"]
== "leggen_backups/database_backup_20250101_120000.db"
)
assert data[0]["key"] == "leggen_backups/database_backup_20250101_120000.db"
def test_list_backups_no_config(self, api_client, mock_config):
"""Test backup listing with no configuration."""

View File

@@ -157,7 +157,6 @@ class TestTransactionsAPI:
)
assert response.status_code == 200
data = response.json()
# Verify the database service was called with correct filters
mock_get_transactions.assert_called_once_with(