import { WithMongooseProps } from './with-mongoose-props' import { Tenant } from './tenant' import { Upload } from './upload-file' import { GetValues } from '../constants' export const UserRolesEnum = { ADMIN: 'admin', AST_ADMIN: 'ast-admin', ADMINISTRATION_EDITOR: 'administration-editor', // for editing of transparent administrations pages ADMINISTRATION_APPROVAL: 'administration-approval', // for approval of transparent administrations pages ANNOUNCEMENT_EDITOR: 'announcement-editor', ALBO_EDITOR: 'albo-editor', NEWS_EDITOR: 'news-editor', STATIC_EDITOR: 'static-editor', DOCUMENT_EDITOR: 'document-editor', USER: 'user', PERSON_EDITOR: 'person-editor', } as const export type UserType = GetValues export type ApplicationRole = { [tenantId: string]: string[] } export type User = WithMongooseProps<{ name: string surname: string email: string password: string tenantIds: string[] tenants: Tenant[] lastTenantId?: string // the last tenant the user was logged in role: UserType profileImage?: Upload last_login: string applicationRoles: ApplicationRole }>