package cn.yunzhixue.ability.center.examsprint.domain.report;

import java.net.URI;
import java.time.Duration;
import java.time.Instant;
import java.util.Optional;

public interface ExamSprintReportStorage {

    StoredExamSprintReportFile upload(
            String reportId,
            ReportType reportType,
            String fileName,
            byte[] pdfBytes,
            Instant expiresAt);

    URI generateDownloadUrl(String storageObjectKey, Duration ttl);

    Optional<StoredExamSprintReportContent> download(String storageObjectKey);

    void delete(String storageObjectKey);

    record StoredExamSprintReportFile(String storageObjectKey, String fileName) {
    }

    record StoredExamSprintReportContent(String fileName, byte[] bytes, String contentType) {
    }
}
