# Test both login paths
$loginBody = '{"tenantCode":"T202605253515","username":"admin","password":"admin123"}'

Write-Host "=== Test /login ==="
try {
    $resp = Invoke-WebRequest -Uri 'http://localhost:8006/login' -Method POST -ContentType 'application/json' -Body $loginBody -UseBasicParsing
    $content = $resp.Content | ConvertFrom-Json
    Write-Host "Status: $($resp.StatusCode), code: $($content.code)"
    if ($content.token) { Write-Host "Token found" }
} catch {
    Write-Host "Error: $($_.Exception.Message)"
}

Write-Host "`n=== Test /company/login ==="
try {
    $resp = Invoke-WebRequest -Uri 'http://localhost:8006/company/login' -Method POST -ContentType 'application/json' -Body $loginBody -UseBasicParsing
    $content = $resp.Content | ConvertFrom-Json
    Write-Host "Status: $($resp.StatusCode), code: $($content.code)"
    if ($content.token) { Write-Host "Token found" }
} catch {
    Write-Host "Error: $($_.Exception.Message)"
}
