import * as Yup from 'yup'
var validNum = /(\W?\+\([0-9]+\) [0-9]{10}|\+\([0-9]+\)[0-9]{10}|\([0-9]+\) [0-9]*-[0-9]*|\([0-9]+\)[0-9]*-[0-9]*|\([0-9]+\) [0-9]* [0-9]*|[0-9]*-[0-9]*-[0-9]*-[0-9]*|[0-9]{11}|\+[0-9]{2} \([0-9]+\) [0-9]*-[0-9]*)\W/
export const locationDetailsSchema = Yup.object().shape({
  name: Yup.string()
    .trim()
    .max(128, "Maximum character is 128.")
    .required('Station name is required!'),
  location: Yup.string()
  .trim()
  .max(128, "Maximum character is 128.")
  .required('Station location is required!'),
  map_URL: Yup.string()
    .required('Url is required!'),
  lat: Yup.string()
    .required('Lat is required!'),
  long: Yup.string()
    .required('Long is required!'),
  BranchId: Yup.string()
  .required('Branch is required!'),
  contact_number: Yup.array()
  .transform(function(value, originalValue) {
    return originalValue ? originalValue.split(/[\s/]+/) : [];
  })
  .of(Yup.string().min(7, "Minimum character is 7").matches(/^[+]*[(]{0,1}[0-9]{1,4}[)]{0,1}[-\s\./0-9]*$/, "Please enter a valid contact number"))
  .required('Contact number is required!'),
  code: Yup.string()
  .required('Station code is required!')
})


 