package com.ruoyi.ss.transactionBill.domain.dto;

import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.constants.DictTypeConstants;
import com.ruoyi.common.validRule.allowSize.AllowSize;
import com.ruoyi.common.validRule.deviceNoExist.DeviceNoExist;
import com.ruoyi.common.validRule.suitExist.SuitExist;
import com.ruoyi.system.valid.DictValid;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.util.List;

/**
 * @author wjh
 * 2024/8/14
 */
@Data
public class RechargeDTO {

    @ApiModelProperty("设备编号")
    @NotBlank(message = "设备编号不允许为空")
    @DeviceNoExist(message = "设备不存在")
    private String deviceNo;

    @ApiModelProperty("套餐ID")
    @NotNull(message = "套餐ID不允许为空")
    @SuitExist(message = "套餐不存在")
    private Long suitId;

    @ApiModelProperty("交易金额")
    @NotNull(message = "交易金额不允许为空")
    @Min(value = 0, message = "交易金额不允许小于0")
    private BigDecimal money;

    @ApiModelProperty("套餐时长/度数")
    @Min(value = 0, message = "套餐时长/度数不允许小于0")
    private Integer suitTime;

    @ApiModelProperty("套餐时长单位")
    @DictValid(type = DictTypeConstants.TIME_UNIT, message = "非法的套餐时长单位")
    private String suitTimeUnit;

    @ApiModelProperty("套餐收费模式")
    @NotBlank(message = "套餐收费模式不允许为空")
    @DictValid(type = DictTypeConstants.SUIT_FEE_MODE, message = "非法的套餐收费模式")
    private String suitFeeMode;

    @ApiModelProperty("套餐收费类型")
    @NotBlank(message = "套餐收费类型不允许为空")
    @DictValid(type = DictTypeConstants.SUIT_FEE_TYPE, message = "非法的套餐收费类型")
    private String suitFeeType;

    @ApiModelProperty("套餐金额")
    @NotNull(message = "套餐金额不允许为空")
    @Min(value = 0, message = "套餐金额不允许小于0")
    private BigDecimal suitPrice;

    @ApiModelProperty("套餐押金")
    @Min(value = 0, message = "套餐押金不允许小于0")
    private BigDecimal suitDeposit;

    @ApiModelProperty("套餐档位金额列表")
    @AllowSize(sizes = {0, 4}, message = "套餐档位金额列表大小仅允许为0或者4")
    private List<BigDecimal> suitGearAmount;

    @ApiModelProperty("套餐时段档位列表")
    @AllowSize(sizes = {0, 24}, message = "套餐时段档位列表大小仅允许为0或者24")
    private List<Integer> suitGearTime;

}
