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

interface SysFeedbackListRouteState {
  feedbackContent: string;
  feedbackType: '1' | '2' | '3' | '4' | '';
  pageNumber: number;
  pageSize: number;
  status: '0' | '1' | '2' | '3' | '';
}

const sysFeedbackListRouteSchema =
  defineListRouteStateSchema<SysFeedbackListRouteState>({
    path: '/sys/sysFeedback',
    fields: {
      feedbackContent: stringListRouteField(),
      feedbackType: enumListRouteField(['1', '2', '3', '4'], ''),
      pageNumber: positiveIntegerListRouteField({ defaultValue: 1 }),
      pageSize: positiveIntegerListRouteField({
        allowedValues: [10, 20, 50, 100],
        defaultValue: 10,
      }),
      status: enumListRouteField(['0', '1', '2', '3'], ''),
    },
  });

export { sysFeedbackListRouteSchema };
export type { SysFeedbackListRouteState };
