import { DatabaseModel, Id, Milliseconds, Toggle } from '..'; import { CurrencySymbol } from '../../constants'; import { FlagId } from '../flag/Flag'; import { GroupMembership } from '../group'; import { Notification, NotificationSettings } from '../notification'; import { SubscriptionId } from '../payments'; import { PortfoliosData } from '../portfolio/PortfoliosData'; import { RecipeId } from '../recipe'; import { TutorialCompletion } from '../tutorial'; import { PublicUser } from './PublicUser'; export interface User extends PublicUser, DatabaseModel { /** The user's email. */ email: string; /** The user's Payments customer ID (Stripe) */ paymentsId?: Id; /** The user's active subscriptions (Stripe) */ subscriptions: SubscriptionId[]; /** The list of flags associated with the user */ flags: FlagId[]; /** The user's Google ID */ googleId?: string; /** The user's Facebook ID */ facebookId?: string; /** The user's GitHub username */ gitHubUsername?: string; /** Recipes that the user created. */ recipesCreated: RecipeId[]; /** Recipes that the user has saved. */ recipesSaved: RecipeId[]; /** The list of flags the user created */ flagsCreated: FlagId[]; /** Group memberships for the current user. */ memberships: GroupMembership[]; /** List of notifications for the user. Stored in a subtable. */ notifications?: Notification[]; /** User's notification settings */ notificationSettings?: NotificationSettings; /** User's Tutorial settings */ tutorialCompletion?: TutorialCompletion; /** Keeps track of user toggle preferences */ toggles?: Toggle; /** The user's base currency for all recipes. Defaults to USD. */ baseCurrency?: CurrencySymbol; /** Exchanges (API keys and secrets) and portfolios */ portfoliosData: PortfoliosData; /** Keywords related to the user, for searching. */ keywords: string; /** Is the user banned? */ isBanned: boolean; /** Is the user deleted? */ isDeleted: boolean; /** Has the user signed up? Defaults to false for trial users. */ isSignedUp: boolean; /** The user's latest IP address */ ip: string; /** * The UTC timestamp since the user fully signed up. * If empty, the user has only partially signed up. */ signedUpAt?: Milliseconds; /** * The UTC timestamp since the user last viewed the changelog. */ changelogViewedAt?: Milliseconds; /** Pre-generated referral code specific to the user. */ referralCode: string; /** The user who referred this user. */ referredBy?: UserId; /** List of users referred by the user. */ referrals: UserId[]; } export declare type UserId = string; export declare type Username = string;