import { OrderStatus, PayStatus, OrderType, PayType } from '../schemas/order.schema';
import { OrderGoodsStatus, GoodsType } from '../schemas/order-goods.schema';
import { RefundStatus } from '../schemas/order-refund.schema';

// 订单状态类型
export type OrderStatusType = typeof OrderStatus[keyof typeof OrderStatus];
export type PayStatusType = typeof PayStatus[keyof typeof PayStatus];
export type OrderTypeType = typeof OrderType[keyof typeof OrderType];
export type PayTypeType = typeof PayType[keyof typeof PayType];

// 订单商品状态类型
// 这些类型已在 schemas 中导出，避免重复导出

// 退款状态类型
export type RefundStatusType = typeof RefundStatus[keyof typeof RefundStatus];

// 订单相关类型
export interface OrderQueryParams {
  page?: number;
  pageSize?: number;
  userId?: number;
  orderNo?: string;
  state?: OrderStatusType;
  payState?: PayStatusType;
  startDate?: string;
  endDate?: string;
}

// 订单统计类型
export interface OrderStats {
  totalOrders: number;
  totalAmount: number;
  pendingOrders: number;
  completedOrders: number;
  refundOrders: number;
}

// 订单创建结果类型
export interface OrderCreateResult {
  success: boolean;
  orderId: number;
  orderNo: string;
  amount: number;
  payAmount: number;
  message: string;
}

// 订单商品信息类型
export interface OrderGoodsInfo {
  goodsId: number;
  goodsName: string;
  price: number;
  num: number;
  totalAmount: number;
}

// 订单详情类型
export interface OrderDetail {
  order: any; // Order 实体类型
  orderGoods: any[]; // OrderGoods 实体类型数组
  user?: any; // User 实体类型
  merchant?: any; // Merchant 实体类型
  supplier?: any; // Supplier 实体类型
  deliveryAddress?: any; // DeliveryAddress 实体类型
}