diff --git a/app/components/app/assessment-education/entry-form.vue b/app/components/app/assessment-education/entry-form.vue index 5985d785..1183ebb5 100644 --- a/app/components/app/assessment-education/entry-form.vue +++ b/app/components/app/assessment-education/entry-form.vue @@ -1,5 +1,6 @@ @@ -63,7 +46,11 @@ async function handleActionClick(eventType: string) {
Tambah Asesmen Edukasi
diff --git a/app/schemas/assessment-education.ts b/app/schemas/assessment-education.ts new file mode 100644 index 00000000..d6f7cf4b --- /dev/null +++ b/app/schemas/assessment-education.ts @@ -0,0 +1,57 @@ +import * as z from 'zod' + +const AssessmentEducationSchema = z.object({ + generalEducationNeeds: z + .array(z.string(), { + required_error: 'Mohon pilih setidaknya item', + }) + .min(1, 'Mohon pilih setidaknya item'), + + specificEducationNeeds: z + .array(z.string(), { + required_error: 'Mohon pilih setidaknya item', + }) + .min(1, 'Mohon pilih setidaknya item'), + + learningAbility: z.string({ + required_error: 'Mohon pilih kemampuan belajar', + }), + + learningWillingness: z.string({ + required_error: 'Mohon pilih kemauan belajar', + }), + + barrier: z.string({ + required_error: 'Mohon pilih hambatan', + }), + + learningMethod: z.string({ + required_error: 'Mohon pilih metode pembelajaran', + }), + + language: z.string({ + required_error: 'Mohon pilih bahasa', + }), + + languageBarrier: z.string({ + required_error: 'Mohon pilih hambatan bahasa', + }), + + beliefValue: z.string({ + required_error: 'Mohon pilih keyakinan pada nilai-nilai yang dianut', + }), + + plans: z + .array( + z.object({ + id: z.number(), + value: z.string().nonempty('Mohon masukkan catatan'), + }), + ) + .min(1, 'Minimal 1 catatan rencana studi'), +}) + +type AssessmentEducationFormData = z.infer + +export { AssessmentEducationSchema } +export type { AssessmentEducationFormData }