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

import com.engine.salary.entity.salaryformula.po.FormulaVar;
import com.engine.salary.util.valid.DataCheck;
import com.engine.salary.util.valid.Modify;
import com.engine.salary.util.valid.ModifyTypeEnum;
import com.engine.salary.util.valid.RuntimeTypeEnum;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class SalaryFormulaSaveParam {
    /**
     * id
     */
    @DataCheck(require = true,message = "主键为空",runtime = RuntimeTypeEnum.UPDATE)
    private Long id;
    /**
     * 名称
     */
    @DataCheck(require = true,message = "名称为空")
    private String name;
    /**
     * 备注
     */
    private String description;
    /**
     * 模块
     */
    @DataCheck(require = true,message = "模块为空")
    private String module;
    /**
     * 用途
     */
    private String useFor;
    /**
     * 引用类型
     * @see com.engine.salary.enums.salaryformula.ReferenceTypeEnum
     */
    private String referenceType;
    /**
     * 返回类型
     */
    @DataCheck(require = true,message = "返回类型为空")
    private String returnType;
    /**
     * 校验类型
     */
    @DataCheck(require = true,message = "校验类型为空")
    private String validateType;
    /**
     * 扩展参数
     */
    private String extendParam;
    /**
     * 公式内容
     */
    @DataCheck(require = true,message = "公式内容为空")
    @Modify(modifyType = ModifyTypeEnum.RESTORE_SQL)
    private String formula;


    private List<FormulaVar> parameters;
}
