declare namespace MasterModel {
  interface SearchUserPaginationBody extends SearchPaginationBody {
    order?: 'email' | 'name' | undefined;
    email?: string;
    metadata?: Partial<UserMetadata>;
  }
  interface ChangePasswordRequestBody {
    old_password: string;
    password: string;
  }

  interface UserResponse {
    id?: string;
    email?: string;
    enable_2fa?: boolean;
    metadata?: UserMetadata;
  }

  interface UserMetadata {
    frontend_thing_id?: string;
    frontend_thing_key?: string;
    full_name?: string;
    phone_number?: string;
    telegram?: string;
    user_type?: 'admin' | 'enduser' | 'sysadmin' | 'users';
  }

  // User
  interface CreateUserMetadata extends UserMetadata {
    group_id?: string;
  }

  interface CreateUserBodyRequest extends Partial<UserResponse> {
    password: string;
    full_name?: string;
    metadata?: CreateUserMetadata;
  }

  interface UserListResponse {
    total?: number;
    offset?: number;
    limit?: number;
    users: UserResponse[];
  }
  interface UserResetPasswordRequest {
    token: string;
    password: string;
    confirm_password?: string;
  }

  // 2FA
  interface Enable2FAResponse {
    otp_auth_url?: string;
    qr_code_base64?: string;
  }

  interface Verify2FARequestBody {
    otp?: string;
  }
}
