@startuml
title Admin Audit Log List (After)

skinparam backgroundColor #FFFFFF
skinparam defaultFontColor #000000
skinparam ArrowColor #000000
skinparam SequenceLifeLineBorderColor #000000
skinparam SequenceLifeLineBackgroundColor #F7F7F7
skinparam ParticipantBorderColor #000000
skinparam ParticipantBackgroundColor #D7F0FF
skinparam NoteBackgroundColor #E9FFE9
skinparam NoteBorderColor #000000

actor "Admin Client" as Client
participant "AdminPlugin\n/audit-log/list" as Handler
participant "Tenant Runtime\nDatabaseAdapter" as Adapter
database "tenant.admin_audit_logs" as AuditTable

Client -> Handler: GET /admin/audit-log/list?\nlimit=1&action=admin.email.create&success=true

Handler -> Adapter: count_admin_audit_logs(filters)\n(ignore limit/offset)
Adapter -> AuditTable: SELECT COUNT(*) WHERE filters
AuditTable --> Adapter: N rows match
Adapter --> Handler: N

Handler -> Adapter: list_admin_audit_logs_with_params(filters + page)
Adapter -> AuditTable: SELECT ... WHERE filters\nORDER BY created_at DESC LIMIT 1 OFFSET 0
AuditTable --> Adapter: 1 row
Adapter --> Handler: Vec<AdminAuditLog>(len=1)

Handler --> Client: { total: N, auditLogs: [1 row] }

note right of Handler
Supports actor/action/target/success/time filters\nand returns accurate full-match totals.
end note

@enduml
