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

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

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

export { documentCollectionListRouteSchema };
export type { DocumentCollectionListRouteState };
