feat(work-orders): synchronize peripheral changes through events

This commit is contained in:
2026-10-08 11:50:15 +08:00
parent afcbd52a5a
commit b70283c2ff
8 changed files with 600 additions and 13 deletions
@@ -1,4 +1,4 @@
"""Opt-in checks against provisioned sample tables, never business-table writes."""
"""Opt-in checks against provisioned sample tables and transactional source events."""
from concurrent.futures import ThreadPoolExecutor
import os
import subprocess
@@ -39,6 +39,10 @@ def sample():
yield store, who
# Only this test's unguessable project key; tables created by the authorized setup.
with store.connection() as conn:
if store.settings.db_name == "tjwater_v2" and conn.execute(
"SELECT to_regclass('workbench.domain_event_log') AS name"
).fetchone()["name"] is not None:
conn.execute("DELETE FROM workbench.domain_event_log WHERE project_id=%s", (who.project_id,))
for table in (
"work_order_revisions", "test_data_record_revisions", "work_orders",
"test_data_records", "feedback", "requests", "revisions", "tasks", "scenarios",