feat(collect): support soft deletion of one task

This commit is contained in:
chengma
2026-07-20 10:27:21 +08:00
parent a92f1c86f4
commit 9852b1c9c1
8 changed files with 333 additions and 10 deletions
+3 -1
View File
@@ -102,10 +102,12 @@ 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, include_deleted=False) -> list[Task]
get_task(task_id, path=None, include_deleted=False) -> Task | None
# 默认排除已软删除批次;include_deleted 仅供内部诊断/测试使用
# 默认排除已软删除批次和任务;include_deleted 仅供内部诊断/测试使用
delete_batch(batch_id, reason=None, path=None) -> dict
# T-206 软删除:写 batches.deleted_at/deleted_reason,不物理删除 batches/tasks;默认业务列表和执行流程不可见/不可调用;返回任务数、committed 数和关联图片路径
delete_task(task_id, reason=None, path=None) -> dict
# T-670 软删除单条非 running 任务:写 tasks.deleted_at/deleted_reason;不删除 Excel、图片或线上商品,默认业务查询和执行入口不可见/不可调用
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 不前进