import { z } from 'zod'
import type { MaterialPackage } from '~/models/material-package'

const MaterialSchema = 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 MaterialFormData = z.infer<typeof MaterialSchema> & Partial<MaterialPackage>

export { MaterialSchema }
export type { MaterialFormData }
