package com.engine.salary.entity.salarysob.dto;

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;

import java.util.List;

/**
 * @author Harryxzy
 * @date 2022/11/15 16:00
 * @description
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class SalarySobBackItemAggregateDTO {

    // 薪资账套的id
    @JsonSerialize(using = ToStringSerializer.class)
    private Long salarySobId;

    // 已发项目设置
    private List<SalarySobBackItemDTO> issuedItems;

    // 补发项目设置
    private List<SalarySobBackItemDTO> reissueItems;

    @Data
    @Builder
    @NoArgsConstructor
    @AllArgsConstructor
    public static class SalarySobBackItemDTO{

        // 主键id
        @JsonSerialize(using = ToStringSerializer.class)
        private Long id;

        // 薪资项目的名称
        private String name;

        // 薪资项目的id
        @JsonSerialize(using = ToStringSerializer.class)
        private Long salaryItemId;

        // 公式id
        @JsonSerialize(using = ToStringSerializer.class)
        private Long formulaId;

        // 公式详情
        private String formulaContent;

        // 字段类型
        private String dataType;

        // 显示顺序
        private Integer sortedIndex;

        // 是否可以编辑
        private boolean canEdit;

        // 是否可以删除
        private boolean canDelete;

        private String backCalcType;
    }
}

