admin/validation/adminWalletCredit.ts
alisaza e1eaf5eff5 feat: initial ghabilee-admin backoffice app
Extract admin dashboard from ghabilee-frontend2 into a dedicated Next.js
app for backoffice.ghabilee.ir (no SEO indexing / Clarity).
2026-09-05 13:12:59 +03:30

20 lines
722 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { z } from 'zod'
export const AdminWalletCreditValidation = z.object({
amount: z
.string()
.trim()
.min(1, 'مبلغ را وارد کنید')
.refine((value) => /^\d+$/.test(value), 'مبلغ باید عدد صحیح باشد')
.refine((value) => Number(value) > 0, 'مبلغ باید بیشتر از صفر باشد'),
description: z
.string()
.trim()
.max(500, 'توضیحات حداکثر ۵۰۰ کاراکتر است')
.refine((value) => value.length === 0 || value.length >= 3, 'توضیحات باید حداقل ۳ کاراکتر باشد')
.optional()
.or(z.literal('')),
})
export type AdminWalletCreditValues = z.infer<typeof AdminWalletCreditValidation>