/**
 * Created by Mai on 2017/8/17.
 */
import mongoose from "mongoose";
let Schema = mongoose.Schema;

let collectionName = 'temp_bills';

// 标记字段
let flagsSchema = new Schema({
    fieldName: String,
    flag: Number
});
let BillsTemplateSchema = {
    // 树结构所需ID
    ID: Number,
    ParentID: Number,
    NextSiblingID: Number,
    // 编号
    code: String,
    // 名称
    name: String,
    // 单位
    unit: String,
    // 类别
    type: Number,
    // 标记
    flags:{
        type: [flagsSchema],
        default: []
    },
    // 所属计价ID
    valuationId: String,
    // 工程专业
    engineering: Number,
    //计算基数
    calcBase: String,
    //费率ID
    feeRateID:Number
};

mongoose.model(collectionName, new Schema(BillsTemplateSchema, {versionKey: false, collection: collectionName}));
