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

import com.engine.salary.enums.salarybill.SalaryTemplateTextContentPositionEnum;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

/**
 * @Description: 工资单模板
 * @Author: wangxiangzhong
 * @Date: 2021-12-08 14:44
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
////"主题及其他设置")
public class SalaryTemplateShowSetDTO {

//   工资单主题")
    private String theme;

//   工资单背景图")
    private String background;

//   文本内容")
    private String textContent;

//   文本内容位置")
    private String textContentPosition;

    private List<Map<String, Object>> getTextContentPositionOptions () {
        return Arrays.stream(SalaryTemplateTextContentPositionEnum.values())
                .map(m->
                {
                    Map<String, Object> map = new HashMap<>();
                    map.put("id", String.valueOf(m.getValue()));
                    map.put("content", m.getDefaultLabel());
                    return map;
                })
                .collect(Collectors.toList());
    }

//   薪资项为空时不显示")
    private Boolean salaryItemNullStatus;


//   薪资项为0时不显示")
    private Boolean salaryItemZeroStatus;

}
