package com.xindazhou.user.controller.admin.level.vo.level;

import com.xindazhou.framework.common.enums.CommonStatusEnum;
import com.xindazhou.framework.common.validation.InEnum;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.hibernate.validator.constraints.Range;
import org.hibernate.validator.constraints.URL;

import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Positive;

/**
 * 会员等级 Base VO，提供给添加、修改、详细的子 VO 使用
 * 如果子 VO 存在差异的字段，请不要添加到这里，影响 Swagger 文档生成
 */
@Data
public class MemberLevelBaseVO {

    @Schema(description = "等级名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "xdz")
    @NotBlank(message = "等级名称不能为空")
    private String name;

    @Schema(description = "升级经验", example = "100")
    @Positive(message = "升级经验必须大于 0")
    private Integer experience;

    @Schema(description = "等级", example = "1")
    @Positive(message = "等级必须大于 0")
    private Integer level;

    @Schema(description = "享受折扣", example = "98")
    @Range(min = 0, max = 100, message = "享受折扣的范围为 0-100")
    private Integer discountPercent;

    @Schema(description = "等级图标", example = "")
    @URL(message = "等级图标必须是 URL 格式")
    private String icon;

    @Schema(description = "等级背景图", example = "")
    @URL(message = "等级背景图必须是 URL 格式")
    private String backgroundUrl;

    @Schema(description = "状态", example = "1")
    @InEnum(CommonStatusEnum.class)
    private Integer status;

    @Schema(description = "成长值下限", example = "0")
    private Integer minExperience;

    @Schema(description = "成长值上限", example = "100")
    private Integer maxExperience;

    @Schema(description = "是否默认等级", example = "false")
    private Boolean isDefault;

    @Schema(description = "备注", example = "普通会员等级")
    private String remark;

}
