Files
meezi/src/Meezi.API/Models/Auth/AuthDtos.cs
T

55 lines
2.4 KiB
C#
Raw Normal View History

2026-05-27 21:33:48 +03:30
namespace Meezi.API.Models.Auth;
public record SendOtpRequest(string Phone);
/// <summary>Username + password login (alternative to OTP). Optional cafeId to scope to a specific café.</summary>
public record LoginWithPasswordRequest(string Username, string Password, string? CafeId = null);
/// <summary>Admin-issued recovery key login — logs the café Owner in when OTP access is lost.</summary>
public record LoginWithRecoveryKeyRequest(string Key);
2026-05-27 21:33:48 +03:30
public record VerifyOtpRequest(string Phone, string Code, string? CafeId = null);
public record RefreshTokenRequest(string RefreshToken);
public record SwitchCafeRequest(string CafeId);
2026-05-31 11:06:24 +03:30
/// <summary>Switch the active branch within the current café. Null = café-wide (Owner only).</summary>
public record SwitchBranchRequest(string? BranchId);
2026-05-29 10:18:47 +03:30
/// <summary>Step 1 of self-registration: send OTP to a new phone number.</summary>
/// <param name="Slug">Optional custom Koja slug (e.g. "lamiz-enghelab"). Auto-derived from CafeName if omitted.</param>
public record RegisterRequest(string Phone, string CafeName, string? Slug = null);
2026-05-29 10:18:47 +03:30
/// <summary>Step 2 of self-registration: verify OTP and create the cafe account.</summary>
public record VerifyRegisterRequest(string Phone, string Code);
/// <summary>One café membership entry returned when user belongs to multiple cafés.</summary>
public record CafeMembershipDto(string CafeId, string CafeName, string Role, string PlanTier);
2026-05-31 11:06:24 +03:30
/// <summary>A branch the signed-in employee may operate as, with their role there.</summary>
public record BranchMembershipDto(string BranchId, string BranchName, string Role);
2026-05-27 21:33:48 +03:30
public record AuthTokenResponse(
string AccessToken,
string RefreshToken,
DateTime ExpiresAt,
string UserId,
string CafeId,
string Role,
string PlanTier,
string Language,
string Actor = Meezi.Core.Constants.MeeziActorKinds.Merchant,
string? BranchId = null,
2026-05-31 11:06:24 +03:30
List<CafeMembershipDto>? Memberships = null,
string? BranchName = null,
bool IsCafeWide = false,
List<BranchMembershipDto>? Branches = null,
/// <summary>Effective capabilities for the active role — drives client-side page/action gating.</summary>
List<string>? Permissions = null);
2026-05-27 21:33:48 +03:30
public record SendOtpResponse(bool Sent, int ExpiresInSeconds);
/// <summary>Returned when a phone number belongs to multiple cafés and no CafeId was specified.</summary>
public record CafeChoicesResponse(List<CafeMembershipDto> Cafes);