mirror of
https://github.com/elisiariocouto/leggen.git
synced 2025-12-13 20:42:39 +00:00
- Merge leggend API components into leggen (api/, services/, background/) - Replace leggend command with 'leggen server' subcommand - Consolidate configuration systems into leggen.utils.config - Update environment variables: LEGGEND_API_URL -> LEGGEN_API_URL - Rename LeggendAPIClient -> LeggenAPIClient - Update all documentation, Docker configs, and compose files - Fix all import statements and test references - Remove duplicate utility files and clean up package structure All tests passing (101/101), linting clean, server functionality preserved. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
53 lines
1.1 KiB
Python
53 lines
1.1 KiB
Python
from datetime import datetime
|
|
from typing import List, Optional
|
|
|
|
from pydantic import BaseModel
|
|
|
|
|
|
class BankInstitution(BaseModel):
|
|
"""Bank institution model"""
|
|
|
|
id: str
|
|
name: str
|
|
bic: Optional[str] = None
|
|
transaction_total_days: int
|
|
countries: List[str]
|
|
logo: Optional[str] = None
|
|
|
|
|
|
class BankConnectionRequest(BaseModel):
|
|
"""Request to connect to a bank"""
|
|
|
|
institution_id: str
|
|
redirect_url: Optional[str] = "http://localhost:8000/"
|
|
|
|
|
|
class BankRequisition(BaseModel):
|
|
"""Bank requisition/connection model"""
|
|
|
|
id: str
|
|
institution_id: str
|
|
status: str
|
|
status_display: Optional[str] = None
|
|
created: datetime
|
|
link: str
|
|
accounts: List[str] = []
|
|
|
|
class Config:
|
|
json_encoders = {datetime: lambda v: v.isoformat()}
|
|
|
|
|
|
class BankConnectionStatus(BaseModel):
|
|
"""Bank connection status response"""
|
|
|
|
bank_id: str
|
|
bank_name: str
|
|
status: str
|
|
status_display: str
|
|
created_at: datetime
|
|
requisition_id: str
|
|
accounts_count: int
|
|
|
|
class Config:
|
|
json_encoders = {datetime: lambda v: v.isoformat()}
|