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