/**
 * 售后记录数据模型接口定义
 * 作者: 阿瑞
 * 功能: 定义售后记录数据结构
 * 版本: 1.0
 */

import { IOrderProductItem } from './IProduct';

/**
 * 售后类型枚举
 */
export enum AfterSalesType {
  RETURN = '退货',
  EXCHANGE = '换货',
  RESEND = '补发',
  DIFFERENCE = '补差'
}

/**
 * 售后进度枚举
 */
export enum AfterSalesProgress {
  PENDING = '待处理',
  PROCESSING = '处理中',
  COMPLETED = '已处理'
}

/**
 * 交易类型枚举
 */
export enum TransactionType {
  INCOME = '收入',
  EXPENSE = '支出'
}

/**
 * 售后记录信息接口
 */
export interface IAfterSalesRecord {
  id?: number;
  sales_record_id: number;
  type: AfterSalesType;
  previous_after_sale_id?: number;
  date?: string; // ISO日期格式
  reason?: string;
  product_price?: number;
  progress?: AfterSalesProgress;
  transaction_type?: TransactionType;
  platform_id?: number;
  amount?: number;
  pending?: number;
  remark?: string;
  created_at?: string;
  updated_at?: string;
  
  // 关联数据
  original_products?: IOrderProductItem[];
  replacement_products?: IOrderProductItem[];
}

/**
 * 售后记录列表项接口
 */
export interface IAfterSalesRecordListItem {
  id: number;
  sales_record_id: number;
  type: AfterSalesType;
  date: string;
  progress: AfterSalesProgress;
  transaction_type?: TransactionType;
  amount?: number;
  pending?: number;
} 