package com.storycove.dto;

import java.util.ArrayList;
import java.util.List;
import java.util.UUID;

public class FileImportResponse {

    private boolean success;
    private String message;
    private UUID storyId;
    private String storyTitle;
    private String fileName;
    private String fileType; // "EPUB" or "PDF"
    private Integer wordCount;
    private Integer extractedImages;
    private List<String> warnings;
    private List<String> errors;

    public FileImportResponse() {
        this.warnings = new ArrayList<>();
        this.errors = new ArrayList<>();
    }

    public FileImportResponse(boolean success, String message) {
        this();
        this.success = success;
        this.message = message;
    }

    public static FileImportResponse success(UUID storyId, String storyTitle, String fileType) {
        FileImportResponse response = new FileImportResponse(true, "File imported successfully");
        response.setStoryId(storyId);
        response.setStoryTitle(storyTitle);
        response.setFileType(fileType);
        return response;
    }

    public static FileImportResponse error(String message, String fileName) {
        FileImportResponse response = new FileImportResponse(false, message);
        response.setFileName(fileName);
        return response;
    }

    public void addWarning(String warning) {
        this.warnings.add(warning);
    }

    public void addError(String error) {
        this.errors.add(error);
    }

    public boolean isSuccess() {
        return success;
    }

    public void setSuccess(boolean success) {
        this.success = success;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public UUID getStoryId() {
        return storyId;
    }

    public void setStoryId(UUID storyId) {
        this.storyId = storyId;
    }

    public String getStoryTitle() {
        return storyTitle;
    }

    public void setStoryTitle(String storyTitle) {
        this.storyTitle = storyTitle;
    }

    public String getFileName() {
        return fileName;
    }

    public void setFileName(String fileName) {
        this.fileName = fileName;
    }

    public String getFileType() {
        return fileType;
    }

    public void setFileType(String fileType) {
        this.fileType = fileType;
    }

    public Integer getWordCount() {
        return wordCount;
    }

    public void setWordCount(Integer wordCount) {
        this.wordCount = wordCount;
    }

    public Integer getExtractedImages() {
        return extractedImages;
    }

    public void setExtractedImages(Integer extractedImages) {
        this.extractedImages = extractedImages;
    }

    public List<String> getWarnings() {
        return warnings;
    }

    public void setWarnings(List<String> warnings) {
        this.warnings = warnings;
    }

    public List<String> getErrors() {
        return errors;
    }

    public void setErrors(List<String> errors) {
        this.errors = errors;
    }
}
