import { z } from 'zod';
import {
  GoodsCategorySchema,
  CreateGoodsCategoryDto,
  UpdateGoodsCategoryDto
} from '@d8d/goods-module-mt/schemas';

export type GoodsCategory = z.infer<typeof GoodsCategorySchema>;
export type CreateGoodsCategory = z.infer<typeof CreateGoodsCategoryDto>;
export type UpdateGoodsCategory = z.infer<typeof UpdateGoodsCategoryDto>;

// 树形节点类型
export interface GoodsCategoryTreeNode extends GoodsCategory {
  children?: GoodsCategoryTreeNode[];
  key: string;
}

// API响应类型
export interface GoodsCategoryListResponse {
  data: GoodsCategory[];
  total: number;
  page: number;
  pageSize: number;
}

// 表单类型
export interface GoodsCategoryFormData {
  name: string;
  parentId: number;
  imageFileId?: number | null;
  level: number;
  state: number;
}

// 搜索参数
export interface GoodsCategorySearchParams {
  name?: string;
  parentId?: number;
  state?: number;
  page?: number;
  pageSize?: number;
}