using CloudBuilder.Core.DependencyInjection.Form;
using CloudBuilder.Core.DependencyInjection.Request;
using Microsoft.Extensions.DependencyInjection;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace System
{
    public class SearchFilterTypePolicy : AbstractPolicy
    {
        public const string TEXT = "Text";
        public const string TEXT_CONTAIN = "TextContain";
        public const string NUMBER = "Number";
        public const string DATE = "Date";
        public const string DATETIME = "DateTime";
        public const string MULTIPLE_SELECTION = "MultipleSelection";
        public const string SINGLE_SELECTION = "SingleSelection";
        public const string SEARCH_SINGLE_SELECTION = "SearchSingleSelection";
        public const string MENU_SINGLE_SELECTION = "MenuSingleSelection";
        public const string CHECKBOX = "Checkbox";
        public const string CHECKBOX_GROUP = "CheckboxGroup";
        public const string RADIO_GROUP = "RadioGroup";

        public static SearchFilterTypePolicy instance = null;

        public SearchFilterTypePolicy(IContext context) : base(context)
        {
            this.values = new string[] { TEXT, TEXT_CONTAIN, NUMBER, DATE, DATETIME, MULTIPLE_SELECTION, SINGLE_SELECTION };
        }

        public static SearchFilterTypePolicy GetInstance()
        {
            instance = ApplicationServiceContext.ServiceProvider.GetKeyedService<SearchFilterTypePolicy>(typeof(SearchFilterTypePolicy).Name);
            return instance;
        }
    }
}
