import { Gender } from './settingsType';

/* General API Types */
export interface UserSettingsFromApi {
  theme: number;
  calendarType: number;
  language: number;
}
export interface ApiSession {
  key: string;
  created: string;
  deviceOs: string;
  deviceName: string;
  ipAddress: string;
}
export interface ActiveSessionsData {
  sessions: ApiSession[];
  currentKey: string;
}
export interface LoginLog {
  loginDateTime: string;
  ipAddress: string;
  deviceName: string;
  deviceOs: string;
}

/* Profile API Types */
export interface GetProfileApiResponse {
  success: boolean;
  message: string;
  firstName?: string;
  lastName?: string;
  nationalCode?: string;
  gender?: Gender;
  countryCode?: string;
  profileImageUrl?: string;
  phoneNumber: string;
  userSettings?: UserSettingsFromApi;
  activeSessions?: ActiveSessionsData;
  loginLogs?: LoginLog[];
  email?: string;
  hasPassword?: boolean;
}
export interface SaveProfileApiResponse {
  success: boolean;
  message?: string;
  phoneNumber?: string;
  email?: string;
}

/* Settings API Types */
export interface SaveSettingsApiResponse {
  success: boolean;
  message?: string;
}

/* Session API Types */
export interface DeleteSessionsApiResponse {
  success: boolean;
  message?: string;
}

/* Password API Types */
export interface PasswordApiResponse {
  success: boolean;
  message?: string;
}

/* Email API Types */
export interface SendEmailCodeApiResponse {
  success: boolean;
  message?: string;
}
export interface ConfirmEmailCodeApiResponse {
  success: boolean;
  confirm?: boolean;
  message?: string;
}
export interface ChangeEmailApiResponse {
  success: boolean;
  message?: string;
}

/* Phone Number API Types */
export interface PhoneNumberApiResponse {
  success: boolean;
  message?: string;
}
export interface ConfirmPhoneNumberApiResponse extends PhoneNumberApiResponse {
  confirm?: boolean;
}
