(email: string)
| 59 | * @returns Default data for a new user. |
| 60 | */ |
| 61 | export function createUserInput(email: string) { |
| 62 | const username = 'fcc-' + crypto.randomUUID(); |
| 63 | const externalId = crypto.randomUUID(); |
| 64 | // This explicitly includes all array fields. This is not strictly necessary - |
| 65 | // Prisma will return an empty array even if the property is missing, but it's |
| 66 | // probably best to add them to the document, at least until we normalise the |
| 67 | // data. |
| 68 | return { |
| 69 | about: '', |
| 70 | acceptedPrivacyTerms: false, |
| 71 | donationEmails: [], // TODO(Post-MVP): Omit this from the document? (prisma will always return []) |
| 72 | email, |
| 73 | emailVerified: true, // this should be true until a user changes their email address |
| 74 | // TODO(Post-MVP): remove externalId? |
| 75 | externalId, |
| 76 | isBanned: false, |
| 77 | isCheater: false, |
| 78 | isDonating: false, |
| 79 | isHonest: false, |
| 80 | keyboardShortcuts: false, |
| 81 | location: '', |
| 82 | name: '', |
| 83 | unsubscribeId: nanoid(), |
| 84 | picture: '', |
| 85 | portfolio: [], // TODO(Post-MVP): Omit this from the document? (prisma will always return []) |
| 86 | profileUI: { |
| 87 | isLocked: false, |
| 88 | showAbout: false, |
| 89 | showCerts: false, |
| 90 | showDonation: false, |
| 91 | showExperience: false, |
| 92 | showHeatMap: false, |
| 93 | showLocation: false, |
| 94 | showName: false, |
| 95 | showPoints: false, |
| 96 | showPortfolio: false, |
| 97 | showTimeLine: false |
| 98 | }, |
| 99 | sendQuincyEmail: null, |
| 100 | theme: 'default', |
| 101 | username, |
| 102 | usernameDisplay: username, |
| 103 | yearsTopContributor: [], // TODO: Omit this from the document? (prisma will always return []), |
| 104 | ...createResetProperties() |
| 105 | }; |
| 106 | } |
no test coverage detected