/**
 * Created by Zhong on 2018/3/22.
 */
/*清单库编辑器-清单*/
const mongoose = require('mongoose');
const Schema = mongoose.Schema;

// 设计细目
const designItem = {
    id: Number,
    serialNo: Number,
};

const stdBills_bills = new Schema({
    ID: String,
    ParentID: String,
    NextSiblingID: String,
    code: String,
    name: String,
    unit: String,
    ruleText: String,
    engineerContent: String,//工程内容
    engineering: Number, //工程专业，填计算程序工程专业ID
    fixedFlag: Number,  //固定ID
    Expression: String,
    comment: String, //备注，清单精灵处输入
    jobs: [],
    items: [],
    designs: { type: [designItem], default: [] },
    recharge: String,
    billsLibId: { type: Number, index: true },
    sectionInfo: Schema.Types.Mixed,
    deleted: Boolean,
    kind: Number, // 前台里（重构、微前端）BRType： 1: 大项费用、 8：XMJ 4：清单
    erratumRecord: String, // 勘误记录
    unitPrice: Number, // 单价
    isBillBudget: Boolean, // 清单预算标记
},
    { versionKey: false }
);

mongoose.model('std_bills_lib_bills', stdBills_bills, 'std_bills_lib_bills');