import { z } from 'zod'
import type { CreateDto } from '~/models/consultation'

const ConsultationSchema = z.object({
  date: z.string({ required_error: 'Tanggal harus diisi' }),
  dstUnit_id: z.number({ required_error: 'Unit harus diisi' }),
  problem: z.string({ required_error: 'Uraian harus diisi' }).min(20, 'Uraian minimum 20 karakter'),
})

type ConsultationFormData = z.infer<typeof ConsultationSchema> & (CreateDto)

export { ConsultationSchema }
export type { ConsultationFormData }
