package com.unicorn.hgzero.meeting.infra.event.dto;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;

/**
 * 회의록 AI 분석 요청 이벤트
 */
@Getter
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class MinutesAnalysisRequestEvent {

    private String eventType;     // MINUTES_ANALYSIS_REQUEST
    private String eventId;       // 이벤트 고유 ID
    private String minutesId;     // 회의록 ID
    private String meetingId;     // 회의 ID
    private String requesterId;   // 요청자 ID
    private String requesterName; // 요청자 이름
    private String content;       // 분석할 회의록 내용
    private String[] features;    // 분석 기능 목록 (KEY_POINTS, KEYWORDS, DECISIONS, etc.)
    private String priority;      // URGENT, HIGH, NORMAL, LOW
    private LocalDateTime requestedAt; // 요청 시간
    private LocalDateTime timestamp;   // 이벤트 발생 시간

    // 회의 메타정보
    private MeetingMeta meetingMeta;

    @Getter
    @Builder
    @NoArgsConstructor
    @AllArgsConstructor
    public static class MeetingMeta {
        private String title;
        private LocalDateTime meetingDate;
        private int participantCount;
        private int durationMinutes;
        private String organizerId;
        private String[] participantIds;
    }

    public static MinutesAnalysisRequestEvent create(String minutesId, String meetingId, 
                                                   String requesterId, String requesterName, 
                                                   String content, MeetingMeta meetingMeta) {
        return MinutesAnalysisRequestEvent.builder()
                .eventType("MINUTES_ANALYSIS_REQUEST")
                .eventId("analysis-" + minutesId + "-" + System.currentTimeMillis())
                .minutesId(minutesId)
                .meetingId(meetingId)
                .requesterId(requesterId)
                .requesterName(requesterName)
                .content(content)
                .features(new String[]{"KEY_POINTS", "KEYWORDS", "DECISIONS", "SUMMARY", "RELATED_MINUTES"})
                .priority("NORMAL")
                .requestedAt(LocalDateTime.now())
                .timestamp(LocalDateTime.now())
                .meetingMeta(meetingMeta)
                .build();
    }
}