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

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

const skillListRouteSchema = defineListRouteStateSchema<SkillListRouteState>({
  path: '/ai/skill',
  fields: {
    categoryId: stringListRouteField(),
    keyword: stringListRouteField(),
    pageNumber: positiveIntegerListRouteField({ defaultValue: 1 }),
    pageSize: positiveIntegerListRouteField({
      allowedValues: [10, 20, 50],
      defaultValue: 10,
    }),
    publishStatus: stringListRouteField(),
    visibilityScope: stringListRouteField(),
  },
});

export { skillListRouteSchema };
export type { SkillListRouteState };
