Add offline biz_state log import with unified create-task entry.

Create tasks via pick-NE or import log; re-import appends batches like collects, without inventory NE or SSH.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
oliver 2026-09-24 07:36:11 +08:00
parent 7b5f03ad54
commit d701e4a35e
13 changed files with 1991 additions and 139 deletions

View file

@ -251,6 +251,10 @@ def update_task(db: Session, task_id: str, body: dict[str, Any]) -> dict[str, An
task = db.get(BizStateTask, task_id)
if not task:
raise HTTPException(status_code=404, detail="task_not_found")
# Offline import tasks have no inventory NE / credentials — keep paused.
if str(task.source or "").strip().lower() == "import":
if "status" in body and str(body.get("status") or "").strip() == "running":
raise HTTPException(status_code=400, detail="import_offline_only")
if "note" in body:
task.note = str(body.get("note") or "")[:256]
if "purpose" in body and body["purpose"] is not None: