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

@Data
public class UserAnswerQueryResponse implements Serializable {

    private static final long serialVersionUID = 1L;

    private Boolean success;

    @JsonProperty("groups")
    private List<AnswerGroup> groups;

    @JsonProperty("total_count")
    private Integer totalCount;

    @Data
    public static class AnswerGroup implements Serializable {
        private static final long serialVersionUID = 1L;

        @JsonProperty("group_type")
        private String groupType;

        @JsonProperty("group_id")
        private String groupId;

        @JsonProperty("group_name")
        private String groupName;

        @JsonProperty("total_score")
        private BigDecimal totalScore;

        @JsonProperty("total_max_score")
        private BigDecimal totalMaxScore;

        @JsonProperty("score_rate")
        private BigDecimal scoreRate;

        @JsonProperty("answer_count")
        private Integer answerCount;

        @JsonProperty("correct_count")
        private Integer correctCount;

        @JsonProperty("created_at")
        private LocalDateTime createdAt;

        @JsonProperty("answers")
        private List<AnswerDetail> answers;
    }

    @Data
    public static class AnswerDetail implements Serializable {
        private static final long serialVersionUID = 1L;

        @JsonProperty("answer_id")
        private Long answerId;

        @JsonProperty("question_id")
        private String questionId;

        @JsonProperty("question_type")
        private String questionType;

        @JsonProperty("question_type_name")
        private String questionTypeName;

        @JsonProperty("user_answer")
        private Object userAnswer;

        @JsonProperty("score")
        private BigDecimal score;

        @JsonProperty("max_score")
        private BigDecimal maxScore;

        @JsonProperty("is_correct")
        private Integer isCorrect;

        @JsonProperty("is_correct_text")
        private String isCorrectText;

        @JsonProperty("feedback")
        private String feedback;

        @JsonProperty("grading_type")
        private String gradingType;

        @JsonProperty("time_spent")
        private Integer timeSpent;

        @JsonProperty("knowledge_base_path")
        private String knowledgeBasePath;

        @JsonProperty("chunk_ids")
        private List<String> chunkIds;

        @JsonProperty("page_numbers")
        private List<Integer> pageNumbers;

        @JsonProperty("document_name")
        private String documentName;

        @JsonProperty("answered_at")
        private LocalDateTime answeredAt;
    }
}
