import { array, mixed, object, string } from 'yup';
import { OptionType } from '@/components/input/SelectInput';

export const MarketingFilterSchema = object({
  product_ids: array().of(mixed<OptionType<number>>().required()).required(),
  status: mixed<OptionType<string>>().nullable(),
  customer: mixed<OptionType<number>>().nullable(),
  project_flock: mixed<OptionType<number>>().nullable(),
  project_flock_kandang: mixed<OptionType<number>>().nullable(),
  warehouse: mixed<OptionType<number>>().nullable(),
  start_date: string().optional(),
  end_date: string().optional(),
  filter_by: mixed<OptionType<string>>().nullable(),
});

export type MarketingFilterFormValues = {
  product_ids: OptionType<number>[];
  status: OptionType<string> | null;
  customer: OptionType<number> | null;
  project_flock: OptionType<number> | null;
  project_flock_kandang: OptionType<number> | null;
  warehouse: OptionType<number> | null;
  start_date: string;
  end_date: string;
  filter_by: OptionType<string> | null;
};
