package com.storycove.dto;

import jakarta.validation.constraints.NotNull;

import java.util.List;
import java.util.Map;
import java.util.UUID;

public class ZIPImportRequest {

    @NotNull(message = "ZIP session ID is required")
    private String zipSessionId; // Temporary ID for the uploaded ZIP file

    @NotNull(message = "Selected files are required")
    private List<String> selectedFiles; // List of file names to import

    // Per-file metadata overrides (key = fileName)
    private Map<String, FileImportMetadata> fileMetadata;

    // Default metadata for all files (if not specified per file)
    private UUID defaultAuthorId;
    private String defaultAuthorName;
    private UUID defaultSeriesId;
    private String defaultSeriesName;
    private List<String> defaultTags;

    private Boolean createMissingAuthor = true;
    private Boolean createMissingSeries = true;
    private Boolean extractImages = true;

    public ZIPImportRequest() {}

    public static class FileImportMetadata {
        private UUID authorId;
        private String authorName;
        private UUID seriesId;
        private String seriesName;
        private Double seriesVolume;
        private List<String> tags;

        public UUID getAuthorId() {
            return authorId;
        }

        public void setAuthorId(UUID authorId) {
            this.authorId = authorId;
        }

        public String getAuthorName() {
            return authorName;
        }

        public void setAuthorName(String authorName) {
            this.authorName = authorName;
        }

        public UUID getSeriesId() {
            return seriesId;
        }

        public void setSeriesId(UUID seriesId) {
            this.seriesId = seriesId;
        }

        public String getSeriesName() {
            return seriesName;
        }

        public void setSeriesName(String seriesName) {
            this.seriesName = seriesName;
        }

        public Double getSeriesVolume() {
            return seriesVolume;
        }

        public void setSeriesVolume(Double seriesVolume) {
            this.seriesVolume = seriesVolume;
        }

        public List<String> getTags() {
            return tags;
        }

        public void setTags(List<String> tags) {
            this.tags = tags;
        }
    }

    public String getZipSessionId() {
        return zipSessionId;
    }

    public void setZipSessionId(String zipSessionId) {
        this.zipSessionId = zipSessionId;
    }

    public List<String> getSelectedFiles() {
        return selectedFiles;
    }

    public void setSelectedFiles(List<String> selectedFiles) {
        this.selectedFiles = selectedFiles;
    }

    public Map<String, FileImportMetadata> getFileMetadata() {
        return fileMetadata;
    }

    public void setFileMetadata(Map<String, FileImportMetadata> fileMetadata) {
        this.fileMetadata = fileMetadata;
    }

    public UUID getDefaultAuthorId() {
        return defaultAuthorId;
    }

    public void setDefaultAuthorId(UUID defaultAuthorId) {
        this.defaultAuthorId = defaultAuthorId;
    }

    public String getDefaultAuthorName() {
        return defaultAuthorName;
    }

    public void setDefaultAuthorName(String defaultAuthorName) {
        this.defaultAuthorName = defaultAuthorName;
    }

    public UUID getDefaultSeriesId() {
        return defaultSeriesId;
    }

    public void setDefaultSeriesId(UUID defaultSeriesId) {
        this.defaultSeriesId = defaultSeriesId;
    }

    public String getDefaultSeriesName() {
        return defaultSeriesName;
    }

    public void setDefaultSeriesName(String defaultSeriesName) {
        this.defaultSeriesName = defaultSeriesName;
    }

    public List<String> getDefaultTags() {
        return defaultTags;
    }

    public void setDefaultTags(List<String> defaultTags) {
        this.defaultTags = defaultTags;
    }

    public Boolean getCreateMissingAuthor() {
        return createMissingAuthor;
    }

    public void setCreateMissingAuthor(Boolean createMissingAuthor) {
        this.createMissingAuthor = createMissingAuthor;
    }

    public Boolean getCreateMissingSeries() {
        return createMissingSeries;
    }

    public void setCreateMissingSeries(Boolean createMissingSeries) {
        this.createMissingSeries = createMissingSeries;
    }

    public Boolean getExtractImages() {
        return extractImages;
    }

    public void setExtractImages(Boolean extractImages) {
        this.extractImages = extractImages;
    }
}
