Initial commit: intercompany ledger app

This commit is contained in:
leefer
2026-08-06 23:46:04 +08:00
commit b3043f9430
60 changed files with 4280 additions and 0 deletions
+41
View File
@@ -0,0 +1,41 @@
from __future__ import annotations
from dataclasses import dataclass
from datetime import date, datetime
from decimal import Decimal
from pathlib import Path
@dataclass(frozen=True)
class NormalizedTransaction:
source_file: Path
sheet_name: str
source_row: int
transaction_at: datetime
income: Decimal
expense: Decimal
balance: Decimal | None
own_account: str | None
own_name: str | None
counterparty_account: str | None
counterparty_name: str | None
counterparty_bank: str | None
summary: str | None
purpose: str | None
reference: str | None
currency: str | None
@dataclass(frozen=True)
class StatementBatch:
source_file: Path
sheet_name: str
bank_name: str
template_id: str
header_row: int
own_account: str | None
own_name: str | None
period_start: date | None
period_end: date | None
transactions: tuple[NormalizedTransaction, ...]
warnings: tuple[str, ...]