package com.eactive.eai.rms.onl.manage.comm.codeMan;

import java.math.BigDecimal;

import com.eactive.eai.rms.data.entity.onl.code.Code;
import com.fasterxml.jackson.annotation.JsonProperty;

import lombok.Data;

@Data
public class CodeUI {

	private String id;

	@JsonProperty("CODEGROUP")
	private String codeGroup;

	@JsonProperty("CODE")
	private String code;

	@JsonProperty("CODENAME")
	private String codeName;

	@JsonProperty("CODENAME_EN")
	private String codeName_En;

	@JsonProperty("PARENTCODE")
	private String parentCode;

	@JsonProperty("SEQ")
	private BigDecimal seq;

	@JsonProperty("USEYN")
	private String useYn;

	@JsonProperty("USEYNNAME")
	private String useYnName;

	private String parent;

	private String expanded = "true";

	private String isLeaf = "true";

	private Integer level;

	public CodeUI(Code code, Integer level) {
		this.level = level;
		this.id = code.getId().getCodegroup();
		this.parent = code.getParentcode();
		this.code = code.getId().getCode();
		this.codeGroup = code.getId().getCodegroup();
		this.parentCode = code.getParentcode();
		this.codeName = code.getCodename();
		this.codeName_En = code.getCodenameEn();
		this.seq = code.getSeq();
		this.useYn = code.getUseyn();
	}

	public CodeUI() {
	}
}
