//清单指引材料数据
const mongoose = require('mongoose');
const Schema = mongoose.Schema;

const materialSchema = {
  gljID: { type: Number, required: true }
};

const stdBillsGuidanceMaterial = new Schema({
    libID: String,
    ID: { type: String, index: true },
    billID: String, //关联清单的ID
    materials: {
      type: [materialSchema],
      default: [],
    },
}, {versionKey: false});

stdBillsGuidanceMaterial.index({ libID: 1, billID: 1 });

mongoose.model('std_billsGuidance_materials', stdBillsGuidanceMaterial, 'std_billsGuidance_materials');