import { array, boolean, mixed, number, object, string } from 'yup'

export const courseSchema = object().shape({
  title: string().required().min(3).max(255),
  teacherId: mixed().required(),
  capacity: number().typeError('ظرفیت باید عدد باشد').required().min(1),
  prerequisiteCourseIds: array().nullable().default([]),
  contentMediaId: number().nullable().notRequired(),
  description: string().nullable().notRequired(),
  termId: mixed().required(),
  isActive: boolean().nullable().notRequired(),
})

export const offeredCourseSchema = object().shape({
  termId: string().required(),
  title: string().required(),
  capacity: string().required(),
  imageId: string().nullable().notRequired(),
  isActive: boolean().nullable().notRequired(),
})
