|
@@ -3,6 +3,9 @@ const Schema = require('mongoose').Schema;
|
|
|
const metaPlugin = require('naf-framework-mongoose-free/lib/model/meta-plugin');
|
|
|
const MoneyPlugin = require('naf-framework-mongoose-free/lib/model/type-money-plugin');
|
|
|
|
|
|
+/**
|
|
|
+ * 与订单不同,此处是1订单1规格模式,对完账就对完了
|
|
|
+ */
|
|
|
// 售后进度
|
|
|
const afterSale = {
|
|
|
order_detail: { type: String, required: false, zh: '订单详情', ref: 'Trade.OrderDetail' }, //
|
|
@@ -19,6 +22,7 @@ const afterSale = {
|
|
|
status: { type: String, required: false, zh: '售后状态' }, // 字典:afterSale_status
|
|
|
result: { type: Object, required: false, zh: '售后结果' }, // 售后完成后需要补充的内容,例如:退款的金额
|
|
|
deal_person: { type: String, required: false, zh: '处理人', ref: 'User.Admin' }, //
|
|
|
+ out_bill: { type: String, required: false, default: '1', zh: '是否出账' }, // 字典:tf
|
|
|
};
|
|
|
const schema = new Schema(afterSale, { toJSON: { getters: true, virtuals: true } });
|
|
|
schema.index({ id: 1 });
|
|
@@ -27,6 +31,7 @@ schema.index({ type: 1 });
|
|
|
schema.index({ apply_time: 1 });
|
|
|
schema.index({ end_time: 1 });
|
|
|
schema.index({ deal_person: 1 });
|
|
|
+schema.index({ out_bill: 1 });
|
|
|
|
|
|
schema.plugin(metaPlugin);
|
|
|
schema.plugin(MoneyPlugin({ zh: '退款金额', required: false, key: 'money' }));
|