package com.engine.salary.entity.salaryitem.po;

import com.engine.hrmelog.annotation.ElogTransform;
import com.engine.salary.entity.salaryformula.po.FormulaPO;
import com.engine.salary.enums.SalaryRoundingModeEnum;
import com.engine.salary.enums.SalarySystemTypeEnum;
import com.engine.salary.enums.SalaryValueTypeEnum;
import com.engine.salary.enums.salaryitem.SalaryDataTypeEnum;
import com.thoughtworks.xstream.annotations.XStreamAlias;
import com.thoughtworks.xstream.annotations.XStreamAsAttribute;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Collection;
import java.util.Date;

/**
 * 薪资项目
 * <p>Copyright: Copyright (c) 2022</p>
 * <p>Company: 泛微软件</p>
 *
 * @author qiantao
 * @version 1.0
 **/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
//hrsa_salary_item
@ElogTransform(name = "薪资项目")
@XStreamAlias("SalaryItem")
public class SalaryItemPO {

    /**
     * 主键id
     */
    @ElogTransform(name = "主键id")
    @XStreamAlias("id")
    @XStreamAsAttribute
    private Long id;

    /**
     * 名称
     */
    @ElogTransform(name = "名称")
    @XStreamAlias("name")
    @XStreamAsAttribute
    private String name;

    /**
     * 编号
     */
    @ElogTransform(name = "编号")
    @XStreamAlias("code")
    @XStreamAsAttribute
    private String code;

    /**
     * 是否是系统项目
     *
     * @see SalarySystemTypeEnum
     */
    @ElogTransform(name = "是否是系统项目")
    @XStreamAlias("systemType")
    @XStreamAsAttribute
    private Integer systemType;

    /**
     * 系统薪资项目的id（是从哪个系统薪资项目复制过来的）
     */
    @ElogTransform(name = "系统薪资项目的id")
    @XStreamAlias("sysSalaryItemId")
    @XStreamAsAttribute
    private Long sysSalaryItemId;

    /**
     * 默认使用。0：默认不适用、1：默认使用
     */
    @ElogTransform(name = "默认使用")
    @XStreamAlias("useDefault")
    @XStreamAsAttribute
    private Integer useDefault;

    /**
     * 薪资档案引用。0：薪资档案未引用、1：薪资档案引用
     */
    @ElogTransform(name = "薪资档案引用")
    @XStreamAlias("useInEmployeeSalary")
    @XStreamAsAttribute
    private Integer useInEmployeeSalary;

    /**
     * 核算时隐藏
     */
    @ElogTransform(name = "核算时隐藏")
    @XStreamAlias("hideDefault")
    @XStreamAsAttribute
    private Integer hideDefault;

    /**
     * 进位规则
     *
     * @see SalaryRoundingModeEnum
     */
    @ElogTransform(name = "进位规则")
    @XStreamAlias("roundingMode")
    @XStreamAsAttribute
    private Integer roundingMode;

    /**
     * 保留的小数位数
     */
    @ElogTransform(name = "保留的小数位数")
    @XStreamAlias("pattern")
    @XStreamAsAttribute
    private Integer pattern;

    /**
     * 取值方式
     *
     * @see SalaryValueTypeEnum
     */
    @ElogTransform(name = "取值方式")
    @XStreamAlias("valueType")
    @XStreamAsAttribute
    private Integer valueType;

    /**
     * 字段类型
     *
     * @see SalaryDataTypeEnum
     */
    @ElogTransform(name = "字段类型")
    @XStreamAlias("dataType")
    @XStreamAsAttribute
    private String dataType;

    /**
     * 公式
     */
    @ElogTransform(name = "公式")
    @XStreamAlias("formulaId")
    @XStreamAsAttribute
    private Long formulaId;

    /**
     * 备注
     */
    @ElogTransform(name = "备注")
    @XStreamAlias("description")
    @XStreamAsAttribute
    private String description;

    /**
     * 是否可以编辑。0：不可编辑、1：可编辑
     */
    @ElogTransform(name = "是否可以编辑")
    @XStreamAlias("canEdit")
    @XStreamAsAttribute
    private Integer canEdit;

    /**
     * 租户key
     */
    @ElogTransform(name = "租户key")
    @XStreamAlias("tenantKey")
    @XStreamAsAttribute
    private String tenantKey;

    /**
     * 创建人id
     */
    @ElogTransform(name = "创建人id")
    @XStreamAlias("creator")
    @XStreamAsAttribute
    private Long creator;

    /**
     * 是否删除
     */
    @ElogTransform(name = "是否删除")
    @XStreamAlias("deleteType")
    @XStreamAsAttribute
    private Integer deleteType;

    /**
     * 创建时间
     */
    @ElogTransform(name = "创建时间")
    @XStreamAlias("createTime")
    @XStreamAsAttribute
    private Date createTime;

    /**
     * 更新时间
     */
    @ElogTransform(name = "更新时间")
    @XStreamAlias("updateTime")
    @XStreamAsAttribute
    private Date updateTime;

    //查询条件
    Collection<Long> ids;

    Collection<Long> sysSalaryItemIds;

    /**
     * 可见性
     */
    @ElogTransform(name = "可见性")
    @XStreamAlias("sharedType")
    @XStreamAsAttribute
    private Integer sharedType;

    /**
     * 可见范围
     */
    @ElogTransform(name = "可见范围")
    @XStreamAlias("taxAgentIds")
    @XStreamAsAttribute
    private String taxAgentIds;

    /**
     * 0不可删除，1可删除
     */
    @ElogTransform(name = "是否已经删除")
    @XStreamAlias("canDelete")
    @XStreamAsAttribute
    private Integer canDelete;

    /**
     * 排序
     */
    @ElogTransform(name = "排序")
    @XStreamAlias("sortedIndex")
    @XStreamAsAttribute
    private Integer sortedIndex;

    /**
     * 宽度
     */
    @ElogTransform(name = "宽度")
    @XStreamAlias("width")
    @XStreamAsAttribute
    private Integer width;

    /**
     * 默认值
     */
    @ElogTransform(name = "默认值")
    @XStreamAlias("defaultValue")
    @XStreamAsAttribute
    private String defaultValue;

    @XStreamAlias("Formula")
    FormulaPO formula;
}
