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

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

import java.util.List;

public record AchievementExamSprintReportPayload(
        String studentName,
        @NotBlank String reportTitle,
        @NotBlank String reportSubtitle,
        @NotBlank String completionTitle,
        @NotBlank String completionSubtitle,
        @NotNull @Valid SummaryMetrics summaryMetrics,
        @NotNull @Valid Comparison vocabularyComparison,
        @NotNull @Valid Comparison paperKnownWordsComparison,
        @NotNull @Valid ExamUnknownWordsHitStatus examUnknownWordsHitStatus) {

    public record SummaryMetrics(
            @NotBlank String vocabularyGrowthText,
            @NotBlank String paperKnownWordsGrowthText,
            @NotBlank String unknownWordHitRateText,
            @NotBlank String learningEfficiencyText) {
    }

    public record Comparison(
            @NotNull @DecimalMin("0.0") Double beforeValue,
            @NotNull @DecimalMin("0.0") Double afterValue,
            @NotBlank String beforeText,
            @NotBlank String afterText,
            @NotBlank String growthText) {
    }

    public record ExamUnknownWordsHitStatus(
            @NotBlank String unknownWordHitRateText,
            @NotBlank String learningEfficiencyText,
            @NotBlank String unknownWordsBeforeText,
            @NotBlank String unknownWordsAfterText,
            @NotBlank String reducedUnknownWordsText,
            @NotNull List<@NotBlank String> hitWords) {
    }
}
