import { z } from 'zod';
import { BaseFilterInputSchema } from './base-filter-input.schema';
import { InputType } from '../../types';

export const NumberRangeFilterInputSchema = BaseFilterInputSchema.extend({
  type: z
    .literal(InputType.NumberRange)
    .describe(
      'Specifies this as a number range input type. Must be InputType.NumberRange.',
    ),
  min: z.number().optional().describe('Current minimum value of the range.'),
  max: z.number().optional().describe('Current maximum value of the range.'),
  minValue: z
    .number()
    .optional()
    .describe(
      'Minimum value of the number range. Optional if only a maximum is needed.',
    ),
  maxValue: z
    .number()
    .optional()
    .describe(
      'Maximum value of the number range. Optional if only a minimum is needed.',
    ),
  minLabel: z.string().describe('Label for the minimum input field.'),
  maxLabel: z.string().describe('Label for the maximum input field.'),
}).describe('NumberRangeFilterInput');

export type NumberRangeFilterInput = z.infer<
  typeof NumberRangeFilterInputSchema
>;
