package com.oguerreiro.resilient.service.dto;

import java.math.BigDecimal;

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

/**
 * A DTO for the {@link com.oguerreiro.resilient.domain.OutputData} entity.
 */
@Schema(description = "Output data Values\nThe values calculated using the Variable.outputFormula, for all variables with Variable.output==TRUE.")
public class OutputDataDTO extends AbstractResilientDTO<Long> {
  private static final long serialVersionUID = 1L;

  @NotNull
  @Schema(description = "The evaluated value, calculated by Variable.outputFormula. This will probably represent an emission value.", requiredMode = Schema.RequiredMode.REQUIRED)
  private BigDecimal value;

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

  private VariableDTO variable;

  private PeriodDTO period;

  private PeriodVersionDTO periodVersion;

  private UnitDTO baseUnit;

  private OrganizationDTO owner;

  public BigDecimal getValue() {
    return value;
  }

  public void setValue(BigDecimal value) {
    this.value = value;
  }

  public Integer getVersion() {
    return version;
  }

  public void setVersion(Integer version) {
    this.version = version;
  }

  public VariableDTO getVariable() {
    return variable;
  }

  public void setVariable(VariableDTO variable) {
    this.variable = variable;
  }

  public PeriodDTO getPeriod() {
    return period;
  }

  public void setPeriod(PeriodDTO period) {
    this.period = period;
  }

  public PeriodVersionDTO getPeriodVersion() {
    return periodVersion;
  }

  public void setPeriodVersion(PeriodVersionDTO periodVersion) {
    this.periodVersion = periodVersion;
  }

  public UnitDTO getBaseUnit() {
    return baseUnit;
  }

  public void setBaseUnit(UnitDTO baseUnit) {
    this.baseUnit = baseUnit;
  }

  public OrganizationDTO getOwner() {
    return owner;
  }

  public void setOwner(OrganizationDTO owner) {
    this.owner = owner;
  }

  //@formatter:off
  @Override
  public String toString() {
    return "OutputDataDTO{" + 
              "id=" + getId() + 
              ", value=" + getValue() + 
              ", variable=" + getVariable() + 
              ", period=" + getPeriod() + 
              ", periodVersion=" + getPeriodVersion() + 
              ", baseUnit=" + getBaseUnit() + 
              ", version=" + getVersion() + 
           "}";
  }
  //@formatter:on
}
