﻿// Copyright (c) 2018 Nikolay Zahariev <zahasoft.com>. Licensed under the MIT License.

namespace Zahasoft.Guard.User.Logout
{
    using System.ComponentModel.DataAnnotations;
    using Zahasoft.Guard.Base;
    using Zahasoft.Guard.Translations;

    /// <summary>
    /// User logout request model.
    /// </summary>
    public class UserLogoutRequest : Request
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="UserLogoutRequest"/> class.
        /// </summary>
        public UserLogoutRequest()
        {
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="UserLogoutRequest"/> class.
        /// </summary>
        /// <param name="email">User email</param>
        public UserLogoutRequest(string email)
            : this()
        {
            Email = email;
        }

        /// <summary>
        /// Gets or sets user's email address.
        /// </summary>
        [Required(ErrorMessage = TranslationKey.RequiredEmail)]
        [EmailAddress(ErrorMessage = TranslationKey.NotValidEmail)]
        [Display(Name = TranslationKey.Email, Prompt = TranslationKey.Email)]
        public string Email { get; set; }
    }
}
