@startuml
!theme mono

title 회의록 목록 조회 내부 시퀀스

participant "API Gateway<<E>>" as Gateway
participant "MeetingController" as Controller
participant "MeetingService" as Service
participant "MeetingRepository" as Repository
database "PostgreSQL<<E>>" as DB
database "Redis Cache<<E>>" as Cache

Gateway -> Controller: GET /api/meetings?page=0&size=20
activate Controller

Controller -> Service: getMeetingList(pageRequest, filters)
activate Service

note right of Service
조회 조건:
- 페이징 (page, size)
- 필터 (날짜, 상태, 작성자)
- 정렬 (최신순, 제목순)
end note

Service -> Cache: get(meetings:list:{hash})
activate Cache
note right of Cache
목록 조회 캐싱
키: 쿼리 조건 해시
TTL: 5분
end note
Cache --> Service: null (cache miss)
deactivate Cache

Service -> Repository: findAll(specification, pageable)
activate Repository

Repository -> DB: 회의록 목록 조회\n(필터 조건, 정렬, 페이징)
activate DB
DB --> Repository: meeting_rows
deactivate DB

Repository --> Service: Page<Meeting>
deactivate Repository

Service -> Service: toResponseList(meetings)
note right of Service
응답 변환:
- DTO 매핑
- 민감 정보 필터링
end note

Service -> Cache: SET meetings:list:{hash}\n(TTL: 5분)
activate Cache
note right of Cache
  목록 데이터 캐싱:
  - TTL: 5분
  - 자동 만료
end note
Cache --> Service: OK
deactivate Cache

Service --> Controller: Page<MeetingResponse>
deactivate Service

Controller --> Gateway: 200 OK
deactivate Controller

@enduml
