using System;
using System.ComponentModel.DataAnnotations;
using Qusion.WebApp.Areas.Qusion.Filters;

namespace Qusion.WebApp.Areas.Qusion.Models.Pages
{
    public sealed class PageCreateInput
    {
        [Required(ErrorMessage = "pages.required_title")]
        public string Title { get; set; }

        public string Alias { get; set; }

        [RequiredIf("PageType", "External", "pages.require_external")]
        [DataType(DataType.Url)]
        [Url(ErrorMessage = "pages.invalid_external")]
        public string ExternalUrl { get; set; }

        [RequiredIf("PageType", "InternalRedirect", "pages.require_internal")]
        public Guid? InternalRedirectID { get; set; }

        public Guid? ParentID { get; set; }

        /// <summary>
        /// Gets or sets page workflow status.
        /// </summary>
        public int Status { get; set; }

        public string PageType { get; set; }

        public bool Navigable { get; set; }

        public bool RequireSSL { get; set; }

        public bool AllowAnonymous { get; set; }

        public int Ordinal { get; set; }
    }
}