package com.ejie.ad74a.util.constantes.modelos;

import org.springframework.context.i18n.LocaleContextHolder;

import com.ejie.ad74a.model.Combo;
import com.ejie.ad74a.util.comun.Utilidades;
import com.ejie.ad74a.util.constantes.Constantes;

public abstract class TipoSolicitantes {

	private TipoSolicitantes() {

	}
	// Longitud de campos
	/*
	 * Los JSP necesitan Strings, las comparaciones en java Integer
	 */

	public static final Integer ACTIVO_SI = 1;
	public static final Integer ACTIVO_NO = 0;

	public static final int MAX_LENGTH_APELLIDO101 = 100;
	public static final String MAX_LENGTH_APELLIDO101_STR = Utilidades.getStringFromInteger(MAX_LENGTH_APELLIDO101);

	public static final int MAX_LENGTH_APELLIDO201 = 100;
	public static final String MAX_LENGTH_APELLIDO201_STR = Utilidades.getStringFromInteger(MAX_LENGTH_APELLIDO201);

	public static final int MAX_LENGTH_NOMBRE01 = 100;
	public static final String MAX_LENGTH_NOMBRE01_STR = Utilidades.getStringFromInteger(MAX_LENGTH_NOMBRE01);

	public static final int MAX_LENGTH_IDENTIFICADOR01 = 100;
	public static final String MAX_LENGTH_IDENTIFICADOR01_STR = Utilidades
			.getStringFromInteger(MAX_LENGTH_IDENTIFICADOR01);

	public static final int MAX_LENGTH_NUMTIS01 = 8;
	public static final String MAX_LENGTH_NUMTIS01_STR = Utilidades.getStringFromInteger(MAX_LENGTH_NUMTIS01);

	public static final int MAX_LENGTH_NUMSS01 = 20;
	public static final String MAX_LENGTH_NUMSS01_STR = Utilidades.getStringFromInteger(MAX_LENGTH_NUMSS01);

	public static final int MAX_LENGTH_EMAIL01 = 100;
	public static final String MAX_LENGTH_EMAIL01_STR = Utilidades.getStringFromInteger(MAX_LENGTH_EMAIL01);

	public static final int MAX_LENGTH_TLFNOMOVIL01 = 9;
	public static final String MAX_LENGTH_TLFNOMOVIL01_STR = Utilidades.getStringFromInteger(MAX_LENGTH_TLFNOMOVIL01);

	public static final int MAX_LENGTH_TFNONOT00 = 9;
	public static final String MAX_LENGTH_TFNONOT00_STR = Utilidades.getStringFromInteger(MAX_LENGTH_TFNONOT00);

	public static final int MAX_LENGTH_EMAILNOT00 = 100;
	public static final String MAX_LENGTH_EMAILNOT00_STR = Utilidades.getStringFromInteger(MAX_LENGTH_EMAILNOT00);

	public static final int MAX_LENGTH_TLFNOSERVICIO01 = 9;
	public static final String MAX_LENGTH_TLFNOSERVICIO01_STR = Utilidades
			.getStringFromInteger(MAX_LENGTH_TLFNOSERVICIO01);

	public static final int MAX_LENGTH_APELLIDO1REP00 = 100;
	public static final String MAX_LENGTH_APELLIDO1REP00_STR = Utilidades
			.getStringFromInteger(MAX_LENGTH_APELLIDO1REP00);
	public static final int MAX_LENGTH_APELLIDO2REP00 = 100;
	public static final String MAX_LENGTH_APELLIDO2REP00_STR = Utilidades
			.getStringFromInteger(MAX_LENGTH_APELLIDO2REP00);

	public static final int MAX_LENGTH_RAZONSOCIALREP00 = 100;
	public static final String MAX_LENGTH_RAZONSOCIALREP00_STR = Utilidades
			.getStringFromInteger(MAX_LENGTH_RAZONSOCIALREP00);

	public static final int MAX_LENGTH_IDENTIFICADORREP00 = 100;
	public static final String MAX_LENGTH_IDENTIFICADORREP00STR = Utilidades
			.getStringFromInteger(MAX_LENGTH_IDENTIFICADORREP00);

	// tipoBeneficiario01 //
	public static enum TipoBeneficiario01 {
		TITULAR_A(1, "tipoBeneficiario01.titularA"), //
		BENEFICIARIO_B(2, "tipoBeneficiario01.beneficiarioB"), //
		BENEFICIARIO_C(3, "tipoBeneficiario01.beneficiarioC");

		private TipoBeneficiario01(Integer id, String labelDesc) {
			this.id = id;
			this.labelDesc = labelDesc;
		}

		private Integer id;
		private String labelDesc;

		public int getId() {
			return this.id;
		}

		public String getLabelDesc() {
			return Utilidades.getLabelFromResource(Constantes.BASENAME_RESOURCE_AD74A_I18N, this.labelDesc,
					LocaleContextHolder.getLocale());
		}

		public String getLabelDesc(int id) {
			String desc = "";
			for (TipoBeneficiario01 tipo : TipoBeneficiario01.values()) {
				if (tipo.getId() == id) {
					desc = Utilidades.getLabelFromResource(Constantes.BASENAME_RESOURCE_AD74A_I18N, tipo.getLabelDesc(),
							LocaleContextHolder.getLocale());
				}
			}
			return desc;
		}

		public Combo getCombo() {
			return new Combo(id.toString(),
					Utilidades.getLabelFromResource(Constantes.BASENAME_RESOURCE_AD74A_I18N, this.labelDesc,
							com.ejie.ad74a.constantes.Constantes.LOCALE_ES),
					Utilidades.getLabelFromResource(Constantes.BASENAME_RESOURCE_AD74A_I18N, this.labelDesc,
							com.ejie.ad74a.constantes.Constantes.LOCALE_EU));
		}
	}

	// Tipos de Solicitud //
	public interface PantallaOrigen {
		public static final String TAB_DATOS_BENEFICIARIOS = "tabDatosBeneficiarios";
		public static final String TAB_PRESTACION_SERVICIO = "tabPrestacionSevicio";

	}
}
