Extract admin dashboard from ghabilee-frontend2 into a dedicated Next.js app for backoffice.ghabilee.ir (no SEO indexing / Clarity).
17 lines
1.0 KiB
TypeScript
17 lines
1.0 KiB
TypeScript
import { z } from 'zod'
|
||
|
||
// All profile fields are optional in v1 (per soza.md: "all fields, none required").
|
||
// status and hostPlan are always present since they're plain selects with a fixed value.
|
||
export const AdminUserEditValidation = z.object({
|
||
firstName: z.string().trim().max(100, 'نام حداکثر ۱۰۰ کاراکتر است').optional().or(z.literal('')),
|
||
lastName: z.string().trim().max(100, 'نام خانوادگی حداکثر ۱۰۰ کاراکتر است').optional().or(z.literal('')),
|
||
gender: z.enum(['male', 'female', 'other']).optional().or(z.literal('')),
|
||
cityId: z.string().optional().or(z.literal('')),
|
||
avatarUrl: z.union([z.literal(''), z.url('آدرس تصویر معتبر نیست')]).optional(),
|
||
bio: z.string().trim().max(500, 'بیوگرافی حداکثر ۵۰۰ کاراکتر است').optional().or(z.literal('')),
|
||
status: z.enum(['active', 'suspended']),
|
||
hostPlan: z.enum(['free', 'unlimited']),
|
||
})
|
||
|
||
export type AdminUserEditValues = z.infer<typeof AdminUserEditValidation>
|