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

import com.engine.salary.exception.SalaryRunTimeException;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.commons.lang3.StringUtils;

/**
 * @Description: 工资单模板
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
////"工资单复制参数")
public class SalaryTemplateCopyParam {

//   主键")
    private Long id;

//   模板名称")
    private String name;

    private Long salarySobId;

    public static void checkParam(SalaryTemplateCopyParam copyParam) {
        if (copyParam.getId() == null) {
            throw new SalaryRunTimeException("id必选");
        }
        if (StringUtils.isEmpty(copyParam.getName())) {
            throw new SalaryRunTimeException("模板名称必填");
        }
    }
}
