Initial income_calculator project

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-02-23 16:49:24 +03:00
commit 31dc287c3d
44 changed files with 1935 additions and 0 deletions

23
backend/parsers/base.py Normal file
View File

@@ -0,0 +1,23 @@
from abc import ABC, abstractmethod
from dataclasses import dataclass
from typing import List
@dataclass
class ParsedTransaction:
operation_date: str # ISO date or datetime
debit_date: str | None
amount: float # signed: negative = expense
amount_card_currency: float | None
description: str
card_tail: str # last 4 digits for account matching
class BaseBankParser(ABC):
@abstractmethod
def can_parse(self, filename: str) -> bool:
pass
@abstractmethod
def parse(self, file_path: str) -> List[ParsedTransaction]:
pass