aboutsummaryrefslogtreecommitdiff
path: root/BackEnd/Timeline/Services/User/IBasicUserService.cs
blob: 0ae3fdff280dafac9d15f4968f096a13496d5cb0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
using System;
using System.Threading.Tasks;

namespace Timeline.Services.User
{
    /// <summary>
    /// This service provide some basic user features, which should be used internally for other services.
    /// </summary>
    public interface IBasicUserService
    {
        /// <summary>
        /// Check if a user exists.
        /// </summary>
        /// <param name="id">The id of the user.</param>
        /// <returns>True if exists. Otherwise false.</returns>
        Task<bool> CheckUserExistenceAsync(long id);

        /// <summary>
        /// Get the user id of given username.
        /// </summary>
        /// <param name="username">Username of the user.</param>
        /// <returns>The id of the user.</returns>
        /// <exception cref="ArgumentNullException">Thrown when <paramref name="username"/> is null.</exception>
        /// <exception cref="ArgumentException">Thrown when <paramref name="username"/> is of bad format.</exception>
        /// <exception cref="EntityNotExistException">Thrown when the user with given username does not exist.</exception>
        Task<long> GetUserIdByUsernameAsync(string username);

        /// <summary>
        /// Get the username modified time of a user.
        /// </summary>
        /// <param name="userId">User id.</param>
        /// <returns>The time.</returns>
        /// <exception cref="EntityNotExistException">Thrown when user does not exist.</exception>
        Task<DateTime> GetUsernameLastModifiedTimeAsync(long userId);
    }
}