$ErrorActionPreference = "Stop"
$ProjectRoot = Split-Path -Parent $PSScriptRoot
Push-Location (Join-Path $ProjectRoot "backend")
try {
    uv run python -m zbt.commands.build_analytics
    if ($LASTEXITCODE -ne 0) { throw "Analytics 基础数据构建失败。" }
}
finally {
    Pop-Location
}
