package kr.co.accura.wtm.domain.timesheet.rule;

import lombok.Getter;

import java.time.LocalDate;
import java.util.ArrayList;
import java.util.List;

@Getter
public class ValidationResult {

    private final List<ValidationMessage> errors = new ArrayList<>();
    private final List<ValidationMessage> warnings = new ArrayList<>();

    public void addError(LocalDate date, String message) {
        errors.add(new ValidationMessage(date, message));
    }

    public void addWarning(LocalDate date, String message) {
        warnings.add(new ValidationMessage(date, message));
    }

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

    public boolean hasWarnings() {
        return !warnings.isEmpty();
    }

    public record ValidationMessage(LocalDate date, String message) {}
}
