package top.continew.admin.business.model.req;

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

import java.io.Serial;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;

/**
 * 免费额度赠送请求信息
 *
 * @author jiay
 * @since 2025/11/17
 */
@Data
@Schema(description = "免费额度赠送请求信息")
public class FreeQuotaGrantReq implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    /**
     * 用户ID列表
     */
    @Schema(description = "用户ID列表")
    private List<Long> userIds;

    /**
     * 部门ID列表
     */
    @Schema(description = "部门ID列表")
    private List<Long> deptIds;

    /**
     * 额度配置列表（如果为空，则使用默认配置）
     */
    @Schema(description = "额度配置列表")
    private List<QuotaItem> quotaItems;

    /**
     * 额度配置项
     */
    @Data
    @Schema(description = "额度配置项")
    public static class QuotaItem implements Serializable {

        @Serial
        private static final long serialVersionUID = 1L;

        /**
         * 配置ID（从FreeQuotaConfig表获取）
         */
        @Schema(description = "配置ID", example = "1")
        private Long configId;

        /**
         * 类别编码
         */
        @Schema(description = "类别编码", example = "TOKEN")
        private String categoryCode;

        /**
         * 类别名称
         */
        @Schema(description = "类别名称", example = "大模型")
        private String categoryName;

        /**
         * 赠送额度（如果不指定，使用配置中的默认额度）
         */
        @Schema(description = "赠送额度", example = "500000")
        private BigDecimal grantQuota;

        /**
         * 计费类型
         */
        @Schema(description = "计费类型", example = "0")
        private Integer chargeType;

        /**
         * 账户类型 1:次数 2:点数
         */
        @Schema(description = "账户类型", example = "1")
        private Integer type;

        /**
         * 是否启用此项赠送
         */
        @Schema(description = "是否启用", example = "true")
        private Boolean enabled;
    }
}
