Life Cycle



email *EmailString
passwordHash *PasswordStringEncripted password using bcryptjs
firstName *First nameString
lastName *Last nameString
avatar AvatarString
phone PhoneString
defaultTenantId Default TenantStringWhen the user logs in, it will redirect to the last tenant
verifyToken Verify TokenStringGenerated at /forgot-password, validated at /reset
admin Admin UserAdminUserDetermines if a user can access the /admin portal
tenants TenantsTenantUser[]
invitations InvitationsTenantUserInvitation[]User has been invited to join a tenant
logs LogsLog[]User audit trails/events.
createdLinkedAccounts Linked AccountsLinkedAccount[]Linked accounts created by user.
createdRows RowsRow[]Custom entity rows created by user
createdApiKeys API KeysAPIKey[]API Keys created by user


model User {
  id                       String                @id @default(cuid())
  createdAt                DateTime              @default(now())
  updatedAt                DateTime              @updatedAt
  email                    String                @unique
  passwordHash             String
  firstName                String
  lastName                 String
  avatar                   String?
  phone                    String?
  defaultTenantId          String?
  verifyToken              String?
  admin                    AdminUser?
  tenants                  TenantUser[]
  invitation               TenantUserInvitation?
  logs                     Log[]
  createdLinkedAccounts    LinkedAccount[]
  createdRows              Row[]
  createdApiKeys           ApiKey[]