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;

/**
 * 用户子账号余额表创建参数
 *
 * @author jiay
 * @since 2025/05/23 07:51
 */
@Data
@Schema(description = "用户子账号余额表创建参数")
public class PlantformBalanceAddReq implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    /**
     * 用户id
     */
    @Schema(description = "用户id")
    private Long userId;

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

    /**
     * 余额
     */
    @Schema(description = "余额")
    private Double balance;

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

    /**
     * 平台
     */
    @Schema(description = "平台")
    private Long platformId;

    public PlantformBalanceAddReq initPlantformBalance(CheckPlantBalanceReq req) {
        initPlantformBalance();
        this.platformId = req.getPlatformId();
        this.chargeType = req.getChargeType();
        this.type = req.getType();
        this.userId = req.getUserId();
        return this;
    }

    public PlantformBalanceAddReq initPlantformBalance() {
        this.balance = 5D;
        return this;
    }
}