@anoki/fse-common
Version:
Common types for FSE
38 lines (32 loc) • 987 B
text/typescript
import { WithMongooseProps } from './with-mongoose-props'
import { Upload } from './upload-file'
import { GetValues } from '../constants'
export const UserRolesEnum = {
ADMIN: 'admin',
USER: 'user',
} as const
export const UsersApplicationRolesEnum = {
CMS_EDITOR: 'cmsEditor',
STRUCTURE_EDITOR: 'structureEditor',
SETTINGS_EDITOR: 'settingsEditor',
ADMINISTRATOR: 'administrator',
}
export type UserType = GetValues<typeof UserRolesEnum>
export type UserRoles = GetValues<typeof UserRolesEnum>
export type UsersApplicationRoles = GetValues<typeof UsersApplicationRolesEnum>
export type User = WithMongooseProps<{
name: string
surname: string
email: string
password: string
role: UserType
profileImage?: Upload
last_login: string
applicationRoles: UsersApplicationRoles[]
fiscalCode: string
sex: string
pid: string | null
personId: string // uniqueIdentifier for user services FSE
hasSeenConsent: boolean
hasAcceptedPrivacyPolicy: boolean
}>