fix(burst): recognize native pressure units and separate isolation impact
Generic Container CI/CD / test-build-publish (push) Successful in 4m37s
Server CI/CD v2 / build-test-publish-and-deploy (push) Successful in 4m37s

This commit is contained in:
2026-11-14 23:45:25 +08:00
parent b45c5c6f46
commit 11eb09fe8f
12 changed files with 87 additions and 11 deletions
+14
View File
@@ -104,3 +104,17 @@ def resolve_overlay(snapshot: TaskDataSnapshot, mode: str) -> dict:
normalized["properties"]["weight"] = weight
features.append(normalized)
return {"type": "FeatureCollection", "features": features}
def validate_overlay_stage(data: dict, stage: str | None) -> None:
"""An event-impact claim must be supported by the saved scenario geometry."""
if stage != "event_impact":
return
features = data.get("features", [])
require(bool(features) and all(
(feature.get("properties") or {}).get("impact_phase") in {
"after_burst_before_intervention", "after_contamination_before_intervention",
} for feature in features
), "OVERLAY_IMPACT_PHASE_MISMATCH",
"事件影响阶段须引用处置前情景覆盖;关阀及供水失源覆盖请使用 isolation_plan,不能替代不可用的事件降压结果",
status=422)