18 lines
513 B
TypeScript
18 lines
513 B
TypeScript
import { type TypeOf, nativeEnum } from 'zod'
|
|
|
|
import { DateSchema } from './common/date'
|
|
import { IdSchema } from './common/id'
|
|
|
|
import { RIGHTS } from '@/constants/rights'
|
|
import { AbstractSchema } from './abstract'
|
|
|
|
export const UserShareBaseSchema = AbstractSchema.extend({
|
|
userId: IdSchema, // FIXME: default of model is `''`
|
|
right: nativeEnum(RIGHTS).default(RIGHTS.READ),
|
|
|
|
created: DateSchema.nullable(),
|
|
updated: DateSchema.nullable(),
|
|
})
|
|
|
|
export type TeamMember = TypeOf<typeof UserShareBaseSchema>
|