const { ObjectId } = require('mongodb'); enum Status { unpay = 'unpay', // 未支付 paid = 'paid',// 已支付 expired = 'expired', // 已过期 goodsFeeRefunded = 'goodsFeeRefunded', // 已退还浸酒费用 refunded = 'refunded', // 已退款 shipped = 'shipped', // 已发货 completed = 'completed', // 已完成 } interface Wine { name: string, details: string, quantity: number, price: number, totalPrice: number, code: string } interface ReceiveInfo { name: string;//收货人姓名 phone: string;//收货人电话 region: string[];//收货人地区 address: string;//收货人地址 } interface AfterSale { notes: string, waybillNo: string } interface RefundRecord { amount: number; //退费金额 applyTime: number; //退费申请时间 platform: 'unionPay'; reason: string; //退费原因 type: 'goodsFee' | 'shippingFee'; //退费类型 refundSerialNo: string; //退费流水号 result: 'refunding' | 'refunded' | 'refund_fail'; //退费状态 operator: string;//操作人 operatorId: string;//操作人id } interface MedicineWineOrder { _id: ObjectId; createTime: number; storeId: string;//门店id name: string, patientId: string, // 患者id pickUpType: 'store' | 'delivery';// 取货方式: 门店自取 | 快递配送 shippingNo?: string;//配送单号 orderNo: string;//订单号 orderId: string; // 关联咨询订单号 rpNo: string;//关联处方id // rpSerialNo: string;//关联处方流水号 status: Status; wines: Wine[], goodsFee?: number;//浸酒费用 shippingOriginalFee?: number;//配送原价 shippingDiscount?: number;//配送优惠 shippingFee?: number;//配送费用 totalFee?: number; //总费用 receiveInfo?: ReceiveInfo;//收货人信息 tradeNo?: string;//交易号 disabled: boolean; updateTime: number; blhno: string;//病历号 syncHisChargeStatus: 'charged' | 'refunded';// 已同步his支付状态 charged: 已收取医保退款 refunded: 已退还医保退款 syncHisDelivery: 'charged' | 'refunded';// 已同步his物流状态 charged: 已收取运费 refunded: 已退还运费 refundRecords?: RefundRecord[];//退费记录 deliveryCancelled?: boolean;//配送已取消 afterSale?: AfterSale;//售后信息 }