2026-05-27 21:33:48 +03:30
|
|
|
namespace Meezi.API.Models.Auth;
|
|
|
|
|
|
|
|
|
|
public record SendOtpRequest(string Phone);
|
|
|
|
|
|
2026-05-31 19:58:54 +03:30
|
|
|
/// <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);
|
|
|
|
|
|
2026-05-27 21:33:48 +03:30
|
|
|
public record VerifyOtpRequest(string Phone, string Code, string? CafeId = null);
|
|
|
|
|
|
|
|
|
|
public record RefreshTokenRequest(string RefreshToken);
|
|
|
|
|
|
2026-05-29 17:14:46 +03:30
|
|
|
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>
|
2026-05-31 22:28:25 +03:30
|
|
|
/// <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);
|
|
|
|
|
|
2026-05-29 17:14:46 +03:30
|
|
|
/// <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,
|
2026-05-29 17:14:46 +03:30
|
|
|
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);
|
2026-05-29 17:14:46 +03:30
|
|
|
|
|
|
|
|
/// <summary>Returned when a phone number belongs to multiple cafés and no CafeId was specified.</summary>
|
|
|
|
|
public record CafeChoicesResponse(List<CafeMembershipDto> Cafes);
|