package com.kamco.cd.training.common.enums;

import com.kamco.cd.training.common.utils.enums.CodeExpose;
import com.kamco.cd.training.common.utils.enums.EnumType;
import java.util.Arrays;
import lombok.AllArgsConstructor;
import lombok.Getter;

@CodeExpose
@Getter
@AllArgsConstructor
public enum ModelType implements EnumType {
  G1("G1"),
  G2("G2"),
  G3("G3"),
  G4("G4"),
  CLS("CLS");

  private String desc;

  public static ModelType getValueData(String modelNo) {
    return Arrays.stream(ModelType.values())
        .filter(m -> m.getId().equals(modelNo))
        .findFirst()
        .orElse(G1);
  }

  @Override
  public String getId() {
    return name();
  }

  @Override
  public String getText() {
    return desc;
  }
}
