3165e42119
* add trigger for updated user * Add referral bonuses and notifications for them * Cleanup * Add share group button, cleanup * Cleanup * Add referrals list to user profile * Remove unused * Referral bonus => constant * Refactor * Add referral txn to helper fn * Move reads into firebase transaction * Use effects to write referral info * Flex-wrap profile objects * Small ui changes * Restrict referral user to one update * Remove rogue semicolon * Note about group referral query details * Track referrals, add them to settings list
68 lines
1.4 KiB
TypeScript
68 lines
1.4 KiB
TypeScript
export type User = {
|
|
id: string
|
|
createdTime: number
|
|
|
|
name: string
|
|
username: string
|
|
avatarUrl?: string
|
|
|
|
// For their user page
|
|
bio?: string
|
|
bannerUrl?: string
|
|
website?: string
|
|
twitterHandle?: string
|
|
discordHandle?: string
|
|
|
|
balance: number
|
|
totalDeposits: number
|
|
|
|
profitCached: {
|
|
daily: number
|
|
weekly: number
|
|
monthly: number
|
|
allTime: number
|
|
}
|
|
|
|
creatorVolumeCached: {
|
|
daily: number
|
|
weekly: number
|
|
monthly: number
|
|
allTime: number
|
|
}
|
|
|
|
followerCountCached: number
|
|
|
|
followedCategories?: string[]
|
|
|
|
referredByUserId?: string
|
|
referredByContractId?: string
|
|
}
|
|
|
|
export const STARTING_BALANCE = 1000
|
|
export const SUS_STARTING_BALANCE = 10 // for sus users, i.e. multiple sign ups for same person
|
|
export const REFERRAL_AMOUNT = 500
|
|
export type PrivateUser = {
|
|
id: string // same as User.id
|
|
username: string // denormalized from User
|
|
|
|
email?: string
|
|
unsubscribedFromResolutionEmails?: boolean
|
|
unsubscribedFromCommentEmails?: boolean
|
|
unsubscribedFromAnswerEmails?: boolean
|
|
unsubscribedFromGenericEmails?: boolean
|
|
initialDeviceToken?: string
|
|
initialIpAddress?: string
|
|
apiKey?: string
|
|
notificationPreferences?: notification_subscribe_types
|
|
}
|
|
|
|
export type notification_subscribe_types = 'all' | 'less' | 'none'
|
|
|
|
export type PortfolioMetrics = {
|
|
investmentValue: number
|
|
balance: number
|
|
totalDeposits: number
|
|
timestamp: number
|
|
userId: string
|
|
}
|