package com.ylx.attendanceconfig.domain.dto;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.DecimalMin;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;

@Data
@ApiModel("考勤扣款区间DTO")
public class AttendanceDeductionRuleDTO implements Serializable {
    private static final long serialVersionUID = -8789319415530497294L;

    @ApiModelProperty("扣款区间ID，新增时可不传")
    private Long id;

    @ApiModelProperty("规则类型：1=早退时长扣款，不传默认1")
    private Integer ruleType;

    @NotNull(message = "开始分钟数不能为空")
    @Min(value = 1, message = "开始分钟数必须大于0")
    @ApiModelProperty(value = "开始分钟数，包含该值", required = true)
    private Integer startMinutes;

    @NotNull(message = "结束分钟数不能为空")
    @Min(value = 1, message = "结束分钟数必须大于0")
    @ApiModelProperty(value = "结束分钟数，包含该值", required = true)
    private Integer endMinutes;

    @NotNull(message = "扣款金额不能为空")
    @DecimalMin(value = "0", message = "扣款金额不能小于0")
    @ApiModelProperty(value = "扣款金额，单位：元", required = true)
    private BigDecimal deductAmount;
}
