var mongoose = require('mongoose');

var stdBillsLibSchema =mongoose.Schema({
    userId: Number,
    billsLibId: Number,
    billsLibName: String,
    createDate: Date,
    deleted: Boolean
},
    {versionKey: false}
);

var billsSchema = mongoose.Schema({
    ID: Number,
    ParentID: Number,
    NextSiblingID: Number,
    code: String,
    name: String,
    unit: String,
    ruleText: String,
    Expression: String,
    jobs: Array,
    items: Array,
    recharge:String,
    billsLibId: Number,
    deleted: Boolean
},
    {versionKey: false}
);

var jobContentSchema = mongoose.Schema({
    id: Number,
    code: Number,
    content: String,
    billsLibId: Number,
    deleted: Boolean
},
    {versionKey: false}
);

var itemCharacterSchema = mongoose.Schema({
    id: Number,
    code: Number,
    content: String,
    itemValue: Array,
    billsLibId: Number,
    deleted: Boolean
},
    {versionKey: false}
);

module.exports = {
    stdBillsLibSchema: stdBillsLibSchema,
    billsSchema: billsSchema,
    jobContentSchema: jobContentSchema,
    itemCharacterSchema: itemCharacterSchema
}