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

import java.math.BigDecimal;
import java.time.OffsetDateTime;
import java.util.Map;

/**
 * Source-neutral support-evidence view used before adapting mixed provider
 * events into a concrete processing profile. The current tachograph Esper
 * profile consumes this as geo support evidence when latitude/longitude are
 * available, while the original provider semantics remain in rawAttributes.
 */
public record RuntimeSupportEvidenceEvent(
        String eventId,
        String sourceFamily,
        String sourceKind,
        String eventDomain,
        String eventType,
        String lifecycle,
        String driverKey,
        String vehicleKey,
        String registrationKey,
        OffsetDateTime occurredAt,
        Long occurredAtEpochSecond,
        BigDecimal latitude,
        BigDecimal longitude,
        String countryCode,
        String regionCode,
        String countryFrom,
        String countryTo,
        String operation,
        Long odometerKm,
        BigDecimal speedKmh,
        BigDecimal maxSpeedKmh,
        Map<String, Object> rawAttributes
) {
    public RuntimeSupportEvidenceEvent {
        rawAttributes = rawAttributes == null ? Map.of() : Map.copyOf(rawAttributes);
    }
}
