/**
 * Created by zhang on 2018/8/22.
 */
//材料替换库
const mongoose = require('mongoose');
const Schema = mongoose.Schema;
const oprSchema = require('../all_schemas/opr_schema');
const material_lib = new Schema({
        ID:{type:String,index:true},
        creator: String,
        createDate: Number,
        recentOpr: [oprSchema],
        name: String,
        compilationId: String,
        compilationName: String,
        billsLibId:Number,
        billsLibName:String,
        deleted: Boolean
    }, {versionKey: false}
);

mongoose.model("std_material_replace_lib", material_lib,"std_material_replace_lib");


const std_replace_bills = new Schema({
        ID: {type:String,index:true},
        libID:{type:String,index:true},
        code: {type:String,index:true},
        name: String,
        rule:Number//规则类型
    }, {versionKey: false}
);

mongoose.model('std_replace_bills', std_replace_bills, 'std_replace_bills');


const std_replace_material = new Schema({
    ID: {type:String,index:true},
    libID:{type:String,index:true},
    billsItemID:{type:String,index:true},
    code: String,
    name: String,
    specs: String,
    type: Number,
    unit: String
},{versionKey: false});

mongoose.model('std_replace_material', std_replace_material, 'std_replace_material');





