import {
  OrderStatusType,
  PayStatusType,
  OrderTypeType,
  PayTypeType,
  RefundStatusType,
  OrderQueryParams,
  OrderStats,
  OrderCreateResult,
  OrderGoodsInfo,
  OrderDetail
} from '@d8d/orders-module-mt';

// 重新导出订单模块的类型
export {
  OrderStatusType,
  PayStatusType,
  OrderTypeType,
  PayTypeType,
  RefundStatusType,
  OrderQueryParams,
  OrderStats,
  OrderCreateResult,
  OrderGoodsInfo,
  OrderDetail
};

// 订单管理组件Props类型
export interface OrderManagementProps {
  onOrderCreated?: (order: any) => void;
  onOrderUpdated?: (order: any) => void;
  onOrderDeleted?: (orderId: number) => void;
  showStats?: boolean;
  enableSearch?: boolean;
  enableFilter?: boolean;
}

// 订单表单数据类型
export interface OrderFormData {
  userId: number;
  merchantId: number;
  supplierId: number;
  deliveryAddressId: number;
  orderType: OrderTypeType;
  payType: PayTypeType;
  orderGoods: OrderGoodsInfo[];
  remark?: string;
}

// 订单搜索过滤类型
export interface OrderFilterParams {
  orderNo?: string;
  userId?: number;
  merchantId?: number;
  supplierId?: number;
  state?: OrderStatusType;
  payState?: PayStatusType;
  startDate?: string;
  endDate?: string;
  page?: number;
  pageSize?: number;
}

// 订单状态更新类型
export interface OrderStatusUpdateData {
  orderId: number;
  state: OrderStatusType;
  remark?: string;
}

// 退款申请数据类型
export interface RefundApplicationData {
  orderId: number;
  refundAmount: number;
  refundReason: string;
  refundRemark?: string;
}

// 订单统计卡片数据类型
export interface OrderStatsCardData {
  title: string;
  value: number;
  description: string;
  icon: string;
  trend?: {
    value: number;
    isPositive: boolean;
  };
}