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

import java.util.List;
import java.util.Objects;

public record AchievementReportContent(
        String studentName,
        String reportTitle,
        String reportSubtitle,
        String completionTitle,
        String completionSubtitle,
        SummaryMetrics summaryMetrics,
        Comparison vocabularyComparison,
        Comparison paperKnownWordsComparison,
        StageVocabularySummary stageVocabularySummary,
        TestPaperVocabularySummary testPaperVocabularySummary,
        ExamUnknownWordsHitStatus examUnknownWordsHitStatus) implements ReportContent {

    public AchievementReportContent {
        Objects.requireNonNull(summaryMetrics, "summaryMetrics");
        Objects.requireNonNull(vocabularyComparison, "vocabularyComparison");
        Objects.requireNonNull(paperKnownWordsComparison, "paperKnownWordsComparison");
        Objects.requireNonNull(stageVocabularySummary, "stageVocabularySummary");
        Objects.requireNonNull(testPaperVocabularySummary, "testPaperVocabularySummary");
        Objects.requireNonNull(examUnknownWordsHitStatus, "examUnknownWordsHitStatus");
    }

    @Override
    public ReportType reportType() {
        return ReportType.ACHIEVEMENT;
    }

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

    public record Comparison(
            Double beforeValue,
            Double afterValue,
            String beforeText,
            String afterText,
            String growthText) {
    }

    public record StageVocabularySummary(
            String stageName,
            String stageVocabularyText,
            String masteryBeforeText,
            String masteryAfterText,
            String masteryImprovementText) {
    }

    public record TestPaperVocabularySummary(
            String testPaperTitle,
            String testPaperWordCountText,
            String unknownWordsBeforeText,
            String unknownWordsAfterText,
            String masteryRateBeforeText,
            String masteryRateAfterText,
            String masteryRateImprovementText) {
    }

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

        public ExamUnknownWordsHitStatus {
            hitWords = hitWords == null ? null : List.copyOf(hitWords);
        }
    }
}
