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

import kr.co.accura.wtm.domain.wbs.entity.WbsNode;
import lombok.Getter;

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

@Getter
public class WbsCompareResult {

    private final List<WbsNodeDto> added = new ArrayList<>();
    private final List<WbsNodeDto> removed = new ArrayList<>();
    private final List<ModifiedEntry> modified = new ArrayList<>();

    public void addAdded(WbsNode node) {
        added.add(WbsNodeDto.from(node));
    }

    public void addRemoved(WbsNode node) {
        removed.add(WbsNodeDto.from(node));
    }

    public void addModified(WbsNode before, WbsNode after) {
        modified.add(new ModifiedEntry(WbsNodeDto.from(before), WbsNodeDto.from(after)));
    }

    public record ModifiedEntry(WbsNodeDto before, WbsNodeDto after) {
    }
}
