package com.oguerreiro.resilient.service.dto;

import java.util.ArrayList;
import java.util.List;

import com.oguerreiro.resilient.domain.enumeration.DashboardComponentChartType;
import com.oguerreiro.resilient.domain.enumeration.DashboardComponentType;
import com.oguerreiro.resilient.domain.enumeration.DashboardComponentView;

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

/**
 * A DTO for the {@link com.oguerreiro.resilient.domain.DashboardComponent} entity.
 */
@Schema(description = "DashboardComponent")
public class DashboardComponentDTO extends AbstractResilientDTO<Long> {

  private static final long serialVersionUID = 1L;

  @NotNull
  @Schema(description = "Required and unique code for the component", requiredMode = Schema.RequiredMode.REQUIRED)
  private String code;

  @NotNull
  @Schema(description = "Name of the component.", requiredMode = Schema.RequiredMode.REQUIRED)
  private String name;

  private String description;

  private Boolean isActive;

  @NotNull
  private Boolean isExportable;

  @NotNull
  private DashboardComponentType type;

  private DashboardComponentView view;

  private DashboardComponentChartType chartType;

  private List<DashboardComponentDetailDTO> dashboardComponentDetails = new ArrayList<>();

  private List<DashboardComponentOrganizationDTO> dashboardComponentOrganizations = new ArrayList<>();

  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 getIsActive() {
    return isActive;
  }

  public void setIsActive(Boolean isActive) {
    this.isActive = isActive;
  }

  public DashboardComponentType getType() {
    return type;
  }

  public void setType(DashboardComponentType type) {
    this.type = type;
  }

  public DashboardComponentView getView() {
    return view;
  }

  public void setView(DashboardComponentView view) {
    this.view = view;
  }

  public DashboardComponentChartType getChartType() {
    return chartType;
  }

  public void setChartType(DashboardComponentChartType chartType) {
    this.chartType = chartType;
  }

  public List<DashboardComponentDetailDTO> getDashboardComponentDetails() {
    return dashboardComponentDetails;
  }

  public void setDashboardComponentDetails(List<DashboardComponentDetailDTO> dashboardComponentDetails) {
    this.dashboardComponentDetails = dashboardComponentDetails;
  }

  public List<DashboardComponentOrganizationDTO> getDashboardComponentOrganizations() {
    return dashboardComponentOrganizations;
  }

  public void setDashboardComponentOrganizations(
      List<DashboardComponentOrganizationDTO> dashboardComponentOrganizations) {
    this.dashboardComponentOrganizations = dashboardComponentOrganizations;
  }

  public Boolean getIsExportable() {
    return isExportable;
  }

  public void setIsExportable(Boolean isExportable) {
    this.isExportable = isExportable;
  }

  //@formatter:off
  @Override
  public String toString() {
    return "DashboardComponentDTO{" + 
              "id=" + getId() + 
              ", code='" + getCode() + "'" + 
              ", name='" + getName() + "'" + 
              ", description='" + getDescription() + "'" + 
              ", type='" + getType() + "'" +
              ", view='" + getView() + "'" +
              ", chartType='" + getChartType() + "'" +
              ", isExportable='" + getIsExportable() + "'" +
              ", isActive='" + getIsActive() + "'" +
              ", version=" + getVersion() + 
           "}";
  }
//@formatter:on
}
