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

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

const skillListRouteSchema = defineListRouteStateSchema<SkillListRouteState>({
  path: '/ai/skill',
  fields: {
    categoryId: stringListRouteField(),
    keyword: stringListRouteField(),
    pageNumber: positiveIntegerListRouteField({ defaultValue: 1 }),
    pageSize: positiveIntegerListRouteField({
      allowedValues: [12, 24, 48],
      defaultValue: 12,
    }),
  },
});

export { skillListRouteSchema };
export type { SkillListRouteState };
