using CloudBuilder.Core.DependencyInjection.Form;
using CloudBuilder.Core.DependencyInjection.Policy;
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 CloudBuilder.Core.Policy
{
    public class CoreMessagePolicy : AbstractPolicy, IPolicy
    {
        public const string THE_DATA_HAS_BEEN_MODIFIED = "the_data_has_been_modified";
        public const string NO_PERMISSION = "no_permission";

        public static CoreMessagePolicy instance = null;

        public CoreMessagePolicy(IContext context) : base(context)
        {
            this.values = new string[] { THE_DATA_HAS_BEEN_MODIFIED, NO_PERMISSION };
        }

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

    }
}