package kr.co.accura.wtm.domain.wbs.dto;

import kr.co.accura.wtm.domain.wbs.entity.CanonicalWbs;

public record CanonicalWbsDto(
        Long id,
        Long projectId,
        String wbsCode,
        Integer level,
        String name,
        String parentCode,
        String discipline,
        Boolean isActive,
        String mappedP6Code
) {
    public static CanonicalWbsDto from(CanonicalWbs cw) {
        return new CanonicalWbsDto(
                cw.getId(),
                cw.getProjectId(),
                cw.getWbsCode(),
                cw.getLevel(),
                cw.getName(),
                cw.getParentCode(),
                cw.getDiscipline(),
                cw.getIsActive(),
                cw.getMappedP6Code()
        );
    }
}
