import { BaseQuery } from '@/types/base';
import type { FormSchema } from '@/components/FormDesigner';

/**
 * 表单定义状态
 */
export type FormDefinitionStatus = 'DRAFT' | 'PUBLISHED' | 'DISABLED';

/**
 * 表单定义查询参数
 */
export interface FormDefinitionQuery extends BaseQuery {
  name?: string;
  key?: string;
  categoryId?: number;  // 分类ID
  status?: FormDefinitionStatus;
}

/**
 * 表单定义响应
 */
export interface FormDefinitionResponse {
  id: number;
  name: string;
  key: string;
  formVersion: number;
  categoryId?: number;  // 分类ID
  description?: string;
  schema: FormSchema;
  tags?: string[];
  status: FormDefinitionStatus;
  isTemplate: boolean;
  createBy?: string;
  createTime?: string;
  updateBy?: string;
  updateTime?: string;
}

/**
 * 表单定义创建/更新请求
 */
export interface FormDefinitionRequest {
  name: string;
  key: string;
  categoryId?: number;  // 分类ID
  description?: string;
  schema: FormSchema;
  tags?: string[];
  status?: FormDefinitionStatus;
  isTemplate?: boolean;
}

