first sketch; incomplete; WiP
This commit is contained in:
@@ -5,7 +5,7 @@ from pydantic import Field, computed_field
|
||||
from sqlalchemy import Date, ForeignKey, Index, Integer, String, UniqueConstraint
|
||||
from sqlalchemy.orm import Mapped, mapped_column, relationship
|
||||
|
||||
from src.models.common import ExportBaseModel, IngestdbBase, date2str, hashify
|
||||
from src.models.common import Amount, ExportBaseModel, IngestdbBase, date2str, hashify
|
||||
|
||||
|
||||
class Transaction(ExportBaseModel):
|
||||
@@ -22,12 +22,13 @@ class Transaction(ExportBaseModel):
|
||||
account_iban: str
|
||||
account_currency: str
|
||||
date_valid: date
|
||||
amount: Decimal = Field(description="Signed amount; negative = money out")
|
||||
amount: Amount
|
||||
amount_currency: str
|
||||
date_book: date | None = None
|
||||
text: str | None = None
|
||||
other_name: str | None = None
|
||||
other_iban: str | None = None
|
||||
# TODO: The Pydantic model should hold a category object, NOT the category id which is owned by the DB
|
||||
category_id: int | None = None
|
||||
|
||||
@computed_field # type: ignore[prop-decorator]
|
||||
|
||||
Reference in New Issue
Block a user