@startuml
skinparam backgroundColor white
skinparam defaultFontColor #000000
skinparam ArrowColor #000000
skinparam packageStyle rectangle
skinparam shadowing false
skinparam rectangle {
  BorderColor #000000
  FontColor #000000
}

title Runtime Dispatch Coverage (Before DB Persistence Assertions)

rectangle "Server Dispatch Tests\n(#4606-4714)" as dispatch_tests #DDEEFF {
  rectangle "Tenant Header Resolution" as header_resolution #E8F6FF
  rectangle "Fallback Header Resolution" as fallback_resolution #E8F6FF
  rectangle "Invalid/Unknown Tenant Rejection" as invalid_rejection #E8F6FF
}

rectangle "dispatch_auth_request" as dispatcher #FFE5CC
rectangle "TenantRuntimeRegistry" as registry #FFF4CC
rectangle "AthenaAuth<SqlxAdapter> (lazy)" as lazy_runtime #F5E6FF
rectangle "Admin Plugin Route" as admin_route #E8FFE8

header_resolution --> dispatcher : GET /admin/email/list
fallback_resolution --> dispatcher : GET /admin/email/list
invalid_rejection --> dispatcher : GET /admin/email/list

dispatcher --> registry : resolve tenant from headers
registry --> lazy_runtime : choose runtime by tenant
dispatcher --> admin_route : forwarded auth request
admin_route --> dispatch_tests : UNAUTHORIZED / BAD_REQUEST assertions

note bottom
Coverage verifies tenant header wiring only.
No DB-backed write/read persistence checks across tenant schemas.
end note
@enduml