package com.reading.platform.entity;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;

import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * Course Entity
 * Course package entity with comprehensive fields for course management
 */
@Data
@TableName("courses")
public class Course {

    @TableId(type = IdType.AUTO)
    private Long id;

    private Long tenantId;

    private String name;

    private String code;

    private String description;

    private String coverUrl;

    private String category;

    private String ageRange;

    private String difficultyLevel;

    private Integer durationMinutes;

    private String objectives;

    private String status;

    private Integer isSystem;

    // ============================================
    // Course Package Refactoring Fields (2026-02-28)
    // ============================================

    // Core content
    private String coreContent;

    // Course introduction (8 fields)
    private String introSummary;
    private String introHighlights;
    private String introGoals;
    private String introSchedule;
    private String introKeyPoints;
    private String introMethods;
    private String introEvaluation;
    private String introNotes;

    // Schedule reference data (JSON)
    private String scheduleRefData;

    // Environment construction (Step 7)
    private String environmentConstruction;

    // Theme and picture book relation
    private Long themeId;
    private String pictureBookName;

    // Cover image
    private String coverImagePath;

    // Digital resources (JSON arrays)
    private String ebookPaths;
    private String audioPaths;
    private String videoPaths;
    private String otherResources;

    // Teaching materials
    private String pptPath;
    private String pptName;
    private String posterPaths;
    private String tools;
    private String studentMaterials;

    // Lesson plan, activities, assessment (JSON)
    private String lessonPlanData;
    private String activitiesData;
    private String assessmentData;

    // Grade and domain tags (JSON arrays)
    private String gradeTags;
    private String domainTags;

    // Collective lesson flag
    private Integer hasCollectiveLesson;

    // Version and review fields
    private String version;
    private Long parentId;
    private Integer isLatest;
    private LocalDateTime submittedAt;
    private Long submittedBy;
    private LocalDateTime reviewedAt;
    private Long reviewedBy;
    private String reviewComment;
    private String reviewChecklist;
    private LocalDateTime publishedAt;

    // Usage statistics
    private Integer usageCount;
    private Integer teacherCount;
    private BigDecimal avgRating;
    private Long createdBy;

    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createdAt;

    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updatedAt;

    @TableLogic
    private Integer deleted;

}
