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

import { IOrderProductItem } from './IProduct';
import { ICustomerListItem } from './ICustomer';
import { IShopListItem } from './IShop';

/**
 * 支付类型枚举
 */
export enum PaymentType {
  FULL = 0,
  DEPOSIT = 1,
  UNPAID = 2,
  GIFT = 3,
  OTHER = 4
}

/**
 * 销售记录信息接口
 */
export interface ISalesRecord {
  id?: number;
  customer_id?: number;
  source_id?: number;
  guide_id?: number;
  payment_type?: PaymentType;
  deal_date?: string; // ISO日期格式
  receivable?: number;
  received?: number;
  pending?: number;
  platform_id?: number;
  deal_shop?: string;
  order_status?: string[];
  followup_date?: string; // ISO日期格式
  remark?: string;
  created_at?: string;
  updated_at?: string;
  
  // 关联数据
  customer?: ICustomerListItem;
  source?: IShopListItem;
  products?: IOrderProductItem[];
}

/**
 * 销售记录列表项接口
 */
export interface ISalesRecordListItem {
  id: number;
  customer_name: string;
  deal_date: string;
  receivable: number;
  received: number;
  pending: number;
  payment_type: PaymentType;
  order_status: string[];
  products_count: number;
} 