32 lines
1013 B
TypeScript
32 lines
1013 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>
|
|
|
|
// Check Out Consul Polis
|
|
const ConsulPoliesSchema = z.object({
|
|
unit_id: z.number(),
|
|
responsible_doctor_id: z.number(),
|
|
|
|
})
|
|
type ConsulPoliesFormData = z.infer<typeof ConsulPoliesSchema>
|
|
|
|
// Checkout
|
|
const CheckOutSchema = z.object({
|
|
dischargeMethod_code: z.string({ required_error: 'Metode pulang harus diisi' }),
|
|
// unit_id: z.number(),
|
|
consulPolies: z.array(ConsulPoliesSchema),
|
|
responsible_doctor_id: z.number(),
|
|
|
|
})
|
|
type CheckOutFormData = z.infer<typeof CheckOutSchema>
|
|
|
|
// Exports
|
|
export { CheckInSchema, CheckOutSchema }
|
|
export type { CheckInFormData, CheckOutFormData, ConsulPoliesFormData }
|