2026-05-27 21:33:48 +03:30
|
|
|
using Meezi.API.Models.Auth;
|
|
|
|
|
|
|
|
|
|
namespace Meezi.API.Services;
|
|
|
|
|
|
|
|
|
|
public interface IAuthService
|
|
|
|
|
{
|
|
|
|
|
Task<(bool Success, SendOtpResponse? Data, string? ErrorCode, string? ErrorMessage)> SendOtpAsync(
|
|
|
|
|
SendOtpRequest request,
|
|
|
|
|
CancellationToken cancellationToken = default);
|
|
|
|
|
|
2026-05-29 17:14:46 +03:30
|
|
|
/// <summary>
|
|
|
|
|
/// Returns either an AuthTokenResponse (single café) or error code CHOOSE_CAFE
|
|
|
|
|
/// with CafeChoicesResponse serialised in ErrorMessage when multiple cafés found.
|
|
|
|
|
/// </summary>
|
|
|
|
|
Task<(bool Success, AuthTokenResponse? Data, string? ErrorCode, string? ErrorMessage, CafeChoicesResponse? Choices)> VerifyOtpAsync(
|
2026-05-27 21:33:48 +03:30
|
|
|
VerifyOtpRequest request,
|
|
|
|
|
CancellationToken cancellationToken = default);
|
|
|
|
|
|
2026-05-31 19:58:54 +03:30
|
|
|
Task<(bool Success, AuthTokenResponse? Data, string? ErrorCode, string? ErrorMessage, CafeChoicesResponse? Choices)> LoginWithPasswordAsync(
|
|
|
|
|
LoginWithPasswordRequest request,
|
|
|
|
|
CancellationToken cancellationToken = default);
|
|
|
|
|
|
2026-06-15 15:10:11 +03:30
|
|
|
/// <summary>Log in the café Owner using an admin-issued permanent recovery key.</summary>
|
|
|
|
|
Task<(bool Success, AuthTokenResponse? Data, string? ErrorCode, string? ErrorMessage)> LoginWithRecoveryKeyAsync(
|
|
|
|
|
LoginWithRecoveryKeyRequest request,
|
|
|
|
|
CancellationToken cancellationToken = default);
|
|
|
|
|
|
2026-05-29 17:14:46 +03:30
|
|
|
Task<(bool Success, AuthTokenResponse? Data, string? ErrorCode, string? ErrorMessage)> SwitchCafeAsync(
|
|
|
|
|
string employeeId, string targetCafeId,
|
|
|
|
|
CancellationToken cancellationToken = default);
|
|
|
|
|
|
2026-05-31 11:06:24 +03:30
|
|
|
/// <summary>
|
|
|
|
|
/// Re-issue a token scoped to a different branch within the current café.
|
|
|
|
|
/// <paramref name="targetBranchId"/> null means café-wide (Owner only).
|
|
|
|
|
/// </summary>
|
|
|
|
|
Task<(bool Success, AuthTokenResponse? Data, string? ErrorCode, string? ErrorMessage)> SwitchBranchAsync(
|
|
|
|
|
string employeeId, string cafeId, string? targetBranchId,
|
|
|
|
|
CancellationToken cancellationToken = default);
|
|
|
|
|
|
2026-05-27 21:33:48 +03:30
|
|
|
Task<(bool Success, AuthTokenResponse? Data, string? ErrorCode, string? ErrorMessage)> RefreshAsync(
|
|
|
|
|
RefreshTokenRequest request,
|
|
|
|
|
CancellationToken cancellationToken = default);
|
2026-05-29 10:18:47 +03:30
|
|
|
|
|
|
|
|
Task<(bool Success, SendOtpResponse? Data, string? ErrorCode, string? ErrorMessage)> RegisterAsync(
|
|
|
|
|
RegisterRequest request,
|
|
|
|
|
CancellationToken cancellationToken = default);
|
|
|
|
|
|
|
|
|
|
Task<(bool Success, AuthTokenResponse? Data, string? ErrorCode, string? ErrorMessage)> VerifyRegisterAsync(
|
|
|
|
|
VerifyRegisterRequest request,
|
|
|
|
|
CancellationToken cancellationToken = default);
|
2026-05-27 21:33:48 +03:30
|
|
|
}
|