import { z } from 'zod';

/**
 * Zod schema for validating a date range.
 *
 * The schema expects a tuple containing two optional date values:
 * - The first element represents the start date.
 * - The second element represents the end date.
 */
export const DateRangeSchema = z.tuple([
  z.coerce.date().optional(), // start
  z.coerce.date().optional(), // end
]);

/**
 * Type representing a date range value inferred from DateRangeSchema.
 */
export type DateRangeValue = z.infer<typeof DateRangeSchema>;
