using System.ComponentModel.DataAnnotations;
using System.Runtime.Serialization;

namespace Qusion.WebApp.Areas.cms.Models.Documents
{
    public class DocumentSettingsInput
    {
        /// <summary>
        /// Gets or sets allowed extensions for document.
        /// </summary>
        [Required(ErrorMessage = "utility.extensions_required")]
        [RegularExpression(@"^(([a-zA-Z0-9]+),?)+$", ErrorMessage = "utility.extensions_invalid")]
        public string AllowedExtensions { get; set; }

        /// <summary>
        /// Gets or sets max size to upload.
        /// </summary>
        [DataMember(IsRequired = true)]
        [Range(1, int.MaxValue, ErrorMessage = "utility.maxsize_required")]
        public int MaxAllowedSize { get; set; }

        /// <summary>
        /// Gets or sets cache path.
        /// </summary>
        [Required(ErrorMessage = "utility.cachepath_required")]
        public string CachePath { get; set; }

        /// <summary>
        /// Gets or sets directory path.
        /// </summary>
        [Required(ErrorMessage = "utility.directory_required")]
        public string Directory { get; set; }

        public int GeneralPageSize { get; set; }
    }
}