package at.procon.eventhub.tachographfilesession.dto;

import java.time.OffsetDateTime;

public record TachographEsperEventsProcessingRequest(
        OffsetDateTime occurredFrom,
        OffsetDateTime occurredTo,
        Integer significantDrivingMinutes,
        Integer minimumRestPeriodMinutes
) {
    public TachographEsperEventsProcessingRequest {
        significantDrivingMinutes = significantDrivingMinutes == null ? null : Math.max(1, significantDrivingMinutes);
        minimumRestPeriodMinutes = minimumRestPeriodMinutes == null
                ? null
                : Math.max(1, minimumRestPeriodMinutes);
    }
}
