import * as Yup from 'yup';

export const LocationFormSchema = Yup.object({
  name: Yup.string().required('Nama wajib diisi!'),
  address: Yup.string().required('Alamat wajib diisi!'),

  areaId: Yup.number()
    .min(1, 'Area wajib diisi!')
    .required('Area wajib diisi!'),
  area: Yup.object({
    value: Yup.number().min(1).required(),
    label: Yup.string().required(),
  }).nullable(),
});

export const UpdateLocationFormSchema = LocationFormSchema;

export type LocationFormValues = Yup.InferType<typeof LocationFormSchema>;
