From d879325496d1771ee2167a27c9372319339d6d77 Mon Sep 17 00:00:00 2001 From: Khafid Prayoga Date: Wed, 22 Oct 2025 11:43:10 +0700 Subject: [PATCH] feat(assessment-education): finish form entry data finish form tambah assessment education finish: form data and schema for content assessment eduction todo: handler dan service --- .../app/assessment-education/entry-form.vue | 105 +++++++++++++++--- .../field/base-checkbox.vue | 2 + .../field/checkbox-general.vue | 2 + .../app/person-contact/entry-form.vue | 2 +- .../content/assessment-education/add.vue | 73 +++++------- app/schemas/assessment-education.ts | 57 ++++++++++ 6 files changed, 180 insertions(+), 61 deletions(-) create mode 100644 app/schemas/assessment-education.ts 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 }