24 lines
766 B
TypeScript
24 lines
766 B
TypeScript
import { z } from 'zod'
|
|
|
|
// Check In
|
|
const CheckInSchema = z.object({
|
|
registeredAt: z.string({ required_error: 'Tanggal masuk harus diisi' }),
|
|
responsible_doctor_id: z.number({ required_error: 'Dokter harus diisi' }).gt(0, 'Dokter harus diisi'),
|
|
adm_employee_id: z.number({ required_error: 'PJA harus diisi' }).gt(0, 'PJA harus diisi'),
|
|
})
|
|
type CheckInFormData = z.infer<typeof CheckInSchema>
|
|
|
|
export { CheckInSchema }
|
|
export type { CheckInFormData }
|
|
|
|
// Check Out
|
|
const CheckOutSchema = z.object({
|
|
dischargeMethod_code: z.string({ required_error: 'Metode pulang harus diisi' }),
|
|
unit_id: z.number(),
|
|
responsible_doctor_id: z.number(),
|
|
})
|
|
type CheckOutFormData = z.infer<typeof CheckOutSchema>
|
|
|
|
export { CheckOutSchema }
|
|
export type { CheckOutFormData }
|