feat(material): modify handlers and service of material

This commit is contained in:
riefive
2025-09-19 15:23:09 +07:00
parent 29b54b072c
commit 70378a69e9
11 changed files with 244 additions and 142 deletions

No files matched your search

+2 -2
View File
@@ -1,5 +1,5 @@
import { z } from 'zod'
import type { EquipmentMaterial } from '~/models/equipment-material'
import type { Material } from '~/models/material'
const MaterialSchema = z.object({
code: z.string({ required_error: 'Kode harus diisi' }).min(1, 'Kode minimum 1 karakter'),
@@ -8,7 +8,7 @@ const MaterialSchema = z.object({
stock: z.preprocess((val) => Number(val), z.number({ invalid_type_error: 'Stok harus berupa angka' }).min(1, 'Stok harus lebih besar dari 0')),
})
type MaterialFormData = z.infer<typeof MaterialSchema> & EquipmentMaterial
type MaterialFormData = z.infer<typeof MaterialSchema> & Material
export { MaterialSchema }
export type { MaterialFormData }