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;
import java.util.List;

/**
 * 음성 변환 관련 DTO 클래스들
 */
public class TranscriptionDto {
    
    /**
     * 실시간 음성 변환 요청 DTO
     */
    @Getter
    @Builder
    @ToString
    public static class StreamRequest {
        
        @NotBlank(message = "녹음 ID는 필수입니다")
        private final String recordingId;
        
        @NotBlank(message = "오디오 데이터는 필수입니다")
        private final String audioData;
        
        @NotNull(message = "타임스탬프는 필수입니다")
        private final Long timestamp;
        
        private final Integer chunkIndex;
    }
    
    /**
     * 배치 음성 변환 요청 DTO
     */
    @Getter
    @Builder
    @ToString
    public static class BatchRequest {
        
        @NotBlank(message = "녹음 ID는 필수입니다")
        private final String recordingId;
        
        private final String language;
        private final String callbackUrl;
    }
    
    /**
     * 배치 변환 응답 DTO
     */
    @Getter
    @Builder
    @ToString
    public static class BatchResponse {
        
        private final String jobId;
        private final String recordingId;
        private final String status;
        private final LocalDateTime estimatedCompletionTime;
        private final String callbackUrl;
    }
    
    /**
     * 배치 콜백 요청 DTO
     */
    @Getter
    @Builder
    @ToString
    public static class BatchCallbackRequest {
        
        @NotBlank(message = "작업 ID는 필수입니다")
        private final String jobId;
        
        @NotBlank(message = "상태는 필수입니다")
        private final String status;
        
        private final List<TranscriptSegmentDto.Detail> segments;
        private final String error;
    }
    
    /**
     * 변환 완료 응답 DTO
     */
    @Getter
    @Builder
    @ToString
    public static class CompleteResponse {
        
        private final String jobId;
        private final String recordingId;
        private final String status;
        private final Integer segmentCount;
        private final Integer totalDuration;
        private final Double averageConfidence;
    }
    
    /**
     * 변환 결과 응답 DTO
     */
    @Getter
    @Builder
    @ToString
    public static class Response {
        
        private final String recordingId;
        private final String fullText;
        private final Integer segmentCount;
        private final Integer totalDuration;
        private final Double averageConfidence;
        private final Integer speakerCount;
        private final List<TranscriptSegmentDto.Detail> segments;
    }
}