@startuml
title SQLx Email Schema Isolation Test Coverage (After)

skinparam backgroundColor #FFFFFF
skinparam defaultFontColor #000000
skinparam ArrowColor #000000
skinparam ParticipantBorderColor #000000
skinparam ParticipantBackgroundColor #D9F2D9
skinparam DatabaseBorderColor #000000
skinparam NoteBackgroundColor #E9F7FF
skinparam NoteBorderColor #000000

actor "Test Harness" as Test
participant "sqlx_adapter_email_entities_are_isolated_per_schema" as Spec
database "tenant_email_a_* schema" as TenantA
database "tenant_email_b_* schema" as TenantB

Test -> Spec: run schema-isolation integration test
Spec -> TenantA: create/read/update/delete\nemails/failures/templates/admin_audit_logs
Spec -> TenantB: assert no visibility into tenant A rows
Spec -> Spec: count/list admin_audit_logs\nwith target/action/success filters per tenant

note right of Spec
Isolation contract now covers both data-plane\n(email entities) and control-plane\n(admin audit logs with filtered queries).
end note

@enduml
