namespace ZionSchematics.Models.SearchContentTypes
{
    public class ContentTypeFactory
    {
        private const string Barcode = "BARCODE";
        private const string CharacterString = "CHARACTERSTRING";
        private const string CharacterStringWithNumber = "CHARACTERSTRINGWITHNUMBER";
        private const string Currency = "CURRENCY";
        private const string Date = "DATE";
        private const string Numeric = "NUMERIC";
        private const string Paragraphy = "PARAGRAPHY";
        private const string Phone = "PHONE";
        private const string StaticText = "STATICTEXT";
        private const string Cpf = "CPF";
        private const string Cnpj = "CNPJ";
        private const string RegexCustom = "REGEXCUSTOM";
        private const string ConstantValue = "CONSTANTVALUE";
        private const string ValueVariable = "VALUEVARIABLE";
        private const string Condition = "CONDITION";

        public static IContentType construct(string type)
        {
            switch (type.ToUpper())
            {
                case Barcode: return new BarcodeType();
                case CharacterString: return new CharacterStringType();
                case CharacterStringWithNumber: return new CharacterStringWithNumberType();
                case Currency: return new CurrencyType();
                case Date: return new DateType();
                case Numeric: return new NumericType();
                case Paragraphy: return new ParagraphyType();
                case Phone: return new PhoneType();
                case StaticText: return new StaticTextType();
                case Cpf: return new CpfType();
                case Cnpj: return new CnpjType();
                case RegexCustom: return new RegexCustom();
                case ConstantValue: return new ConstantValue();
                case ValueVariable: return new ValueVariable();
                default: return null;
            }
        }
    }
}
