From ca5b2365654fd6d9c93722c4e0a035b65b6a989d Mon Sep 17 00:00:00 2001 From: rstubryan Date: Fri, 24 Oct 2025 10:00:35 +0700 Subject: [PATCH] refactor(FE-114): enforce required usage amount in RecordingForm validation --- .../pages/production/recording/form/RecordingForm.schema.ts | 2 +- .../pages/production/recording/form/RecordingForm.tsx | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/pages/production/recording/form/RecordingForm.schema.ts b/src/components/pages/production/recording/form/RecordingForm.schema.ts index 597a24e1..b00e9363 100644 --- a/src/components/pages/production/recording/form/RecordingForm.schema.ts +++ b/src/components/pages/production/recording/form/RecordingForm.schema.ts @@ -48,7 +48,7 @@ export const RecordingFormSchema = Yup.object({ .min(1, 'Produk wajib diisi!') .typeError('Produk harus berupa angka!'), usage_amount: Yup.number() - .optional() + .required('Jumlah penggunaan wajib diisi!') .min(0, 'Jumlah penggunaan tidak boleh negatif!') .typeError('Jumlah penggunaan harus berupa angka!'), notes: Yup.string().optional(), diff --git a/src/components/pages/production/recording/form/RecordingForm.tsx b/src/components/pages/production/recording/form/RecordingForm.tsx index 15f7fcdf..e5a2531c 100644 --- a/src/components/pages/production/recording/form/RecordingForm.tsx +++ b/src/components/pages/production/recording/form/RecordingForm.tsx @@ -903,6 +903,7 @@ const RecordingForm = ({ type = 'add', initialValues }: RecordingFormProps) => {