package cn.yunzhixue.ability.center.examsprint.contracts.report;

import com.fasterxml.jackson.annotation.JsonAlias;
import com.fasterxml.jackson.annotation.JsonProperty;
import jakarta.validation.Valid;
import jakarta.validation.constraints.DecimalMax;
import jakarta.validation.constraints.DecimalMin;
import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;

import java.util.List;

public record OutlookExamSprintReportPayload(
        @JsonProperty("StudentName") @JsonAlias("studentName") @NotBlank String studentName,
        @JsonProperty("StudentStage") @NotNull @Min(0) Integer studentStage,
        @JsonProperty("StageName") @NotBlank String stageName,
        @JsonProperty("StageVocabulary") @NotNull @Min(0) Integer stageVocabulary,
        @JsonProperty("StageExaminName") @NotBlank String stageExaminName,
        @JsonProperty("StageImportant") @NotNull @Min(0) Integer stageImportant,
        @JsonProperty("StudentWordsLatest") @NotEmpty List<@NotNull @Valid StudentWordLatest> studentWordsLatest,
        @JsonProperty("MastedWordCount") @NotNull @Min(0) Integer mastedWordCount,
        @JsonProperty("UnMastedWordCount") @NotNull @Min(0) Integer unMastedWordCount,
        @JsonProperty("ExamineStrangeWordCount") @NotNull @Min(0) Integer examineStrangeWordCount,
        @JsonProperty("TestPaperWordIdArray") @NotNull List<@NotNull @Min(0) Integer> testPaperWordIdArray,
        @JsonProperty("TestPaperTitle") @NotBlank String testPaperTitle,
        @JsonProperty("TestPaperUnMasterWords") @NotNull List<@NotBlank String> testPaperUnMasterWords,
        @JsonProperty("TestPaperMastedWords") @NotNull List<@NotBlank String> testPaperMastedWords,
        @JsonProperty("TestPaperMastedWordCount") @NotNull @Min(0) Integer testPaperMastedWordCount,
        @JsonProperty("TestPaperWordCount") @NotNull @Min(0) Integer testPaperWordCount,
        @JsonProperty("Complex") @NotNull Boolean complex) {

    public record StudentWordLatest(
            @JsonProperty("WordId") @NotNull @Min(0) Integer wordId,
            @JsonProperty("MeanId") @NotNull @Min(0) Integer meanId,
            @JsonProperty("WordSpell") @NotBlank String wordSpell,
            @JsonProperty("WordFrequency") @NotNull @Min(1) Integer wordFrequency,
            @JsonProperty("Mastery") @NotNull @DecimalMin("0.0") @DecimalMax("1.0") Double mastery,
            @JsonProperty("ReviewTimes") @NotNull @Min(0) Integer reviewTimes,
            @JsonProperty("Reliability") @NotNull @Min(0) Integer reliability,
            @JsonProperty("CreateTime") @NotBlank String createTime) {
    }
}
