@startuml
title Email Admin List Totals (Before)

skinparam backgroundColor #FFFFFF
skinparam defaultFontColor #000000
skinparam ArrowColor #000000
skinparam SequenceLifeLineBorderColor #000000
skinparam SequenceLifeLineBackgroundColor #F7F7F7
skinparam ParticipantBorderColor #000000
skinparam ParticipantBackgroundColor #FFF4D6
skinparam NoteBackgroundColor #FFE9E9
skinparam NoteBorderColor #000000

actor "Admin Client" as Client
participant "AdminPlugin\n(list handlers)" as Handler
participant "Tenant Runtime\nDatabaseAdapter" as Adapter
database "Tenant Email Tables\n(emails / failures / templates)" as Tables

Client -> Handler: GET /admin/email*/list\n(limit=1, filters...)
Handler -> Adapter: list_*_with_params(limit=1, offset=0, filters)
Adapter -> Tables: SELECT ... LIMIT 1 OFFSET 0
Tables --> Adapter: page rows (size = 1)
Adapter --> Handler: Vec<row>(len = 1)
Handler -> Handler: total = rows.len()
Handler --> Client: { total: 1, items: [ ...1 row... ] }

note right of Handler
`total` reflects page length,
not full match count.
end note

@enduml
