28 lines
782 B
TypeScript
28 lines
782 B
TypeScript
|
|
import { z } from 'zod';
|
||
|
|
|
||
|
|
export const createUserSchema = z.object({
|
||
|
|
email: z.string().email(),
|
||
|
|
name: z.string().min(1).max(200),
|
||
|
|
password: z.string().min(12),
|
||
|
|
displayName: z.string().min(1).max(200),
|
||
|
|
phone: z.string().optional(),
|
||
|
|
roleId: z.string().uuid(),
|
||
|
|
});
|
||
|
|
|
||
|
|
export type CreateUserInput = z.infer<typeof createUserSchema>;
|
||
|
|
|
||
|
|
export const updateUserSchema = z.object({
|
||
|
|
displayName: z.string().min(1).max(200).optional(),
|
||
|
|
phone: z.string().nullable().optional(),
|
||
|
|
isActive: z.boolean().optional(),
|
||
|
|
roleId: z.string().uuid().optional(),
|
||
|
|
});
|
||
|
|
|
||
|
|
export type UpdateUserInput = z.infer<typeof updateUserSchema>;
|
||
|
|
|
||
|
|
export const resetPasswordSchema = z.object({
|
||
|
|
newPassword: z.string().min(12),
|
||
|
|
});
|
||
|
|
|
||
|
|
export type ResetPasswordInput = z.infer<typeof resetPasswordSchema>;
|