42 lines
690 B
TypeScript
42 lines
690 B
TypeScript
// Standard Server Action result type
|
|
export type ActionResult<T = void> = {
|
|
success: boolean
|
|
data?: T
|
|
message?: string
|
|
errors?: Record<string, string[]>
|
|
}
|
|
|
|
// User types
|
|
export type UserRole = 'USER' | 'ADMIN' | 'MODERATOR'
|
|
|
|
export type SafeUser = {
|
|
id: string
|
|
email: string
|
|
name: string | null
|
|
role: UserRole
|
|
isActive: boolean
|
|
createdAt: Date
|
|
}
|
|
|
|
// Auth types
|
|
export type LoginCredentials = {
|
|
email: string
|
|
password: string
|
|
}
|
|
|
|
export type RegisterData = {
|
|
email: string
|
|
password: string
|
|
name: string
|
|
}
|
|
|
|
export type UpdatePasswordData = {
|
|
currentPassword: string
|
|
newPassword: string
|
|
}
|
|
|
|
export type UpdateProfileData = {
|
|
name?: string
|
|
email?: string
|
|
}
|