using GreenTree.Nachtragsmanagement.Core.Domain.User;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace GreenTree.Nachtragsmanagement.Core.Authentication
{
    public interface IUserHelper
    {
        /// <summary>
        /// Evaluates the current user from request cookies
        /// </summary>
        User FromCookiesOrSession();

        /// <summary>
        /// Evaluates the current user from request cookies
        /// </summary>
        /// <param name="expirationHoursIncrease">The hours the authCookie will be increased if it exists.</param>
        User FromCookiesOrSession(int expirationHoursIncrease);

        /// <summary>
        /// Writes the current user to response cookies
        /// </summary>
        /// <param name="user">The current authenticated user.</param>
        void ToCookiesAndSession(User user);

        /// <summary>
        /// Writes the current user to response cookies
        /// </summary>
        /// <param name="user">The current authenticated user.</param>
        /// <param name="setRequestCookie">Set also the request cookie for further authorization.</param>
        void ToCookiesAndSession(User user, bool setRequestCookie);

        /// <summary>
        /// Writes the current user to response cookies
        /// </summary>
        /// <param name="user">The current authenticated user.</param>
        /// <param name="expirationDate">The cookie expiration date.</param>
        void ToCookiesAndSession(User user, DateTime expirationDate);

        /// <summary>
        /// Writes the current user to response cookies
        /// </summary>
        /// <param name="user">The current authenticated user.</param>
        /// <param name="expirationDate">The cookie expiration date.</param>
        /// <param name="setRequestCookie">Set also the request cookie for further authorization.</param>
        void ToCookiesAndSession(User user, DateTime expirationDate, bool setRequestCookie);

        /// <summary>
        /// Clears the authentication cookie
        /// </summary>
        void ClearCookieAndSession();
    }
}
