package com.oguerreiro.resilient.service.dto;

import java.time.Instant;

import com.oguerreiro.resilient.domain.enumeration.ResilientLogLevel;

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

/**
 * A DTO for the {@link com.oguerreiro.resilient.domain.ResilientLog} entity.
 */
public class ResilientLogDTO extends AbstractResilientDTO<Long> {
  private static final long serialVersionUID = 1L;

  @NotNull
  @Schema(requiredMode = Schema.RequiredMode.REQUIRED)
  private Long ownerId;

  @NotNull
  @Schema(requiredMode = Schema.RequiredMode.REQUIRED)
  private ResilientLogLevel level;

  @NotNull
  @Schema(requiredMode = Schema.RequiredMode.REQUIRED)
  private String logMessage;

  @NotNull
  @Schema(requiredMode = Schema.RequiredMode.REQUIRED)
  private Instant creationDate;

  @NotNull
  @Schema(requiredMode = Schema.RequiredMode.REQUIRED)
  private String creationUsername;

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

  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 Long getOwnerId() {
    return ownerId;
  }

  public void setOwnerId(Long ownerId) {
    this.ownerId = ownerId;
  }

  public ResilientLogLevel getLevel() {
    return level;
  }

  public void setLevel(ResilientLogLevel level) {
    this.level = level;
  }

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