package com.greenorange.promotion.model.dto.courseChapter;

import com.greenorange.promotion.annotation.EnumValue;
import com.greenorange.promotion.model.enums.PreviewPermissionEnum;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Min;
import lombok.Data;
import java.math.BigDecimal;

import java.io.Serial;
import java.io.Serializable;

/**
 * 课程章节添加请求体
 */
@Data
@Schema(description = "课程章节添加请求体", requiredProperties = {
                "name",
                "duration",
                "permissions",
                "videoView",
                "courseId",
})
public class CourseChapterAddRequest implements Serializable {

    /**
     * 章节名称
     */
    @NotBlank(message = "章节名称不能为空")
    @Schema(description = "章节名称", example = "企业经营管理者为什么必须懂财务？")
    private String name;

    /**
     * 章节时长(单位：秒)
     */
    @Min(value = 0L, message = "章节时长不能小于0")
    @Schema(description = "章节时长", example = "600")
    private Long duration;

    /**
     * 试看权限[全集试看,部分试看,关闭,开启]
     */
    @NotBlank(message = "试看权限不能为空")
    @EnumValue(enumClass = PreviewPermissionEnum.class)
    @Schema(description = "试看权限[全集试看,部分试看,关闭,开启]", example = "全集试看")
    private String permissions;

    /**
     * 视频文件 view 值
     */
    @NotBlank(message = "视频文件 view 值不能为空")
    @Schema(description = "视频文件 view 值", example = "3E29KDS9")
    private String videoView;

    /**
     * 所属课程ID
     */
    @Min(value = 1L, message = "所属课程ID ID不能小于1")
    @Schema(description = "所属课程ID", example = "1")
    private Long courseId;


    @Serial
    private static final long serialVersionUID = 1L;
}

