User
Below is the complete user model as defined in svr-api. For more detailed information on specific parts of the user, please see:
user.model.js
{
annuity: { // this object is not used at the moment
annuityProjections: {
minAge: Number,
maxAge: Number,
startAge: Number,
values: { type: Array, default: undefined }
},
lifeExpectancy: Number,
health: { value: Number },
riskTolerance: { value: Number },
budget: { value: Number },
travelExpenses: { value: Number },
foodExpenses: { value: Number },
medicalExpenses: { value: Number },
discretionaryFunds: { value: Number },
monthlyIncome: Number,
estimatedBudget: Number,
neededMonthlyIncome: Number,
recommendedAnnuityType: Number,
recommendedInitialInvestment: Number
},
healthAndCare: {
detailsConfirmed: Boolean,
climate: { value: Number },
surroundings: { value: String },
hobbies: {
selections: [{ id: Number, title: String }],
customSelections: [{ title: String }]
},
travel: { value: Number },
food: {
selections: [{ id: Number, title: String }],
customSelections: [{ title: String }]
},
rest: {
selections: [{ id: Number, title: String }],
customSelections: [{ title: String }]
},
lastScreen: {
screen: {
type: String,
enum: ['details', 'climate', 'surroundings', 'hobbies', 'travel', 'food', 'rest']
},
date: Date
},
family: [
{
_id: String / ObjectId,
name: {
first: String,
last: String,
middle: String
},
image: String,
phone: Number,
email: String,
shellEmail: String,
inviteUrl: String,
preneed: {
...userInfo
}
}
]
},
verified: { type: Boolean, default: false }, //v14
image: String,
defaultImage: {
type: Number,
default: function () {
// use the size of the planningProfileImages array to set the max integer for the random default profile image idx
const imageCount = (planningProfileImages && planningProfileImages.length) || 6;
return generateRandomIntFromInterval(0, imageCount - 1); // account for 0-index
}
},
name: {
first: { type: String, required: false, default: '' },
last: { type: String, required: false, default: '' },
middle: String,
nickname: String,
suffix: String,
prefix: String
},
searchName: {
type: String,
select: false,
lowercase: true,
index: true,
set: setSearchName
},
phone: {
type: Number,
unique: true,
sparse: true,
set: val => val && getNumber(val)
},
email: { type: String, unique: true, sparse: true, required: false, lowercase: true },
fbId: { type: String, unique: true, sparse: true },
appleId: { type: String, unique: true, sparse: true },
fbEmail: { type: String, lowercase: true },
dashPassword: { type: String, select: false, set: hashPass },
lastActivitySeenDate: Number,
password: { type: String, select: false, set: hashPass },
hasPassword: { type: Boolean, default: false },
dateOfBirth: Date,
age: Number, //<-- going to set this based on dateOfBirth for annuities
lifeExpectancy: Number,
birthday: Number, //<-- i dont think we use this one
deceased: { type: Boolean, default: false },
deceasedDate: Number,
address: {
street1: String,
street2: String,
city: String,
state: String,
zip: String,
country: String,
coords: []
},
gender: { type: String, enum: genderEnum }, //based on efunerals values
bio: String,
shirtSize: String,
displayTitle: String,
shellEmail: String,
contacts: { type: [Contact.schema], select: false },
completedSignup: { type: Boolean, default: false },
declaration: {
date: Number,
message: String,
contactInfo: String,
users: [{ type: Schema.Types.ObjectId, ref: 'User' }]
},
serviceInfo: {
date: Number,
title: String,
location: String,
contactInfo: String,
users: [{ type: Schema.Types.ObjectId, ref: 'User' }]
},
prefs: {
sms: { type: Boolean, default: true },
push: { type: Boolean, default: false, index: true }, // needs to be false for iOS
email: { type: Boolean, default: true },
notifications: {
announcementForContact: { type: Boolean, default: true }, // user creates memorial
announcementByContact: { type: Boolean, default: true }, // contact of user creates memorial
announcementInvitation: { type: Boolean, default: true }, // user invited to a memorial
announcementManageInvitation: { type: Boolean, default: true }, // User invited to manage
announcementUpdates: { type: Boolean, default: true }, // details of announcement updated
funeralHomeAnnouncement: { type: Boolean, default: true }, // funeral home user follows created announcement
commentOwnMemory: { type: Boolean, default: true }, // comment - User is the poster
commentAnyMemory: { type: Boolean, default: true }, // comment - User is following
memoryAnnouncement: { type: Boolean, default: true }, // memories - User is owner/manager
commentAnnouncement: { type: Boolean, default: true }, //comment - User is owner/manager
storyAnnouncement: { type: Boolean, default: true }, //story - User is owner/manager
directMessage: { type: Boolean, default: true }, // chat 1to1
groupChat: { type: Boolean, default: true }, // group chat
announcementCreate: { type: Boolean, default: true } // Notify contacts when creating a memorial
}
},
pushtokens: [
{
_id: false,
os: String,
token: { type: String, index: true },
device_id: String
}
],
meta: {
isApp: { type: Boolean, default: false },
isDash: { type: Boolean, default: false },
isRep: { type: Boolean, default: false },
isShell: { type: Boolean, default: false },
isShellFromWeb: { type: Boolean, default: false },
isSimpleShell: { type: Boolean, default: false },
isWebLead: { type: Boolean, default: false },
shellType: String,
shellMemorial: Object,
sixHrNoteSent: { type: Boolean, default: false },
statSummarySent: { type: Boolean, default: false },
completedSignup: { type: Boolean, default: false },
completedDashSignup: { type: Boolean, default: false },
everdaysAdmin: { type: Boolean, default: false },
everdaysAdminJourneys: { type: Boolean, default: false },
isBot: { type: Boolean, default: false },
subscribe365: { type: Boolean, default: false },
tosAgree: { type: Boolean, default: false },
crmAccess: { type: Boolean, default: false },
realUserStatusApple: Number,
sentWelcomeEmail: { type: Boolean, default: false },
sentDesktopMemorialEmail: { type: Boolean, default: false },
clickedGetAppLink: { type: Boolean, default: false },
posterShell: { type: Boolean, default: false },
posterShellEmail: String,
posterShellPhone: Number,
webLeadPhone: Number,
webLeadEmail: String,
tempRegisterPhone: Number, //v14
tempRegisterEmail: Number //v14
},
platform: String,
locale: {
regionCode: { type: String, default: 'US' },
phoneCountryCode: { type: Number, default: 1 }
},
hasNewActivity: { type: Boolean, default: false },
funeralHomeFollows: [
{
type: Schema.Types.ObjectId,
ref: 'FuneralHome'
}
],
followMemorial: { type: Schema.Types.ObjectId }, // <- So we can know which memorial the user
lastStoryNote: { type: Number, default: 0 }, // has followed and use the information
lastMemoryNote: { type: Number, default: 0 }, //in the link to complete registration with password
lastCommentNote: { type: Number, default: 0 },
isAFP: { type: Boolean, default: false },
sfRef: String,
mailchimpId: String,
crmRef: { type: String, unique: true, sparse: true },
lastFuneralHome: { type: Schema.Types.ObjectId, ref: 'FuneralHome' },
company: { type: Schema.Types.ObjectId, ref: 'Company' },
companies: [{ type: Schema.Types.ObjectId, ref: 'Company' }],
isCompanyAdmin: { type: Boolean, default: false },
title: String,
about: String,
recentLocations: [
{
name: String,
address: String,
city: String,
state: String,
zip: String,
coords: [Number],
profileImage: String,
compIndex: String
}
],
lastEmailReceived: [],
lastSmsReceived: [],
homes: [homeSchema],
managerStats: managerStatsSchema,
memorialStatsSummary: memorialStatsSummarySchema,
memorialStats: { type: [memorialStatSchema], select: false },
isBanned: { type: Boolean, default: false },
messagingLogs: { type: [twilioLogSchema], select: false },
journeyLog: [journeyLogSchema],
onboardInfo: {
onboardType: { type: String, enum: Object.values(onboardTypes) },
lastOnboardStep: { type: String },
phoneVerified: { type: Boolean },
emailMismatch: { type: String },
companyMeta: {
name: { type: String },
type: { type: String },
title: { type: String },
address: {
street1: { type: String },
city: { type: String },
state: { type: String },
zip: { type: String },
country: { type: String }
},
phone: String,
website: { type: String, set: testForProtocol },
image: { type: String }
}
},
isGuest: { type: Boolean, default: false },
isArchived: { type: Boolean, default: false },
isDemoModeOn: { type: Boolean, default: false },
requestIps: { type: Array, select: false, default: [] },
srsUserNames: { type: Array, default: [] },
visitedMemorials: { type: Array, default: [] }, // for tracking memorials that the user has visited and closed the "Welcome Modal"
draftMemorialId: { type: Schema.Types.ObjectId, ref: 'Memorial' },
draftEmail: String,
userNameUpdatedOnce: { type: Boolean, default: false },
recentMemorial: { type: Schema.Types.ObjectId, ref: 'Memorial' },
recentInvitation: { type: Schema.Types.ObjectId, ref: 'Invitation' },
processingVideos: [
{
_id: Schema.Types.ObjectId,
memorialId: Schema.Types.ObjectId,
createdAt: Number,
mediaType: String,
isProcessing: Boolean,
name: String,
pendingUrl: String,
poster: {
_id: Schema.Types.ObjectId,
image: String,
name: String
},
progress: Number,
video: {
url: String
}
}
],
surveyAnswers: [{ question: Number, answers: [Number], context: String }],
eFuneral: {
//v13, probably can be removed soon
defaultPackageName: String,
url: String,
saleId: String,
efSaleStartedDate: Date,
packageData: Object,
packageFundingSigned: Boolean,
lastScreen: {
flow: { type: String, lowercase: true },
screen: String,
date: Date
},
funeralHomeId: { type: Schema.Types.ObjectId, ref: 'FuneralHome' },
preneedPackageId: String,
paymentOption: Object,
estimates: [Object],
typeForm: [Object],
planningJournalEmailed: Boolean //if person got pj emailed to them via mailchiimp
},
preneed: {
finalExpenses: {
bulletPoints: [String],
estimate: Number,
incrementValue: Number,
inflationPercentage: Number,
lastUpdated: Date,
lastViewedScreen: {
screenId: {
type: String,
enum: ['details', 'climate', 'surroundings', 'hobbies', 'travel', 'food', 'rest']
},
date: Date
},
maximumPrice: Number,
minimumPrice: Number,
monthlyRateMultiplier: Number,
monthlyRateMultiplierLastUpdated: Date,
priceChangeLog: [
{
direction: {
type: String,
enum: ['up', 'none', 'down']
},
date: Date,
screenId: {
type: String,
enum: ['details', 'climate', 'surroundings', 'hobbies', 'travel', 'food', 'rest']
}
}
],
selectedPrice: Number
},
userInfo: {
type: {
name: {
first: String,
last: String
},
dateOfBirth: Date,
gender: { type: String, enum: ['Male', 'Female'] }, //based on efunerals values
address: {
street1: String,
street2: String,
city: String,
state: String,
zip: String,
country: String,
coords: { type: Array, default: undefined }
},
email: String,
phone: Number,
stageComplete: Boolean,
display: { type: Array, default: undefined }
},
default: undefined
},
experience: {
type: {
style: Number,
category: Number,
invitedType: { value: Number, skip: Boolean },
vibe: { value: Number, skip: Boolean },
donations: { value: String, skip: Boolean },
celebrationType: { value: Number, skip: Boolean },
celebrationSpecific: { value: Number, somethingElse: String, skip: Boolean }, // note: somethingElse (if exists) should take precedence over the state in value
stageComplete: Boolean,
display: { type: Array, default: undefined }
},
default: undefined
},
venue: {
type: {
services: {
name: String,
address: {
street1: String,
street2: String,
city: String,
state: String,
zip: String,
country: String,
coords: { type: Array, default: undefined }
},
somewhereElse: Boolean, // this may be obselete now - Marc/2.11.2022
myFamilyCanDecide: Boolean,
theFuneralHome: Boolean,
skip: Boolean
},
afterServices: {
name: String,
address: {
street1: String,
street2: String,
city: String,
state: String,
zip: String,
country: String,
coords: { type: Array, default: undefined }
},
myFamilyCanDecide: Boolean,
skip: Boolean
},
stageComplete: Boolean,
display: { type: Array, default: undefined }
},
default: undefined
},
disposition: {
type: {
style: Number,
location: {
skip: Boolean,
name: String,
address: {
street1: String,
street2: String,
city: String,
state: String,
zip: String,
country: String,
coords: { type: Array, default: undefined }
},
myFamilyCanDecide: Boolean,
keepItInAnUrn: Boolean
},
plot: {
skip: Boolean,
purchased: Boolean
},
stageComplete: Boolean,
display: { type: Array, default: undefined }
},
default: undefined
},
family: [
{
_id: String / ObjectId,
name: {
first: String,
last: String,
middle: String
},
image: String,
phone: Number,
email: String,
shellEmail: String,
inviteUrl: String,
preneed: {
...userInfo
}
}
],
nextPlanningStage: {
name: String,
id: Number
},
viewedPrice: Boolean,
viewedAddOns: Boolean,
viewedSubmitOrder: Boolean,
completedPlanning: Boolean,
addOns: [Object],
estimates: [Object],
paymentOptions: [Object],
packageName: String,
packageId: String,
funeralHome: { type: Schema.Types.ObjectId, ref: 'FuneralHome', default: undefined },
funeralHomeSkipped: { type: Boolean, default: false },
preSelectedCompany: { type: Schema.Types.ObjectId, ref: 'Company', default: undefined },
lastScreen: {
platform: { type: String, enum: ['app', 'web'] },
screen: String,
date: Date
},
actions: [Object],
plan: {
planType: { type: String, enum: ['outright', 'insurance'] },
price: Number,
years: Number,
paymentDescription: String
},
medicaid: Boolean,
tos: Date,
order: {
submittedOn: Date,
orderId: String
},
eFuneral: {
url: String,
saleId: String,
efSaleStartedDate: Date,
packageFundingSigned: Boolean
},
shownGPL: [Object],
packageData: Object, //what the user bought,
typeForm: [Object], //raw dump from typeform,
providerNearby: Boolean,
planningJournalEmailed: Boolean, //if person got pj emailed to them via mailchiimp
packagePDFDownloaded: Boolean, //if person downloads pdf via nicks ads
hasSeenCompleteDetails: Boolean, //need because user can go back and forth in flow
hasSeenSubmitOrder: Boolean //need because user can go back and forth in flow
},
othersPlans: [{ type: Schema.Types.ObjectId, ref: 'User' }],
othersHealthAndCare: [{ type: Schema.Types.ObjectId, ref: 'User' }],
othersCemeteryPlans: [{ type: Schema.Types.ObjectId, ref: 'User' }],
heroContent: Number, //v14 see getGeneralPlanningContent
fundCartAbandon: {
paymentOption: Object,
packageName: String
},
shownGPL: [
{
home: Schema.Types.ObjectId,
date: Date
}
],
directorInfo: {
lastDirectorVideoUsed: {
idx: Number,
url: String
}
},
appToWebPlanLink: String, // the link the apps will use when sunsetting to send to Plan on the web
appToWebSecureLink: String, // the link the apps will use when sunsetting to send to Secure on the web
insurance: {
objectives: {
enoughIncomeToRetire: LikertValue,
coverCareCosts: LikertValue,
coverFinalExpenses: LikertValue,
settlePosthumousBills: LikertValue,
policySize: LikertValue,
coveragePermanence: LikertValue,
willingnessToAnswerMoreQuestions: Boolean
},
finances: {
monthlyExpenses: Number,
monthlyAllowance: Number,
totalAssets: Number
},
lostInsurance: {
health: { type: Boolean, default: false },
vision: { type: Boolean, default: false },
dental: { type: Boolean, default: false },
life: { type: Boolean, default: false },
other: []
},
health: {
seriousIllness: Boolean,
inCare: Boolean,
practiceSelfCare: Boolean,
smoker: Boolean,
sleepWell: Boolean,
drinker: Boolean,
exerciser: Boolean,
height: Number, // inches,
weight: Number, // lbs
bmi: Number
},
matches: {
lastCalculated: Date,
bestMatch: InsuranceProductSchema,
remainingMatches: [InsuranceProductSchema]
},
selectedProduct: {
productData: InsuranceProductSchema,
dateSelected: Date,
wasRejected: Boolean
}
},
purchase: {
aa: {
appNumber: Number,
pricing: [],
transactionId: Number,
purchaseCompleted: Boolean,
purchaseDate: Date,
policyNumber: String,
paymentMethod: { type: String, enum: ['bank', 'credit'] },
underwriting: {
approved: Boolean,
code: { type: String, enum: ['O', 'D', 'R'] }, // Okay(approved), Declined, Referred
message: String,
error: String,
lastUpdated: Date
},
results: {
approved: Boolean,
completed: Boolean,
finalDecisionType: { type: String, enum: ['O', 'D', 'R'] },
finalDecision: String,
lastUpdated: Date
},
applicationPDFUrl: String,
beneficiaries: [
{
_id: false,
userData: { type: Schema.Types.ObjectId, ref: 'User' },
relationship: {
type: String,
enum: [
'spouse',
'mother',
'father',
'daughter',
'son',
'brother',
'sister',
'cousin',
'aunt',
'uncle',
'grandfather',
'grandmother',
'grandchild',
'niece',
'nephew'
]
}
}
],
wasProfileAdded: Boolean, // see private docs
// additional information
occupation: String,
annualSalary: String,
birthState: String,
hasDriversLicense: Boolean,
driversLicenseNumber: String,
stateIssued: String
}
},
cemeteryInfo: {
funeralPlan: Boolean,
burialPlan: Boolean,
cemeteryId: { type: Schema.Types.ObjectId, ref: 'Cemetery' },
funeralId: { type: Schema.Types.ObjectId, ref: 'SalesFuneralHome' },
family: [
{
_id: false,
familyUser: { type: Schema.Types.ObjectId, ref: 'User' },
relationship: {
type: String,
enum: [
'spouse',
'mother',
'father',
'daughter',
'son',
'brother',
'sister',
'cousin',
'aunt',
'uncle',
'grandfather',
'grandmother',
'grandchild',
'niece',
'nephew'
]
}
}
]
},
}
Data​
| Key | Type | Description | Notes |
|---|---|---|---|
| othersPlans | Array<User> | An array of other users who have invited the current user to their preneed plan. | The following fields will be populated on the users in the array: name image preneed.userInfo preneed.funeralHome preneed.funeralHomeSkipped preneed.experience preneed.venue preneed.disposition |
| othersHealthAndCare | Array<User> | An array of other users who have invited the current user to their healthAndCare plan. | The following fields will be populated on the users in the array: name image healthAndCare |