using System.Collections.Generic;
using Sockeye.Biz;

namespace Sockeye.DataList
{
    internal class VendorNotificationDataList : DataListProcessingBase
    {
        public VendorNotificationDataList(long translationId)
        {
            DefaultListAType = SockType.VendorNotification;
            SQLFrom = @"FROM avendornotification ";

            var RoleSet = BizRoles.GetRoleSet(DefaultListAType);
            AllowedRoles = RoleSet.ReadFullRecord | RoleSet.Change;
            DefaultColumns = new List<string>() { "VendorNotification", "VendorNotificationCreated", "VendorNotificationProcessed" };
            DefaultSortBy = new Dictionary<string, string>() { { "VendorNotification", "-" } };
            FieldDefinitions = new List<DataListFieldDefinition>();

            FieldDefinitions.Add(new DataListFieldDefinition
            {
                TKey = "VendorNotification",
                FieldKey = "VendorNotification",
                SockType = (int)SockType.VendorNotification,
                UiFieldDataType = (int)UiFieldDataType.Integer,
                SqlIdColumnName = "avendornotification.id",
                SqlValueColumnName = "avendornotification.id",
                IsRowId = true
            });

            FieldDefinitions.Add(new DataListFieldDefinition
            {
                TKey = "VendorNotificationCreated",
                FieldKey = "VendorNotificationCreated",
                SockType = (int)SockType.VendorNotification,
                UiFieldDataType = (int)UiFieldDataType.DateTime,
                SqlIdColumnName = "avendornotification.id",
                SqlValueColumnName = "avendornotification.created"
            });

            FieldDefinitions.Add(new DataListFieldDefinition
            {
                TKey = "VendorNotificationProcessed",
                FieldKey = "VendorNotificationProcessed",
                UiFieldDataType = (int)UiFieldDataType.DateTime,
                SqlValueColumnName = "avendornotification.processed"
            });
        }
    }//eoc
}//eons