package at.procon.dip.domain.ted.service;

/**
 * Shared package sequencing contract used to determine the next TED daily package to download.
 * <p>
 * This service encapsulates the proven sequencing rules from the legacy download implementation
 * so they can also be used by the NEW runtime without depending on the old route/service graph.
 */
public interface TedPackageSequenceService {

    /**
     * Returns the next package to download according to the current sequencing strategy,
     * or {@code null} if nothing should be downloaded right now.
     */
    PackageInfo getNextPackageToDownload();

    /**
     * Simple year/serial pair with TED package identifier helper.
     */
    record PackageInfo(int year, int serialNumber) {
        public String identifier() {
            return "%04d%05d".formatted(year, serialNumber);
        }
    }
}
