package com.oguerreiro.resilient.service.dto;

import java.math.BigDecimal;

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

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

  @NotNull
  @Schema(description = "Year that the factor belongs to", requiredMode = Schema.RequiredMode.REQUIRED)
  private Integer year;

  @NotNull
  @Pattern(regexp = "^[0-9]*$")
  @Schema(description = "Unique key, within the year", requiredMode = Schema.RequiredMode.REQUIRED)
  private String code;

  @NotNull
  @Schema(description = "The name or title for the Emission factor", requiredMode = Schema.RequiredMode.REQUIRED)
  private String name;

  @NotNull
  @Schema(description = "The unit of the Emission Factor.", requiredMode = Schema.RequiredMode.REQUIRED)
  private String unit;

  @NotNull
  @Schema(description = "The value of the factor.", requiredMode = Schema.RequiredMode.REQUIRED)
  private BigDecimal value;

  @Schema(description = "The source of the Emission Factor.")
  private String source;

  @Schema(description = "Comments")
  private String comments;

  private VariableScopeDTO variableScope;

  private VariableCategoryDTO variableCategory;

  public Integer getYear() {
    return year;
  }

  public void setYear(Integer year) {
    this.year = year;
  }

  public String getCode() {
    return code;
  }

  public void setCode(String code) {
    this.code = code;
  }

  public String getName() {
    return name;
  }

  public void setName(String name) {
    this.name = name;
  }

  public String getUnit() {
    return unit;
  }

  public void setUnit(String unit) {
    this.unit = unit;
  }

  public BigDecimal getValue() {
    return value;
  }

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

  public String getSource() {
    return source;
  }

  public void setSource(String source) {
    this.source = source;
  }

  public String getComments() {
    return comments;
  }

  public void setComments(String comments) {
    this.comments = comments;
  }

  public VariableScopeDTO getVariableScope() {
    return variableScope;
  }

  public void setVariableScope(VariableScopeDTO variableScope) {
    this.variableScope = variableScope;
  }

  public VariableCategoryDTO getVariableCategory() {
    return variableCategory;
  }

  public void setVariableCategory(VariableCategoryDTO variableCategory) {
    this.variableCategory = variableCategory;
  }

//@formatter:off
  @Override
  public String toString() {
    return "EmissionFactorDTO{" + 
              "id=" + getId() + 
              ", year='" + getYear() + 
              ", code='" + getCode() + "'" + 
              ", name='" + getName() + "'" + 
              ", unit='" + getUnit() + "'" + 
              ", value=" + getValue() + 
              ", source='" + getSource() + "'" + 
              ", comments='" + getComments() + "'" + 
              ", variableScope=" + getVariableScope() + 
              ", variableCategory=" + getVariableCategory() + 
              ", version=" + getVersion() + 
           "}";
  }
//@formatter:on
}
