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

import kr.co.accura.wtm.domain.wbs.entity.WbsDisciplineAssignment;
import lombok.*;

@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class WbsDisciplineAssignmentDto {

    private Long id;
    private Long canonicalWbsId;
    private String discipline;
    private Boolean isActive;

    public static WbsDisciplineAssignmentDto from(WbsDisciplineAssignment entity) {
        return WbsDisciplineAssignmentDto.builder()
                .id(entity.getId())
                .canonicalWbsId(entity.getCanonicalWbs().getId())
                .discipline(entity.getDiscipline())
                .isActive(entity.getIsActive())
                .build();
    }
}
