package com.unicorn.hgzero.stt.dto;

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

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

import java.time.LocalDateTime;

/**
 * 변환 세그먼트 관련 DTO 클래스들
 */
public class TranscriptSegmentDto {
    
    /**
     * 변환 세그먼트 응답 DTO
     */
    @Getter
    @Builder
    @ToString
    public static class Response {
        
        private final String transcriptId;
        private final String recordingId;
        private final String text;
        private final String speakerId;
        private final String speakerName;
        private final Long timestamp;
        private final Double duration;
        private final Double confidence;
        private final Boolean warningFlag;
    }
    
    /**
     * 변환 세그먼트 상세 응답 DTO
     */
    @Getter
    @Builder
    @ToString
    public static class Detail {
        
        private final String transcriptId;
        private final String text;
        private final String speakerId;
        private final String speakerName;
        private final Long timestamp;
        private final Double duration;
        private final Double confidence;
    }
    
    /**
     * 변환 세그먼트 생성 요청 DTO
     */
    @Getter
    @Builder
    @ToString
    public static class CreateRequest {
        
        @NotBlank(message = "녹음 ID는 필수입니다")
        private final String recordingId;
        
        @NotBlank(message = "텍스트는 필수입니다")
        private final String text;
        
        @NotBlank(message = "화자 ID는 필수입니다")
        private final String speakerId;
        
        private final String speakerName;
        
        @NotNull(message = "타임스탬프는 필수입니다")
        private final Long timestamp;
        
        @NotNull(message = "발언 시간은 필수입니다")
        @DecimalMin(value = "0.0", message = "발언 시간은 0 이상이어야 합니다")
        private final Double duration;
        
        @NotNull(message = "신뢰도는 필수입니다")
        @DecimalMin(value = "0.0", message = "신뢰도는 0 이상이어야 합니다")
        @DecimalMax(value = "1.0", message = "신뢰도는 1 이하여야 합니다")
        private final Double confidence;
        
        private final Integer chunkIndex;
    }
}