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

import lombok.Getter;
import lombok.Setter;

import java.util.ArrayList;
import java.util.List;

@Getter
@Setter
public class WbsParseResult {

    private final List<WbsNodeDto> nodes = new ArrayList<>();
    private final List<String> errors = new ArrayList<>();

    public void addNode(WbsNodeDto node) {
        nodes.add(node);
    }

    public void addError(String error) {
        errors.add(error);
    }

    public boolean hasErrors() {
        return !errors.isEmpty();
    }

    public void setError(String error) {
        errors.add(error);
    }
}
