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

namespace GreenTree.Nachtragsmanagement.Services.User
{
    /// <summary>
    /// User service interface
    /// </summary>
    public interface IUserService
    {
        #region User

        /// <summary>
        /// Gets all users
        /// </summary>
        IList<Core.Domain.User.User> GetAllUsers();

        /// <summary>
        /// Gets a user by specified Id
        /// </summary>
        /// <param name="id">User identifier.</param>
        Core.Domain.User.User GetUserById(int id);

        /// <summary>
        /// Gets all users to the specified ids
        /// </summary>
        IList<Core.Domain.User.User> GetUsersByIds(int[] ids);

        /// <summary>
        /// Gets a user by specified customer number
        /// </summary>
        /// <param name="customNumber">Customer number.</param>
        Core.Domain.User.User GetUserByCustomNumber(string customNumber);

        /// <summary>
        /// Insert a user
        /// </summary>
        /// <param name="user">User.</param>
        void InsertUser(Core.Domain.User.User user);

        /// <summary>
        /// Update a user
        /// </summary>
        /// <param name="user">User.</param>
        void UpdateUser(Core.Domain.User.User user);

        /// <summary>
        /// Delete a user
        /// </summary>
        /// <param name="user">User.</param>
        void DeleteUser(Core.Domain.User.User user);

        #endregion

        #region Role

        /// <summary>
        /// Gets all roles
        /// </summary>
        IList<Role> GetAllRoles();

        /// <summary>
        /// Gets a user by specified Id
        /// </summary>
        /// <param name="id">Role identifier.</param>
        Role GetRoleById(int id);

        /// <summary>
        /// Gets all roles to the specified ids
        /// </summary>
        IList<Role> GetRolesByIds(int[] ids);

        /// <summary>
        /// Gets all users to the corresponding role
        /// </summary>
        /// <param name="roleId">Role id.</param>
        IList<Core.Domain.User.User> GetUsersByRole(int roleId);

        /// <summary>
        /// Insert a user
        /// </summary>
        /// <param name="role">Role.</param>
        void InsertRole(Role role);

        /// <summary>
        /// Update a role
        /// </summary>
        /// <param name="role">Role.</param>
        void UpdateRole(Role role);

        /// <summary>
        /// Delete a role
        /// </summary>
        /// <param name="role">Role.</param>
        void DeleteRole(Role role);

        #endregion

        #region Function

        /// <summary>
        /// Gets all functions
        /// </summary>
        IList<Function> GetAllFunctions();

        /// <summary>
        /// Gets a function by specified Id
        /// </summary>
        /// <param name="id">Function identifier.</param>
        Function GetFunctionById(int id);

        /// <summary>
        /// Gets a function by specified name
        /// </summary>
        /// <param name="name">Function name.</param>
        Function GetFunctionByName(string name);

        /// <summary>
        /// Gets all functions to the specified ids
        /// </summary>
        IList<Function> GetFunctionsByIds(int[] ids);

        /// <summary>
        /// Insert a function
        /// </summary>
        /// <param name="function">Function.</param>
        void InsertFunction(Function function);

        /// <summary>
        /// Update a function
        /// </summary>
        /// <param name="function">Function.</param>
        void UpdateFunction(Function function);

        /// <summary>
        /// Delete a function
        /// </summary>
        /// <param name="function">Function.</param>
        void DeleteFunction(Function function);

        #endregion
    }
}
