B-42: 导入功能加固——逐工作表确认、流式上传与诊断证据

This commit is contained in:
腾讯WorkBuddy
2026-08-17 01:00:19 +08:00
parent 7f1a93f6a6
commit 486842963e
15 changed files with 2019 additions and 183 deletions
+20
View File
@@ -40,3 +40,23 @@ class StatementBatch:
transactions: tuple[NormalizedTransaction, ...]
warnings: tuple[str, ...]
template_version: int = 1
@dataclass(frozen=True)
class SheetResult:
"""Per-worksheet parse outcome with the four diagnostic evidence items.
``outcome`` is the deterministic parse verdict: ``parsed`` (transactions
normalized), ``exception`` (template/header/balance problems) or
``ignored`` (empty or single-cell sheets with no bank content). The human
decision about whether a parsed sheet may participate in calculations is
a separate lifecycle stage (``review_status``), persisted in
``sheet_reviews``; it is never decided here.
"""
sheet_name: str
outcome: str # parsed | exception | ignored
message: str | None = None
scanned_rows: int | None = None
candidate_headers: tuple[str, ...] = ()
batch: StatementBatch | None = None