package com.iqser.red.service.persistence.service.v1.api.shared.model.analysislog.entitylog;

import java.time.OffsetDateTime;
import java.util.HashMap;
import java.util.Map;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class Change {

    private int analysisNumber;
    private ChangeType type;
    private OffsetDateTime dateTime;
    private Map<String, String> propertyChanges = new HashMap<>();


    public void addChange(String property, String value) {

        if (value == null) {
            return;
        }

        this.propertyChanges.put(property, value);
    }

}
