You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$response=Invoke-RestMethod-Uri "http://localhost:5080/api/wallet/transactions"-Method GET -Headers $headers$response|ConvertTo-Json-Depth 5# Expected: 4 transactions for Alice (2 sent, 2 received, including pending)
Test 4: Get only sent transactions
$response=Invoke-RestMethod-Uri "http://localhost:5080/api/wallet/transactions?type=sent"-Method GET -Headers $headers$response|ConvertTo-Json-Depth 5# Expected: 2 transactions (Alice sent to Charlie)
Test 5: Get only received transactions
$response=Invoke-RestMethod-Uri "http://localhost:5080/api/wallet/transactions?type=received"-Method GET -Headers $headers$response|ConvertTo-Json-Depth 5# Expected: 2 transactions (Alice received from Charlie)
$response=Invoke-RestMethod-Uri "http://localhost:5080/api/wallet/transactions/1"-Method GET -Headers $headers$response|ConvertTo-Json-Depth 5# Expected: Transaction 1 details (Charlie to Alice, 2.0 hours)
Test 8: Get transaction user is not part of (should be 404)
try {
Invoke-RestMethod-Uri "http://localhost:5080/api/wallet/transactions/5"-Method GET -Headers $headersWrite-Host"FAIL: Should not be able to see transaction 5 (Globex tenant)"
} catch {
Write-Host"Status: $($_.Exception.Response.StatusCode.value__)"# Expected: 404 (transaction is in different tenant)
}
Test 9: Cross-tenant isolation (Globex user)
$globexLogin=@{
email="admin@globex.test"password="Test123!"tenant_slug="globex"
} |ConvertTo-Json$globexResponse=Invoke-RestMethod-Uri "http://localhost:5080/api/auth/login"-Method POST -Body $globexLogin-ContentType "application/json"$globexToken=$globexResponse.access_token$globexHeaders=@{ Authorization="Bearer $globexToken" }
# Get Bob's balance$response=Invoke-RestMethod-Uri "http://localhost:5080/api/wallet/balance"-Method GET -Headers $globexHeaders$response|ConvertTo-Json# Expected: balance = 0 (self-transfer doesn't change balance)# Try to access ACME's transactiontry {
Invoke-RestMethod-Uri "http://localhost:5080/api/wallet/transactions/1"-Method GET -Headers $globexHeadersWrite-Host"FAIL: Should not see ACME transactions"
} catch {
Write-Host"Status: $($_.Exception.Response.StatusCode.value__)"# Expected: 404
}