import { z } from 'zod'
import type { CodeName } from '~/models/_base'

const BaseSchema = z.object({
  code: z.string({ required_error: 'Kode harus diisi' }).min(1, 'Kode minimum 1 karakter'),
  name: z.string({ required_error: 'Nama harus diisi' }).min(1, 'Nama minimum 1 karakter'),
})

type BaseFormData = z.infer<typeof BaseSchema> & CodeName

export { BaseSchema }
export type { BaseFormData }
