package com.oguerreiro.resilient.service.dto;

import java.time.Instant;

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

/**
 * A DTO for the {@link com.oguerreiro.resilient.domain.InputDataUploadLog} entity.
 */
@Schema(description = "Input data upload file\nUsers can upload an Excel file with InputData that will automatically insert values in the table InputData")
public class InputDataUploadLogDTO extends AbstractResilientDTO<Long> {
  private static final long serialVersionUID = 1L;

  @NotNull
  @Schema(description = "The log of the event. Eg. \"InputDataUpload created\"; \"InputDataUpload replaced with new file\"; \"125 records inserted\"; \"User XPTO confirmed the file replacement.\"", requiredMode = Schema.RequiredMode.REQUIRED)
  private String logMessage;

  @NotNull
  @Schema(description = "The creation date (insert). When the data was inserted into the system.", requiredMode = Schema.RequiredMode.REQUIRED)
  private Instant creationDate;

  @NotNull
  @Schema(description = "The actual username logged into the system, that inserted the data. NOT a reference to the user, but the login username.", requiredMode = Schema.RequiredMode.REQUIRED)
  private String creationUsername;

  @Schema(description = "Record version for concurrency control.")
  private Integer version;

  private InputDataUploadDTO inputDataUpload;

  public String getLogMessage() {
    return logMessage;
  }

  public void setLogMessage(String logMessage) {
    this.logMessage = logMessage;
  }

  public Instant getCreationDate() {
    return creationDate;
  }

  public void setCreationDate(Instant creationDate) {
    this.creationDate = creationDate;
  }

  public String getCreationUsername() {
    return creationUsername;
  }

  public void setCreationUsername(String creationUsername) {
    this.creationUsername = creationUsername;
  }

  public InputDataUploadDTO getInputDataUpload() {
    return inputDataUpload;
  }

  public void setInputDataUpload(InputDataUploadDTO inputDataUpload) {
    this.inputDataUpload = inputDataUpload;
  }

//@formatter:off
  @Override
  public String toString() {
    return "InputDataUploadLogDTO{" + 
              "id=" + getId() + 
              ", logMessage='" + getLogMessage() + "'" + 
              ", creationDate='" + getCreationDate() + "'" + 
              ", creationUsername='" + getCreationUsername() + "'" + 
              ", inputDataUpload=" + getInputDataUpload() + 
              ", version=" + getVersion() +
           "}";
  }
//@formatter:on
}
