import {
  defineListRouteStateSchema,
  positiveIntegerListRouteField,
  stringListRouteField,
} from '#/composables/useListRouteState';

interface BotListRouteState {
  categoryId: string;
  keyword: string;
  pageNumber: number;
  pageSize: number;
}

const botListRouteSchema = defineListRouteStateSchema<BotListRouteState>({
  path: '/ai/bots',
  fields: {
    categoryId: stringListRouteField(),
    keyword: stringListRouteField(),
    pageNumber: positiveIntegerListRouteField({ defaultValue: 1 }),
    pageSize: positiveIntegerListRouteField({
      allowedValues: [12, 18, 24],
      defaultValue: 12,
    }),
  },
});

export { botListRouteSchema };
export type { BotListRouteState };
