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

const MaterialSchema = z.object({
  materialPackage_code: z.string({ required_error: 'Kode harus diisi' }).min(1, 'Kode minimum 1 karakter'),
  material_code: z.string({ required_error: 'Nama harus diisi' }).min(1, 'Nama minimum 1 karakter'),
})

type MaterialFormData = z.infer<typeof MaterialSchema> & Partial<MaterialPackageItem>

export { MaterialSchema }
export type { MaterialFormData }
