package pwc.taxtech.atms.dto.vatdto;

import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Getter;
import lombok.Setter;

import java.util.HashMap;
import java.util.Map;

@Getter
@Setter
public class CellTemplateConfigGroupDto {
    Integer columnIndex;

    Integer rowIndex;

    String columnName;

    String rowName;

    Integer dataType;

    Boolean isReadOnly;
    @JsonProperty("cellTemplateID")
    Long cellTemplateId;
    @JsonProperty("reportTemplateID")
    Long reportTemplateId;

    String comment;

    public CellTemplateConfigGroupDto(Integer columnIndex, Integer rowIndex
            , String columnName, String rowName, Integer dataType, Boolean isReadOnly
            , Long cellTemplateId, Long reportTemplateId, String comment) {
        this.columnIndex = columnIndex;
        this.rowIndex = rowIndex;
        this.columnName = columnName;
        this.rowName = rowName;
        this.dataType = dataType;
        this.isReadOnly = isReadOnly;
        this.cellTemplateId = cellTemplateId;
        this.reportTemplateId = reportTemplateId;
        this.comment = comment;
    }


    public Map<String, Map<String, Object>> toStr() {
        StringBuilder sb = new StringBuilder();
        sb.append(this.getColumnIndex());
        sb.append(this.getRowIndex());
        sb.append(this.getColumnName());
        sb.append(this.getRowName());
        sb.append(this.getDataType());
        sb.append(this.getIsReadOnly());
        sb.append(this.getCellTemplateId());
        sb.append(this.getReportTemplateId());
        sb.append(this.getComment());

        Map<String, Map<String, Object>> result = new HashMap<>();

        Map<String, Object> map = new HashMap<>();
        map.put("columnIndex", this.getColumnIndex());
        map.put("rowIndex", this.getRowIndex());
        map.put("columnName", this.getColumnName());
        map.put("rowName", this.getRowName());
        map.put("dataType", this.getDataType());
        map.put("isReadOnly", this.getIsReadOnly());
        map.put("cellTemplateId", this.getCellTemplateId());
        map.put("reportTemplateId", this.getReportTemplateId());
        map.put("comment", this.getComment());

        result.put(sb.toString(), map);
        return result;
    }
}