package at.procon.eventhub.processing.driverworkingtime.model;

import java.time.OffsetDateTime;
import java.util.List;
import java.util.UUID;

public record DriverWorkingTimePotentialInVehicleTripInterval(
        UUID sessionId,
        String driverKey,
        OffsetDateTime startedAt,
        OffsetDateTime endedAt,
        long durationSeconds,
        String registrationKey,
        String vehicleKey,
        int containedPotentialInVehicleOvernightStayIntervalCount,
        long containedPotentialInVehicleOvernightStayDurationSeconds,
        long containedCardAbsentDurationSeconds,
        OffsetDateTime firstPotentialInVehicleOvernightStayStartedAt,
        OffsetDateTime lastPotentialInVehicleOvernightStayEndedAt,
        String firstPreviousDrivingSourceIntervalId,
        String lastNextDrivingSourceIntervalId,
        List<DriverWorkingTimeRestCoverageInterval> potentialInVehicleOvernightStayIntervals
) {
    public DriverWorkingTimePotentialInVehicleTripInterval {
        potentialInVehicleOvernightStayIntervals = potentialInVehicleOvernightStayIntervals == null
                ? List.of()
                : List.copyOf(potentialInVehicleOvernightStayIntervals);
    }
}
