package at.procon.eventhub.tachograph.dto;

import at.procon.eventhub.importing.ExtractionBatchResult;
import java.time.OffsetDateTime;
import java.util.Map;
import java.util.UUID;

public record TachographExtractionBatchResultDto(
        UUID packageId,
        String extractionCode,
        String sourceKind,
        int sourceRowsRead,
        int eventsMapped,
        int eventsInserted,
        int alreadyImported,
        boolean executed,
        OffsetDateTime lastSourcePackageImportedAt,
        String lastSourcePackageId,
        OffsetDateTime lastSourceRowUpdatedAt,
        OffsetDateTime lastOccurredTo,
        Map<String, Integer> eventTypeCounts
) implements ExtractionBatchResult {

    public TachographExtractionBatchResultDto {
        eventTypeCounts = eventTypeCounts == null ? Map.of() : Map.copyOf(eventTypeCounts);
    }
}
