package top.tqx.demo_1.dto;

import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;

@Data
public class ReportResponse implements Serializable {
    
    private static final long serialVersionUID = 1L;
    
    @JsonProperty("success")
    private Boolean success;
    
    @JsonProperty("report")
    private ReportData report;
    
    @Data
    public static class ReportData implements Serializable {
        private static final long serialVersionUID = 1L;
        
        @JsonProperty("report_type")
        private String reportType;
        
        @JsonProperty("start_date")
        private String startDate;
        
        @JsonProperty("end_date")
        private String endDate;
        
        @JsonProperty("total_queries")
        private Integer totalQueries;
        
        @JsonProperty("total_feedback")
        private Integer totalFeedback;
        
        @JsonProperty("positive_count")
        private Integer positiveCount;
        
        @JsonProperty("negative_count")
        private Integer negativeCount;
        
        @JsonProperty("satisfaction_rate")
        private BigDecimal satisfactionRate;
        
        @JsonProperty("avg_rating")
        private BigDecimal avgRating;
        
        @JsonProperty("high_freq_queries")
        private List<HighFreqQueryItem> highFreqQueries;
        
        @JsonProperty("low_rating_queries")
        private List<LowRatingQueryItem> lowRatingQueries;
        
        @JsonProperty("improvement_suggestions")
        private List<String> improvementSuggestions;
        
        @JsonProperty("created_at")
        private String createdAt;
    }
    
    @Data
    public static class HighFreqQueryItem implements Serializable {
        private static final long serialVersionUID = 1L;
        
        @JsonProperty("query")
        private String query;
        
        @JsonProperty("frequency")
        private Integer frequency;
        
        @JsonProperty("sample_answer")
        private String sampleAnswer;
    }
    
    @Data
    public static class LowRatingQueryItem implements Serializable {
        private static final long serialVersionUID = 1L;
        
        @JsonProperty("query")
        private String query;
        
        @JsonProperty("rating")
        private Integer rating;
        
        @JsonProperty("reason")
        private String reason;
    }
}
