feat: add soft delete for import batches

This commit is contained in:
chengma
2026-07-01 09:41:10 +08:00
parent 5b044f2349
commit cc277366ed
10 changed files with 362 additions and 42 deletions
+6 -1
View File
@@ -81,7 +81,12 @@ update_account(alias, **fields) -> None # 支持账号展示字段、端
delete_account(alias) -> None
# 任务 / 各阶段结果
insert_tasks(batch_id, rows, path=None) -> int # 写输入列;rows 含 source_file_abs/source_sheet/source_row/row_key
list_tasks(batch_id=None, stage=None, status=None, alias=None, path=None) -> list[Task]
list_tasks(batch_id=None, stage=None, status=None, alias=None, path=None, include_deleted=False) -> list[Task]
get_task(task_id, path=None, include_deleted=False) -> Task | None
# 默认排除已软删除批次;include_deleted 仅供内部诊断/测试使用
delete_batch(batch_id, reason=None, path=None) -> dict
# T-206 软删除:写 batches.deleted_at/deleted_reason,不物理删除 batches/tasks;默认业务列表和执行流程不可见/不可调用;返回任务数、committed 数和关联图片路径
mark_running(task_id, phase) -> None
mark_failed(task_id, phase, error) -> None # status=failed,stage 不前进,对应 attempts+1
mark_skipped(task_id, reason) -> None # status=skipped,stage 不前进