/**
 * Created by Zhong on 2018/3/22.
 */
/*标准工料机*/
const mongoose = require('mongoose');
const Schema = mongoose.Schema;
//标准工料机的组成物只来自标准工料机
const std_gljComponent = new Schema(
    {
        ID: Number,
        consumeAmt: Number,
        consumeAmtProperty: {
            type: Schema.Types.Mixed,
            default: {}
        }
    },
    {_id: false},
    {versionKey: false}
);

const std_glj = new Schema({
    deleted: Boolean,
    repositoryId: Number,
    ID: Number,
    code: String,
    name: String,
    specs: String,
    basePrice: Number,
    priceProperty: {
        type: Schema.Types.Mixed,
        default: {}
    },
    gljClass: Number,
    gljType: Number,
    shortName: String,
    unit: String,
    taxRate: String, // 税率
    adjCoe: Number,
    component: [std_gljComponent],
    materialType: Number, //三材类型：钢材1、钢筋2、木材3、水泥4、标准砖5
    materialCoe: Number, //三材系数
    model: Number, //机型
    //经济指标数据
    materialIndexType:String,//工料指标类别
    materialIndexUnit:String,//工料指标单位
    materialIndexCoe:Number//单位转换系数

},{versionKey: false});

mongoose.model('std_glj_lib_gljList', std_glj, 'std_glj_lib_gljList');