using CloudBuilder.Core.Authorization;
using CloudBuilder.Security.Entity;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CloudBuilder.Security.Data
{
    [NotMapped]
    [TypeScript]
    public class SecurityGroupPermissionDependentViewDisplayData : SecurityGroupPermissionDependentViewEntity
    {
        public SecurityGroupPermissionDependentViewDisplayData()
        {

        }
        public SecurityGroupPermissionDependentViewDisplayData(SecurityGroupPermissionDependentViewEntity entity)
        {
            CopyFrom(entity, true);
            this.IsView = entity.ViewIndc == YesNoPolicy.YES;
            this.IsCreate = entity.CreateIndc == YesNoPolicy.YES;
            this.IsAmend = entity.AmendIndc == YesNoPolicy.YES;
            this.IsDelete = entity.DeleteIndc == YesNoPolicy.YES;
        }

        public const string IS_VIEW = "IsView";
        public const string IS_CREATE = "IsCreate";
        public const string IS_AMEND = "IsAmend";
        public const string IS_DELETE = "IsDelete";

        public bool IsView { get; set; }
        public bool IsCreate { get; set; }
        public bool IsAmend { get; set; }
        public bool IsDelete { get; set; }
    }
}
