2023-08-12 20:13:47 +01:00
|
|
|
using System.Diagnostics.CodeAnalysis;
|
2024-02-24 14:52:43 +00:00
|
|
|
using OliverBooth.Data.Web;
|
2023-08-12 20:13:47 +01:00
|
|
|
|
2023-08-13 17:33:54 +01:00
|
|
|
namespace OliverBooth.Services;
|
2023-08-12 20:13:47 +01:00
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Represents a service for managing users.
|
|
|
|
/// </summary>
|
2024-02-24 14:52:43 +00:00
|
|
|
public interface IUserService
|
2023-08-12 20:13:47 +01:00
|
|
|
{
|
|
|
|
/// <summary>
|
|
|
|
/// Attempts to find a user with the specified ID.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="id">The ID of the user to find.</param>
|
|
|
|
/// <param name="user">
|
|
|
|
/// When this method returns, contains the user with the specified ID, if the user is found; otherwise,
|
|
|
|
/// <see langword="null" />.
|
|
|
|
/// </param>
|
|
|
|
/// <returns>
|
|
|
|
/// <see langword="true" /> if a user with the specified ID is found; otherwise, <see langword="false" />.
|
|
|
|
/// </returns>
|
|
|
|
bool TryGetUser(Guid id, [NotNullWhen(true)] out IUser? user);
|
2024-02-20 20:39:52 +00:00
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Verifies the login information of the specified user.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="email">The email address.</param>
|
|
|
|
/// <param name="password">The password.</param>
|
|
|
|
/// <param name="user">
|
|
|
|
/// When this method returns, contains the user associated with the login credentials, or
|
|
|
|
/// <see langword="null" /> if the credentials are invalid.
|
|
|
|
/// </param>
|
|
|
|
/// <returns>
|
|
|
|
/// <see langword="true" /> if the login credentials are valid; otherwise, <see langword="false" />.
|
|
|
|
/// </returns>
|
|
|
|
public bool VerifyLogin(string email, string password, [NotNullWhen(true)] out IUser? user);
|
2023-08-12 20:13:47 +01:00
|
|
|
}
|