user-info.ts 431 B

123456789101112
  1. export const UserType = { admin: 'admin', general: 'general', guest: 'guest' } as const;
  2. type guestType = typeof UserType.guest
  3. export type UserType = typeof UserType[keyof typeof UserType];
  4. export type IUserInfo = {
  5. userIdHash: string // userId hash generated by using appSiteUrl as salt
  6. type: Exclude<UserType, guestType>
  7. userCreatedAt: Date // createdAt of user that answered the questionnaire
  8. } | {
  9. type: guestType
  10. }