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

import com.ruoyi.common.constants.DictTypeConstants;
import com.ruoyi.ss.device.domain.vo.DeviceVO;
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;

/**
 * 下单使用设备的参数
 * @author wjh
 * 2024/7/24
 */
@Data
public class TimeBillAddOrderDTO {

    @ApiModelProperty("设备ID")
    @NotNull(message = "设备ID不允许为空")
    private Long deviceId;

    @ApiModelProperty("设备起步时长")
    @NotNull(message = "设备起步时长不允许为空")
    @Min(value = 0, message = "设备起步时长不允许小于0")
    private Integer deviceStartTime;

    @ApiModelProperty("设备起步时长单位")
    @NotBlank(message = "设备起步时长单位不允许为空")
    @DictValid(type = DictTypeConstants.TIME_UNIT, message = "非法的时长单位")
    private String deviceStartUnit;

    @ApiModelProperty("设备起步价格")
    @NotNull(message = "设备起步价格不允许为空")
    @Min(value = 0, message = "设备起步价格不允许小于0")
    private BigDecimal deviceStartPrice;

    @ApiModelProperty("设备超出起步时长")
    @NotNull(message = "设备超出起步时长不允许为空")
    @Min(value = 0, message = "设备超出起步时长不允许小于0")
    private Integer deviceOverTime;

    @ApiModelProperty("设备超出起步时长单位")
    @NotBlank(message = "设备超出起步时长单位不允许为空")
    @DictValid(type = DictTypeConstants.TIME_UNIT, message = "非法的时长单位")
    private String deviceOverUnit;

    @ApiModelProperty("设备超出起步时长价格")
    @NotNull(message = "设备超出起步时长价格不允许为空")
    @Min(value = 0, message = "设备超出起步时长价格不允许小于0")
    private BigDecimal deviceOverPrice;

    @ApiModelProperty("用户ID")
    private Long userId;

    @ApiModelProperty("设备")
    private DeviceVO device;

}
