package com.engine.salary.entity.datacollection.param;

import com.engine.salary.enums.salaryitem.SalaryDataTypeEnum;
import com.engine.salary.util.valid.DataCheck;
import com.engine.salary.util.valid.RuntimeTypeEnum;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * <p>Copyright: Copyright (c) 2024</p>
 * <p>Company: 泛微软件</p>
 *
 * @author xzy
 * @version 1.0
 **/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class VariableItemSaveParam {

    //主键id
    @JsonSerialize(using = ToStringSerializer.class)
    @DataCheck(require = true, runtime = {RuntimeTypeEnum.UPDATE}, message = "id不允许为空")
    private Long id;

    //名称
    @DataCheck(require = true, max = 40, message = "名称不允许为空,名称不能超过40个字符")
    private String name;

    /**
     * 字段类型
     * @see SalaryDataTypeEnum
     */
    @DataCheck(require = true, message = "字段类型不允许为空")
    private String dataType;
}
