T1: restructure to domain/application/infrastructure + schema version 1

- Move cashflow_model/ -> domain/
- Move engine/ -> application/
- Move cli/, sync/, ai/ -> infrastructure/
- Update all imports across codebase and tests
- Add version=1 to FinancialModel.to_dict() with migration hook in from_dict
- Update pyproject.toml: cf entry point and packages.find

Tests: 63/63 pass.
This commit is contained in:
2026-10-08 16:34:10 +03:00
parent 12611edd6f
commit feb77ef217
32 changed files with 1945 additions and 109 deletions
+33
View File
@@ -0,0 +1,33 @@
from dataclasses import dataclass, field
from uuid import UUID, uuid4
@dataclass
class Transaction:
id: UUID = field(default_factory=uuid4)
date: str = ""
account: str = ""
category: str = ""
amount: float = 0.0
description: str = ""
def to_dict(self) -> dict:
return {
"id": str(self.id),
"date": self.date,
"account": self.account,
"category": self.category,
"amount": self.amount,
"description": self.description,
}
@classmethod
def from_dict(cls, data: dict) -> "Transaction":
return cls(
id=UUID(data["id"]),
date=data["date"],
account=data.get("account", ""),
category=data.get("category", ""),
amount=data.get("amount", 0.0),
description=data.get("description", ""),
)