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

interface SysJobListRouteState {
  keyword: string;
  pageNumber: number;
  pageSize: number;
}

const sysJobListRouteSchema = defineListRouteStateSchema<SysJobListRouteState>({
  path: '/sys/sysJob',
  fields: {
    keyword: stringListRouteField(),
    pageNumber: positiveIntegerListRouteField({ defaultValue: 1 }),
    pageSize: positiveIntegerListRouteField({
      allowedValues: [10, 20, 50, 100],
      defaultValue: 10,
    }),
  },
});

export { sysJobListRouteSchema };
export type { SysJobListRouteState };
