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

interface WorkflowExecListRouteState {
  execKey: string;
  pageNumber: number;
  pageSize: number;
}

const workflowExecListRouteSchema =
  defineListRouteStateSchema<WorkflowExecListRouteState>({
    path: '/ai/workflow/executeRecords',
    fields: {
      execKey: stringListRouteField(),
      pageNumber: positiveIntegerListRouteField({ defaultValue: 1 }),
      pageSize: positiveIntegerListRouteField({
        allowedValues: [10, 20, 50, 100],
        defaultValue: 10,
      }),
    },
  });

export { workflowExecListRouteSchema };
export type { WorkflowExecListRouteState };
