package cn.novalon.gym.manage.groupcourse.domain;

import cn.novalon.gym.manage.sys.core.domain.BaseDomain;
import io.swagger.v3.oas.annotations.media.Schema;

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

/**
 * 团课完整信息领域模型
 * 包含团课基础信息、关联的类型信息以及类型的标签信息
 */
public class GroupCourseDetail extends BaseDomain {

    // ===== 团课基础信息 =====
    
    @Schema(description = "课程名称", example = "瑜伽入门")
    private String courseName;

    @Schema(description = "教练ID", example = "1")
    private Long coachId;

    @Schema(description = "课程类型ID", example = "1")
    private Long courseType;

    @Schema(description = "开始时间", example = "2026-06-02T09:00:00")
    private LocalDateTime startTime;

    @Schema(description = "结束时间", example = "2026-06-02T10:00:00")
    private LocalDateTime endTime;

    @Schema(description = "最大参与人数", example = "20")
    private Integer maxMembers;

    @Schema(description = "当前参与人数", example = "15")
    private Integer currentMembers;

    @Schema(description = "课程状态", example = "0")
    private Long status;

    @Schema(description = "上课地点", example = "健身房A区")
    private String location;

    @Schema(description = "封面图URL", example = "https://example.com/yoga.jpg")
    private String coverImage;

    @Schema(description = "课程描述", example = "适合初学者的瑜伽课程")
    private String description;

    @Schema(description = "点卡额度（消耗次数）", example = "1")
    private Integer pointCardAmount;

    @Schema(description = "储值卡额度（消耗金额）", example = "50.00")
    private BigDecimal storedValueAmount;

    @Schema(description = "二维码路径", example = "D:\\Games\\exmp\\image\\abc123_20260618120000.png")
    private String qrCodePath;

    // ===== 关联的类型信息 =====

    @Schema(description = "类型信息")
    private GroupCourseType typeInfo;

    // ===== 快捷访问属性（从类型信息派生）=====

    @Schema(description = "类型名称", example = "瑜伽入门")
    private String typeName;

    @Schema(description = "类型分类", example = "柔韧与平衡类")
    private String typeCategory;

    @Schema(description = "基础难度", example = "2")
    private Integer baseDifficulty;

    @Schema(description = "难度等级描述", example = "初级")
    private String difficultyLevel;

    @Schema(description = "综合难度系数", example = "2")
    private Integer calculatedDifficulty;

    // ===== 标签信息（从类型标签派生）=====

    @Schema(description = "标签列表")
    private List<CourseLabel> labels;

    // ===== Getters and Setters =====

    public String getCourseName() {
        return courseName;
    }

    public void setCourseName(String courseName) {
        this.courseName = courseName;
    }

    public Long getCoachId() {
        return coachId;
    }

    public void setCoachId(Long coachId) {
        this.coachId = coachId;
    }

    public Long getCourseType() {
        return courseType;
    }

    public void setCourseType(Long courseType) {
        this.courseType = courseType;
    }

    public LocalDateTime getStartTime() {
        return startTime;
    }

    public void setStartTime(LocalDateTime startTime) {
        this.startTime = startTime;
    }

    public LocalDateTime getEndTime() {
        return endTime;
    }

    public void setEndTime(LocalDateTime endTime) {
        this.endTime = endTime;
    }

    public Integer getMaxMembers() {
        return maxMembers;
    }

    public void setMaxMembers(Integer maxMembers) {
        this.maxMembers = maxMembers;
    }

    public Integer getCurrentMembers() {
        return currentMembers;
    }

    public void setCurrentMembers(Integer currentMembers) {
        this.currentMembers = currentMembers;
    }

    public Long getStatus() {
        return status;
    }

    public void setStatus(Long status) {
        this.status = status;
    }

    public String getLocation() {
        return location;
    }

    public void setLocation(String location) {
        this.location = location;
    }

    public String getCoverImage() {
        return coverImage;
    }

    public void setCoverImage(String coverImage) {
        this.coverImage = coverImage;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public Integer getPointCardAmount() {
        return pointCardAmount;
    }

    public void setPointCardAmount(Integer pointCardAmount) {
        this.pointCardAmount = pointCardAmount;
    }

    public BigDecimal getStoredValueAmount() {
        return storedValueAmount;
    }

    public void setStoredValueAmount(BigDecimal storedValueAmount) {
        this.storedValueAmount = storedValueAmount;
    }

    public String getQrCodePath() {
        return qrCodePath;
    }

    public void setQrCodePath(String qrCodePath) {
        this.qrCodePath = qrCodePath;
    }

    public GroupCourseType getTypeInfo() {
        return typeInfo;
    }

    public void setTypeInfo(GroupCourseType typeInfo) {
        this.typeInfo = typeInfo;
        // 同步派生属性
        if (typeInfo != null) {
            this.typeName = typeInfo.getTypeName();
            this.typeCategory = typeInfo.getCategory();
            this.baseDifficulty = typeInfo.getBaseDifficulty();
            this.difficultyLevel = typeInfo.getDifficultyLevel();
            this.calculatedDifficulty = typeInfo.getCalculatedDifficulty();
            this.labels = typeInfo.getLabels();
        }
    }

    public String getTypeName() {
        return typeName;
    }

    public void setTypeName(String typeName) {
        this.typeName = typeName;
    }

    public String getTypeCategory() {
        return typeCategory;
    }

    public void setTypeCategory(String typeCategory) {
        this.typeCategory = typeCategory;
    }

    public Integer getBaseDifficulty() {
        return baseDifficulty;
    }

    public void setBaseDifficulty(Integer baseDifficulty) {
        this.baseDifficulty = baseDifficulty;
    }

    public String getDifficultyLevel() {
        return difficultyLevel;
    }

    public void setDifficultyLevel(String difficultyLevel) {
        this.difficultyLevel = difficultyLevel;
    }

    public Integer getCalculatedDifficulty() {
        return calculatedDifficulty;
    }

    public void setCalculatedDifficulty(Integer calculatedDifficulty) {
        this.calculatedDifficulty = calculatedDifficulty;
    }

    public List<CourseLabel> getLabels() {
        return labels;
    }

    public void setLabels(List<CourseLabel> labels) {
        this.labels = labels;
    }
}