package com.unicorn.hgzero.stt.dto;

import lombok.Builder;
import lombok.Getter;
import lombok.ToString;

import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.DecimalMax;
import jakarta.validation.constraints.DecimalMin;

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

/**
 * 화자 관련 DTO 클래스들
 */
public class SpeakerDto {
    
    /**
     * 화자 식별 요청 DTO
     */
    @Getter
    @Builder
    @ToString
    public static class IdentifyRequest {
        
        @NotBlank(message = "녹음 ID는 필수입니다")
        private final String recordingId;
        
        @NotBlank(message = "오디오 프레임은 필수입니다")
        private final String audioFrame;
        
        private final Long timestamp;
    }
    
    /**
     * 화자 식별 응답 DTO
     */
    @Getter
    @Builder
    @ToString
    public static class IdentificationResponse {
        
        private final String speakerId;
        private final String speakerName;
        private final Double confidence;
        private final Boolean isNewSpeaker;
        private final String profileId;
    }
    
    /**
     * 화자 상세 응답 DTO
     */
    @Getter
    @Builder
    @ToString
    public static class DetailResponse {
        
        private final String speakerId;
        private final String speakerName;
        private final String profileId;
        private final String userId;
        private final Integer totalSegments;
        private final Integer totalDuration;
        private final Double averageConfidence;
        private final LocalDateTime firstAppeared;
        private final LocalDateTime lastAppeared;
    }
    
    /**
     * 화자 정보 업데이트 요청 DTO
     */
    @Getter
    @Builder
    @ToString
    public static class UpdateRequest {
        
        private final String speakerName;
        private final String userId;
    }
    
    /**
     * 화자 목록 응답 DTO
     */
    @Getter
    @Builder
    @ToString
    public static class ListResponse {
        
        private final String recordingId;
        private final Integer speakerCount;
        private final List<SpeakerSummary> speakers;
    }
    
    /**
     * 화자 요약 DTO
     */
    @Getter
    @Builder
    @ToString
    public static class SpeakerSummary {
        
        private final String speakerId;
        private final String speakerName;
        private final Integer segmentCount;
        private final Integer totalDuration;
        private final Double speakingRatio;
    }
}