package com.unicorn.hgzero.meeting.biz.dto;

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

import java.time.LocalDateTime;
import java.util.List;

/**
 * AI 분석 결과 DTO
 */
@Getter
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class AiAnalysisDTO {

    private String minutesId;
    private String analysisId;
    private String status; // PENDING, IN_PROGRESS, COMPLETED, FAILED
    private LocalDateTime requestedAt;
    private LocalDateTime completedAt;
    
    // AI 분석 결과
    private AnalysisResult result;

    @Getter
    @Builder
    @NoArgsConstructor
    @AllArgsConstructor
    public static class AnalysisResult {
        
        // 핵심내용 (최대 4개)
        private List<KeyPoint> keyPoints;
        
        // 키워드 (해시태그 형태)
        private List<String> keywords;
        
        // 전체 요약
        private String summary;
        
        // 결정사항
        private List<Decision> decisions;
        
        // 관련회의록 추천
        private List<RelatedMinutes> relatedMinutes;
        
        // 감정 분석 (선택사항)
        private SentimentAnalysis sentiment;
        
        // 분석 품질 점수 (0-100)
        private int qualityScore;
    }

    @Getter
    @Builder
    @NoArgsConstructor
    @AllArgsConstructor
    public static class KeyPoint {
        private int index;
        private String content;
        private double confidence; // 신뢰도 (0.0 - 1.0)
        private String category; // DECISION, DISCUSSION, ACTION_ITEM 등
    }

    @Getter
    @Builder
    @NoArgsConstructor
    @AllArgsConstructor
    public static class Decision {
        private String content;
        private String category; // STRATEGIC, OPERATIONAL, TECHNICAL 등
        private double confidence;
        private String extractedFrom; // 추출된 원문
    }

    @Getter
    @Builder
    @NoArgsConstructor
    @AllArgsConstructor
    public static class RelatedMinutes {
        private String minutesId;
        private String title;
        private double relevanceScore; // 연관도 점수 (0.0 - 1.0)
        private String reason; // 연관 이유
        private LocalDateTime meetingDate;
    }

    @Getter
    @Builder
    @NoArgsConstructor
    @AllArgsConstructor
    public static class SentimentAnalysis {
        private String overall; // POSITIVE, NEUTRAL, NEGATIVE
        private double positiveScore;
        private double neutralScore;
        private double negativeScore;
        private List<String> positiveKeywords;
        private List<String> negativeKeywords;
    }
}