package p.packer.dtos;

import java.util.List;
import java.util.Objects;

public record PackerBankCompositionDetailsDTO(
        List<PackerBankCompositionFileDTO> availableFiles,
        List<PackerBankCompositionFileDTO> selectedFiles,
        long measuredBankSizeBytes) {

    public PackerBankCompositionDetailsDTO {
        availableFiles = List.copyOf(Objects.requireNonNull(availableFiles, "availableFiles"));
        selectedFiles = List.copyOf(Objects.requireNonNull(selectedFiles, "selectedFiles"));
        if (measuredBankSizeBytes < 0L) {
            throw new IllegalArgumentException("measuredBankSizeBytes must be non-negative");
        }
    }
}
