# Runs all local Firebase go-live checks (no PHP required).
$ErrorActionPreference = 'Stop'
$scriptDir = $PSScriptRoot

Write-Host "=== Firebase go-live checks (arafstore-14938) ===" -ForegroundColor Cyan
& (Join-Path $scriptDir 'verify-firebase-service-account.ps1')
& (Join-Path $scriptDir 'verify-firebase-config-consistency.ps1')
& (Join-Path $scriptDir 'sync-service-account-to-deploy.ps1')

$rules = Join-Path (Split-Path $scriptDir -Parent) 'database.rules.json'
if (-not (Test-Path $rules)) {
    Write-Host "WARN missing database.rules.json - publish rules in Console manually" -ForegroundColor Yellow
} else {
    Write-Host "OK database.rules.json present" -ForegroundColor Green
}

Write-Host ""
Write-Host "Manual steps remaining:" -ForegroundColor Yellow
Write-Host "  1. FIREBASE_CONSOLE_CHECKLIST.md"
Write-Host "  2. prepare-production-upload.ps1 -> upload zip to server"
Write-Host "  3. Server: php api/firebase-smoke-test.php"
Write-Host "  4. FIREBASE_KEY_ROTATION.md (key was shared via chat)"
