'use strict';

/**
 *
 *
 * @author Zhong
 * @date 2018/10/23
 * @version
 */

/*
* 补充定额库用户新增安装增加费分册章节
*
*
* */

const mongoose = require('mongoose');
const Schema = mongoose.Schema;
const deleteSchema = require('../all_schemas/delete_schema');
//安装增加费-费用规则
const feeRuleSchema = new Schema({
    ID: String,
    code: String,
    rule: String,
    base: String,
    feeRate: Number,
    labour: Number,
    material: Number,
    machine: Number
});

//补充安装增加费-分册章节
const installSectionSchema = new Schema({
    userId: String,
    compilationId: String,
    ID: String,
    feeItemId: String,
    name: String,
    feeRule: [feeRuleSchema],
    deleteInfo: deleteSchema
}, {versionKey: false});

mongoose.model('complementary_ration_installationSection', installSectionSchema, 'complementary_ration_installationSection');
