package at.procon.eventhub.processing.eventprocessing.dto;

import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.Map;

public record RuntimeEventProcessingPartitionResultDto(
        String partitionType,
        String partitionKey,
        String resultType,
        Object result,
        Map<String, Object> metadata
) {
    public RuntimeEventProcessingPartitionResultDto {
        metadata = metadata == null ? Map.of() : Collections.unmodifiableMap(new LinkedHashMap<>(metadata));
    }
}
