refactor(dtos): use @shumai/db/enums across DTO definitions

This commit is contained in:
yiling
2026-08-01 10:47:41 +08:00
parent 11fc76e56b
commit 7dfb2c7f2f
5 changed files with 18 additions and 8 deletions
+5 -2
View File
@@ -1,6 +1,9 @@
import { z } from 'zod'
import { UserType, TeamMemberScope } from '@shumai/db/enums'
import { paginationPageInfoSchema, paginationParamsSchema } from './pagination'
export { UserType, TeamMemberScope }
export const createTeamRequestSchema = z.object({
name: z.string(),
})
@@ -50,9 +53,9 @@ export const userInfoSchema = z.object({
name: z.string(),
role: z.enum(['owner', 'editor', 'reviewer', 'bot', 'unknown']),
email: z.string().optional(),
type: z.enum(['human', 'agent']).optional(),
type: z.nativeEnum(UserType).optional(),
image: z.string().optional(),
scope: z.enum(['team', 'project']).optional(),
scope: z.nativeEnum(TeamMemberScope).optional(),
})
export type UserInfo = z.infer<typeof userInfoSchema>