package com.oguerreiro.resilient.service.dto;

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.VariableScope} entity.
 */
@Schema(description = "Variable Scope\nExample: GEE Scope 1/2/3 or General Info")
public class VariableScopeDTO extends AbstractResilientDTO<Long> {
  private static final long serialVersionUID = 1L;

  @NotNull
  @Pattern(regexp = "^[0-9]*$")
  @Schema(description = "Unique key, user defined.\nBe aware, that this will be used to create the Variable.code\nNOTE: The field type is string, but restricted to only numbers", requiredMode = Schema.RequiredMode.REQUIRED)
  private String code;

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

  @NotNull
  @Schema(description = "A description or usage of this scope", requiredMode = Schema.RequiredMode.REQUIRED)
  private String description;

  private Boolean hiddenForData;
  private Boolean hiddenForFactor;

  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 getDescription() {
    return description;
  }

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

  public Boolean getHiddenForData() {
    return hiddenForData;
  }

  public void setHiddenForData(Boolean hiddenForData) {
    this.hiddenForData = hiddenForData;
  }

  public Boolean getHiddenForFactor() {
    return hiddenForFactor;
  }

  public void setHiddenForFactor(Boolean hiddenForFactor) {
    this.hiddenForFactor = hiddenForFactor;
  }

  //@formatter:off
  @Override
  public String toString() {
    return "VariableScopeDTO{" +
              "id=" + getId() +
              ", code='" + getCode() + "'" +
              ", name='" + getName() + "'" +
              ", description='" + getDescription() + "'" +
              ", version=" + getVersion() +
           "}";
  }
  //@formatter:on
}
