@startuml
title Auth Schema Resolution Flow
skinparam backgroundColor #FAFAFA
skinparam defaultFontName Consolas
skinparam componentStyle rectangle

actor Client
component "Axum Server" as Server
component "ParsedMultiTenancyConfig" as Parsed
component "TenantDatabaseRuntimeConfig" as TenantCfg
component "SqlxAdapter\n(auth_schema + table_ref)" as Adapter
database "PostgreSQL" as Db

Client -> Server: Request (/api/auth/*)
Server -> Parsed: Read multitenancy config
Parsed -> TenantCfg: Resolve tenant + auth schema
note right of TenantCfg
schema_mapping.__schema__
defaults to public
end note

Server -> Adapter: build_sqlx_adapter(..., auth_schema)
Adapter -> Db: SQL on "schema"."table"
Db --> Adapter: Rows
Adapter --> Server: Auth result
Server --> Client: JSON response
@enduml
