package com.lesingle.edu.dto.response;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Builder;
import lombok.Data;

import java.time.LocalDateTime;

/**
 * 课程套餐响应
 * 用于返回课程套餐信息给前端
 */
@Data
@Builder
@Schema(description = "课程套餐响应")
public class CoursePackageResponse {

    @Schema(description = "ID")
    private Long id;

    @Schema(description = "名称")
    private String name;

    @Schema(description = "描述")
    private String description;

    @Schema(description = "价格（分）")
    private Long price;

    @Schema(description = "折后价格（分）")
    private Long discountPrice;

    @Schema(description = "折扣类型")
    private String discountType;

    @Schema(description = "年级水平（数组）")
    private String[] gradeLevels;

    @Schema(description = "课程数量")
    private Integer courseCount;

    @Schema(description = "使用学校数")
    private Integer tenantCount;

    @Schema(description = "状态")
    private String status;

    @Schema(description = "提交时间")
    private LocalDateTime submittedAt;

    @Schema(description = "提交人 ID")
    private Long submittedBy;

    @Schema(description = "审核时间")
    private LocalDateTime reviewedAt;

    @Schema(description = "审核人 ID")
    private Long reviewedBy;

    @Schema(description = "审核意见")
    private String reviewComment;

    @Schema(description = "发布时间")
    private LocalDateTime publishedAt;

    @Schema(description = "创建时间")
    private LocalDateTime createdAt;

    @Schema(description = "更新时间")
    private LocalDateTime updatedAt;

    @Schema(description = "包含的课程")
    private java.util.List<CoursePackageCourseItem> courses;

    @Schema(description = "开始日期（租户套餐）")
    private java.time.LocalDate startDate;

    @Schema(description = "结束日期（租户套餐）")
    private java.time.LocalDate endDate;

    @Schema(description = "排序号（在课程套餐中的顺序）")
    private Integer sortOrder;

    @Schema(description = "主题ID")
    private Long themeId;

    @Schema(description = "主题名称")
    private String themeName;

    @Schema(description = "主题颜色(hex)，来自主题字典")
    private String themeColor;

    @Schema(description = "绘本名称")
    private String pictureBookName;

    @Schema(description = "封面图片路径")
    private String coverImagePath;

    @Schema(description = "年级标签（数组）")
    private String[] gradeTags;

    @Schema(description = "领域标签（数组）")
    private String[] domainTags;

    @Schema(description = "课程时长（分钟）")
    private Integer durationMinutes;

    @Schema(description = "使用次数")
    private Integer usageCount;

    @Schema(description = "平均评分")
    private java.math.BigDecimal avgRating;

    /**
     * 课程包中的课程项
     */
    @Data
    @Schema(description = "课程包中的课程项")
    public static class CoursePackageCourseItem {
        @Schema(description = "课程 ID")
        private Long id;

        @Schema(description = "课程名称")
        private String name;

        @Schema(description = "适用年级")
        private String gradeLevel;

        @Schema(description = "排序号")
        private Integer sortOrder;

        @Schema(description = "排课计划参考数据（JSON）")
        private String scheduleRefData;

        @Schema(description = "课程类型")
        private String lessonType;
    }
}
