Skip to content

feat: Pluggable bank sync connector architecture#623

Open
flaggdavid-source wants to merge 1 commit intorohitdash08:mainfrom
flaggdavid-source:feature/bank-sync-connector-architecture
Open

feat: Pluggable bank sync connector architecture#623
flaggdavid-source wants to merge 1 commit intorohitdash08:mainfrom
flaggdavid-source:feature/bank-sync-connector-architecture

Conversation

@flaggdavid-source
Copy link
Copy Markdown

Summary

Implements a pluggable architecture for bank integrations as requested in the bounty issue.

Changes

New Files

  1. app/services/bank_connectors/__init__.py - Package exports
  2. app/services/bank_connectors/base.py - Connector interface:
    • BankConnector abstract base class
    • BankAccount and BankTransaction data models
    • ConnectorStatus enum
  3. app/services/bank_connectors/registry.py - Connector registry
  4. app/services/bank_connectors/mock.py - Mock connector for testing
  5. app/routes/bank_connections.py - REST API endpoints
  6. tests/test_bank_connectors.py - Unit tests (14 tests)

Modified Files

  1. app/models.py - Added:
    • BankConnection model
    • BankAccount model
    • BankTransaction model
  2. app/routes/__init__.py - Registered bank connections blueprint

API Endpoints

  • GET /bank-connections/connectors - List available connectors
  • POST /bank-connections/connectors/<type>/auth-url - Get OAuth URL
  • POST /bank-connections/connectors/<type>/connect - Connect bank
  • GET /bank-connections - List user's connections
  • GET /bank-connections/<id> - Get connection details
  • DELETE /bank-connections/<id> - Disconnect
  • POST /bank-connections/<id>/refresh - Refresh connection
  • POST /bank-connections/<id>/import - Import transactions
  • GET /bank-connections/<id>/transactions - List transactions

Testing

All 14 bank connector tests pass:

tests/test_bank_connectors.py - 14 passed

Acceptance Criteria Met

✅ Connector interface - BankConnector abstract class with OAuth flow
✅ Import & refresh support - import_transactions and refresh_connection endpoints
✅ Mock connector included - MockBankConnector for testing/development

@flaggdavid-source flaggdavid-source force-pushed the feature/bank-sync-connector-architecture branch from bc941cd to e3ebf51 Compare March 25, 2026 03:15
- Add BankConnector abstract base class defining the interface
- Add BankTransaction, BankAccount, ConnectorStatus dataclasses
- Add TransactionType enum and ConnectorError exception
- Add ConnectorRegistry for managing available connectors
- Add MockBankConnector for testing
- Add comprehensive tests for all components

Implements:
- Connector interface with import and refresh methods
- Import support (fetch new transactions)
- Refresh support (update existing transactions)
- Mock connector for testing
@flaggdavid-source flaggdavid-source force-pushed the feature/bank-sync-connector-architecture branch from e3ebf51 to d77a56f Compare March 30, 2026 09:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant