// GetUserStatusByPhoneNumberOrEmail

import type { ApiResponse } from '@/types/apiResponse';
import type { GUID } from '@/types/commonTypes';

export interface GetUserStatusByPhoneNumberOrEmailRequest {
  phoneNumber?: string;
  email?: string;
}

export interface GetUserStatusByPhoneNumberOrEmailResponse extends ApiResponse {
  userStatus: UserStatus;
}

export enum UserStatus {
  None = 0,
  RegisteredWithPassword = 1,
  RegisteredWithoutPassword = 2,
  NotRegistered = 3,
}

// LoginOrSignUpWithOtp

export interface LoginRequest {
  otpCode: string;
  phoneNumber?: string;
  email?: string;
  returnUrl: string;
}

export interface PasswordLoginRequest {
  phoneNumber?: string;
  email?: string;
  password: string;
  returnUrl: string;
}

export interface LoginResponse extends ApiResponse, LoginResult {}

export interface LoginResult {
  returnUrl: string;
  userId: GUID;
  registeredWithOutPhoneNumber: boolean;
  completedUserInformation: boolean;
}

// SendSmsOtp

export interface SendSmsOtpRequest {
  phoneNumber: string;
}

// SendEmailOtp

export interface SendEmailOtpRequest {
  email: string;
}

// ConfirmOtp

export interface ConfirmEmailOtpRequest {
  email: string;
  otpCode: string;
}

export interface ConfirmSmsOtpRequest {
  phoneNumber: string;
  otpCode: string;
}

export interface ConfirmOtpResponse extends ApiResponse {
  confirm: boolean;
}

// ResetPassword

export interface ResetPasswordRequest {
  email?: string;
  phoneNumber?: string;
  newPassword: string;
  confirmNewPassword: string;
}

export interface ResetPasswordResponse extends ApiResponse {
  passwordChanged: boolean;
}

// SendForgetPassCode

export interface SendForgetPassCodeRequest {
  email?: string;
  phoneNumber?: string;
}

// ConfirmForgetPassCode

export interface ConfirmForgetPassCodeRequest {
  email?: string;
  phoneNumber?: string;
  code: string;
}

// LoginOrSignUpWithGoogle

export interface GoogleCodeClientResponse {
  id_token: string;
}

export interface LoginOrSignUpWithGoogleRequest {
  idToken: string;
  returnUrl: string;
}

export interface LoginOrSignUpWithGoogleResponse
  extends ApiResponse,
    LoginResult {}
