feat(imports): resume persisted address runs
This commit is contained in:
@@ -151,6 +151,7 @@ class AddressImportCommitRequest(BaseModel):
|
||||
|
||||
|
||||
class AddressImportRollbackRequest(BaseModel):
|
||||
expected_plan_hash: str = Field(min_length=64, max_length=64)
|
||||
reason: str = Field(min_length=3, max_length=2000)
|
||||
|
||||
|
||||
|
||||
@@ -336,6 +336,8 @@ def rollback_address_import(
|
||||
payload: AddressImportRollbackRequest,
|
||||
) -> AddressImportRun:
|
||||
run = get_import_run(session, principal, run_id)
|
||||
if run.plan_hash != payload.expected_plan_hash:
|
||||
raise AddressBookError("The reviewed import plan changed; reload the import run.")
|
||||
if run.status == "rolled_back":
|
||||
return run
|
||||
if run.status != "applied":
|
||||
|
||||
@@ -446,8 +446,11 @@ manifest = ModuleManifest(
|
||||
"CSV and XLSX files can be mapped with scoped, reusable profile versions. Each preview validates headers, "
|
||||
"encodings, source keys, duplicates, blank values, workbook limits, and contact identity before any mutation. "
|
||||
"The reviewed input hash and plan hash are retained with row-level effects and diagnostics. Apply is idempotent, "
|
||||
"rejects contacts changed after preview, and records sufficient evidence for a guarded rollback. XLSX formulas, "
|
||||
"macros, and legacy workbook formats are never executed or imported."
|
||||
"rejects contacts changed after preview, and records sufficient evidence for a guarded rollback. A persisted run "
|
||||
"can be reopened with its run link after navigation or reload; previewed, applied, rolled-back, expired, and "
|
||||
"unavailable states remain explicit. Both apply and rollback submit the reviewed plan hash. Missing, expired, "
|
||||
"hidden, and cross-tenant runs disclose no source payload. XLSX formulas, macros, and legacy workbook formats "
|
||||
"are never executed or imported."
|
||||
),
|
||||
layer="configured",
|
||||
documentation_types=("admin", "user"),
|
||||
|
||||
Reference in New Issue
Block a user