package com.oguerreiro.resilient.service.dto;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.persistence.Lob;
import jakarta.validation.constraints.NotNull;

/**
 * A DTO for the {@link com.oguerreiro.resilient.domain.Document} entity.
 */
@Schema(description = "Document with attach")
public class DocumentDTO extends AbstractResilientDTO<Long> {
  private static final long serialVersionUID = 1L;

  @NotNull
  @Schema(description = "A simple and small text with a title, for human reference and better relation", requiredMode = Schema.RequiredMode.REQUIRED)
  private String title;

  @Schema(description = "An additional optional description")
  private String description;

  @Schema(description = "An Excel file, that must match a template for input", requiredMode = Schema.RequiredMode.REQUIRED)
  @Lob
  private byte[] dataFile;

  private String dataFileContentType;

  public String getTitle() {
    return title;
  }

  public void setTitle(String title) {
    this.title = title;
  }

  public String getDescription() {
    return description;
  }

  public void setDescription(String description) {
    this.description = description;
  }

  public byte[] getDataFile() {
    return dataFile;
  }

  public void setDataFile(byte[] dataFile) {
    this.dataFile = dataFile;
  }

  public String getDataFileContentType() {
    return dataFileContentType;
  }

  public void setDataFileContentType(String dataFileContentType) {
    this.dataFileContentType = dataFileContentType;
  }

//@formatter:off
  @Override
  public String toString() {
    return "InputDataUploadDTO{" + 
              "id=" + getId() + 
              ", title='" + getTitle() + "'" +
              ", description='" + getDescription() + "'" + 
              ", dataFile='" + getDataFile() + "'" + 
              ", version=" + getVersion() + 
           "}";
  }
//@formatter:on
}
